/* StayFasted website v2
   Colors, radii and type follow the app's design system v0.3 (design/system/DESIGN.md).
   Rules carried over: purple is for the ring and for selection only, never a button fill;
   headings are medium weight; red is text only. */

:root {
  --ink: #1A1A1A;
  --ink-2: #4A4A4A;
  --ink-3: #6F6F73;
  --primary: #1A1A1A;
  --on-primary: #FFFFFF;
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --surface: #F3F3F4;
  --surface-warm: #EBE9E4;
  --border: #D9D9DB;
  --line: #E4E4E6;
  --accent: #7C3AED;
  --accent-2: #A78BFA;
  --accent-strong: #6E6784;
  --accent-subtle: #EEEAF6;
  --success: #2F6B45;
  --success-subtle: #D6E6DC;
  --water: #3A5FC4;
  --water-subtle: #E9EDF5;
  --streak: #B85C2B;
  --streak-subtle: #F7EBE2;
  --healing: #3E7C74;
  --healing-subtle: #DDEBE8;
  --phone-frame: #111113;
  --ring-track: #E4E4E6;
  --shadow: 0 30px 60px -30px rgba(26, 26, 26, .28), 0 12px 24px -16px rgba(26, 26, 26, .18);
  --nav-bg: rgba(255, 255, 255, .82);

  --r-chip: 8px;
  --r-field: 12px;
  --r-list: 16px;
  --r-card: 20px;
  --r-sheet: 24px;
  --r-pill: 999px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --page: 1120px;
  color-scheme: light;
}

/* Dark values. Applied when the system is dark and the visitor has not chosen light,
   and when the visitor has chosen dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F2F2F2;
    --ink-2: #A8A8AC;
    --ink-3: #8A8A90;
    --primary: #F2F2F2;
    --on-primary: #141414;
    --bg: #0F0F0F;
    --card: #1A1A1A;
    --surface: #1F1F1F;
    --surface-warm: #1A1A1A;
    --border: #2E2E2E;
    --line: #242424;
    --accent: #A78BFA;
    --accent-2: #C4B5FD;
    --accent-strong: #8E85A8;
    --accent-subtle: #2A2340;
    --success: #8FCBA5;
    --success-subtle: #1C3126;
    --water: #9DB0E8;
    --water-subtle: #1E2740;
    --streak: #E6A070;
    --streak-subtle: #3A2418;
    --healing: #8FC9C0;
    --healing-subtle: #173230;
    --phone-frame: #2A2A2D;
    --ring-track: #262626;
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 12px 24px -16px rgba(0, 0, 0, .6);
    --nav-bg: rgba(15, 15, 15, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #F2F2F2;
  --ink-2: #A8A8AC;
  --ink-3: #8A8A90;
  --primary: #F2F2F2;
  --on-primary: #141414;
  --bg: #0F0F0F;
  --card: #1A1A1A;
  --surface: #1F1F1F;
  --surface-warm: #1A1A1A;
  --border: #2E2E2E;
  --line: #242424;
  --accent: #A78BFA;
  --accent-2: #C4B5FD;
  --accent-strong: #8E85A8;
  --accent-subtle: #2A2340;
  --success: #8FCBA5;
  --success-subtle: #1C3126;
  --water: #9DB0E8;
  --water-subtle: #1E2740;
  --streak: #E6A070;
  --streak-subtle: #3A2418;
  --healing: #8FC9C0;
  --healing-subtle: #173230;
  --phone-frame: #2A2A2D;
  --ring-track: #262626;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 12px 24px -16px rgba(0, 0, 0, .6);
  --nav-bg: rgba(15, 15, 15, .8);
  color-scheme: dark;
}

/* Screenshots come in a light and a dark version; show the one that matches. */
.only-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-light { display: none; }
  :root:not([data-theme="light"]) .only-dark { display: block; }
}
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.022em; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 24px; }
.section { padding: 112px 0; scroll-margin-top: 40px; }
.eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 16px;
}
.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(32px, 4.4vw, 48px); }
.section-head p { margin-top: 18px; font-size: 19px; color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font: 500 16px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, background-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.text-link { color: var(--ink); font-weight: 500; text-underline-offset: 4px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { text-decoration: none; font-size: 15px; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: transparent; color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer;
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 0; text-align: center; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 720px; z-index: -1;
  background:
    radial-gradient(60% 60% at 50% 0%, var(--accent-subtle) 0%, transparent 70%);
}
.status-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: var(--r-pill);
  background: var(--success-subtle); color: var(--success);
  font-size: 14px; font-weight: 500;
}
.status-chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero h1 { font-size: clamp(40px, 6.6vw, 76px); max-width: 900px; margin: 24px auto 0; letter-spacing: -0.035em; line-height: 1.02; }
.hero .lede { max-width: 620px; margin: 24px auto 0; font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); }
.hero-cta { margin-top: 36px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust { margin: 22px 0 0; padding: 0; list-style: none; display: flex; gap: 8px 22px; justify-content: center; flex-wrap: wrap; font-size: 14px; color: var(--ink-3); }
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { width: 14px; height: 14px; color: var(--success); }

.hero-phones { position: relative; margin: 64px auto 0; height: 560px; max-width: 980px; }
.hero-phones .phone { position: absolute; top: 0; left: 50%; }
.hero-phones .phone.main { width: 320px; margin-left: -160px; z-index: 2; }
.hero-phones .phone.left { width: 270px; margin-left: -450px; top: 90px; opacity: .96; }
.hero-phones .phone.right { width: 270px; margin-left: 180px; top: 90px; opacity: .96; }
.hero-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; z-index: 3; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }

