/* Evening Focus Coach landing: "moonlit room" (spec: docs/DESIGN_RESEARCH.md §3) */

/* ---- Fonts: self-hosted, SIL OFL (fonts/LICENSE-*), Latin subset, no third-party requests ---- */
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/fraunces-latin-opsz-normal.woff2") format("woff2-variations"), url("fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* palette (contrast vs --night-0 in comments; verified by tests/smoke.py) */
  --night-0: #0E1022;  /* page bg */
  --night-1: #15183A;  /* alternate section bg */
  --surface: #1C2046;  /* cards, phone frame */
  --line: #2C3163;     /* 1px borders */
  --text: #EFE9DC;     /* moonlight cream */
  --soft: #B4B2CF;     /* secondary text */
  --muted: #8C8AAE;    /* captions only */
  --accent: #A99BF5;   /* lavender CTA */
  --accent-hi: #B9ADF8;
  --mint: #8CDCC8;     /* time reclaimed */
  --lamp: #F2C98A;     /* tiny warm highlights, focus ring */

  --serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* 4px spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;
  --gutter: 20px; --section: var(--s8); --maxw: 1080px;
  --r-card: 20px; --r-phone: 44px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (min-width: 840px) { :root { --gutter: 24px; --section: var(--s10); } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: 400 1.125rem/1.6 var(--body);
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(169, 155, 245, .18), transparent 70%),
    radial-gradient(40% 30% at 80% 30%, rgba(242, 201, 138, .08), transparent 70%),
    var(--night-0);
  background-repeat: no-repeat; background-color: var(--night-0);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--mint); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--serif); color: var(--text); margin: 0; text-wrap: balance; }
h1 { font-weight: 400; font-variation-settings: "opsz" 96; font-size: clamp(2.4rem, 7vw + 1rem, 4.5rem); line-height: 1.05; letter-spacing: -.02em; max-width: 34ch; }
h2 { font-weight: 500; font-variation-settings: "opsz" 96; font-size: clamp(1.75rem, 3vw + 1rem, 2.75rem); line-height: 1.1; letter-spacing: -.02em; margin-bottom: var(--s4); }
h3 { font-weight: 500; font-variation-settings: "opsz" 36; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 var(--s4); max-width: 60ch; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(680px + 2 * var(--gutter)); }
.soft { color: var(--soft); }
.fine { color: var(--soft); font-size: .9375rem; }
.caption { color: var(--muted); font-size: .9375rem; margin-top: var(--s3); }
.eyebrow { font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 var(--s3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -100px; z-index: 50; background: var(--accent); color: var(--night-0); padding: var(--s2) var(--s4); border-radius: 999px; font-weight: 700; }
.skip:focus { top: var(--s2); }

/* ---- Nav ---- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(14, 16, 34, .7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.nav-in { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: var(--s2); color: var(--text); text-decoration: none; font: 500 1.0625rem/1 var(--serif); letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
.nav-cta { color: var(--text); text-decoration: none; font-weight: 700; font-size: .9375rem; padding: 10px var(--s4); min-height: 44px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.nav-cta:hover { border-color: var(--accent); color: var(--text); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; border: 0;
  font: 700 1.0625rem/1 var(--body); padding: 18px 28px; min-height: 56px; border-radius: 999px; transition: background-color .2s, transform .2s; }
.btn.primary { background: var(--accent); color: var(--night-0); box-shadow: 0 8px 30px -8px rgba(169, 155, 245, .55); }
.btn.primary:hover, .btn.primary:active { background: var(--accent-hi); color: var(--night-0); transform: translateY(-1px); }
.text-link { color: var(--soft); font-weight: 700; text-decoration: none; padding: var(--s3) var(--s1); min-height: 48px; display: inline-flex; align-items: center; gap: 6px; }
.text-link:hover { color: var(--text); text-decoration: underline; }

/* ---- Hero ---- */
.hero { padding: var(--s7) 0 0; overflow: hidden; }
.hero-grid { display: grid; gap: var(--s7); }
.hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero .sub { font-size: 1.1875rem; color: var(--soft); max-width: 34ch; margin: var(--s4) 0 var(--s5); }
.cta-row { display: flex; flex-direction: column; align-items: center; gap: var(--s2); width: 100%; }
.reassure { margin: var(--s3) 0 0; }
.hero-visual { position: relative; display: grid; place-items: center; max-height: 560px; overflow: hidden; margin-inline: calc(-1 * var(--gutter));
  -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); padding-top: var(--s4); }
