/* sleepea.co. Brand values from docs/handoff/design/Tokens.json; type is the system face, as in the app. */
:root {
  --ground: #F6F9F3;
  --surface: #FFFFFF;
  --field: #E8EFE3;
  --ink: #102F26;
  --muted: #4C6258;
  --accent: #B5EE57;
  --accent-ink: #102F26;
  --link: #246343;
  --evergreen: #102F26;
  --on-evergreen: #F1F6EE;
  --pod: #55B780;
  --margin: clamp(16px, 2.2vw, 32px);
  --gap: 12px;
  --radius: 24px;
  --step-0: 16px;
  --step-1: clamp(17px, 1.25vw, 19px);
  --step-2: clamp(22px, 1.9vw, 28px);
  --step-3: clamp(32px, 3.1vw, 44px);
  --step-4: clamp(44px, 5.6vw, 84px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--step-1)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--pod); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.02; font-weight: 700; }
p { margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* Buttons: one shape, fully round, flat. */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-ink);
  font: 600 var(--step-0)/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s var(--ease);
}
.button:hover { color: var(--accent-ink); background: #A6E041; transform: translateY(-1px); }
.button:active { transform: translateY(1px) scale(.98); }
.button.quiet { background: var(--field); }
.button.quiet:hover { background: #DCE6D6; }
.button.on-dark { background: var(--accent); }

/* Header: wordmark, a few links, one action. */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--margin);
}
.bar .wordmark img { width: 148px; height: auto; }
.bar nav { display: flex; align-items: center; gap: 26px; }
.bar nav a { color: var(--ink); text-decoration: none; font-size: var(--step-0); font-weight: 500; }
.bar nav a:hover { color: var(--link); }
.bar nav .button { min-height: 44px; padding: 0 20px; }

/* Hero: reading sheet on the left, the app's own screen fixed on the right. */
.stage {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap);
  padding: 0 var(--margin) var(--margin);
}
.sheet { display: flex; flex-direction: column; }
.hero-copy { padding: clamp(40px, 10vh, 120px) 0 0; max-width: 38rem; }
.hero-copy h1 { font-size: var(--step-4); }
.hero-copy .lede { margin-top: 36px; font-size: var(--step-2); line-height: 1.32; max-width: 30ch; letter-spacing: -0.01em; }
.hero-copy .actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-copy .note { margin-top: 18px; color: var(--muted); font-size: var(--step-0); }

.screen-panel {
  position: sticky; top: var(--gap); height: calc(100svh - 2 * var(--gap));
  min-height: 560px; border-radius: var(--radius); background: var(--evergreen);
  overflow: hidden; display: flex; flex-direction: column;
}
.screen-panel .screens { position: relative; flex: 1; }
.screen-panel figure {
  position: absolute; inset: 0; margin: 0; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 1.4s var(--ease);
}
.screen-panel figure.on { opacity: 1; }
.screen-panel figure img {
  width: auto; height: 92%; max-width: 86%; object-fit: cover; object-position: top;
  border-radius: 36px 36px 0 0;
}
.screen-panel .strip {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  min-height: 56px; padding: 0 22px; background: var(--ground); color: var(--ink); font-size: 15px;
}
.screen-panel .strip span:last-child { color: var(--muted); }

/* Reading column sections sit beside the fixed screen. */
.read section { padding-top: clamp(96px, 16vh, 180px); max-width: 40rem; }
.read h2 { font-size: var(--step-3); max-width: 18ch; }
.read .body { margin-top: 24px; max-width: 46ch; }
.read .body p + p { margin-top: 16px; }

/* How it works: one slider drives the words and the screen. */
.steps-control { margin-top: 40px; }
.steps-control input[type=range] {
  width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.steps-control input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: var(--field); }