/* ---------- Phone frame ---------- */
.phone {
  position: relative;
  border-radius: 13.5% / 6.3%;
  padding: 3.1%;
  background: var(--phone-frame);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.phone .screen { position: relative; border-radius: 11% / 5.1%; overflow: hidden; aspect-ratio: 1320 / 2868; background: var(--bg); }
.phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone .island { position: absolute; z-index: 2; top: 2.1%; left: 50%; width: 29%; aspect-ratio: 126 / 37; transform: translateX(-50%); background: #000; border-radius: 999px; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--surface); border-radius: var(--r-sheet); padding: 32px 28px 28px; display: flex; flex-direction: column; }
.step .num { font: 500 13px/1 var(--mono); color: var(--ink-3); letter-spacing: .06em; }
.step h3 { font-size: 24px; margin-top: 14px; }
.step p { margin-top: 10px; color: var(--ink-2); font-size: 16px; }
.step .art { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; min-height: 196px; display: grid; place-items: center; }

.mini-ring { position: relative; width: 150px; height: 150px; }
.mini-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini-ring .track { stroke: var(--ring-track); }
.mini-ring .value { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.6s cubic-bezier(.2, .7, .2, 1); }
.in-view .mini-ring .value { stroke-dashoffset: 17; }
.mini-ring .time { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font: 300 26px/1 var(--mono); letter-spacing: -0.02em; }
.mini-ring .time small { display: block; margin-top: 7px; font: 400 11px/1 var(--font); color: var(--ink-3); letter-spacing: 0; }

.mini-checkin { width: 100%; }
.moods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.moods span { border: 1px solid var(--border); border-radius: var(--r-field); padding: 9px 0 7px; text-align: center; font-size: 10px; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.moods span b { display: block; font-size: 20px; line-height: 1.1; margin-bottom: 3px; font-weight: 400; }
.moods span.on { border: 2px solid var(--accent); background: var(--accent-subtle); color: var(--ink); padding: 8px 0 6px; }
.reply { margin-top: 12px; background: var(--surface); border-radius: var(--r-list); padding: 12px 14px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); text-align: left; }

.mini-refeed { width: 100%; display: grid; gap: 8px; }
.mini-refeed div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); text-align: left; }
.chip { display: inline-block; padding: 3px 9px; border-radius: var(--r-chip); font-size: 12px; font-weight: 600; min-width: 46px; text-align: center; }
.chip.water { background: var(--water-subtle); color: var(--water); }
.chip.success { background: var(--success-subtle); color: var(--success); }
.chip.streak { background: var(--streak-subtle); color: var(--streak); }
.chip.healing { background: var(--healing-subtle); color: var(--healing); }
.chip.plain { background: var(--surface); color: var(--ink-2); }

