/* ───────────────────────────────────────────────────────────────────────────
   LoLight homepage — THE PICTURE.

   The page is ink. One picture, one sentence, one action. Amber only ever
   means light; indigo only ever means a control; the mark only ever sits on
   #030305. Two voices: Instrument Serif for the one line a person reads out
   loud, Source Sans 3 for everything they read to themselves.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── the two faces, self-hosted (latin only) ──────────────────────────────── */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/instrument-serif-400-latin.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: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('assets/fonts/source-sans-3-var-latin.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;
}

/* ── tokens ───────────────────────────────────────────────────────────────── */
:root {
  --ink: #030305;          /* the brand's own ground — the mark's field       */
  --surface: #0a0a14;
  --card: #15151c;
  --raised: #1a1a25;

  --cream: #f5f1e8;
  --fg2: rgba(245, 241, 232, 0.72);
  --fg3: rgba(245, 241, 232, 0.52);
  --fg4: rgba(245, 241, 232, 0.34);

  --amber: #f5a623;        /* LIGHT. never a control, never the mark          */
  --amber-dim: rgba(245, 166, 35, 0.22);
  --indigo: #6c47ff;       /* CONTROL. the one saturated thing you press      */
  --indigo-300: #a5b4fc;

  --hairline: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --outline: rgba(255, 255, 255, 0.36);
  --rail-track: #70707f;

  --display: 'Instrument Serif', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --text: 'Source Sans 3', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --door-h: 60px;
  --gut: 20px;
  --measure: 62ch;
  color-scheme: dark;
}

@media (min-width: 760px) {
  :root { --door-h: 76px; --gut: 40px; }
}

/* ── reset, lightly ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--indigo-300);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── the two voices ───────────────────────────────────────────────────────── */
.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.018em;       /* every page that feels designed sets this */
  text-wrap: balance;
  margin: 0;
}
.display--2 {
  font-size: clamp(34px, 6.4vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.016em;
  max-width: 20ch;
}
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg3);
  margin: 0 0 18px;
}
.prose {
  max-width: var(--measure);
  color: var(--fg2);
}
.prose--fine { font-size: 15px; color: var(--fg3); margin-top: 40px; }

/* ── 1. the doorway ───────────────────────────────────────────────────────── */

/* the mark's own ink field. it is never over the room, never tinted, never
   cropped: an opaque strip of #030305 the width of the page. */
.door {
  height: var(--door-h);
  background: var(--ink);
  display: flex;
  align-items: center;
  padding-inline: var(--gut);
  position: relative;
  z-index: 2;
}
.plate { background: var(--ink); display: flex; align-items: center; }
.mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
@media (min-width: 760px) { .mark { width: 40px; height: 40px; } }

.hero {
  position: relative;
  height: calc(100svh - var(--door-h));
  min-height: 520px;
  max-height: 1100px;
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
}
.hero__media { position: absolute; inset: 0; margin: 0; }
.hero__still,
.hero__film,
.hero__night {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
/* the dip. page.js sets the duration of each step inline, because the steps
   have different ones — off fast, light back fast, then a long quiet settle —
   and the whole dark part of it has to be over inside half a second. these are
   the first step's defaults. */
.hero__film, .hero__night { opacity: 0; }
.hero__film { transition: opacity 100ms linear; }
.hero__night { transition: opacity 120ms cubic-bezier(0.4, 0, 1, 1); }
.hero__film.is-on, .hero__night.is-on { opacity: 1; }

/* the picture fades into the page it sits on, so the sentence keeps its
   ground. on the phone frame this region is already ink and the gradient
   does nothing; on the wide frame it buys the lower-left its contrast. */
.hero::after {
  content: '';
  position: absolute;
  inset: 32% 0 0;
  background: linear-gradient(to bottom, rgba(3, 3, 5, 0) 0%, rgba(3, 3, 5, 0.30) 46%, rgba(3, 3, 5, 0.86) 82%, var(--ink) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero__caption {
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--fg3);
  margin: 0 0 16px;
}

.hero__say {
  position: absolute;
  left: var(--gut);
  right: var(--gut);
  bottom: clamp(28px, 5vh, 56px);
  z-index: 2;
}
.hero__say .display {
  font-size: clamp(40px, 11.4vw, 92px);
  max-width: 13ch;
  letter-spacing: -0.022em;
}
@media (min-width: 760px) {
  .hero__say { max-width: 64ch; }
  .hero__say .display { max-width: 16ch; }
}
/* the only line on the page that explains rather than states. 17px, fg2,
   balanced, and short enough to stay two lines on a 390. */
.hero__does {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.42;
  color: var(--fg2);
  max-width: 34ch;
  text-wrap: balance;
}
@media (min-width: 760px) { .hero__does { max-width: 46ch; font-size: 18px; } }

.hero__act {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  margin-top: clamp(24px, 4vh, 38px);
}

/* the ONE control on the page: indigo, filled, white. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 176px;
  padding: 0 30px;
  border-radius: 14px;
  background: var(--indigo);
  color: #fff;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.005em;
  text-decoration: none;
  transition: transform 140ms ease, background-color 140ms ease;
}
.button:hover { background: #7d5cff; }
.button:active { transform: translateY(1px); }

/* the quiet second thing. a text link, ranked plainly below the button. */
.quiet {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--fg2);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  line-height: 1.2;
  padding-bottom: 2px;
}
.quiet:hover { color: var(--cream); border-bottom-color: var(--outline); }

/* ── the bands ────────────────────────────────────────────────────────────── */
.band {
  padding: clamp(92px, 15vh, 176px) var(--gut);
  max-width: 1180px;
  margin-inline: auto;
}
.band + .band { border-top: 1px solid var(--hairline); }

/* ── 2. the switchboard ───────────────────────────────────────────────────── */
.board {
  margin-top: clamp(36px, 6vh, 64px);
  display: grid;
  gap: 28px;
}
@media (min-width: 980px) {
  .board { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr); gap: 36px; align-items: start; }
}

