/* Daybreak website. One night that ends at daybreak: the sky at the top, the sun at the bottom.
   Colours and type follow the app (src/ui/theme.ts): night navy, warm dawn as the one accent,
   Instrument Serif for the big moments and the system face for everything else. */

@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: oklch(0.15 0.035 268);
  --ground: oklch(0.18 0.045 268);
  --surface: oklch(0.23 0.05 268);
  --line: oklch(0.85 0.04 270 / 0.12);
  --ink: oklch(0.96 0.008 80);
  --ink-soft: oklch(0.81 0.03 268);
  --ink-faint: oklch(0.66 0.035 268);
  --dawn: oklch(0.83 0.11 58);
  --dawn-deep: oklch(0.74 0.15 40);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --wide: 1240px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--dawn); color: var(--night); }
:focus-visible { outline: 2px solid var(--dawn); outline-offset: 4px; border-radius: 6px; }

.skip { position: absolute; left: 16px; top: -48px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--night); text-decoration: none; font-weight: 600; z-index: 10; }
.skip:focus { top: 12px; }

.fine { font-size: 14px; line-height: 1.5; color: var(--ink-faint); }

/* Navigation */
.nav {
  position: absolute; inset: 0 0 auto; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) var(--gutter) 0;
}
.brand, .footer__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 21px; letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav__cta {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--night); background: var(--dawn);
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.nav__cta:hover { background: oklch(0.88 0.09 62); }
.nav__cta:active { transform: scale(0.97); }

/* The App Store badge: Apple's artwork, never redrawn or recoloured. */
.store { display: inline-block; border-radius: 10px; transition: transform 160ms var(--ease-out), opacity 200ms ease; }
.store img { width: 150px; height: auto; }
.store:hover { opacity: 0.88; }
.store:active { transform: scale(0.97); }

/* iPhone frame around a real screenshot. The screenshot already carries the Dynamic Island. */
.phone {
  --w: clamp(250px, 27vw, 360px);
  position: relative;
  width: var(--w);
  padding: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.165);
  background: oklch(0.27 0.012 260);
  box-shadow:
    inset 0 0 0 1px oklch(0.7 0.01 260 / 0.35),
    inset 0 0 0 calc(var(--w) * 0.012) oklch(0.09 0.01 260),
    0 calc(var(--w) * 0.1) calc(var(--w) * 0.2) calc(var(--w) * -0.06) oklch(0.05 0.03 268 / 0.75),
    0 calc(var(--w) * 0.02) calc(var(--w) * 0.05) oklch(0.05 0.03 268 / 0.5);
}
.phone::before, .phone::after {
  content: ''; position: absolute; width: 3px; border-radius: 2px; background: oklch(0.3 0.012 260);
}
.phone::before { left: -2px; top: 19%; height: 7%; box-shadow: 0 calc(var(--w) * 0.15) 0 oklch(0.3 0.012 260); }
.phone::after { right: -2px; top: 26%; height: 11%; }
.phone img { width: 100%; border-radius: calc(var(--w) * 0.135); background: var(--night); }
.phone--small { --w: clamp(230px, 22vw, 300px); }

