/*
 * Sun alarm's website, in the app's own design language (app/src/main/java/.../ui/theme):
 * warm monochrome, white cards with hairlines, Instrument Serif for display, Geist for text,
 * Geist Mono for small labels, one accent (the sun's pale yellow).
 * Shapes: buttons 8px, cards and frames 12px, phones 28px (their screens 22px). Nothing else.
 */

@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --canvas: #f7f6f3;
  --surface: #ffffff;
  --border: #eaeaea;
  --text-strong: #111111;
  --text: #2f3437;
  --text-muted: #696865;
  --sun-tint: #fbf3db;
  --on-sun-tint: #956400;
  --shadow: 0 1px 2px rgb(47 52 55 / 0.04), 0 12px 32px -12px rgb(47 52 55 / 0.12);
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(20px, 5vw, 48px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #141413;
    --surface: #1c1b1a;
    --border: #2c2b29;
    --text-strong: #f2f0ec;
    --text: #d8d5cf;
    --text-muted: #9a968f;
    --sun-tint: #3a3121;
    --on-sun-tint: #e8c47d;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.5);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; color: var(--text-strong); }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 30;
  background: var(--text-strong); color: var(--canvas); padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }

.icon { width: 1em; height: 1em; flex: none; fill: currentColor; }

.label {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.h2 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lede { max-width: 56ch; color: var(--text-muted); font-size: 18px; text-wrap: pretty; }

/* Buttons: one primary (Ask for the beta), one quiet text link. */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border-radius: 8px;
  font: 500 16px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--text-strong); color: var(--canvas); }
.btn--primary:hover { background: color-mix(in oklab, var(--text-strong) 86%, var(--canvas)); }
.btn--quiet { padding-inline: 4px; color: var(--text-strong); }
.btn--quiet .icon { transition: transform 0.2s var(--ease); }
.btn--quiet:hover .icon { transform: translateX(3px); }

