/* The app's night sky, deep navy brightening to indigo at the bottom. */
:root {
  color-scheme: dark;
  --sky-top: #0a0f2e;
  --sky-low: #21265c;
  --ink: #f1eff8;
  --muted: #aaa6c4;
  --faint: #ffffff40;
  --line: #ffffff1a;
  --card: #ffffff0a;
  --accent: #ff8a3d;
  --deep: #7321ba;
  --core: #0668be;
  --rem: #0d9b00;
  --awake: #ff9a3e;
  --display: 'Avenir Next', Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--sky-top) linear-gradient(var(--sky-top), var(--sky-low));
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { max-width: 100%; }

.wrap { max-width: 1120px; margin: auto; padding: 0 32px; }
header { height: 88px; display: flex; align-items: center; justify-content: space-between; }
.brand { font: 500 23px var(--display); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand img { width: 35px; height: 35px; border-radius: 9px; }
header nav { display: flex; gap: 28px; font-size: 14px; }
header nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
header nav a:hover, header nav a[aria-current=page] { color: var(--ink); }

.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; padding: 56px 0 72px; }
.hero h1 { font-size: clamp(44px, 5.6vw, 72px); line-height: 1.04; margin: 18px 0 18px; text-wrap: balance; }
.hero-sub { font: 500 clamp(22px, 2.4vw, 28px)/1.3 var(--display); color: var(--accent); margin: 0 0 24px; }
.hero-body { color: var(--muted); font-size: 18px; max-width: 520px; margin: 0; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 36px; }
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { height: 54px; width: auto; }
.text-link { font-size: 15px; color: var(--muted); text-decoration: none; }
.text-link:hover { color: var(--ink); }
.hero-art { display: flex; justify-content: center; }
.hero-art .screen { width: 330px; }

