/* Twin horizon: Lune is night (left), Elio is day (right). Colours copied from each app's theme.css. */
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("/fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("/fonts/be-vietnam-pro-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url("/fonts/be-vietnam-pro-latin-500-normal.woff2") format("woff2"); }

:root {
  --night: #16143A; --night-glow: #2E2A5C; --night-ink: #EDEBFA; --night-muted: #A1A5CE;
  --day: #FFFDF9; --day-glow: #FDF0D5; --day-ink: #23190F; --day-muted: #5E5145; --day-line: #EDE6DA;
  --lune: #F5511E; --elio: #D07C08; --lune-tint: #FFF1EA; --elio-tint: #FDF4E4;
  --ink: #1F1D33; --ink-2: #5F5C78; --line: #E3E1EC; --ok: #3F6B2E; --err: #A12C2C;
  --head: "Figtree", system-ui, sans-serif;
  --body: "Be Vietnam Pro", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  /* the horizon between night and day: the same colours at dawn and at dusk.
     Each band starts 1px past its edge: sections can start mid-pixel, and the glow beneath would show as a line. */
  --dusk-1: #4A3262; --dusk-2: #E7A27A; --band: 240px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--night); color: var(--night-ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; height: auto; }
h1, h2, .h1, .h2, .mark { font-family: var(--head); font-weight: 600; letter-spacing: -0.035em; line-height: 1.04; margin: 0; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--lune); outline-offset: 3px; }

/* The split sections: two full layers, night on top and clipped at the seam, day below.
   The kit (img-comparison-slider) does the clip and the drag; the seam is drawn here. */
.split { display: grid; }
.split > * { grid-area: 1 / 1; }
.horizon { display: block; --divider-width: 0px; }
.horizon:focus { outline: none; }
.horizon:not(:defined) > [slot="second"], .horizon:not(:defined) > [slot="handle"] { display: none; }
.layer { position: relative; isolation: isolate; height: 100%; line-height: 1.6; }
.layer-night { color: var(--night-ink); background: radial-gradient(40% 55% at 30% 60%, var(--night-glow), var(--night)); }
.layer-day { color: var(--day-ink); background: radial-gradient(40% 55% at 70% 36%, var(--day-glow), var(--day)); }
.layer::before, .layer::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--split, 50%); translate: -50%; z-index: -1; pointer-events: none; }
.layer::before { width: 320px; background: radial-gradient(closest-side, rgba(245, 120, 40, .45), rgba(208, 124, 8, 0)); }
.layer::after {
  width: 4px; background: linear-gradient(transparent, var(--lune) 14%, var(--elio) 86%, transparent);
  filter: drop-shadow(0 0 10px rgba(245, 81, 30, .8));
}
[data-seam] { display: none; }

