/* Dusk: Migraine Tracker — dusktracker.com
   The site wears the app's identity: the dark room. True-black ground (never a
   backlit white page), dimmed lavender ink (never #FFF — it haloes for
   photophobic eyes), a warm amber readout like the last light on the horizon,
   and a calm periwinkle accent. Dark-only on purpose: the site is the product
   promise. Type: Nunito (rounded display, SF-Rounded analog) / Atkinson
   Hyperlegible (body — designed for low-vision legibility) / IBM Plex Mono
   (readouts + eyebrows). */

:root {
  --night:      #000000;   /* page ground — the dark room */
  --surface:    #121016;   /* raised card, barely lifted off black */
  --sheet:      #1A1620;   /* nested / inset surface */
  --ink:        #D9D4E4;   /* primary text — dimmed lavender-white */
  --ink-soft:   #8A8398;   /* secondary text */
  --line:       #2A2633;   /* hairlines */
  --peri:       #9E93F0;   /* periwinkle — links, accents, the star */
  --peri-deep:  #574FD6;
  --amber:      #E0A44E;   /* the readout — amber on black */
  --amber-soft: rgba(224,164,78,.14);
  --peri-soft:  rgba(158,147,240,.13);
  --radius:     16px;
  --radius-lg:  24px;
  --shadow:     0 24px 56px -28px rgba(0,0,0,.9);
  --maxw:       1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--peri); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

h1, h2, h3, .display {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0;
}

/* ---------- layout ---------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.section { padding: 96px 0; }
.section--tint { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 620px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin-top: 14px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; margin: 14px 0 0; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0,0,0,.78);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: 'Nunito',sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.topnav { display: flex; gap: 26px; }
.topnav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem; }
.topnav a:hover { color: var(--peri); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--peri-deep); color: #EFEDFB;
  padding: 15px 26px; border-radius: 999px;
  font-family: 'Nunito',sans-serif; font-weight: 700; font-size: 1.04rem;
  text-decoration: none; border: 0; cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-2px); background: #6A62E2; }
.btn .apple { width: 19px; height: 22px; flex: 0 0 auto; }
.btn--soon { background: var(--sheet); color: var(--ink); border: 1px solid var(--line); cursor: default; }
.btn--soon:hover { transform: none; background: var(--sheet); }

/* ---------- hero: the dark room ---------- */

.hero {
  position: relative;
  padding: 72px 0 110px;
  text-align: center;
  overflow: hidden;
}
/* the amber horizon — a soft glow rising from the bottom of the hero */
.hero::after {
  content: "";
  position: absolute; left: 50%; bottom: -260px; transform: translateX(-50%);
  width: 1200px; height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(224,164,78,.16), rgba(224,164,78,.05) 55%, transparent 75%);
  pointer-events: none;
}
.hero > .wrap { position: relative; z-index: 1; }

.hero .pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--peri-soft); color: var(--peri);
  font-family: 'IBM Plex Mono',monospace; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 15px; border-radius: 999px; margin-bottom: 30px;
}

.phrase {
  font-family: 'Nunito',sans-serif; font-weight: 800;
  font-size: clamp(2.1rem, 6vw, 3.8rem);
  line-height: 1.08; color: var(--ink);
  max-width: 15ch; margin: 0 auto;
  animation: rise .7s .1s both cubic-bezier(.2,.7,.2,1);
}

/* signature: eclipse + star over the readout card */
.moon-wrap { position: relative; display: inline-block; margin: 40px auto 0; animation: fade .9s .5s both; }
.moon { width: 190px; height: 190px; display: block; margin: 0 auto; }
.moon .star { animation: twinkle 5s 1.4s ease-in-out infinite; transform-origin: center; }

.readout-card {
  display: inline-block;
  margin: 26px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 44px 24px;
  animation: rise .6s .8s both cubic-bezier(.2,.7,.2,1);
}
.readout-card .num {
  font-family: 'IBM Plex Mono',monospace; font-weight: 600;
  font-size: 3.4rem; line-height: 1; color: var(--amber);
}
.readout-card .cap {
  font-family: 'IBM Plex Mono',monospace; font-size: .75rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft); margin-top: 10px;
}

.hero .lede { max-width: 46ch; margin: 40px auto 0; font-size: 1.18rem; color: var(--ink); animation: fade .6s 1.1s both; }
.hero .lede b { color: var(--amber); font-weight: 700; }
.hero .cta-row { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: fade .6s 1.25s both; }
.fine { font-family: 'IBM Plex Mono',monospace; font-size: .8rem; color: var(--ink-soft); letter-spacing: .02em; }

/* ---------- feature bands ---------- */