.board__pic { position: relative; margin: 0; }
.board__pic canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1152 / 648;
  border-radius: 14px;
  background-color: var(--ink);
  background-image: url('assets/hero/evening-living-room-1600.webp');
  background-size: cover;
  background-position: center;
}
.board__pic canvas.is-live { background-image: none; }
.board__state {
  margin-top: 14px;
  font-size: 13px;
  color: var(--fg3);
  min-height: 2.6em;
}

/* the brief's own three states, said as three words. a sequence, not a menu:
   nothing here is a second CTA, so nothing here is indigo. */
.presets { margin-top: 2px; }
.presets__lead { display: block; font-size: 13px; color: var(--fg3); }
.presets__row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 2px;
}
.preset {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--fg2);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.preset:hover { color: var(--cream); }
.preset.is-on { color: var(--cream); border-bottom-color: var(--amber); }

.rail {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 6px 16px 10px;
}
.rail__head { padding: 14px 0 6px; }
.eyebrow--rail { margin-bottom: 8px; color: var(--fg3); }
.rail__note { font-size: 13px; color: var(--fg3); margin: 0 0 6px; }

.sw {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 6px 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--hairline);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sw--master { border-top: 0; border-bottom: 1px solid var(--border); }
.sw:active { opacity: 0.78; }
.sw__name { flex: 1 1 auto; min-width: 0; }
.sw__label { display: block; font-size: 15px; line-height: 1.25; }
.sw__sub { display: block; font-size: 12px; color: var(--fg3); line-height: 1.35; }
.sw__read {
  font-size: 13px;
  font-weight: 500;
  min-width: 3.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--fg2);
}
.sw[aria-checked="true"] .sw__read { color: var(--amber); }

/* the app's own switch: 52 x 32 of track, a 26 knob, one hairline.
   amber when on because a lit lamp is amber, ink when off. */
.sw__track {
  flex: 0 0 auto;
  width: 52px;
  height: 32px;
  border-radius: 16px;
  border: 1px solid var(--outline);
  background: var(--surface);
  position: relative;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.sw__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: var(--rail-track);
  transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1), background-color 180ms ease;
}
.sw[aria-checked="true"] .sw__track { background: var(--amber); border-color: var(--amber); }
.sw[aria-checked="true"] .sw__knob { transform: translateX(20px); background: #fffdf7; }
.sw[data-mixed="1"] .sw__track { background: var(--amber-dim); border-color: var(--amber); }
.sw[data-mixed="1"] .sw__knob { transform: translateX(10px); background: var(--amber); }
.sw[data-waiting="1"] .sw__track { border-style: dashed; }

.rail__plain { font-size: 14px; color: var(--fg2); }
.rail__plain li { padding: 6px 0; border-top: 1px solid var(--hairline); }

/* ── 3. the couch, then the three states ─────────────────────────────────── */
.piece { margin-top: clamp(36px, 6vh, 60px); max-width: 1100px; }
.piece img { width: 100%; height: auto; border-radius: 14px; }
.piece figcaption {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg3);
  max-width: var(--measure);
}
.states {
  margin-top: clamp(44px, 7vh, 76px);
  display: grid;
  gap: 34px;
}
@media (min-width: 860px) { .states { grid-template-columns: repeat(3, 1fr); gap: 44px; } }
.state h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 23px;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--amber-dim);
  margin-bottom: 14px;
}
.state p { margin: 0; color: var(--fg2); font-size: 16px; max-width: 42ch; }

/* ── 4. the way in ────────────────────────────────────────────────────────── */
.steps {
  margin-top: clamp(36px, 6vh, 60px);
  display: grid;
  gap: 22px;
  max-width: var(--measure);
}
.steps li { display: flex; gap: 18px; align-items: baseline; }
.steps__n {
  font-family: var(--display);
  font-size: 26px;
  color: var(--fg3);
  min-width: 1.1em;
  line-height: 1;
}
.steps__t { color: var(--fg2); }
.prose--way { margin-top: clamp(28px, 4vh, 40px); }
.plate-fig { margin-top: clamp(44px, 7vh, 76px); max-width: 880px; }
.plate-fig img { width: 100%; height: auto; border-radius: 14px; }
.plate-fig figcaption { margin-top: 14px; font-size: 13px; color: var(--fg3); }

/* ── 5. works with ────────────────────────────────────────────────────────── */
.works { margin-top: clamp(36px, 6vh, 60px); display: grid; gap: 26px; max-width: var(--measure); }
.works li { display: grid; gap: 4px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.works b { font-family: var(--display); font-weight: 400; font-size: 23px; letter-spacing: -0.01em; }
.works span { color: var(--fg2); font-size: 16px; }

/* ── 6. the door ──────────────────────────────────────────────────────────── */
.band--door { border-top: 1px solid var(--hairline); }
.plate--wide { display: block; }
.wordmark { width: 208px; height: auto; object-fit: contain; }
.foot { margin-top: 22px; font-size: 15px; color: var(--fg2); max-width: var(--measure); }
.foot--dim { color: var(--fg3); font-size: 14px; margin-top: 10px; }
.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--fg2);
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
.foot a:hover { color: var(--cream); }

/* ── motion: one orchestrated moment, then quiet ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .hero__film, .hero__night { display: none; }
}
