/* snapsleep.spicetek.com
   Built from design/2026-09-24-site-design. Dark first: it is a sleep product,
   and the hero is a real infrared frame, which only reads on a dark page.
   Tokens are the designer's (design/tokens/snapsleep.css); everything below
   them is layout. */

@import url('/styles/fonts.css');

/* ---- tokens ---- */
:root {
  --bg: #11120D;
  --surface: #1A1C14;
  --raised: #25281C;
  --line: #383C2B;
  --text: #F5EAD8;
  --text-soft: #BDB6A2;
  --signal: #CFE047;
  --on-signal: #151709;
  --sage: #AEBF92;
  --rust: #D67F48;
  --app-card: #F9F4ED;

  --font-display: 'Caprasimo', Georgia, serif;
  --font-body: 'Figtree', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --gutter: clamp(16px, 5vw, 64px);
  --measure: 64ch;
  --radius: 14px;
}

/* The app's own light palette, so a light-mode reader gets the product's
   colours rather than an inverted night. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F5EAD8; --surface: #FBF6EC; --raised: #EBDDC5; --line: #D6CBB8;
    --text: #201E1D; --text-soft: #5A5347; --signal: #8C491A; --on-signal: #FFF8F0;
    --sage: #56633F; --rust: #C67139;
  }
}
:root[data-theme="light"] {
  --bg: #F5EAD8; --surface: #FBF6EC; --raised: #EBDDC5; --line: #D6CBB8;
  --text: #201E1D; --text-soft: #5A5347; --signal: #8C491A; --on-signal: #FFF8F0;
  --sage: #56633F; --rust: #C67139;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(16px, 0.95rem + 0.2vw, 17px);
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.05; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 1.6rem + 4.4vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem); }
p { margin: 0 0 1em; max-width: var(--measure); }

.wrap { width: min(1280px, 100% - var(--gutter) * 2); margin-inline: auto; }

.eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--sage); margin: 0 0 1rem;
}

/* Visible focus everywhere. Keyboard users are not an edge case on a page
   whose whole job is being trusted by a professional reader. */
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--signal); color: var(--on-signal); padding: .7rem 1.1rem;
  font-weight: 600; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.35rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap;
}
.btn--primary { background: var(--signal); color: var(--on-signal); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost:hover { border-color: var(--sage); }

/* ---- header ---- */
.site-header {
  position: relative; z-index: 10;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1rem;
  min-height: 64px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-display); font-size: 1.15rem; text-decoration: none;
}
.brand .moon { color: var(--rust); font-size: 1.1rem; }
.brand small {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .14em;
  color: var(--text-soft); text-transform: uppercase;
}
.site-nav { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.5rem); margin-left: auto; flex-wrap: wrap; }
/* :not(.btn) matters. Without it this rule out-specifies .btn--primary's own
   colour and repaints the button's label in the muted nav grey — which in the
   light palette put cream-grey text on rust at a contrast ratio of 1.12. */
.site-nav a:not(.btn) { font-size: .9rem; text-decoration: none; color: var(--text-soft); }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--text); }

.langs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.langs a, .langs span {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  padding: .28rem .6rem; border-radius: 999px; text-decoration: none; color: var(--text-soft);
}
.langs [aria-current="true"] { background: var(--raised); color: var(--text); }
/* Spanish is reserved in the structure but not written yet. */
.langs .pending { opacity: .38; cursor: not-allowed; }

/* ---- hero ----
   The hero is a dark bedroom with a torch in it, which only reads on near-black.
   So it keeps the night palette in every colour scheme rather than following
   the page: a light-mode reader gets a cream page with one dark window into
   the dark bedroom, which is the honest picture of what the app does. */
.hero, .waveform-rail {
  --bg: #11120D;
  --surface: #1A1C14;
  --line: #383C2B;
  --text: #F5EAD8;
  --text-soft: #BDB6A2;
  --signal: #CFE047;
  --on-signal: #151709;
  --sage: #AEBF92;
  --rust: #D67F48;
  color: var(--text);
}
.hero { position: relative; overflow: hidden; background: var(--bg); isolation: isolate; }
.hero__inner { position: relative; z-index: 3; padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero h1 { margin: 0 0 1.25rem; max-width: 12ch; }
.hero p.lede { font-size: clamp(1rem, .95rem + .3vw, 1.15rem); color: var(--text-soft); max-width: 46ch; }
.hero__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; }

/* Two layers: the dark bedroom always visible, and a clear morning sky revealed
   through a radial mask that follows the cursor. With no pointer and no JS the
   mask drifts on its own, so the reveal still happens. */
