/* ============================================================
   EczaIQ — landing page
   Design: apothecary green canvas · saffron/mint accents ·
   Fraunces / Hanken Grotesk / IBM Plex Mono · ℞ prescription grammar
   Real product screenshots shown in browser/phone frames.
   ============================================================ */

:root {
  /* ---- canvas: deep apothecary green (dominant) ---- */
  --forest:      #0B1F17;
  --forest-2:    #0E271C;
  --pine:        #143b2d;
  --pine-2:      #16493A;

  /* ---- paper: warm prescription off-white (light sections) ---- */
  --paper:       #F4F1E8;
  --paper-2:     #ECE7D6;
  --ink:         #14201A;
  --ink-soft:    #3c4a41;

  /* ---- brand + sharp accents ---- */
  --brand:       #1E8E6E;
  --brand-strong:#14755A;
  --amber:       #E8A33D;   /* saffron signal */
  --amber-deep:  #C9821E;
  --mint:        #86EFC0;   /* positive data on dark */
  --danger:      #E5705B;

  /* ---- text on dark ---- */
  --on-dark:     #EAF3EC;
  --on-dark-soft:#B7C9BE;
  --on-dark-mut: #7C9187;

  /* ---- lines ---- */
  --line-dark:  rgba(234,243,236,.10);
  --line-dark-2:rgba(234,243,236,.16);
  --line-light: #DDD6C4;

  /* ---- type ---- */
  --display: Georgia, "Times New Roman", serif;
  --body:    -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:    ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1180px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------------- base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  background: var(--forest);
  color: var(--on-dark);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.06; letter-spacing: -0.015em; }