/* The nav sits on the sky, in its ink. */
.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 72px;
  padding-inline: var(--gutter);
  color: var(--ink, var(--text-strong));
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 28px/1 var(--serif); letter-spacing: -0.01em; text-decoration: none; color: inherit;
}
.wordmark img { width: 26px; height: 26px; border-radius: 7px; }
.nav__links { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav__links a { text-decoration: none; opacity: 0.86; }
.nav__links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.nav .btn--primary { background: var(--ink, var(--text-strong)); color: var(--ink-contrast, var(--canvas)); padding: 11px 16px; font-size: 15px; }
@media (max-width: 767px) { .nav__links a { display: none; } }

/* Hero: the sky stays pinned while the sun rises with the scroll. */
.hero { position: relative; height: 220vh; background: #05060b; }
.hero__stage { position: sticky; top: 0; height: 100dvh; min-height: 560px; overflow: hidden; color: var(--ink, #efe9de); transition: color 0.45s var(--ease); }
.hero .nav, .hero__copy { transition: color 0.45s var(--ease); }
.hero canvas, .sunset canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The words up in the sky, where it is even; the app's clock down on the hills. */
.hero__clock {
  position: absolute; left: var(--gutter); bottom: clamp(28px, 6vh, 64px); z-index: 2;
  display: grid; gap: 6px;
  color: var(--clock-ink, #efe9de); transition: color 0.45s var(--ease);
}
.hero__clock .time { font: 400 clamp(64px, 9vw, 104px)/0.9 var(--serif); letter-spacing: -0.02em; }
.hero__clock .time small { font: 400 15px/1 var(--mono); margin-left: 8px; letter-spacing: 0; }
.hero__clock .label { color: inherit; opacity: 0.8; }
.hero__copy {
  position: absolute; left: var(--gutter); right: var(--gutter); top: calc(72px + clamp(28px, 9vh, 96px)); z-index: 2;
  max-width: 640px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 5.6rem);
  line-height: 1;
  letter-spacing: -0.025em;
  color: inherit;
}
.hero__sub { margin-top: 18px; max-width: 46ch; font-size: clamp(17px, 1.6vw, 19px); opacity: 0.86; text-wrap: pretty; }
.hero__ctas { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hero .btn--primary { background: var(--ink, #efe9de); color: var(--ink-contrast, #1f2326); }
.hero .btn--quiet { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero__stage { position: relative; }
}

/* Sections */
.section { padding-block: clamp(88px, 12vw, 168px); }
.section[data-flush] { padding-top: 0; }
.gap-top { margin-top: 18px; }
.gap-top-s { margin-top: 10px; }
.d1 { --i: 1; }
.d2 { --i: 2; }
.d3 { --i: 3; }
.section__head { display: grid; gap: 18px; max-width: 720px; }

/* A morning, in four screens: a staggered row of phones, a swipeable strip on phones. */
.phones {
  margin-top: clamp(48px, 7vw, 88px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px);
  align-items: start;
}
.phones figure { margin: 0; }
.phones figure:nth-child(2) { margin-top: 64px; }
.phones figure:nth-child(3) { margin-top: 24px; }
.phones figure:nth-child(4) { margin-top: 88px; }
.phones figcaption { margin-top: 18px; display: grid; gap: 4px; padding-inline: 4px; }
.phones figcaption strong { font-weight: 500; color: var(--text-strong); }
.phones figcaption span { color: var(--text-muted); font-size: 15px; line-height: 1.5; }
@media (max-width: 899px) {
  .phones {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); padding-bottom: 8px;
  }
  .phones::-webkit-scrollbar { display: none; }
  .phones figure { scroll-snap-align: center; margin-top: 0 !important; }
}

.phone {
  border-radius: 28px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.phone img { border-radius: 22px; width: 100%; aspect-ratio: 720 / 1602; object-fit: cover; }
/* A Settings page, cropped to its content. */
.phone--page img { aspect-ratio: 720 / 1242; object-position: top; }

/* Sounds: the words and their timeline beside the sound's own page. */
.split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(40px, 7vw, 112px); align-items: center; }
.split .phone { max-width: 340px; justify-self: center; }
@media (max-width: 899px) { .split { grid-template-columns: 1fr; } }

.timeline { margin: 36px 0 0; padding: 0; list-style: none; display: grid; gap: 22px; }
.timeline li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.timeline .badge {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-strong); font-size: 20px;
}
.timeline .when { font: 500 12px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.timeline .what { color: var(--text-strong); font-weight: 500; }
.timeline .why { color: var(--text-muted); font-size: 15px; line-height: 1.5; }

/* Bedtime: the sunset, framed. Its words keep the evening's rose ink in either theme. */
.sunset {
  position: relative; overflow: hidden;
  border-radius: 12px;
  min-height: min(82vh, 680px);
  display: flex; align-items: flex-end;
  background: #2a0a0c;
  color: #f6dcd3;
}
.sunset__copy { position: relative; z-index: 2; padding: clamp(28px, 5vw, 64px); max-width: 620px; }
.sunset__copy .label { color: #f6dcd3; opacity: 0.8; }
.sunset h2 { margin-top: 14px; color: #fbe9e1; }
.sunset p { margin-top: 16px; max-width: 48ch; color: #f6dcd3; opacity: 0.9; }

/* Small things: a bento of five, each cell its own kind. */
.bento {
  margin-top: clamp(48px, 6vw, 72px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.cell {
  position: relative; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  padding: clamp(22px, 2.4vw, 32px);
  display: flex; flex-direction: column; gap: 10px;
}
.cell h3 { font: 500 19px/1.3 var(--sans); color: var(--text-strong); }
.cell p { color: var(--text-muted); font-size: 15px; line-height: 1.55; }
.cell .icon { font-size: 22px; color: var(--text-strong); }
.cell--weather { grid-column: span 2; grid-row: span 2; padding-bottom: 0; }
.cell--weather .shot {
  margin-top: auto; align-self: center; width: min(78%, 320px);
  border-radius: 22px 22px 0 0; border: 1px solid var(--border); border-bottom: 0; overflow: hidden;
  transform: translateY(8px);
}
.cell--weather .shot img { aspect-ratio: 720 / 1100; object-fit: cover; object-position: top; }
.cell--notes { grid-column: span 2; background: var(--sun-tint); border-color: transparent; }
.cell--notes h3, .cell--notes .icon { color: var(--on-sun-tint); }
.cell--notes p { color: color-mix(in oklab, var(--on-sun-tint) 78%, var(--text)); }
.cell--length { grid-column: span 4; display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 24px 48px; }
@media (max-width: 899px) {
  .bento { grid-template-columns: 1fr; }
  .cell--weather, .cell--notes, .cell--length { grid-column: auto; grid-row: auto; }
  .cell--length { grid-template-columns: 1fr; }
}

/* A real copy of the app's length slider: move it and the sunrise's start moves. */
.length { display: grid; gap: 14px; }
.length__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.length__value { font: 500 19px/1 var(--sans); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.length__hint { color: var(--text-muted); font-size: 15px; }
.length input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; }
.length input[type="range"]::-webkit-slider-runnable-track {
  height: 14px; border-radius: 999px;
  background: linear-gradient(to right, var(--text-strong) var(--fill, 20%), var(--border) var(--fill, 20%));
}
.length input[type="range"]::-moz-range-track { height: 14px; border-radius: 999px; background: var(--border); }
.length input[type="range"]::-moz-range-progress { height: 14px; border-radius: 999px; background: var(--text-strong); }
.length input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 4px; height: 36px; margin-top: -11px; border-radius: 2px;
  background: var(--text-strong); box-shadow: 0 0 0 6px var(--surface);
}
.length input[type="range"]::-moz-range-thumb {
  width: 4px; height: 36px; border: 0; border-radius: 2px; background: var(--text-strong); box-shadow: 0 0 0 6px var(--surface);
}

/* Privacy: a statement, and what it means. */
.promise { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.promise .h2 { max-width: 14ch; }
.facts { margin: 0; padding: 0; list-style: none; display: grid; }
.facts li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding: 22px 0; border-top: 1px solid var(--border); }
.facts li:last-child { border-bottom: 1px solid var(--border); }
.facts .icon { font-size: 22px; color: var(--text-strong); margin-top: 2px; }
.facts strong { display: block; color: var(--text-strong); font-weight: 500; }
.facts span { color: var(--text-muted); font-size: 15px; line-height: 1.55; }
.promise .btn--quiet { margin-top: 24px; }
@media (max-width: 899px) { .promise { grid-template-columns: 1fr; } }

/* Last word */
.closing { text-align: center; display: grid; justify-items: center; gap: 18px; }
.closing .h2 { max-width: 18ch; }
.closing .lede { margin-bottom: 10px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding-block: 48px 56px; color: var(--text-muted); font-size: 15px; }
.footer__grid { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: start; }
.footer .wordmark { color: var(--text-strong); font-size: 24px; }
.footer nav ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.footer nav a { text-decoration: none; color: var(--text); }
.footer nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__fine { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
@media (max-width: 767px) { .footer__grid { grid-template-columns: 1fr; } }

/* Things arrive as they come into view, a little after one another. */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* The legal pages: a quiet document, with its contents beside it on wide screens. */
.page-head { border-bottom: 1px solid var(--border); }
.page-head .nav { position: static; color: var(--text-strong); padding-inline: 0; }
.doc-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); padding-block: clamp(48px, 7vw, 96px) clamp(72px, 9vw, 128px); }
.toc { position: sticky; top: 32px; align-self: start; display: grid; gap: 12px; }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; }
.toc a { text-decoration: none; color: var(--text-muted); }
.toc a:hover { color: var(--text-strong); }
.doc { max-width: 68ch; }
.doc h1 { font-family: var(--serif); font-size: clamp(2.6rem, 5vw, 3.8rem); line-height: 1.04; letter-spacing: -0.02em; }
.doc .updated { margin-top: 14px; }
.doc .intro { margin-top: 24px; font-size: 19px; color: var(--text); }
.doc h2 { margin-top: 56px; font: 600 21px/1.35 var(--sans); scroll-margin-top: 24px; }
.doc h3 { margin-top: 28px; font: 500 17px/1.4 var(--sans); }
.doc p, .doc ul, .doc dl { margin-top: 14px; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 8px; }
.doc a { text-underline-offset: 3px; }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; }
.doc dt { color: var(--text-muted); }
.doc dd { margin: 0; color: var(--text-strong); }
.doc .card { margin-top: 18px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 20px 24px; }
.doc pre {
  margin-top: 14px; padding: 20px 22px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font: 400 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
}
.doc details { margin-top: 14px; }
.doc summary { cursor: pointer; color: var(--text-strong); font-weight: 500; }
@media (max-width: 899px) {
  .doc-wrap { grid-template-columns: 1fr; }
  .toc { position: static; }
}
@media (max-width: 560px) { .doc dl { grid-template-columns: 1fr; gap: 2px; } .doc dd { margin-bottom: 12px; } }

.notfound { min-height: 70dvh; display: grid; align-content: center; gap: 18px; }