/* The knob: a "+" with arrows that say it moves */
.knob { position: relative; display: grid; place-items: center; width: 88px; height: 56px; pointer-events: auto; cursor: ew-resize; }
.knob::before {
  content: ""; position: absolute; width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lune), var(--elio)); box-shadow: 0 8px 24px rgba(120, 50, 10, .35), 0 0 0 4px rgba(255, 255, 255, .14);
}
.knob svg { position: relative; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.knob .cross { stroke: #fff; stroke-width: 3; }
.knob .chev { stroke: var(--lune); stroke-width: 2.5; }

/* Hero */
.hero .layer {
  min-height: 100svh; padding: clamp(56px, 10vh, 120px) var(--gutter) calc(var(--dock, 280px) + clamp(40px, 7vh, 72px));
  display: grid; grid-template-columns: 1fr 1fr; align-content: center; row-gap: clamp(40px, 7vh, 72px);
}
/* dusk at the foot of the day side, so the hero runs into the night film */
.hero .layer-day {
  background:
    linear-gradient(transparent, var(--dusk-2) 40%, var(--dusk-1) 75%, var(--night)) 0 calc(100% + 1px) / 100% calc(var(--band) + 1px) no-repeat,
    radial-gradient(40% 55% at 70% 36%, var(--day-glow), var(--day));
}
.hero .h1 { grid-column: 1 / -1; justify-self: center; max-width: 13ch; text-align: center; font-size: clamp(44px, 7.4vw, 112px); }
.layer-night .h1, .layer-night .h2 { color: #fff; }
.lockup { display: grid; gap: 14px; }
.lockup-lune { justify-items: end; text-align: right; padding-right: 72px; }
.lockup-elio { justify-items: start; padding-left: 72px; }
.mark { display: flex; align-items: center; gap: 14px; font-size: clamp(40px, 4.4vw, 64px); }
.mark img { width: 1em; height: 1em; }
.line { font: 500 clamp(17px, 1.6vw, 22px)/1.3 var(--head); letter-spacing: -0.02em; }
.layer-night .line, .layer-night .lead, .layer-night .foot { color: var(--night-muted); }
.layer-day .line, .layer-day .lead, .layer-day .foot { color: var(--day-muted); }
.dock { align-self: end; justify-self: center; width: min(560px, 100% - 2 * var(--gutter)); padding-bottom: 64px; position: relative; z-index: 1; }
/* Under the first form: a pointer down to the film. The hero's foot is dark on both sides, so it reads on night and day. */
.hero .dock { padding-bottom: 16px; }
.more { display: grid; justify-items: center; gap: 2px; margin-top: 22px; color: var(--night-ink); font: 500 15px/1.3 var(--body); text-decoration: none; text-shadow: 0 1px 8px rgba(5, 4, 20, .5); }
.more svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.more:hover { color: #fff; }

/* The sign-up form: a white card that sits across the seam */
.join {
  background: #fff; color: var(--ink); border-radius: 22px; padding: 20px;
  box-shadow: 0 30px 80px rgba(5, 4, 20, .35), 0 2px 6px rgba(5, 4, 20, .2);
  display: grid; gap: 14px;
}
.pick { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick legend { padding: 0; margin-bottom: 10px; font-weight: 500; font-size: 15px; color: var(--ink-2); }
/* Product tiles: the real checkbox stays in the page for keyboards and screen readers */
.tile {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer;
  font: 600 18px/1.15 var(--head); letter-spacing: -0.02em; color: var(--ink-2); background: #fff;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.tile input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tile img { width: 32px; height: 32px; transition: filter .15s, opacity .15s; }
.tile small { display: block; margin-top: 3px; font: 400 13px/1.3 var(--body); letter-spacing: 0; color: var(--ink-2); }
.tile .tick { width: 24px; height: 24px; }
.tile .tick circle { fill: #fff; stroke: var(--line); stroke-width: 1.5; }
.tile .tick path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tile:hover { border-color: #C9C6D8; }
.tile:not(:has(:checked)) img { filter: grayscale(1); opacity: .45; }
.tile:has(:checked) { color: var(--ink); }
.tile:has(:checked) .tick path { opacity: 1; }
.tile-lune:has(:checked) { border-color: var(--lune); background: var(--lune-tint); }
.tile-lune:has(:checked) .tick circle { fill: var(--lune); stroke: var(--lune); }
.tile-elio:has(:checked) { border-color: var(--elio); background: var(--elio-tint); }
.tile-elio:has(:checked) .tick circle { fill: var(--elio); stroke: var(--elio); }
.tile:has(:focus-visible) { outline: 3px solid var(--ink-2); outline-offset: 2px; }
.row { display: flex; gap: 10px; }
.row[hidden] { display: none; }
.row input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 14px;
  font: 400 17px var(--body); color: var(--ink); background: #fff;
}
.row input:focus-visible { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(95, 92, 120, .18); }
.row button {
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--lune); color: #fff; font: 600 17px var(--body);
}
.row button:hover { background: #E04512; }
.row button:disabled { opacity: .6; cursor: progress; }
.msg:empty { display: none; }
.msg { font-weight: 500; font-size: 15px; color: var(--err); }
.msg[data-ok="true"] { color: var(--ok); font-size: 17px; }
.note { font-size: 14px; color: var(--ink-2); text-align: center; }
.hp { position: absolute; left: -9999px; }

/* The film: full night, framed so its dark poster stands off the page */
.film { padding: clamp(32px, 6vh, 64px) var(--gutter) clamp(64px, 10vh, 120px); background: radial-gradient(50% 50% at 50% 50%, var(--night-glow), var(--night)); }
.film video {
  width: min(1040px, 100%); margin: 0 auto; border-radius: 20px; background: #000;
  box-shadow: 0 0 0 1px rgba(161, 165, 206, .35), 0 0 60px rgba(245, 81, 30, .14), 0 40px 110px rgba(5, 4, 20, .6);
}

/* The two products */
.product {
  padding: clamp(72px, 12vh, 140px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: center;
}
.night { background: radial-gradient(60% 70% at 75% 55%, var(--night-glow), var(--night) 75%); color: var(--night-ink); }
/* dawn: Lune's night brightens into Elio's day */
.day {
  padding-top: calc(var(--band) + clamp(40px, 6vh, 72px)); color: var(--day-ink);
  background:
    linear-gradient(var(--night), var(--dusk-1) 35%, var(--dusk-2) 70%, transparent) 0 -1px / 100% calc(var(--band) + 1px) no-repeat,
    radial-gradient(60% 70% at 25% 55%, var(--day-glow), var(--day) 75%);
}
.day .copy { order: 2; }
.copy { display: grid; gap: 22px; max-width: 34em; }
.mark.small { font-size: 28px; gap: 10px; }
.product h2 { font-size: clamp(40px, 5vw, 72px); }
.lead { font-size: clamp(17px, 1.4vw, 20px); }
.night .lead { color: var(--night-ink); } .day .lead { color: var(--day-muted); }
.steps { list-style: none; counter-reset: s; margin: 8px 0 0; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; }
.steps li::before { content: counter(s); grid-row: span 2; font: 600 18px/1.6 var(--head); }
.steps strong { font-weight: 500; }
.night .steps li::before { color: var(--lune); } .night .steps li { color: var(--night-muted); } .night .steps strong { color: var(--night-ink); }
.day .steps li::before { color: var(--elio); } .day .steps li { color: var(--day-muted); } .day .steps strong { color: var(--day-ink); }
/* Real cards from the film, laid over each other: the ask, then what backs it */
.cards { display: grid; }
.cards img { grid-area: 1 / 1; }
.card-a { width: 84%; align-self: start; }
.card-b { width: 64%; justify-self: end; margin-top: 34%; }
.day .card-a { width: 90%; }
.day .card-b { width: 80%; margin-top: 24%; }
.night .cards img { filter: drop-shadow(0 30px 50px rgba(5, 4, 20, .6)); }
.day .cards img { filter: drop-shadow(0 24px 44px rgba(35, 25, 15, .16)) drop-shadow(0 1px 2px rgba(35, 25, 15, .12)); }

/* The last ask: dusk at the top of the night side, where Elio's day ends */
.last .layer {
  min-height: 0; padding: calc(var(--band) - 24px) var(--gutter) calc(var(--dock, 280px) + 40px);
  display: grid; justify-items: center; align-content: start; gap: 18px; text-align: center;
}
.last .layer-night {
  background:
    linear-gradient(var(--day), var(--dusk-2) 30%, var(--dusk-1) 65%, transparent) 0 -1px / 100% calc(var(--band) + 1px) no-repeat,
    radial-gradient(40% 55% at 30% 60%, var(--night-glow), var(--night));
}
.last .layer::before, .last .layer::after { top: calc(var(--band) * .5); }
.knob-at { display: block; height: 56px; }
.last .h2 { font-size: clamp(36px, 4.6vw, 64px); max-width: 18ch; }
.last .dock { padding-bottom: 88px; }
.foot { position: absolute; left: 0; right: 0; bottom: 28px; font-size: 14px; text-align: center; }

/* The seam draws in once, top to bottom, like the film's opening */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .more svg { animation: nudge 2s ease-in-out infinite; }
  @keyframes nudge { 0%, 60%, 100% { translate: 0; } 30% { translate: 0 5px; } }
  .hero .layer::after { animation: draw .8s cubic-bezier(.2, .7, .2, 1) both; transform-origin: top; }
  @keyframes draw { from { scale: 1 0; } }
  /* The knob's arrows bounce outward twice when the knob first comes into view, then fade.
     Hover brings them back, and so does a press: a drag drifts off the knob, which only moves sideways. */
  .knob .chev { opacity: 0; transition: opacity .2s; }
  .knob:hover .chev, .horizon:active .chev, .horizon.held .chev { opacity: 1; }
  .hello .chev-l { animation: hello-l 2.4s .6s ease-in-out backwards; }
  .hello .chev-r { animation: hello-r 2.4s .6s ease-in-out backwards; }
  @keyframes hello-l { 0%, 30%, 60%, 75% { translate: 0; opacity: 1; } 15%, 45% { translate: -6px 0; } 100% { opacity: 0; } }
  @keyframes hello-r { 0%, 30%, 60%, 75% { translate: 0; opacity: 1; } 15%, 45% { translate: 6px 0; } 100% { opacity: 0; } }
}

/* Tablets: product cards drop below the words, so the cards stay readable */
@media (width < 900px) {
  .product { grid-template-columns: 1fr; }
  .day .copy { order: 0; }
}

/* Phones and narrow tablets: the seam lies flat, night above and day below */
@media (width < 760px) {
  .layer::before, .layer::after, .last .layer::before, .last .layer::after { top: var(--split, 50%); bottom: auto; left: 0; right: 0; translate: 0 -50%; }
  .layer::before { width: auto; height: 200px; }
  .layer::after { width: auto; height: 4px; background: linear-gradient(90deg, transparent, var(--lune) 14%, var(--elio) 86%, transparent); }
  /* The kit grabs only inside the knob's box, so on phones the box is a finger-wide strip along the whole line.
     The kit turns the knob 90°: its height runs across the screen, and its top lands on the right edge. */
  .knob { cursor: ns-resize; width: 56px; height: 100vw; place-items: start center; }
  .knob svg { margin: 16px -16px 0; }
  .knob::before { margin-top: 18px; }
  [data-seam] { display: block; }
  .knob-at { display: none; }
  .hero .layer { min-height: 0; grid-template-columns: 1fr; row-gap: 0; padding-top: 36px; padding-bottom: calc(var(--dock, 280px) + 24px); align-content: start; }
  .hero .h1 { justify-self: start; text-align: left; margin-bottom: 24px; }
  .more { margin-top: 12px; }
  .lockup, .lockup-lune, .lockup-elio { justify-items: start; text-align: left; padding: 0; }
  .lockup-lune { padding-bottom: 40px; }
  [data-seam] + .lockup-elio { padding-top: 40px; }
  .pick { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .last .layer { justify-items: start; text-align: left; }
  .last [data-seam] { height: 32px; }
}