/* Screenshots are cropped screens that fade out at the bottom. */
.screen {
  display: block; width: 100%; height: auto;
  border-radius: 28px 28px 0 0; border: 1px solid var(--line); border-bottom: 0;
  background: var(--sky-top);
  -webkit-mask-image: linear-gradient(#000 78%, transparent);
  mask-image: linear-gradient(#000 78%, transparent);
}
.screen.short { -webkit-mask-image: linear-gradient(#000 88%, transparent); mask-image: linear-gradient(#000 88%, transparent); }

/* Question index */
.questions { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 28px 0 32px; }
.questions ol { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.questions a { display: flex; gap: 14px; align-items: baseline; text-decoration: none; font: 500 19px/1.35 var(--display); }
.q-num { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--faint); font: 600 13px var(--display); color: var(--accent); transform: translateY(-2px); }
.q-label { margin: 0; }
.q-label .q-num { width: 34px; height: 34px; font-size: 15px; }

/* Sections */
.section { padding: 112px 0; }
.section h2 { font-size: clamp(32px, 3.6vw, 46px); line-height: 1.12; margin: 16px 0 24px; text-wrap: balance; }
.section p:not(.eyebrow) { color: var(--muted); }

.stuck { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
.stuck-head p:last-child { font-size: 18px; }
.adds { margin: 0; border-top: 1px solid var(--line); }
.adds div { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.adds dt { font: 600 17px var(--display); }
.adds dd { margin: 0; color: var(--muted); font-size: 16px; }

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; border-top: 1px solid var(--line); }
.feature.flip .feature-copy { order: 2; }
.feature-copy { max-width: 480px; }
.feature-copy p { font-size: 18px; }
.feature figure { margin: 0; }
.single { justify-self: center; width: 330px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* Interactive history sample */
.demo { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 24px 24px 18px; }
.demo-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 500 14px -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--muted); background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.chip[aria-pressed=true] { color: var(--ink); background: #ffffff14; border-color: #ffffff38; }
.chip:hover { border-color: #ffffff60; }
.chip.day { width: 32px; padding: 6px 0; justify-content: center; }
.chip .dot { opacity: .35; }
.chip[aria-pressed=true] .dot { opacity: 1; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px #ffffff30; }
.dot.deep, .bar .deep { background: var(--deep); }
.dot.core, .bar .core { background: var(--core); }
.dot.rem, .bar .rem { background: var(--rem); }
.dot.awake, .bar .awake { background: var(--awake); }
.nights { list-style: none; margin: 0; padding: 0; min-height: 520px; }
.nights li { padding: 7px 0; }
.night-label { margin: 0 0 6px !important; font-size: 14px; color: var(--ink) !important; }
.night-label span { color: var(--faint); margin-left: 8px; }
.bar { display: flex; height: 16px; border-radius: 5px; overflow: hidden; transition: width .45s ease; }
.bar i { flex: 0 0 0; min-width: 0; transition: flex-grow .45s ease; }
.bar i + i { box-shadow: inset 1px 0 #00000040; }
.nights .empty { color: var(--muted); padding: 40px 0; text-align: center; }
.demo-note { font-size: 13px; margin: 14px 0 0; color: var(--faint) !important; }

/* Founder note */
.note { border-top: 1px solid var(--line); max-width: 780px; }
.note blockquote { margin: 22px 0 0; padding: 0; }
.note blockquote p { font: 400 clamp(21px, 2.2vw, 26px)/1.5 var(--display); color: var(--ink); margin: 0 0 18px; }

/* Facts and iPad */
.details { display: grid; grid-template-columns: 1fr 1.25fr; gap: 64px; align-items: center; border-top: 1px solid var(--line); }
.facts { display: grid; gap: 32px; }
.facts h3 { font-size: 20px; margin: 0 0 6px; }
.facts p { margin: 0; font-size: 16px; }
.ipad { display: block; width: 100%; height: auto; border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0; -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent); }

/* Closing, at the bottom of the sky */
.closing { text-align: center; padding: 96px 0 120px; }
.closing h2 { font-size: clamp(36px, 4.4vw, 56px); margin: 0 0 32px; }
.closing p { color: var(--muted); font-size: 18px; margin: 0; }
.closing .small { font-size: 15px; margin-top: 18px; }

footer { padding: 28px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; }
footer a { margin-left: 20px; }

/* Support, privacy, and 404 pages */
.page { max-width: 760px; margin: auto; padding: 72px 0 110px; }
.page h1 { font-size: 52px; line-height: 1.1; margin: 16px 0 30px; }
.page h2 { font-size: 24px; margin-top: 44px; }
.page p, .page li { color: var(--muted); }
.page .lead { font-size: 21px; color: #d9d2e9; }
.notice { border-left: 2px solid var(--accent); padding: 15px 20px; background: #ff8a3d0d; font-size: 14px; }
details { border-bottom: 1px solid var(--line); padding: 20px 0; }
summary { cursor: pointer; font: 500 19px var(--display); }
details p { font-size: 16px; }
.contact { margin-top: 48px; padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.contact h2 { margin: 0 0 10px; }
.contact p { margin-bottom: 0; }
.button { display: inline-block; padding: 12px 20px; background: var(--ink); color: var(--sky-top); border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 600; }
.button:hover { background: #fff; color: var(--sky-top); }

.skip { position: absolute; top: -100px; left: 12px; background: #fff; color: #000; padding: 10px; z-index: 10; }
.skip:focus { top: 10px; }

@media (max-width: 900px) {
  .questions ol { grid-template-columns: 1fr 1fr; }
  .stuck, .feature, .details { grid-template-columns: 1fr; gap: 40px; }
  .feature.flip .feature-copy { order: 0; }
  .feature-copy { max-width: 600px; }
}

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  header { height: 72px; }
  header nav { gap: 18px; font-size: 14px; }
  header nav .nav-how { display: none; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 28px 0 48px; }
  .hero-art .screen, .single { width: min(300px, 100%); }
  .questions ol { grid-template-columns: 1fr; gap: 14px; }
  .questions a { font-size: 18px; }
  .section { padding: 72px 0; }
  .adds div { grid-template-columns: 1fr; gap: 2px; }
  .pair { gap: 12px; }
  .pair .screen { border-radius: 18px 18px 0 0; }
  .demo { padding: 16px 14px 12px; margin: 0 -4px; }
  .nights { min-height: 480px; }
  .night-label span { display: block; margin: 0; }
  .page { padding: 48px 0 80px; }
  .page h1 { font-size: 40px; }
  .closing { padding: 64px 0 88px; }
  footer .wrap { flex-direction: column; }
  footer a { margin: 0 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar, .bar i { transition: none; }
}