.ir-stage {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
.ir-stage img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.ir-lens img { object-position: 60% 30%; }
.ir-dim { position: absolute; inset: 0; opacity: .1; }

@property --x { syntax: '<percentage>'; inherits: true; initial-value: 66%; }
@property --y { syntax: '<percentage>'; inherits: true; initial-value: 44%; }

.ir-lens {
  position: absolute; inset: 0;
  -webkit-mask-image: radial-gradient(circle 290px at var(--x) var(--y), #000 0%, rgba(0,0,0,.92) 32%, rgba(0,0,0,0) 72%);
  mask-image: radial-gradient(circle 290px at var(--x) var(--y), #000 0%, rgba(0,0,0,.92) 32%, rgba(0,0,0,0) 72%);
  animation: wander 16s ease-in-out infinite;
  transition: --x .35s ease-out, --y .35s ease-out;
}
/* Once the pointer takes over, stop the idle drift. */
.ir-lens.live { animation: none; }
@keyframes wander {
  0%   { --x: 60%; --y: 42%; }
  22%  { --x: 80%; --y: 60%; }
  45%  { --x: 68%; --y: 70%; }
  68%  { --x: 88%; --y: 36%; }
  100% { --x: 60%; --y: 42%; }
}
.ir-glow {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(circle 250px at var(--x) var(--y), rgba(255,246,224,.20), rgba(160,205,240,.10) 45%, rgba(255,255,255,0) 72%);
}

/* A gradient so the headline keeps its contrast wherever the lens goes. */
.hero__veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(100deg, var(--bg) 0%, var(--bg) 26%, color-mix(in srgb, var(--bg) 72%, transparent) 46%, transparent 68%);
}

.hud {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-soft);
}
.hud span { position: absolute; }
.hud .rec { color: var(--rust); }

.waveform { display: block; width: 100%; height: clamp(64px, 8vw, 96px); object-fit: cover; opacity: .9; }
.waveform-rail {
  position: relative; z-index: 3;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.waveform-rail .labels {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-soft); padding: 0 var(--gutter) .5rem;
}

.hero__hint {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-soft);
  margin: 1.5rem 0 0; opacity: .8;
}
/* A pointer is required to sweep the torch by hand, so only promise it where
   one exists. On touch the lens drifts on its own and the line would be a lie. */
@media (hover: none) { .hero__hint { display: none; } }

/* ---- waveform ---- */
.waveform-stack { position: relative; }
.waveform { display: block; width: 100%; height: clamp(64px, 8vw, 96px); object-fit: cover; }
.waveform--dim { opacity: .3; }
.waveform-played {
  position: absolute; inset: 0; overflow: hidden;
  width: 0; animation: replay 14s linear infinite;
}
.waveform-played .waveform--lit {
  width: 100vw; max-width: none; height: clamp(64px, 8vw, 96px);
  filter: brightness(1.25) saturate(1.2);
}
/* The playhead rides the right edge of the revealed strip, so it needs no
   animation of its own and can never drift out of step with it. A 1px element
   translated by 100% would have moved exactly 1px. */
.playhead {
  position: absolute; top: 0; bottom: 0; right: 0; width: 2px;
  background: var(--signal);
  box-shadow: 0 0 14px 2px color-mix(in srgb, var(--signal) 60%, transparent);
}
/* Hold at the end and fade, rather than snapping back to zero every loop.
   A hard reset every 14 s catches the eye far more than the sweep does. */
@keyframes replay {
  0%   { width: 0;    opacity: 1; }
  82%  { width: 100%; opacity: 1; }
  94%  { width: 100%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* ---- sections ---- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.section--flat { border-top: 0; }
.section h2 { margin-bottom: 2rem; }

.steps { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { border-top: 1px solid var(--line); padding-top: 1rem; }
.step .n { font-family: var(--font-mono); font-size: 11px; color: var(--sage); letter-spacing: .14em; }
.step h3 { margin: .5rem 0 .5rem; }
.step p { color: var(--text-soft); font-size: .95rem; margin: 0; }

.split { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.shot { background: var(--app-card); border-radius: var(--radius); padding: 10px; }
.shot img { border-radius: 8px; }
.caption { color: var(--text-soft); font-size: .85rem; margin-top: .75rem; }

/* ---- does / doesn't ----
   The hard rule from the brief: what it does not do sits at the same level and
   the same size as what it does, in the same grid, visible without scrolling
   past the good news. Never a disclaimer, never smaller, never folded away. */
.ledger { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.ledger > * {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 1.75rem);
}
.ledger h3 { margin: .35rem 0 1rem; }
.ledger ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.ledger li { display: grid; grid-template-columns: 20px 1fr; gap: .7rem; font-size: .95rem; }
.ledger li b { font-weight: 600; }
.ledger .mark { color: var(--sage); line-height: 1.5; }
.ledger .note {
  margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line);
  color: var(--text-soft); font-size: .88rem;
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem);
}
.card--quiet { background: color-mix(in srgb, var(--sage) 8%, var(--surface)); }

.facts { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.facts dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }
.facts dd { margin: .35rem 0 0; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0; color: var(--text-soft); font-size: .88rem; }
.site-footer .row { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .host { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; margin-left: auto; }

/* ---- motion ----
   Everything above degrades on its own: no JS means the lens drifts on the CSS
   animation, and reduced motion means it stops entirely and the frame is simply
   shown. No text is ever inside an animated layer. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ir-lens { -webkit-mask-image: none !important; mask-image: none !important; opacity: .3; }
  .ir-glow { display: none; }
  .waveform-played { width: 100%; }
  .playhead { display: none; }
}

@media (max-width: 720px) {
  .hero__veil { background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 55%, transparent 100%); }
  .ir-stage img { object-position: 70% 40%; }
  .hud { display: none; }
  .site-header .wrap { min-height: 56px; }
}

/* ---- utilities used by the markup (kept here so the HTML carries no
        inline styles, which lets the CSP forbid them outright) ---- */
.hud-tl { top: 22px; left: var(--gutter); }
.hud-tr { top: 22px; right: var(--gutter); }
.hud-br { bottom: 18px; right: var(--gutter); }
.shot--dark { background: #000; }
.shot-title { margin-top: 1rem; }
.eyebrow--tight { margin-bottom: 0; }
.h2-tight { margin-bottom: 1rem; }
.m0 { margin: 0; }
.link-signal { color: var(--signal); }