/* Hero: the night sky, the one gradient on the page. */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  max-width: calc(var(--wide) + 2 * var(--gutter));
  min-height: min(100svh, 980px);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 120px) var(--gutter) clamp(64px, 9vw, 120px);
}
/* taste-skill-ignore: the night sky is Daybreak's one brand gradient (DESIGN.md), stars included. */
.hero__sky {
  position: absolute; inset: 0 calc(50% - 50vw); z-index: -1;
  background:
    radial-gradient(1.4px 1.4px at 12% 18%, oklch(0.96 0.008 80 / 0.7), transparent 60%), /* taste-skill-ignore */
    radial-gradient(1px 1px at 27% 34%, oklch(0.96 0.008 80 / 0.45), transparent 60%), /* taste-skill-ignore */
    radial-gradient(1.6px 1.6px at 41% 12%, oklch(0.96 0.008 80 / 0.6), transparent 60%), /* taste-skill-ignore */
    radial-gradient(1px 1px at 58% 26%, oklch(0.96 0.008 80 / 0.4), transparent 60%), /* taste-skill-ignore */
    radial-gradient(1.4px 1.4px at 73% 9%, oklch(0.96 0.008 80 / 0.65), transparent 60%), /* taste-skill-ignore */
    radial-gradient(1px 1px at 88% 30%, oklch(0.96 0.008 80 / 0.45), transparent 60%), /* taste-skill-ignore */
    radial-gradient(1.2px 1.2px at 6% 52%, oklch(0.96 0.008 80 / 0.35), transparent 60%), /* taste-skill-ignore */
    radial-gradient(1px 1px at 94% 58%, oklch(0.96 0.008 80 / 0.35), transparent 60%), /* taste-skill-ignore */
    linear-gradient(180deg, oklch(0.13 0.035 268) 0%, oklch(0.2 0.06 268) 55%, oklch(0.29 0.07 280) 88%, var(--night) 100%); /* taste-skill-ignore */
}
.hero__copy { max-width: 600px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(64px, 9.4vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.035em;
}
.hero__lede { margin-top: 28px; max-width: 30ch; font-size: 21px; line-height: 1.45; color: var(--ink-soft); }
.hero__get { display: flex; align-items: center; gap: 20px; margin-top: 44px; }
.hero__device { justify-self: center; }

/* The morning, minute by minute */
.morning {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(72px, 10vw, 140px) var(--gutter) clamp(40px, 6vw, 80px);
}
.morning__title {
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  max-width: 11em;
}
.moment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(40px, 8vw, 140px);
  margin-top: clamp(72px, 9vw, 128px);
  padding-left: clamp(0px, 8vw, 120px);
}
.moment--flip { grid-template-columns: auto minmax(0, 1fr); padding: 0 clamp(0px, 8vw, 120px) 0 0; }
.moment--flip .moment__copy { order: 2; }
.moment__copy { max-width: 470px; }
.moment__time { display: block; color: var(--dawn); font-variant-numeric: tabular-nums; }
.moment h3 {
  font-family: var(--serif);
  font-size: clamp(36px, 3.9vw, 56px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.moment__copy > p:not(.moment__time) { margin-top: 18px; color: var(--ink-soft); }
.moment__copy > .fine { margin-top: 12px; color: var(--ink-faint); }

/* Daybreak: the horizon, and the sun from the logo rising over it. */
/* taste-skill-ignore: the horizon at daybreak, the page's closing image, mirrors the app's sky. */
.dawn {
  position: relative;
  overflow: hidden;
  margin-top: clamp(56px, 8vw, 120px);
  padding: clamp(96px, 12vw, 168px) var(--gutter) clamp(220px, 22vw, 300px);
  text-align: center;
  background: linear-gradient(180deg, var(--night) 0%, oklch(0.22 0.07 285) 48%, oklch(0.42 0.1 30) 86%, oklch(0.62 0.13 45) 100%); /* taste-skill-ignore */
}
.dawn__copy { position: relative; z-index: 1; display: grid; justify-items: center; gap: 18px; max-width: 640px; margin: 0 auto; }
.dawn h2 { font-family: var(--serif); font-size: clamp(48px, 7vw, 104px); line-height: 0.92; letter-spacing: -0.035em; }
.dawn__copy > p:not(.fine) { font-size: 21px; color: var(--ink-soft); }
.dawn .store { margin-top: 14px; }
.dawn .store img { width: 165px; }
.dawn .fine { max-width: 36ch; color: oklch(0.85 0.03 268); }
/* taste-skill-ignore: the logo's rising sun, drawn with its own warm light. */
.dawn__sun {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: clamp(360px, 58vw, 860px);
  aspect-ratio: 2 / 1;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, oklch(0.9 0.08 75), var(--dawn) 45%, var(--dawn-deep)); /* taste-skill-ignore */
  transform: translate(-50%, 42%);
  transition: transform 1600ms var(--ease-out);
}
.js .dawn__sun:not(.in) { transform: translate(-50%, 70%); }

/* Footer */
.footer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px 40px;
  align-items: center;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 48px var(--gutter) calc(env(safe-area-inset-bottom) + 48px);
  font-size: 14px;
}
.footer__brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 4px; }
.footer__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--ink-soft); text-decoration: none; border-radius: 8px; transition: color 160ms ease; }
.footer__links a:hover { color: var(--ink); }
.footer__legal { grid-column: 1 / -1; font-size: 14px; color: var(--ink-faint); }

