/* ==========================================================================
   Atopia Therapeutics — corporate website
   Brand: Nile Green palette · Plus Jakarta Sans (headings) + Inter (text)
   ========================================================================== */

:root {
  /* brand colours */
  --nile: #0E6B5C;          /* primary */
  --nile-dark: #0A5247;
  --nile-light: #5FB3A1;
  --gold: #E39B3A;          /* accent */
  --gold-dark: #B9751F;     /* accent for text on light backgrounds (contrast) */
  --sand: #F4EFE6;          /* soft backgrounds */
  --delta: #14302B;         /* deep text / dark sections */

  /* neutrals tinted toward the brand green */
  --ink: #14302B;
  --text: #33474A;
  --muted: #5E7073;
  --line: #DDE5E2;
  --paper: #FBFAF7;
  --white: #FFFFFF;

  --f-head: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --s-xs: .8125rem;
  --s-sm: .9375rem;
  --s-md: 1.0625rem;
  --s-lg: 1.25rem;
  --s-xl: clamp(1.75rem, 3vw, 2.25rem);
  --s-2xl: clamp(2.4rem, 5.2vw, 4rem);

  --radius: 10px;
  --max: 1200px;
  --header-h: 76px;
  --shadow: 0 1px 2px rgba(20, 48, 43, .06), 0 8px 24px rgba(20, 48, 43, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--s-md);
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--nile); text-underline-offset: 3px; }
a:hover { color: var(--nile-dark); }
h1, h2, h3, h4 {
  font-family: var(--f-head);
  color: var(--ink);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -.015em;
  text-wrap: balance;
}
p { margin: 0; }
ul { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--nile); color: #fff; padding: 10px 16px; border-radius: 6px; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- layout ---------- */
.container { max-width: var(--max); margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left)); }
.section { padding-block: clamp(64px, 9vw, 112px); }
.section--sand { background: var(--sand); }
.section--dark { background: var(--delta); color: #C9D6D2; }
.section--dark h2, .section--dark h3 { color: #fff; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split > *, .grid > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.measure { max-width: 64ch; }

/* ---------- type helpers ---------- */
.eyebrow {
  font-family: var(--f-head);
  font-size: var(--s-xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.section--dark .eyebrow { color: var(--gold); }
.h-xl { font-size: var(--s-xl); }
.lead { font-size: var(--s-lg); line-height: 1.55; color: var(--text); }
.muted { color: var(--muted); }
.section-head { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin-bottom: 48px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 var(--s-sm)/1 var(--f-head);
  padding: 15px 24px; border-radius: 999px; border: 2px solid var(--nile);
  background: var(--nile); color: #fff; text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { background: var(--nile-dark); border-color: var(--nile-dark); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--nile); }
.btn--ghost:hover { background: var(--nile); color: #fff; }
.btn--gold { background: var(--gold); border-color: var(--gold); color: var(--delta); }
.btn--gold:hover { background: #F0AE52; border-color: #F0AE52; color: var(--delta); }
.btn--light { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--light:hover { background: #fff; color: var(--delta); border-color: #fff; }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 4px 20px rgba(20,48,43,.06); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; }
.brand img { height: 54px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  font: 600 var(--s-sm) var(--f-head); color: var(--ink); text-decoration: none;
  padding: 10px 14px; border-radius: 999px; transition: background .2s, color .2s;
}
.nav a:hover { background: var(--sand); color: var(--nile); }
.nav a[aria-current="page"] { color: var(--nile); background: var(--sand); }
.nav .btn { margin-left: 10px; padding: 12px 20px; color: #fff; }
.nav .btn:hover, .nav .btn[aria-current="page"] { background: var(--nile-dark); color: #fff; }
.nav-toggle {
  display: none; background: none; border: 0; padding: 10px; cursor: pointer; color: var(--ink);
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px 0; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--paper); }
.hero .container { position: relative; z-index: 1; padding-block: clamp(56px, 8vw, 104px); }
.hero h1 { font-size: var(--s-2xl); font-weight: 800; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--nile); }
.hero-visual { position: relative; aspect-ratio: 4 / 5; max-height: 560px; width: 100%; }
.hero-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-badge {
  position: absolute; left: 0; bottom: 8%;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow); max-width: 240px; font-size: var(--s-xs); color: var(--muted);
}
.hero-badge b { display: block; font-family: var(--f-head); color: var(--ink); font-size: var(--s-sm); }
.hero-tag { font-family: var(--f-head); font-weight: 600; color: var(--gold-dark); font-size: var(--s-lg); }

/* ---------- page header (inner pages) ---------- */
.page-hero { background: var(--sand); border-bottom: 1px solid var(--line); }
.page-hero .container { padding-block: clamp(48px, 7vw, 88px); }
.page-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); max-width: 20ch; margin-top: 12px; }
.page-hero .lead { margin-top: 18px; max-width: 62ch; }
.crumbs { font-size: var(--s-xs); color: var(--muted); }
.crumbs a { color: var(--muted); }

/* ---------- cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
a.card { text-decoration: none; color: inherit; }
a.card:hover, .card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #C8D7D2; }
.card h3 { font-size: 1.2rem; }
.card p { font-size: var(--s-sm); color: var(--muted); }
.icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--sand); color: var(--nile);
  display: grid; place-items: center; flex: none;
}
.icon svg { width: 26px; height: 26px; }
.card .more { margin-top: auto; font: 600 var(--s-sm) var(--f-head); color: var(--nile); }

/* ---------- value bridge (how we work) ---------- */
.bridge { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 16px; align-items: stretch; }
.bridge .node { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.bridge .node.is-us { background: var(--nile); border-color: var(--nile); color: #D9ECE7; }
.bridge .node.is-us h3 { color: #fff; }
.bridge .node h3 { font-size: 1.1rem; margin: 8px 0 6px; }
.bridge .node p { font-size: var(--s-sm); }
.bridge .arrow { display: grid; place-items: center; color: var(--gold); }
.bridge .arrow svg { width: 32px; height: 32px; }
.node .tag { font-size: var(--s-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dark); }
.node.is-us .tag { color: var(--gold); }

/* ---------- pipeline / waves ---------- */
.waves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); overflow: hidden; }
.wave { padding: 32px 28px; border-right: 1px solid rgba(255,255,255,.14); display: flex; flex-direction: column; gap: 10px; }
.wave:last-child { border-right: 0; }
.wave .when { font: 600 var(--s-xs) var(--f-head); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.wave h3 { font-size: 1.35rem; }
.wave.is-now { background: rgba(255,255,255,.05); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: var(--s-xs); font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status--now { color: #7FD8C4; }
.status--next { color: var(--gold); }
.status--future { color: #A8B9B5; }

/* ---------- pillars ---------- */
.pillars { counter-reset: p; }
.pillar { border-top: 2px solid var(--nile); padding-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.pillar h3 { font-size: 1.15rem; }
.pillar p { font-size: var(--s-sm); color: var(--muted); }

/* ---------- name meaning ---------- */
.etym { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; font-family: var(--f-head); }
.etym b { font-size: clamp(1.8rem, 3.6vw, 2.6rem); color: var(--nile); font-weight: 800; }
.etym i { font-family: var(--f-body); font-style: normal; font-size: var(--s-xs); color: var(--muted); }
.etym span { color: var(--gold-dark); font-size: 1.6rem; }
.quote {
  border-left: 4px solid var(--gold); background: #fff; padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--f-head); font-size: var(--s-lg); color: var(--ink); font-weight: 600;
}

/* ---------- services list ---------- */
.service-row {
  display: grid; grid-template-columns: 64px 1fr 1fr; gap: 28px; padding: 36px 0; border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.service-row:last-child { border-bottom: 1px solid var(--line); }
.service-row h2 { font-size: 1.5rem; margin-bottom: 10px; }
.service-row ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.service-row li { position: relative; padding-left: 26px; font-size: var(--s-sm); }
.service-row li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 12px; height: 2px; background: var(--gold);
}

/* ---------- markets ---------- */
.region-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.region { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.region.is-home { border: 2px solid var(--nile); background: #F6FBF9; }
.region h3 { font-size: 1.2rem; }
.region p { font-size: var(--s-sm); color: var(--muted); }
.region .status--now { color: var(--nile); }
.region .status--next { color: var(--gold-dark); }
.region .status--future { color: var(--muted); }
.map-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.map-wrap svg { width: 100%; height: auto; }

/* ---------- news ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  font: 600 var(--s-xs) var(--f-head); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--nile); border-color: var(--nile); color: #fff; }
.post { display: flex; flex-direction: column; gap: 12px; }
.post .meta { display: flex; gap: 12px; align-items: center; font-size: var(--s-xs); color: var(--muted); }
.badge { font: 700 .6875rem var(--f-head); letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--sand); color: var(--nile); }
.post h3 { font-size: 1.15rem; }
.article { max-width: 70ch; }
.article p { margin-bottom: 1.1em; }

/* ---------- CTA band ---------- */
.cta { background: var(--nile); color: #D9ECE7; border-radius: 16px; padding: clamp(32px, 5vw, 56px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; position: relative; overflow: hidden; }
.cta h2 { color: #fff; font-size: var(--s-xl); max-width: 22ch; }
.cta::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(227, 155, 58, .18); }
.cta > * { position: relative; z-index: 1; }

/* ---------- contact ---------- */
.form { display: grid; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 600 var(--s-sm) var(--f-head); color: var(--ink); }
.field input, .field select, .field textarea {
  font: inherit; font-size: var(--s-sm); color: var(--ink); background: #fff;
  border: 1px solid #C9D5D1; border-radius: 8px; padding: 13px 14px; width: 100%;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--nile); box-shadow: 0 0 0 3px rgba(14,107,92,.15); }
.field .err { display: none; font-size: var(--s-xs); color: #B3261E; }
.field.has-error input, .field.has-error textarea { border-color: #B3261E; }
.field.has-error .err { display: block; }
.consent { display: flex; gap: 10px; font-size: var(--s-xs); color: var(--muted); align-items: flex-start; }
.consent input { margin-top: 3px; accent-color: var(--nile); }
.hp { position: absolute; left: -9999px; }
.form-status { display: none; padding: 16px; border-radius: 8px; background: #E7F4F0; color: var(--nile-dark); font-size: var(--s-sm); }
.form-status.is-visible { display: block; }
.contact-list { list-style: none; display: flex; flex-direction: column; }
.contact-list li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: var(--s-sm); }
.contact-list li > * { min-width: 0; overflow-wrap: anywhere; }
.contact-list .k { font: 700 var(--s-xs) var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }

/* ---------- footer ---------- */
.site-footer { background: var(--delta); color: #A9BDB8; font-size: var(--s-sm); }
.site-footer .container { padding-block: 64px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid > * { min-width: 0; }
.site-footer img { height: 64px; width: auto; margin-bottom: 18px; }
.site-footer h4 { color: #fff; font-size: var(--s-xs); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: #D7E3E0; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-tag { font-family: var(--f-head); color: var(--gold); font-weight: 600; margin-top: 6px; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 48px; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; font-size: var(--s-xs); color: #8DA39E; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--delta); color: #fff; padding: 14px 20px; border-radius: 10px; font-size: var(--s-sm);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 80; max-width: calc(100% - 32px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal on scroll (visible by default; JS adds motion only) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .grid-4, .region-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .bridge { grid-template-columns: 1fr; }
  .bridge .arrow { transform: rotate(90deg); padding: 4px 0; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 20px 20px;
    display: none; box-shadow: 0 12px 24px rgba(20,48,43,.08);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 12px; border-radius: 8px; }
  .nav .btn { margin: 8px 0 0; }
  .split, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero-visual { max-height: 340px; aspect-ratio: 1 / 1; order: -1; }
  .waves { grid-template-columns: 1fr; }
  .wave { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.14); }
  .service-row { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 560px) {
  .grid-4, .region-grid, .footer-grid { grid-template-columns: 1fr; }
  .brand img { height: 44px; }
  .contact-list li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