.glow { position: absolute; inset: 8% 0 auto; margin: auto; width: min(100vw, 560px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(169, 155, 245, .38), rgba(169, 155, 245, .10) 60%, transparent);
  filter: blur(8px); animation: breathe 8s ease-in-out infinite; pointer-events: none; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.04); opacity: 1; } }

/* ---- Phone mockup (pure CSS) ---- */
.phone { position: relative; width: min(78vw, 320px); aspect-ratio: 9 / 19.5; padding: 10px; border-radius: var(--r-phone);
  background: linear-gradient(160deg, #2A2E5A, #15183A); border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 0, 0, .4) inset, 0 0 120px -30px rgba(169, 155, 245, .35); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 34px; display: block; background: var(--surface); }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; translate: -50% 0; width: 28%; height: 22px; border-radius: 999px; background: #05060F; z-index: 1; }
.phone-front { z-index: 2; animation: rise .7s var(--ease) both; }
.phone-back { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---- Problem ---- */
.problem { padding: var(--section) 0; }
.lines { font: 400 clamp(1.5rem, 2.5vw + 1rem, 2.25rem)/1.3 var(--serif); font-variation-settings: "opsz" 72; color: var(--soft); letter-spacing: -.01em; margin-bottom: var(--s5); }
.lines span { display: block; }
.turn { font-size: 1.1875rem; color: var(--text); }
.founder { margin: var(--s6) 0 0; padding-left: var(--s4); border-left: 2px solid var(--lamp); color: var(--soft); font: 400 1.0625rem/1.5 var(--body); }

/* ---- Features ---- */
.features { padding: var(--section) 0; background: var(--night-1); }
.bullets { display: grid; gap: var(--s4); margin-top: var(--s6); }
.b { background: var(--surface); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--r-card); padding: var(--s5); }
.b h3 { margin: var(--s4) 0 var(--s2); }
.b p { margin: 0; color: var(--soft); }
.ico { width: 28px; height: 28px; fill: none; stroke: var(--lamp); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- How it works ---- */
.how { padding: var(--section) 0; }
.how-steps { list-style: none; padding: 0; margin: var(--s6) 0 0; display: grid; gap: var(--s8); }
.how-steps li { display: flex; flex-direction: column; align-items: flex-start; }
.num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--lamp); font: 500 1.125rem/1 var(--serif); margin-bottom: var(--s4); }
.how-steps h3 { margin-bottom: var(--s2); }
.how-steps p { color: var(--soft); margin-bottom: var(--s5); }
.how-steps .caption { color: var(--muted); margin: var(--s3) 0 0; }
.phone-sm { width: min(64vw, 240px); padding: 8px; border-radius: 36px; align-self: center; }
.phone-sm img { border-radius: 28px; }
.phone-sm::before { top: 14px; height: 16px; }
.how-steps li:last-child h3 { color: var(--mint); }

/* ---- Privacy strip ---- */
.privacy-strip { border-block: 1px solid rgba(255, 255, 255, .08); background: var(--night-1); padding: var(--s5) 0; text-align: center; }
.privacy-strip p { margin: 0 auto; max-width: none; color: var(--text); }
.privacy-strip a { margin-left: var(--s2); }

/* ---- Waitlist ---- */
.waitlist-sec { padding: var(--section) 0 calc(var(--section) / 2); }
.cta-card { position: relative; text-align: center; max-width: 720px; margin: 0 auto; padding: var(--s7) var(--s5);
  background: linear-gradient(180deg, #232859, var(--surface)); border: 1px solid rgba(255, 255, 255, .10); border-radius: 28px;
  box-shadow: 0 0 120px -40px rgba(169, 155, 245, .55); }
.cta-card p { margin-left: auto; margin-right: auto; }
.waitlist { display: flex; flex-direction: column; gap: var(--s3); max-width: 480px; margin: var(--s5) auto var(--s2); }
.waitlist input { min-height: 56px; background: var(--night-0); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 0 var(--s5); font: inherit; }
.waitlist input::placeholder { color: var(--muted); opacity: 1; }
.waitlist input:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; border-color: var(--accent); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.waitlist .btn:disabled { opacity: .75; cursor: progress; }
.form-msg { min-height: 1.6em; color: var(--lamp); font-size: .9375rem; margin-bottom: var(--s2) !important; }
.cta-card .fine { margin-bottom: var(--s2); }

/* ---- Install ---- */
.install { padding: calc(var(--section) / 2) 0 var(--section); }
.step { background: var(--surface); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--r-card); margin-top: var(--s3); }
.step summary { cursor: pointer; list-style: none; padding: var(--s4) var(--s5); min-height: 56px; display: flex; align-items: center; gap: var(--s2); font-weight: 700; border-radius: var(--r-card); }
.step summary::-webkit-details-marker { display: none; }
.step summary::after { content: "+"; margin-left: auto; font: 400 1.5rem/1 var(--serif); color: var(--lamp); }
.step[open] summary::after { content: "−"; }
.step summary .fine { font-weight: 400; }
.step ol { margin: 0; padding: 0 var(--s5) var(--s4) calc(var(--s5) + 20px); color: var(--soft); }
.step ol li { margin-bottom: var(--s1); }
.step b { color: var(--text); }
.step > .fine { padding: 0 var(--s5) var(--s4); margin: 0; }

/* ---- Pricing ---- */
.pricing { padding: var(--section) 0; background: var(--night-1); }
.price { font: 400 1.375rem/1.4 var(--serif); font-variation-settings: "opsz" 36; color: var(--text); }

/* ---- Footer ---- */
.foot { background: var(--night-0); border-top: 1px solid rgba(255, 255, 255, .08); padding: var(--s7) 0 var(--s8); text-align: center; }
.foot p { margin: 0 auto var(--s2); }
.foot-brand { font: 500 1.125rem/1.2 var(--serif); }
.foot .fine { color: var(--muted); }
.foot a { color: var(--soft); }

/* Section scroll-reveal from the spec (§3.6) deliberately left out: with opacity:0 start states, content could stay
   invisible in crawlers, previews and full-page captures. The page is static apart from the hero. */

/* ---- Wider screens ---- */
@media (min-width: 480px) {
  .cta-row { flex-direction: row; justify-content: center; gap: var(--s4); }
}
@media (max-width: 479px) {
  .hero-copy .btn.primary, .waitlist .btn { width: 100%; }
}
@media (min-width: 640px) {
  .waitlist { flex-direction: row; }
  .waitlist input { flex: 1; }
}
@media (min-width: 840px) {
  .hero { padding: var(--s9) 0 var(--s8); }
  .hero-grid { grid-template-columns: 55fr 45fr; align-items: center; gap: var(--s6); }
  .hero-copy { text-align: left; align-items: flex-start; }
  .cta-row { justify-content: flex-start; }
  .hero-visual { max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; min-height: 680px; padding: 0; margin-inline: 0; }
  .phone-front { width: 300px; rotate: -4deg; }
  .phone-back { display: block; position: absolute; width: 260px; opacity: .6; rotate: 6deg; translate: 120px 30px; z-index: 1; }
  .bullets { grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
  .how-steps { grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
  .how-steps li { height: 100%; }
  .how-steps p:not(.caption) { flex: 1; }
  .cta-card { padding: var(--s8) var(--s7); }
}

/* ---- Motion off on request ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Privacy / legal / 404 pages ---- */
.legal { max-width: calc(680px + 2 * var(--gutter)); margin: 0 auto; padding: var(--s7) var(--gutter) var(--s8); }
.legal h1 { font-size: clamp(2.2rem, 5vw + 1rem, 3.25rem); margin-bottom: var(--s4); }
.legal h2 { font-size: 1.375rem; margin: var(--s6) 0 var(--s2); }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: var(--s1); }
.legal .btn { margin: var(--s2); }
.legal .btn:not(.primary) { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