/* Entrances: each part rises in once as it arrives. Content stays visible without JavaScript. */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: var(--delay, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero__copy, .moment__copy { max-width: none; }
  .hero { grid-template-columns: 1fr; text-align: left; min-height: 0; padding-top: calc(env(safe-area-inset-top) + 112px); }
  .hero__device { justify-self: center; margin-top: 8px; }
  .moment, .moment--flip { grid-template-columns: 1fr; padding: 0; gap: 40px; }
  .moment--flip .moment__copy { order: 0; }
  .moment__device { justify-self: center; }
  .footer { grid-template-columns: 1fr; }
  .footer__links { justify-content: flex-start; margin-left: -10px; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: clamp(56px, 17vw, 76px); }
  .hero__get { flex-direction: column; align-items: flex-start; gap: 14px; }
  .phone { --w: min(76vw, 300px); }
  .phone--small { --w: min(70vw, 280px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .js .dawn__sun:not(.in), .dawn__sun { transform: translate(-50%, 42%); transition: none; }
  .nav__cta, .store, .footer__links a { transition: none; }
}

/* Legal and support pages */
.page-nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: calc(1080px + 2 * var(--gutter)); margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) var(--gutter) 20px;
}
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; font-size: 14px; color: var(--ink-soft); text-decoration: none; }
.back:hover { color: var(--ink); }
.doc {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  max-width: calc(1080px + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(72px, 9vw, 120px);
}
.doc__side { position: sticky; top: 32px; align-self: start; }
.doc__side h1 { font-family: var(--serif); font-size: clamp(44px, 5vw, 64px); line-height: 0.95; letter-spacing: -0.03em; }
.doc__side > p { margin-top: 14px; font-size: 14px; color: var(--ink-faint); }
.doc__side nav { display: grid; gap: 2px; margin-top: 32px; }
.doc__side nav a { display: flex; align-items: center; min-height: 40px; color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.doc__side nav a:hover, .doc__side nav a[aria-current="page"] { color: var(--ink); }
.doc__side nav a[aria-current="page"]::before { content: ''; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%; background: var(--dawn); }
.doc__body { max-width: 68ch; color: var(--ink-soft); }
.doc__body h2 { margin: 48px 0 12px; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.doc__body p, .doc__body ul, .doc__body table { margin: 0 0 14px; }
.doc__body ul { padding-left: 20px; }
.doc__body li { margin: 6px 0; }
.doc__body li::marker { color: var(--ink-faint); }
.doc__body strong { color: var(--ink); font-weight: 600; }
.doc__body a { color: var(--ink); text-decoration-color: var(--dawn); text-underline-offset: 3px; }
.doc__body .summary { padding: 24px 28px; border-radius: 20px; background: var(--ground); color: var(--ink); }
.doc__body .summary h2 { margin-top: 0; }
.doc__body .summary ul { margin-bottom: 0; }
.doc__body table { width: 100%; border-collapse: collapse; }
.doc__body th, .doc__body td { padding: 12px 12px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc__body th { color: var(--ink); font-weight: 600; }
.doc__body ol { padding-left: 22px; }
.doc__body ol li { margin: 10px 0; }
mark.todo { padding: 0 4px; border-radius: 4px; background: oklch(0.83 0.11 58 / 0.22); color: var(--ink); }
.notice { margin-bottom: 32px; padding: 14px 18px; border-radius: 14px; background: oklch(0.83 0.11 58 / 0.12); color: var(--ink); font-size: 14px; }

@media (max-width: 860px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc__side { position: static; min-width: 0; }
  .doc__side nav { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 16px; }
  .doc__body table, .doc__body thead, .doc__body tbody, .doc__body tr { display: block; }
  .doc__body thead { display: none; }
  .doc__body tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .doc__body td { display: block; padding: 2px 0; border: 0; }
  .doc__body td:first-child { color: var(--ink); font-weight: 600; }
}

/* 404 */
.lost { display: grid; place-items: center; min-height: 70svh; padding: 40px var(--gutter); text-align: center; }
.lost h1 { font-family: var(--serif); font-size: clamp(48px, 8vw, 96px); line-height: 0.95; letter-spacing: -0.03em; }
.lost p { margin-top: 16px; color: var(--ink-soft); }
.lost a { color: var(--ink); text-decoration-color: var(--dawn); text-underline-offset: 3px; }