p { margin: 0; }
figure { margin: 0; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
img, svg { max-width: 100%; display: block; }
::selection { background: var(--amber); color: var(--forest); }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

/* let grid/flex tracks shrink below content min-content (prevents mobile overflow) */
.hero__grid > *, .spot > *, .platforms__grid > *, .faq__grid > *,
.fgrid > *, .steps > *, .trust__grid > * { min-width: 0; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--amber); color: var(--forest); padding: 10px 16px; border-radius: 8px;
  font-family: var(--mono); font-size: 13px;
}
.skip-link:focus { left: 12px; top: 12px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

/* ---------------- eyebrow / shared ---------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber); margin: 0 0 20px;
}
.eyebrow--light { color: var(--mint); }
.eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }

/* ---------------- buttons ---------------- */
.btn {
  --pad: 14px 24px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--body); font-weight: 600; font-size: 15px;
  padding: var(--pad); border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s;
  white-space: nowrap;
}
.btn--sm { --pad: 10px 18px; font-size: 14px; }
.btn--lg { --pad: 17px 30px; font-size: 16px; }
.btn--amber {
  background: var(--amber); color: #2a1a04;
  box-shadow: 0 6px 22px rgba(232,163,61,.28), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn--amber:hover { background: #f2b356; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(232,163,61,.36); }
.btn--ghost { background: transparent; color: var(--on-dark); border-color: var(--line-dark-2); }
.btn--ghost:hover { border-color: var(--mint); color: var(--mint); transform: translateY(-2px); }

/* ---------------- nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--forest) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.is-stuck { border-bottom-color: var(--line-dark); background: color-mix(in srgb, var(--forest) 92%, transparent); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.wordmark__rx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(155deg, #1a5643, #0a1c15);
  color: var(--amber); font-family: var(--display); font-size: 18px; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 2px 8px rgba(0,0,0,.35);
}
.wordmark__text { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.wordmark__iq { color: var(--amber); }
.nav__links { display: flex; gap: 28px; margin-left: auto; }
.nav__links a { font-size: 15px; color: var(--on-dark-soft); position: relative; padding: 4px 0; transition: color .2s; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: var(--amber); transition: width .25s var(--ease); }
.nav__links a:hover { color: var(--on-dark); }
.nav__links a:hover::after { width: 100%; }
.nav .btn { margin-left: 8px; }

/* ============================================================
   BROWSER FRAME (wraps real screenshots)
   ============================================================ */
.frame {
  background: #e9ede8;
  border-radius: 15px;
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 30px 70px -24px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.5) inset;
  overflow: hidden;
}
.frame__bar { display: flex; align-items: center; gap: 7px; padding: 11px 15px; background: #e9ede8; border-bottom: 1px solid #d9e0d8; }
.frame__dot { width: 11px; height: 11px; border-radius: 50%; background: #cdd5cb; }
.frame__dot:nth-child(1) { background: #e0857f; }
.frame__dot:nth-child(2) { background: #e6c27a; }
.frame__dot:nth-child(3) { background: #9ac79b; }
.frame__title { font-family: var(--mono); font-size: 12px; color: #56645b; margin-left: 8px; }
.frame__img { width: 100%; height: auto; display: block; background: #f1f3f1; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: 84px 0 96px; overflow: hidden; }
.hero__glow {
  position: absolute; inset: -20% -10% auto -10%; height: 120%;
  background:
    radial-gradient(680px 420px at 78% 18%, rgba(232,163,61,.16), transparent 60%),
    radial-gradient(760px 520px at 8% 6%, rgba(134,239,192,.10), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(20,117,90,.30), transparent 60%);
  pointer-events: none;
}
.hero__grid { position: relative; display: grid; grid-template-columns: 1fr 1.08fr; gap: 56px; align-items: center; }
.hero__title { font-size: clamp(42px, 6.4vw, 74px); font-weight: 600; letter-spacing: -0.03em; margin: 8px 0 24px; }
.hero__title span { display: block; }
.hero__title em { color: var(--amber); font-weight: 500; }
.hero__lede { font-size: clamp(17px, 2vw, 20px); color: var(--on-dark-soft); max-width: 30em; margin-bottom: 32px; }
.hero__lede strong { color: var(--on-dark); font-weight: 600; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero__trust { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.hero__trust li { font-family: var(--mono); font-size: 13px; color: var(--on-dark-mut); display: flex; gap: 8px; align-items: center; }
.hero__trust span { color: var(--mint); font-size: 10px; }
.hero__device { position: relative; }
.hero__device-note { margin-top: 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--on-dark-mut); text-align: center; }

/* ============================================================
   VALUE STRIP
   ============================================================ */
.strip { border-block: 1px solid var(--line-dark); background: var(--forest-2); overflow: hidden; --gap: 40px; }
.strip__track { display: flex; align-items: center; gap: var(--gap); padding: 18px 0; white-space: nowrap; animation: marquee 34s linear infinite; width: max-content; }
.strip__item { font-family: var(--mono); font-size: 14px; color: var(--on-dark-soft); letter-spacing: .01em; }
.strip__item b { color: var(--on-dark); font-weight: 600; }
.strip__sep { color: var(--amber); font-family: var(--display); }
@keyframes marquee { to { transform: translateX(calc(-50% - var(--gap)/2)); } }

/* ============================================================
   FEATURES (paper section)
   ============================================================ */
.features { background: var(--paper); color: var(--ink); padding: 108px 0 116px; }
.sectionhead { max-width: 720px; margin: 0 auto 72px; text-align: center; }
.sectionhead--left { text-align: left; margin-inline: 0; }
.features .eyebrow { color: var(--amber-deep); }
.sectionhead__h { font-size: clamp(30px, 4vw, 46px); color: var(--ink); }
.sectionhead__h em { color: var(--brand-strong); }
.sectionhead__p { margin-top: 20px; font-size: 18px; color: var(--ink-soft); }

/* spotlight rows */
.spot { display: grid; grid-template-columns: 1fr 1.12fr; gap: 56px; align-items: center; padding: 40px 0; }
.spot--rev .spot__media { order: 2; }
.spot--rev .spot__text { order: 3; }
.spot__kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-deep); margin-bottom: 14px; }
.spot__h { font-size: clamp(24px, 3vw, 34px); color: var(--ink); margin-bottom: 18px; }
.spot__p { font-size: 17px; color: var(--ink-soft); max-width: 36em; }
.spot__p b { color: var(--ink); }
.spot__list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.spot__list li { position: relative; padding-left: 26px; font-size: 15.5px; color: var(--ink-soft); }
.spot__list li::before { content: "℞"; position: absolute; left: 0; top: -1px; font-family: var(--display); color: var(--brand); font-weight: 600; }
.spot__media { min-width: 0; }
.spot__media .frame { transform: perspective(1600px) rotateY(-1deg); }
.spot--rev .spot__media .frame { transform: perspective(1600px) rotateY(1deg); }

/* secondary grid */
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 60px; }
.fcard { background: #fff; border: 1px solid var(--line-light); border-radius: 16px; padding: 28px; box-shadow: 0 1px 2px rgba(20,32,27,.05); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.fcard:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -18px rgba(20,32,27,.3); }
.fcard__icon { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 10px; border-radius: 11px; background: var(--forest); color: var(--amber); font-family: var(--mono); font-size: 15px; margin-bottom: 18px; }
.fcard__h { font-family: var(--display); font-size: 21px; color: var(--ink); margin-bottom: 10px; }
.fcard__p { font-size: 14.5px; color: var(--ink-soft); }

/* ============================================================
   PLATFORMS (forest section)
   ============================================================ */
.platforms { background: var(--forest); padding: 110px 0; position: relative; }
.platforms__grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: 56px; align-items: center; }
.platforms__h { font-size: clamp(30px, 4vw, 46px); margin-bottom: 20px; }
.platforms__p { font-size: 18px; color: var(--on-dark-soft); max-width: 30em; }
.platforms__p b { color: var(--mint); font-weight: 600; }
.platforms__badges { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.platforms__badges li { font-family: var(--mono); font-size: 12.5px; color: var(--on-dark-soft); border: 1px solid var(--line-dark-2); border-radius: 999px; padding: 8px 16px; }

.platforms__devices { position: relative; min-height: 420px; }
.mac {
  position: absolute; top: 0; right: 0; width: 88%;
  background: #0b1512; border-radius: 14px; border: 1px solid var(--line-dark-2);
  box-shadow: 0 44px 90px -34px rgba(0,0,0,.75); overflow: hidden;
}
.mac__bar { display: flex; gap: 6px; padding: 10px 12px; background: #10201a; border-bottom: 1px solid var(--line-dark); }
.mac__bar span { width: 9px; height: 9px; border-radius: 50%; background: #2a3a32; }
.mac__img { width: 100%; height: auto; display: block; }

.phone {
  position: absolute; width: 30%; max-width: 190px;
  border-radius: 26px; border: 3px solid #23332b; background: #0b1512; padding: 5px;
  box-shadow: 0 40px 70px -22px rgba(0,0,0,.85);
}
.phone img { width: 100%; height: auto; display: block; border-radius: 20px; }
.phone--a { left: 0; bottom: 0; z-index: 3; transform: rotate(-4deg); }
.phone--b { left: 24%; bottom: -18px; z-index: 2; transform: rotate(3deg); }

/* ============================================================
   HOW IT WORKS (paper)
   ============================================================ */
.how { background: var(--paper-2); color: var(--ink); padding: 108px 0; }
.how .eyebrow { color: var(--amber-deep); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.step { background: var(--paper); border: 1px solid var(--line-light); border-radius: 18px; padding: 32px 28px 34px; position: relative; }
.step__num { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--forest); color: var(--amber); font-family: var(--display); font-size: 22px; font-weight: 600; margin-bottom: 20px; }
.step__h { font-family: var(--display); font-size: 24px; color: var(--ink); margin-bottom: 10px; }
.step__p { font-size: 15.5px; color: var(--ink-soft); }
.step:not(:last-child)::after { content: "℞"; position: absolute; right: -18px; top: 50%; transform: translateY(-50%); font-family: var(--display); color: var(--brand); font-size: 20px; opacity: .5; z-index: 1; }

/* ============================================================
   TRUST BAND (forest)
   ============================================================ */
.trust { background: linear-gradient(180deg, var(--forest), var(--forest-2)); padding: 84px 0; border-top: 1px solid var(--line-dark); }
.trust__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.trust__mark { font-family: var(--display); color: var(--amber); font-size: 26px; display: block; margin-bottom: 14px; }
.trust__item h3 { font-family: var(--display); font-size: 22px; color: var(--on-dark); margin-bottom: 8px; }
.trust__item p { color: var(--on-dark-soft); font-size: 15.5px; }

/* ============================================================
   FAQ (paper)
   ============================================================ */
.faq { background: var(--paper); color: var(--ink); padding: 104px 0; }
.faq__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: start; }
.faq .eyebrow { color: var(--amber-deep); }
.faq__list { display: grid; gap: 4px; }
.qa { border-bottom: 1px solid var(--line-light); }
.qa summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--ink); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-family: var(--mono); font-size: 22px; color: var(--brand-strong); transition: transform .25s var(--ease); }
.qa[open] summary::after { transform: rotate(45deg); }
.qa p { padding: 0 40px 22px 0; color: var(--ink-soft); font-size: 15.5px; }

/* ============================================================
   CLOSING CTA (forest)
   ============================================================ */
.close { position: relative; background: var(--forest); padding: 116px 0 124px; overflow: hidden; text-align: center; }
.close__glow { position: absolute; inset: 0; background: radial-gradient(600px 340px at 50% 0%, rgba(232,163,61,.18), transparent 62%); pointer-events: none; }
.close__inner { position: relative; max-width: 640px; margin: 0 auto; }
.close__inner .eyebrow { justify-content: center; }
.close__h { font-size: clamp(34px, 5vw, 58px); margin-bottom: 18px; }
.close__p { font-size: 19px; color: var(--on-dark-soft); margin-bottom: 34px; }
.close__form { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.close__input { font-family: var(--body); font-size: 16px; padding: 15px 20px; width: min(340px, 100%); background: var(--forest-2); border: 1px solid var(--line-dark-2); border-radius: 10px; color: var(--on-dark); }
.close__input::placeholder { color: var(--on-dark-mut); }
.close__input:focus { border-color: var(--amber); outline: none; }
.close__note { font-family: var(--mono); font-size: 13px; color: var(--on-dark-mut); }
.close__note a { color: var(--mint); border-bottom: 1px solid rgba(134,239,192,.35); }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { background: var(--forest-2); border-top: 1px solid var(--line-dark); padding: 48px 0; }
.foot__inner { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 32px; align-items: center; }
.foot__brand p { margin-top: 10px; font-size: 14px; color: var(--on-dark-mut); max-width: 26em; }
.foot__nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot__nav a { font-size: 14px; color: var(--on-dark-soft); }
.foot__nav a:hover { color: var(--amber); }
.foot__legal { font-family: var(--mono); font-size: 12px; color: var(--on-dark-mut); }

/* ============================================================
   LEGAL + SUPPORT PAGES
   ============================================================ */
.legal { background: var(--paper-2); color: var(--ink); min-height: 70vh; padding: 72px 0 104px; }
.legal__layout { max-width: 900px; }
.legal__paper {
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: 20px;
  box-shadow: 0 28px 70px -36px rgba(20,32,27,.45);
  padding: clamp(28px, 6vw, 64px);
}
.legal__paper > .eyebrow { color: var(--amber-deep); }
.legal__paper h1 { color: var(--ink); font-size: clamp(34px, 6vw, 56px); margin-bottom: 18px; }
.legal__paper h2 {
  border-top: 1px solid var(--line-light);
  color: var(--ink);
  font-size: clamp(21px, 3vw, 28px);
  margin-top: 38px;
  padding-top: 30px;
}
.legal__paper p, .legal__paper li { color: var(--ink-soft); }
.legal__paper p { margin-top: 14px; }
.legal__paper ul { margin: 16px 0 0; padding-left: 24px; }
.legal__paper li + li { margin-top: 8px; }
.legal__paper a:not(.btn) { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
.legal__meta { background: #fff; border-left: 4px solid var(--brand); border-radius: 10px; padding: 14px 18px; }
.legal__lede { font-size: 18px; max-width: 42em; }
.legal__notice { background: #fff3d9; border-left: 4px solid var(--amber-deep); border-radius: 10px; color: var(--ink); margin-top: 28px; padding: 16px 18px; }
.nav__links a[aria-current="page"] { color: var(--amber); }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal][data-reveal-delay="1"] { transition-delay: .09s; }
[data-reveal][data-reveal-delay="2"] { transition-delay: .18s; }
[data-reveal][data-reveal-delay="3"] { transition-delay: .27s; }

/* hero staggered load */
.reveal { opacity: 0; transform: translateY(20px); animation: rise .8s var(--ease) forwards; }
.hero__title span.reveal:nth-child(1) { animation-delay: .05s; }
.hero__title span.reveal:nth-child(2) { animation-delay: .14s; }
.hero__title span.reveal:nth-child(3) { animation-delay: .23s; }
.hero__copy .eyebrow.reveal { animation-delay: 0s; }
.hero__lede.reveal { animation-delay: .34s; }
.hero__cta.reveal { animation-delay: .42s; }
.hero__trust.reveal { animation-delay: .5s; }
.hero__device.reveal { animation-delay: .3s; animation-duration: 1s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero__device { max-width: 560px; }
  .spot, .spot--rev { grid-template-columns: 1fr; gap: 32px; }
  .spot--rev .spot__media, .spot--rev .spot__text { order: 0; }
  .spot__media .frame, .spot--rev .spot__media .frame { transform: none; }
  .spot__media { max-width: 620px; }
  .fgrid { grid-template-columns: 1fr; }
  .platforms__grid { grid-template-columns: 1fr; gap: 40px; }
  .platforms__devices { min-height: 0; height: auto; display: block; padding-bottom: 30px; }
  .mac { position: relative; width: 100%; }
  .phone { position: absolute; width: 26%; }
  .phone--a { left: 2%; bottom: -10px; }
  .phone--b { left: 22%; bottom: -26px; }
  .steps { grid-template-columns: 1fr; }
  .step:not(:last-child)::after { display: none; }
  .trust__grid { grid-template-columns: 1fr; gap: 28px; }
  .faq__grid { grid-template-columns: 1fr; gap: 28px; }
  .foot__inner { grid-template-columns: 1fr; gap: 24px; text-align: left; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .nav__links { display: none; }
  .nav__inner { gap: 12px; }
  .nav .btn { margin-left: auto; }
  .hero { padding: 56px 0 72px; }
  .hero__title { font-size: clamp(38px, 11vw, 54px); }
  .strip { --gap: 28px; }
  .features, .how, .faq, .platforms, .trust { padding: 72px 0; }
  .platforms__devices { padding-bottom: 60px; }
  .phone { width: 30%; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; }
  .strip__track { animation: none; }
  .spot__media .frame, .spot--rev .spot__media .frame { transform: none; }
}
