/* ═══════════════════════════════════════════════════════
   DESIGN SYSTEM — Brutalist Medical Dossier
   ═══════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  --bg:         #fdfbf7;
  --ink:        #1a1a1a;
  --red:        #FF3333;
  --purple:     #8B5CF6;
  --blue:       #3B82F6;
  --green:      #10B981;
  --border:     2px solid var(--ink);
  --shadow:     6px 6px 0px var(--ink);
  --shadow-sm:  4px 4px 0px var(--ink);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Outfit', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  padding-bottom: 5rem;
}

::selection {
  background: var(--red);
  color: #fff;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-top: 2px solid var(--ink); }
::-webkit-scrollbar-thumb { background: var(--ink); }
::-webkit-scrollbar-thumb:hover { background: #333; }

/* ── Icons ── */
.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.icon--terminal { color: var(--red); }
.icon--lg { width: 2rem; height: 2rem; }

/* ── Utility ── */
.mono  { font-family: var(--font-mono); }
.bold  { font-weight: 700; }
.text-red    { color: var(--red); }
.text-purple { color: var(--purple); }
.text-blue   { color: var(--blue); }
.text-green  { color: var(--green); }
.text-muted  { color: #9ca3af; }
.text-xl     { font-size: 1.25rem; }
.underline-subtle { border-bottom: 2px solid rgba(0,0,0,0.15); }

/* ── Shadows ── */
.brutal-shadow {
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.brutal-shadow:hover {
  box-shadow: 10px 10px 0px var(--ink);
  transform: translate(-2px, -2px);
}

.brutal-btn {
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.brutal-btn:hover {
  box-shadow: 8px 8px 0px var(--ink);
  transform: translate(-2px, -2px);
}
.brutal-btn:active {
  box-shadow: 0 0 0 var(--ink);
  transform: translate(4px, 4px);
}


/* ═══════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════ */
.top-bar {
  background: var(--ink);
  color: var(--bg);
  border-bottom: 4px solid var(--red);
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 3rem;
}
.top-bar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.top-bar__label {
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
}
.top-bar__sep {
  opacity: 0.25;
}
.top-bar__id {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
  font-size: 0.75rem;
}

/* Navigation links */
.top-bar__nav {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}
.top-bar__link {
  color: rgba(253,251,247,0.6);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
  border-left: 1px solid rgba(255,255,255,0.08);
}
.top-bar__link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.top-bar__link--cta {
  background: var(--red);
  color: #fff;
}
.top-bar__link--cta:hover {
  background: #e62e2e;
}

@media (max-width: 767px) {
  .top-bar__nav { display: none; }
  .top-bar__sep, .top-bar__id { display: none; }
}


/* ═══════════════════════════════════════
   CONTAINER
   ═══════════════════════════════════════ */
.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1rem 0;
}
@media (min-width: 768px) {
  .container { padding: 3rem 2rem 0; }
}


/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */
.hero { margin-bottom: 5rem; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin-bottom: 2.5rem;
}
.hero__line { display: block; }
.hero__line--dark { color: var(--ink); }
.hero__line--red  { color: var(--red); }
.hero__line--underlined {
  color: var(--ink);
  border-bottom: 8px solid var(--ink);
  padding-bottom: 0.75rem;
  display: inline-block;
  margin-top: 0.5rem;
}

/* Stagger animation */
.hero__title {
  opacity: 0;
  animation: heroFadeIn 0.8s ease forwards;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero row — title + image side by side */
.hero__row {
  display: flex;
  align-items: center;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.hero__image-wrap {
  flex-shrink: 0;
  width: 320px;
  border: var(--border);
  background: #fff;
  transform: rotate(2deg);
  opacity: 0;
  animation: heroImageIn 0.8s ease 0.4s forwards;
  overflow: hidden;
}

.hero__image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}
.hero__image-wrap:hover .hero__image {
  transform: scale(1.05);
}

@keyframes heroImageIn {
  from { opacity: 0; transform: rotate(2deg) translateX(40px); }
  to   { opacity: 1; transform: rotate(2deg) translateX(0); }
}

@media (max-width: 767px) {
  .hero__row {
    flex-direction: column;
    gap: 1.5rem;
  }
  .hero__image-wrap {
    width: 220px;
    align-self: center;
  }
}

/* ── Demographics Grid ── */
.demo-grid {
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: fadeUp 0.6s ease 0.3s both;
}
@media (min-width: 768px) {
  .demo-grid { grid-template-columns: 1fr 1fr 2fr; }
}

.demo-grid__cell {
  padding: 1.25rem;
  border-bottom: var(--border);
}
@media (min-width: 768px) {
  .demo-grid__cell {
    border-bottom: none;
    border-right: var(--border);
  }
  .demo-grid__cell:last-child { border-right: none; }
}

.demo-grid__cell--highlight {
  background: rgba(255,51,51,0.04);
}

.demo-grid__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #6b7280;
  margin-bottom: 0.25rem;
}
.demo-grid__label--red { color: var(--red); }

.demo-grid__value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
}
.demo-grid__value--with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-grid__objective {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
}


/* ═══════════════════════════════════════
   SECTIONS (Generic)
   ═══════════════════════════════════════ */
.section {
  margin-bottom: 5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}
.section__header .section__title { margin-bottom: 0; }

.section__subtitle {
  color: #9ca3af;
  font-size: 1.5rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════
   STORY SECTION
   ═══════════════════════════════════════ */
.story-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .story-grid { grid-template-columns: 2fr 1fr; }
}

.story-card {
  background: #fff;
  border: var(--border);
  padding: 2rem;
  font-size: 1.125rem;
  line-height: 1.7;
}
@media (min-width: 768px) {
  .story-card { padding: 2.5rem; }
}

.story-card__p {
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.story-card__callout {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid;
}
.story-card__callout--red {
  border-color: var(--red);
  background: rgba(255,51,51,0.04);
}
.story-card__callout--purple {
  border-color: var(--purple);
  background: rgba(139,92,246,0.04);
}
.story-card__callout--green {
  border-color: var(--green);
  background: rgba(16,185,129,0.06);
}

.story-card__quote {
  font-size: 1.25rem;
  font-weight: 700;
  font-style: italic;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

/* Plea box */
.plea-box {
  background: var(--ink);
  color: #fff;
  padding: 1.5rem;
  border-left: 8px solid var(--red);
}
.plea-box__label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.plea-box__text { font-size: 1.125rem; }

/* Thesis panel */
.thesis-panel {
  background: var(--ink);
  color: var(--bg);
  border: var(--border);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: fit-content;
}

.thesis-panel__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.thesis-panel__body {
  color: rgba(253,251,247,0.9);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.6;
}

.thesis-panel__footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(255,255,255,0.15);
}
.thesis-panel__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.25rem;
}
.thesis-panel__date {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--green);
}