.band-label { display: flex; align-items: center; gap: 14px; max-width: var(--maxw); margin: 0 auto 32px; }
.band-label .tag { font-family: 'IBM Plex Mono',monospace; font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; padding: 6px 13px; border-radius: 999px; white-space: nowrap; }
.band-label .tag--free { background: var(--amber-soft); color: var(--amber); }
.band-label .tag--pro { background: var(--peri-soft); color: var(--peri); }
.band-label .rule { height: 1px; background: var(--line); flex: 1; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: var(--maxw); margin: 0 auto; }
.feature {
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-3px); border-color: #3A3547; }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--peri-soft); display: grid; place-items: center; margin-bottom: 16px; }
.feature .ico svg { width: 24px; height: 24px; stroke: var(--peri); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 1.3rem; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.55; }
.price-line { text-align: center; margin: 36px 0 0; font-family: 'IBM Plex Mono',monospace; font-size: .86rem; color: var(--ink-soft); letter-spacing: .04em; }
.price-line b { color: var(--amber); font-weight: 600; }

/* ---------- privacy band ---------- */

.privacy-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px 40px; max-width: 880px; margin: 44px auto 0; }
.promise { display: flex; gap: 15px; align-items: flex-start; text-align: left; }
.promise .mark { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--amber-soft); display: grid; place-items: center; margin-top: 3px; }
.promise .mark svg { width: 17px; height: 17px; stroke: var(--amber); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.promise b { color: var(--ink); font-weight: 700; }
.promise span { display: block; color: var(--ink-soft); font-size: 1rem; line-height: 1.5; }

/* ---------- final CTA ---------- */

.closer { text-align: center; position: relative; overflow: hidden; }
.closer::after {
  content: "";
  position: absolute; left: 50%; bottom: -300px; transform: translateX(-50%);
  width: 1200px; height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(224,164,78,.12), transparent 75%);
  pointer-events: none;
}
.closer .wrap { position: relative; z-index: 1; }
.closer h2 { font-size: clamp(2rem, 5.5vw, 3.1rem); }
.closer .cta-row { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); color: var(--ink-soft); padding: 40px 0 46px; text-align: center; }
.foot a { color: var(--ink); text-decoration: none; margin: 0 14px; font-weight: 500; }
.foot a:hover { color: var(--peri); text-decoration: underline; }
.foot p { margin: 20px 0 0; font-size: .92rem; }
.foot .disclaimer { max-width: 62ch; margin: 22px auto 0; font-size: .85rem; line-height: 1.5; }

/* ---------- content pages (support / privacy / terms) ---------- */

.page-head { background: var(--surface); border-bottom: 1px solid var(--line); text-align: center; padding: 60px 0 68px; }
.page-head img.logo { width: 88px; height: 88px; border-radius: 21px; margin: 0 auto 22px; box-shadow: var(--shadow); }
.page-head h1 { font-size: clamp(2.2rem,6vw,3.1rem); }
.page-head .eyebrow { margin-bottom: 14px; }

.prose { max-width: 740px; margin: 0 auto; padding: 68px 24px; }
.prose h2 { font-size: 1.8rem; margin: 8px 0 24px; }
.prose h3 { font-size: 1.3rem; margin: 40px 0 12px; }
.prose p { margin: 0 0 18px; }
.prose ul { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin: 0 0 8px; }
.prose b, .prose strong { color: var(--ink); }
.updated { display: inline-block; font-family: 'IBM Plex Mono',monospace; font-size: .82rem; color: var(--amber); background: var(--amber-soft); padding: 8px 14px; border-radius: 10px; margin-bottom: 30px; }

.faq { border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); margin-bottom: 14px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 20px 24px; font-weight: 700; font-family: 'Nunito',sans-serif; font-size: 1.1rem; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: 'IBM Plex Mono',monospace; color: var(--amber); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.faq[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 24px 22px; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.6; }
.faq .answer b { color: var(--ink); }

.callout { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; }
.callout--amber { border-color: rgba(224,164,78,.35); background: var(--amber-soft); }
.back-link { display: inline-block; margin-top: 26px; color: var(--ink); background: var(--peri-soft); padding: 12px 22px; border-radius: 999px; text-decoration: none; font-weight: 700; font-family: 'Nunito',sans-serif; }
.back-link:hover { background: rgba(158,147,240,.22); }

/* ---------- motion primitives ---------- */

@keyframes rise    { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- accessibility floor ---------- */

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--peri); outline-offset: 3px; border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .phrase, .moon-wrap, .readout-card, .hero .lede, .hero .cta-row { opacity: 1 !important; transform: none !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  body { font-size: 1.05rem; }
  .section { padding: 64px 0; }
  .topnav { gap: 16px; font-size: .92rem; }
  .topnav a.hide-sm { display: none; }
  .grid, .privacy-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 84px; }
  .moon { width: 150px; height: 150px; }
  .readout-card { padding: 22px 32px 20px; }
  .readout-card .num { font-size: 2.7rem; }
}