/* ---------- Feature switcher ---------- */
.band { background: var(--surface); }
.switcher { display: grid; grid-template-columns: 1fr 360px; gap: 72px; align-items: center; }
.switcher h2 { font-size: clamp(32px, 4.4vw, 48px); }
.switcher .intro { margin-top: 16px; color: var(--ink-2); font-size: 19px; max-width: 480px; }
.tabs { margin-top: 36px; display: grid; gap: 10px; }
.tab {
  all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%;
  padding: 18px 22px; border-radius: var(--r-card);
  border: 1px solid transparent; color: var(--ink-3);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.tab strong { display: block; font-weight: 500; font-size: 19px; letter-spacing: -0.01em; }
.tab span { display: none; margin-top: 6px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--card); border-color: var(--line); color: var(--ink); }
.tab[aria-selected="true"] span { display: block; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switcher .phone { width: 100%; max-width: 360px; margin: 0 auto; }
.switcher .screen img { opacity: 0; transition: opacity .35s ease; }
.switcher .screen img.show { opacity: 1; }

/* ---------- Hour by hour ---------- */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stage { border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; background: var(--card); }
.stage .hours { font: 500 12px/1 var(--mono); color: var(--ink-3); letter-spacing: .04em; }
.stage h3 { font-size: 19px; margin-top: 12px; letter-spacing: -0.01em; }
.stage p { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.note { margin-top: 28px; font-size: 14px; color: var(--ink-3); max-width: 720px; }

/* ---------- Breathe ---------- */
.breathe { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; background: var(--accent-subtle); border-radius: 32px; padding: 64px; }
.breathe h2 { font-size: clamp(30px, 4vw, 44px); }
.breathe p { margin-top: 16px; color: var(--ink-2); font-size: 18px; max-width: 460px; }
.breathe ul { margin: 24px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.breathe li { padding: 8px 14px; border-radius: var(--r-pill); background: var(--bg); font-size: 14px; color: var(--ink-2); }
.orb-wrap { display: grid; place-items: center; min-height: 300px; }
.orb { position: relative; width: 240px; height: 240px; display: grid; place-items: center; }
.orb::before, .orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.orb::before { background: var(--accent); opacity: .14; }
.orb::after { background: var(--accent); opacity: .5; transform: scale(.6); animation: breathe 12s ease-in-out infinite; }
.orb span { position: relative; z-index: 1; color: #fff; font-weight: 500; font-size: 17px; letter-spacing: .01em; }
.orb span::after { content: "Breathe in"; animation: breathe-word 12s linear infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.6); } 40% { transform: scale(1); } 55% { transform: scale(1); } }
@keyframes breathe-word { 0%, 39% { content: "Breathe in"; } 40%, 54% { content: "Hold"; } 55%, 100% { content: "Breathe out"; } }

/* ---------- Privacy ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.grid-2 > div { padding: 40px 40px 40px 0; border-bottom: 1px solid var(--line); }
.grid-2 > div:nth-child(even) { padding: 40px 0 40px 40px; border-left: 1px solid var(--line); }
.grid-2 h3 { font-size: 26px; }
.grid-2 p { margin-top: 12px; color: var(--ink-2); max-width: 440px; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { border-radius: var(--r-sheet); padding: 32px 28px; background: var(--surface); display: flex; flex-direction: column; }
.band .plan { background: var(--bg); }
.band .plan.featured { background: var(--card); border: 2px solid var(--ink); padding: 30px 26px; }
.plan .name { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 17px; }
.plan .price { margin-top: 18px; font-size: 44px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.plan .price small { font-size: 16px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.plan .sub { margin-top: 10px; font-size: 15px; color: var(--ink-2); min-height: 46px; }
.plan ul { margin: 24px 0 28px; padding: 24px 0 0; list-style: none; border-top: 1px solid var(--line); display: grid; gap: 12px; font-size: 15px; color: var(--ink-2); }
.plan li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; }
.plan li svg { width: 16px; height: 16px; margin-top: 4px; color: var(--ink); }
.plan .btn { margin-top: auto; width: 100%; }
.fine { margin-top: 24px; font-size: 13px; color: var(--ink-3); text-align: center; }

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: 1fr 1.4fr; gap: 72px; align-items: start; }
.faq h2 { font-size: clamp(32px, 4.4vw, 48px); }
.faq .lead { margin-top: 16px; color: var(--ink-2); }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 0; display: flex; justify-content: space-between; gap: 24px; font-weight: 500; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 24px; line-height: 1; color: var(--ink-3); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 40px 24px 0; color: var(--ink-2); font-size: 16px; }

/* ---------- Final call to action ---------- */
.final { background: var(--surface-warm); border-radius: 32px; padding: 88px 32px; text-align: center; }
.final img { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 28px; box-shadow: var(--shadow); }
.final h2 { font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.03em; }
.final p { margin: 18px auto 0; max-width: 520px; color: var(--ink-2); font-size: 19px; }
.final .btn { margin-top: 32px; }

/* ---------- Footer ---------- */
footer { padding: 72px 0 48px; }
.foot { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 28px; flex-wrap: wrap; font-size: 15px; }
.foot nav a { color: var(--ink-2); text-decoration: none; }
.foot nav a:hover { color: var(--ink); }
.disclaimer { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--ink-3); max-width: 860px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in-view { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Smaller screens ---------- */
@media (max-width: 980px) {
  .section { padding: 84px 0; }
  .steps, .plans { grid-template-columns: 1fr; }
  .stages { grid-template-columns: repeat(2, 1fr); }
  .switcher { grid-template-columns: 1fr; gap: 48px; }
  .switcher .phone { max-width: 300px; }
  .breathe { grid-template-columns: 1fr; padding: 44px 28px; }
  .orb-wrap { min-height: 260px; }
  .faq { grid-template-columns: 1fr; gap: 36px; }
  .hero-phones .phone.left, .hero-phones .phone.right { display: none; }
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .plan .sub { min-height: 0; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  body { font-size: 16px; }
  .section { padding: 68px 0; }
  .section-head { margin-bottom: 40px; }
  .hero { padding-top: 48px; }
  .hero-phones { height: 460px; margin-top: 48px; }
  .hero-phones .phone.main { width: 264px; margin-left: -132px; }
  .stages { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 > div, .grid-2 > div:nth-child(even) { padding: 32px 0; border-left: 0; }
  .final { padding: 64px 20px; border-radius: 24px; }
  .breathe { border-radius: 24px; }
  .btn { width: 100%; }
  .nav .btn { width: auto; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .faq details p { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .orb::after { animation: none; transform: scale(.85); }
  .orb span::after { animation: none; content: "Breathe"; }
  .mini-ring .value { transition: none; }
  .switcher .screen img { transition: none; }
}