.thesis-panel__treatment {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(255,255,255,0.15);
}
.thesis-panel__rx-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.thesis-panel__rx {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}
.thesis-panel__rx-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.15rem;
}


/* ═══════════════════════════════════════
   BIOMARKER CARDS
   ═══════════════════════════════════════ */
.bio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .bio-grid { grid-template-columns: repeat(3, 1fr); }
}

.bio-card {
  background: #fff;
  border: var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.bio-card--red    { border-top: 8px solid var(--red); }
.bio-card--purple { border-top: 8px solid var(--purple); }
.bio-card--blue   { border-top: 8px solid var(--blue); }

.bio-card__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #6b7280;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.bio-card__value {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.bio-card--red .bio-card__value    { color: var(--red); }
.bio-card--purple .bio-card__value { color: var(--purple); }
.bio-card--blue .bio-card__value   { color: var(--blue); }

.bio-card__unit {
  font-size: 1.15rem;
  opacity: 0.45;
}
.bio-card__percent { font-size: 2.25rem; }

.bio-card__badge {
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  position: relative;
  z-index: 1;
}
.bio-card__badge--dark   { background: var(--ink); }
.bio-card__badge--purple { background: var(--purple); }
.bio-card__badge--blue   { background: var(--blue); }

.bio-card__bg-icon {
  position: absolute;
  bottom: -1rem;
  right: -1rem;
  width: 8rem;
  height: 8rem;
  opacity: 0.06;
}


/* ═══════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════ */
.chart-container {
  background: #fff;
  border: var(--border);
  overflow: hidden;
}

/* Tabs */
.tab-bar {
  display: flex;
  border-bottom: var(--border);
  background: var(--bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  padding: 1rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: none;
  border-right: var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  transition: background 0.2s, color 0.2s;
}
.tab--last { border-right: none; }
.tab:hover { background: rgba(0,0,0,0.04); }

@media (max-width: 767px) {
  .tab {
    padding: 0.75rem 0.85rem;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
  }
}

.tab--active[data-tab="hepatic"]  { background: var(--red); color: #fff; }
.tab--active[data-tab="endocrine"]{ background: var(--purple); color: #fff; }
.tab--active[data-tab="metabolic"]{ background: var(--blue); color: #fff; }
.tab--active[data-tab="inflammation"]{ background: #F59E0B; color: #fff; }

.tab__dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  display: inline-block;
}
.tab__dot--red    { background: var(--red); }
.tab__dot--purple { background: var(--purple); }
.tab__dot--blue   { background: var(--blue); }
.tab__dot--amber  { background: #F59E0B; }
.tab--active .tab__dot { background: #fff; }

/* Panels */
.chart-panel { padding: 1rem; }
@media (min-width: 768px) { .chart-panel { padding: 2.5rem; } }
.chart-panel--hidden { display: none; }

.chart-panel__info {
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-left: 4px solid;
}
.chart-panel__info--red    { border-color: var(--red); }
.chart-panel__info--purple { border-color: var(--purple); }
.chart-panel__info--blue   { border-color: var(--blue); }
.chart-panel__info--amber  { border-color: #F59E0B; }

.chart-panel__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.chart-panel__desc {
  color: #4b5563;
  line-height: 1.5;
}

.chart-wrapper {
  height: 300px;
  border: 2px solid #f3f4f6;
  padding: 0.5rem;
  background: rgba(249,250,251,0.4);
  position: relative;
}
@media (min-width: 768px) {
  .chart-wrapper {
    height: 400px;
    padding: 1rem;
  }
}


/* ═══════════════════════════════════════
   DATA TABLE
   ═══════════════════════════════════════ */
.table-wrapper {
  background: #fff;
  border: var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrapper::before {
  content: 'Swipe to view full table →';
  display: none;
}

/* ── Mobile: Horizontal Card Carousel for Data Table ── */
@media (max-width: 899px) {
  .table-wrapper {
    border: none;
    box-shadow: none !important;
    position: relative;
    /* Removed overflow: hidden to prevent iOS trapping touch events */
  }
  .table-wrapper:hover {
    box-shadow: none !important;
    transform: none !important;
  }
  
  /* Reveal Swipe Hint on Mobile */
  .table-wrapper::before { 
    display: block; 
    content: '← Swipe horizontally to see all biomarkers →';
    text-align: center;
    border-bottom: none;
    background: transparent;
    padding: 0 0 0.5rem 0;
    color: #6b7280;
    font-size: 0.70rem;
    letter-spacing: 0.05em;
  }

  /* Make the table itself the scroller to avoid Safari tbody bugs */
  .data-table { 
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.25rem 9vw 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-padding: 0 9vw;
    width: 100%;
  }
  .data-table::-webkit-scrollbar { display: none; }
  
  /* Safari flex padding-right fix */
  .data-table::after {
    content: '';
    display: block;
    min-width: 1px;
    flex-shrink: 0;
  }

  .data-table thead { display: none; }

  .data-table tbody {
    display: contents; /* TRs act as direct children of .data-table flexbox */
  }

  .data-table tbody tr {
    display: block;
    min-width: 82vw;
    flex-shrink: 0;
    margin-right: 1rem; /* Safer than flex gap on legacy iOS */
    scroll-snap-align: center;
    border: var(--border);
    box-shadow: var(--shadow-sm);
    background: #fff;
  }

  .data-table__td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
  }
  .data-table__td:last-child { border-bottom: none; }

  .data-table__td::before {
    content: attr(data-label);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink);
    opacity: 0.6;
    flex-shrink: 0;
    margin-right: 0.75rem;
    min-width: 4.5rem;
  }

  /* First cell = card header */
  .data-table__td.bold {
    background: var(--ink);
    color: #fff;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border-bottom: none;
    justify-content: flex-start;
  }
  .data-table__td.bold::before { display: none; }
  .data-table__td.bold .data-table__unit { color: rgba(255,255,255,0.5); }

  /* Last cell = badge */
  .data-table__td:last-child {
    background: #fafafa;
    justify-content: flex-end;
    padding: 0.5rem 1rem;
  }
  .data-table__td:last-child::before { display: none; }

  .data-table__td--big { font-size: 1.05rem; }
}

.data-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
  min-width: 900px;
}

.data-table thead tr {
  background: var(--ink);
  color: var(--bg);
}

.data-table__th {
  padding: 1.25rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  font-weight: 700;
}
.data-table__th--current { color: var(--red); }

.data-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.15s;
}
.data-table tbody tr:hover { background: #f9fafb; }
.data-table tbody tr:last-child { border-bottom: none; }

.data-table__td {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
}
.data-table__td.bold {
  font-family: var(--font-body);
  font-weight: 700;
}

.data-table__td--big {
  font-weight: 700;
  font-size: 1.5rem;
}

.data-table__unit {
  font-size: 0.8rem;
  font-weight: 400;
  color: #6b7280;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
}
.badge--red    { background: var(--red); }
.badge--dark   { background: var(--ink); }
.badge--green  { background: var(--green); }
.badge--purple { background: var(--purple); }
.badge--blue   { background: var(--blue); }


/* ═══════════════════════════════════════
   CTA SECTION
   ═══════════════════════════════════════ */
.cta-section {
  background: var(--ink);
  color: var(--bg);
  padding: 2.5rem;
  border: var(--border);
  text-align: center;
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) {
  .cta-section { padding: 4rem; }
}

.cta-section__dots {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 16px 16px;
}

.cta-section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--red);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.cta-section__desc {
  font-size: 1.25rem;
  max-width: 48rem;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
  color: #d1d5db;
  position: relative;
  z-index: 1;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1.25rem 2.5rem;
  position: relative;
  z-index: 1;
}


/* ═══════════════════════════════════════
   SCROLL REVEAL ANIMATION (JS-driven)
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .section, .hero__title {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* ═══════════════════════════════════════
   MODAL & NETLIFY FORM
   ═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}
.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg);
  border: var(--border);
  width: 100%;
  max-width: 34rem;
  padding: 1.5rem 1rem;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}
@media (min-width: 768px) {
  .modal { padding: 2.5rem 2rem; }
}

.modal-overlay[aria-hidden="false"] .modal {
  transform: translateY(0);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 0.5rem;
  display: flex;
}
.modal__close:hover { color: var(--red); }

.modal__header { margin-bottom: 2rem; }
.modal__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--red);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
@media (min-width: 768px) {
  .modal__title { font-size: 2rem; }
}
.modal__desc { font-weight: 500; color: #4b5563; font-size: 1rem; }

.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.form-input {
  width: 100%;
  border: var(--border);
  background: #fff;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.2s, transform 0.2s;
}
.form-input:focus {
  box-shadow: 4px 4px 0px var(--ink);
  transform: translate(-1px, -1px);
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* ═══════════════════════════════════════
   MOBILE METRICS (replaces charts on small screens)
   ═══════════════════════════════════════ */
.mobile-metrics { display: none; }

@media (max-width: 767px) {
  .chart-container { display: none !important; }
  .mobile-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

.metric-card {
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.metric-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.metric-card__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.metric-card__value {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.15rem;
}
.metric-card__unit {
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.5;
}
.metric-card__trend {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}
.metric-card__trend--bad { color: var(--red); }
.metric-card__trend--good { color: var(--green); }

.metric-card__badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

/* ═══════════════════════════════════════
   CTA PRIMARY BUTTON & EMAIL LINK
   ═══════════════════════════════════════ */
.cta-btn--primary {
  background: var(--red);
  color: #fff;
  font-size: 1.2rem;
  padding: 1.5rem 3rem;
  border: var(--border);
}
.cta-btn--primary:hover {
  background: #e62e2e;
}

.cta-email-link {
  display: inline-block;
  color: rgba(253,251,247,0.45);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  margin-top: 1.25rem;
  position: relative;
  z-index: 1;
  transition: color 0.2s;
}
.cta-email-link:hover {
  color: #fff;
  text-decoration: underline;
}

.cta-toast {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  color: var(--green);
  font-family: var(--font-mono);
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: bold;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════
   FORM SUBMIT BUTTON & SUCCESS STATE
   ═══════════════════════════════════════ */
.cta-btn--submit {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
  background: var(--red);
  color: #fff;
  border-color: var(--ink);
}

.form-success {
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.form-success__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.5rem;
}
.form-success__desc {
  color: #4b5563;
  font-size: 1rem;
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  border-top: var(--border);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.6;
}
.site-footer__disclaimer {
  max-width: 40rem;
  margin: 0 auto 0.5rem;
}

/* ═══════════════════════════════════════
   BRUTAL-SHADOW STATIC (no hover lift)
   ═══════════════════════════════════════ */
.brutal-shadow--static {
  box-shadow: var(--shadow);
}
.brutal-shadow--static:hover {
  box-shadow: var(--shadow);
  transform: none;
}

