/* SleepPose website. Colours are the app's own Daylight (light) and Nocturne (dark) palettes.
   Layout: a night-blue hero with the phones, then alternating plain sections; legal pages use the narrow prose column. */
:root {
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-soft: #eef1fb;
  --ink: #10163a;
  --muted: #5d6585;
  --line: #e4e8f3;
  --primary: #2b4bd7;
  --primary-ink: #ffffff;
  --hero: #17214a;
  --hero-2: #0d1430;
  --on-hero: #eef1ff;
  --on-hero-muted: #b7c0e6;
  --warn-bg: #fef3e2;
  --warn-ink: #8a4209;
  --warn-line: #f5d9a8;
  --snore: #e5484d;
  --back: #0ea5e9;
  --left: #8b5cf6;
  --right: #10b981;
  --stomach: #f59e0b;
  --todo: #fff1a8;
  --shadow: 0 24px 60px -24px rgba(16, 22, 58, .45);
  --radius: 20px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Roboto Mono", monospace;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #080c18;
    --surface: #101729;
    --surface-soft: #182038;
    --ink: #eef1ff;
    --muted: #9aa3c4;
    --line: #1e2742;
    --primary: #8fa4ff;
    --primary-ink: #0b1230;
    --hero: #101a3d;
    --hero-2: #070b18;
    --warn-bg: #2a1f10;
    --warn-ink: #ffcf8a;
    --warn-line: #4a3517;
    --snore: #ff7b8e;
    --back: #4cc3ff;
    --left: #b59cff;
    --right: #3ddcb1;
    --stomach: #ffb347;
    --todo: #5c4d00;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.eyebrow {
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary);
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { padding-block: 18px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav a { color: inherit; text-decoration: none; font-weight: 600; font-size: .95rem; opacity: .85; }
.site-nav a:hover { opacity: 1; text-decoration: underline; }
.hero-band .site-header { color: var(--on-hero); }

/* Hero */
.hero-band {
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(143, 164, 255, .22), transparent 60%),
    linear-gradient(180deg, var(--hero) 0%, var(--hero-2) 100%);
  color: var(--on-hero);
  overflow: hidden;
}
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding-block: 40px 0; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 850; letter-spacing: -.035em; }
.hero .lead { color: var(--on-hero-muted); margin-top: 18px; }
.hero-copy { padding-bottom: 64px; }
.cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 30px; }
.play-badge { display: inline-block; margin: -14px -10px; } /* the official badge carries its own transparent margin */
.play-badge img { width: 230px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 26px; padding: 0; list-style: none; }
.trust li {
  font-size: .86rem; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); color: var(--on-hero);
}
.trust li.medical { background: rgba(255, 196, 120, .16); color: #ffd9a0; }

/* Phone frames */
.phone {
  position: relative;
  border-radius: 34px;
  padding: 9px;
  background: #0a0f22;
  box-shadow: var(--shadow), inset 0 0 0 1.5px rgba(255, 255, 255, .08);
}
.phone img { border-radius: 26px; width: 100%; aspect-ratio: 1080 / 2188; object-fit: cover; }
.hero-phones { position: relative; height: 640px; align-self: end; }
.hero-phones .phone { position: absolute; width: 290px; bottom: -70px; }
.hero-phones .phone:first-child { left: 2%; transform: rotate(-4deg); z-index: 1; }
.hero-phones .phone:last-child { right: 0; bottom: 10px; transform: rotate(4deg); }

/* A night at a glance: the app's position colours on a timeline */
.night-strip { margin-top: 34px; max-width: 520px; }
.night-strip svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .82rem; color: var(--on-hero-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Sections */
.section { padding-block: 88px; }
.section-head { display: grid; gap: 14px; margin-bottom: 44px; max-width: 720px; }
.alt { background: var(--surface); border-block: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.step { display: grid; gap: 10px; align-content: start; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-soft); color: var(--primary); font-weight: 800;
}
.step p, .feature p, .case p { color: var(--muted); }
.step .optional { font-size: .78rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }

.feature-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.card-shot { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
.feature { background: var(--bg); border-radius: var(--radius); padding: 22px; display: grid; gap: 8px; align-content: start; }
.alt .feature { background: var(--bg); }
.feature .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.check-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.check-list li { padding-left: 30px; position: relative; color: var(--muted); }
.check-list li strong { color: var(--ink); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b4bd7' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* Screenshot gallery */
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(184px, 1fr); gap: 22px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 4px 28px;
}
.gallery figure { margin: 0; scroll-snap-align: start; display: grid; gap: 14px; }
.gallery figcaption { font-size: .92rem; color: var(--muted); }
.gallery figcaption strong { display: block; color: var(--ink); font-size: 1rem; }

.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.case { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; gap: 10px; }
.case .quote { font-weight: 700; font-size: 1.12rem; color: var(--ink); }

.medical-box {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink);
  border-radius: var(--radius); padding: 26px 28px;
}
.medical-box h2 { font-size: 1.4rem; color: var(--warn-ink); }
.medical-box p { margin-top: 8px; max-width: 75ch; }
.medical-box svg { width: 34px; height: 34px; }

.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin-top: 10px; color: var(--muted); }

.final-cta { text-align: center; display: grid; justify-items: center; gap: 16px; }
.final-cta .play-badge { margin-top: 6px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 36px 44px; font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: grid; gap: 14px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--ink); font-weight: 600; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.fine { font-size: .8rem; }

/* Legal pages */
.legal-header { background: var(--hero); color: var(--on-hero); }
.legal-header .site-header { color: var(--on-hero); }
.legal-title { padding-block: 28px 48px; }
.legal-title h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 850; }
.legal-title p { color: var(--on-hero-muted); margin-top: 10px; }
.prose { max-width: 760px; padding-block: 48px 72px; }
.prose h2 { font-size: 1.45rem; margin-top: 44px; margin-bottom: 12px; }
.prose h3 { margin-top: 26px; margin-bottom: 8px; }
.prose p, .prose li { color: var(--ink); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 1.2em; margin: 10px 0; display: grid; gap: 6px; }
.summary-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; }
.summary-box ul { margin-bottom: 0; }
.table-scroll { overflow-x: auto; margin: 14px 0; }
.prose table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
mark.todo { background: var(--todo); color: inherit; padding: 0 4px; border-radius: 4px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .hero-copy { padding-bottom: 0; }
  .hero-phones { height: 420px; }
  .hero-phones .phone { width: 200px; bottom: -110px; }
  .steps, .features { grid-template-columns: 1fr 1fr; }
  .feature-split { grid-template-columns: 1fr; gap: 32px; }
  .site-nav { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .section { padding-block: 64px; }
  .steps, .features, .cases { grid-template-columns: 1fr; }
  .hero-phones { height: 360px; }
  .hero-phones .phone { width: 170px; }
  .hero-phones .phone:first-child { left: 0; }
  .hero-phones .phone:last-child { right: 0; }
  .medical-box { grid-template-columns: 1fr; }
  .play-badge img { width: 200px; }
}