.steps-control input[type=range]::-moz-range-track { height: 8px; border-radius: 8px; background: var(--field); }
.steps-control input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 32px; height: 32px; margin-top: -12px; border-radius: 50%; background: var(--accent); border: 0;
  transition: transform .15s var(--ease);
}
.steps-control input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
.steps-control input[type=range]::-moz-range-thumb { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); border: 0; }
.steps-control ol { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.steps-control li button {
  background: none; border: 0; padding: 4px 0; text-align: left; color: var(--muted);
  font: 500 15px/1.3 var(--font); cursor: pointer;
}
.steps-control li button[aria-current="step"] { color: var(--ink); font-weight: 650; }
.step-text { margin-top: 32px; min-height: 9.5em; }
.step-text h3 { font-size: var(--step-2); line-height: 1.15; letter-spacing: -0.015em; }
.step-text p { margin-top: 12px; max-width: 46ch; }

/* Everyone who helps: three illustrated moments, each with its own line. */
.moments { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 40px; }
.moments li { display: grid; grid-template-columns: 148px 1fr; gap: 24px; align-items: center; }
.moments img { width: 148px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.moments h3 { font-size: var(--step-2); line-height: 1.15; letter-spacing: -0.015em; }
.moments p { margin-top: 8px; }

/* A month: a large figure in the reading column. */
.figure-line { margin-top: 32px; font-size: var(--step-4); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.figure-line + p { margin-top: 12px; color: var(--muted); }

/* Private by default: the one full-width field. */
.private {
  margin: clamp(120px, 18vh, 200px) var(--margin) 0; border-radius: var(--radius);
  background: var(--evergreen); color: var(--on-evergreen);
  display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 80px);
  padding: clamp(40px, 6vw, 96px);
}
.private h2 { font-size: var(--step-4); max-width: 9ch; }
.private ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; align-content: start; }
.private li strong { display: block; font-size: var(--step-2); line-height: 1.2; letter-spacing: -0.015em; color: var(--accent); }
.private li span { display: block; margin-top: 6px; color: #D7E4DA; max-width: 52ch; }
.private a { color: var(--accent); }

/* Plans: two fields meeting at a hard edge. */
.plans { margin: clamp(120px, 18vh, 200px) var(--margin) 0; }
.plans h2 { font-size: var(--step-3); }
.plans .fields { margin-top: 32px; display: grid; grid-template-columns: 7fr 5fr; border-radius: var(--radius); overflow: hidden; }
.plan { padding: clamp(32px, 4vw, 56px); display: flex; flex-direction: column; min-height: 440px; }
.plan.free { background: var(--accent); color: var(--accent-ink); }
.plan.plus { background: var(--surface); }
.plan h3 { font-size: var(--step-3); }
.plan .who { margin-top: 14px; font-size: var(--step-2); line-height: 1.25; max-width: 24ch; letter-spacing: -0.01em; }
.plan .includes { margin-top: 24px; max-width: 46ch; }
.plan .price { margin-top: auto; padding-top: 40px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.plan .price strong { font-size: var(--step-4); letter-spacing: -0.04em; line-height: 1; }
.plan .price span { color: var(--muted); }
.plan.free .price span { color: var(--accent-ink); }
.plan.free .button { background: var(--evergreen); color: var(--on-evergreen); }
.plan.free .button:hover { background: #1B4436; color: var(--on-evergreen); }

/* Questions: answers as reading text. */
.questions {
  margin: clamp(120px, 18vh, 200px) var(--margin) 0;
}
.questions h2 { font-size: var(--step-3); }
.questions .answers { margin-top: 32px; columns: 3; column-gap: 48px; }
.questions .answers p { break-inside: avoid; margin-bottom: 22px; }
.questions .answers b { font-weight: 650; }

/* The close: the app's first screen, already open. */
.close {
  margin: clamp(120px, 18vh, 200px) var(--margin) 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center;
  padding: clamp(40px, 6vw, 96px);
}
.close h2 { font-size: clamp(56px, 7vw, 112px); line-height: .94; max-width: 8ch; }
.close .then { margin-top: 24px; max-width: 34ch; }
.close .then + .actions { margin-top: 28px; }
.close .button { background: var(--evergreen); color: var(--on-evergreen); }
.close .button:hover { background: #1B4436; color: var(--on-evergreen); }

/* A working copy of the app's Today card. */
.today-card[data-ui] {
  justify-self: end; width: min(100%, 420px); background: var(--surface); color: var(--ink);
  border-radius: 28px; padding: 22px;
}
.today-card .who { font-size: 13px; font-weight: 650; letter-spacing: .04em; color: var(--muted); }
.today-card .title { margin-top: 2px; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.today-card .status { margin-top: 18px; display: flex; justify-content: space-between; align-items: baseline;
  background: #E7EFE3; border-radius: 14px; padding: 14px 16px; }
.today-card .status span { font-weight: 600; }
.today-card .status output { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.today-card.asleep .status { background: #EEEAF7; }
.today-card.asleep .status span { color: #614A92; }
.today-card .tap {
  margin-top: 12px; width: 100%; min-height: 64px; border: 1.5px solid #6D8074; border-radius: 16px;
  background: var(--accent); color: var(--accent-ink); font: 650 20px/1 var(--font); cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s var(--ease);
}
.today-card .tap:hover { background: #A6E041; }
.today-card .tap:active { transform: scale(.985); }
.today-card .receipt { margin-top: 12px; min-height: 22px; font-size: 15px; color: var(--muted); }

/* Footer: one quiet line. */
.foot {
  margin-top: clamp(96px, 14vh, 160px); padding: 0 var(--margin) 30px;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: baseline; font-size: 15px; color: var(--muted);
}
.foot nav { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.foot nav a { color: var(--ink); text-decoration: none; }
.foot nav a:hover { color: var(--link); }
.foot .end { text-align: right; }

/* Legal and support pages: a reading column. */
.doc { padding: clamp(48px, 9vh, 112px) var(--margin) 0; display: grid; grid-template-columns: 4fr 8fr; gap: clamp(24px, 5vw, 80px); }
.doc header h1 { font-size: var(--step-4); max-width: 9ch; }
.doc header p { margin-top: 20px; color: var(--muted); font-size: var(--step-0); }
.doc header .side-art { margin-top: 40px; width: min(100%, 320px); border-radius: var(--radius); }
.doc article { max-width: 44rem; }
.doc article h2 { font-size: var(--step-2); line-height: 1.2; letter-spacing: -0.015em; margin-top: 48px; }
.doc article h2:first-child { margin-top: 0; }
.doc article p, .doc article ul { margin-top: 14px; }
.doc article ul { padding-left: 1.2em; }
.doc article li + li { margin-top: 8px; }
.doc article .summary { font-size: var(--step-2); line-height: 1.35; letter-spacing: -0.01em; }

/* Entrances, only once the script has marked the page as able to show them. */
.js .rise { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .rise.in { opacity: 1; transform: none; }

@media (max-width: 1200px) {
  .questions .answers { columns: 2; }
}

@media (max-width: 900px) {
  .bar nav a:not(.button) { display: none; }
  .stage { grid-template-columns: 1fr; }
  .screen-panel { order: -1; position: sticky; top: var(--gap); height: 60svh; min-height: 420px; z-index: 0; }
  .sheet { position: relative; z-index: 1; background: var(--ground); border-radius: var(--radius) var(--radius) 0 0; margin-top: -40px; padding-top: 8px; }
  .hero-copy { padding: 24px 0 0; }
  .hero-copy .lede { margin-top: 20px; }
  .read section { padding-top: 96px; }
  .steps-control ol { grid-template-columns: 1fr 1fr; }
  .moments li { grid-template-columns: 96px 1fr; gap: 16px; }
  .moments img { width: 96px; }
  .private, .plans .fields, .questions, .close, .doc { grid-template-columns: 1fr; }
  .questions .answers { columns: 1; }
  .plans .fields { gap: 12px; overflow: visible; border-radius: 0; }
  .plan { min-height: 0; border-radius: var(--radius); }
  .close { min-height: 0; }
  .today-card[data-ui] { justify-self: stretch; width: 100%; }
  .foot { grid-template-columns: 1fr; gap: 8px; }
  .foot nav { justify-content: flex-start; }
  .foot .end { text-align: left; }
  .doc header .side-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .js .rise { opacity: 1; transform: none; transition: none; }
  .screen-panel figure { transition: none; }
  .button, .today-card .tap { transition: none; }
}
