/* Moonrise landing page.
   The page is a dark screening room: true black, like the bars around a wide film; subtitle white
   for what is being said; grey for everything else. The films and the app bring the colour.
   One family, Atkinson Hyperlegible Next (SIL OFL 1.1, fonts/OFL.txt): a face built to be read at
   a glance, which is what a subtitle asks of type. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #000000;   /* the letterbox */
  --white: #ffffff;   /* headings, and what matters in a line */
  --grey: #b8b8b8;    /* running text, 10.5:1 on black */
  --dim: #8a8a8a;     /* small print, 5.9:1 */
  --edge: #222222;    /* the bezel round a screenshot */
  --gutter: clamp(20px, 4vw, 64px);
  --measure: 34rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--black); }
body {
  margin: 0; background: var(--black); color: var(--grey);
  font: 400 1.125rem/1.6 "Atkinson Hyperlegible Next", system-ui, sans-serif;
}
img, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--white); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; border-radius: 3px; }
p { margin: 0 0 1em; }
strong { color: var(--white); font-weight: 600; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--white); color: var(--black); padding: .5em 1em; z-index: 9; }
.skip:focus { left: 8px; }

h1, h2 { color: var(--white); text-wrap: balance; }
h2 { margin: 0 0 1.2rem; font-weight: 700; font-size: clamp(1.85rem, 3vw, 2.75rem); line-height: 1.1; letter-spacing: -.01em; }
.copy > p:last-child { margin-bottom: 0; }
.small { color: var(--dim); font-size: 1rem; }

section { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter) 8rem; }

/* Top bar */
.bar { display: flex; justify-content: space-between; align-items: center; padding: 20px var(--gutter); }
.name { display: flex; align-items: center; gap: .6em; color: var(--white); text-decoration: none; font-weight: 700; }
.name img { width: 30px; height: 30px; border-radius: 7px; }
.bar nav { font-size: 1rem; }

/* The picture, in scope (2.39:1) */
.scope { margin: 0; position: relative; }
.scope video { width: 100%; aspect-ratio: 854 / 356; object-fit: cover; background: var(--black); }
video::cue {
  font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif; font-weight: 600;
  font-size: clamp(14px, 1.9vw, 30px); line-height: 1.3;
  color: #fff; background: transparent;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000;
}
.toggle { background: none; border: 0; padding: .3rem 0; color: var(--dim); font: inherit; font-size: .9rem; cursor: pointer; }
.toggle:hover { color: var(--white); }
.scope .toggle { position: absolute; right: var(--gutter); bottom: -2.6rem; }

/* The promise sits where a subtitle sits under a wide film: centred, two lines */
.caption { text-align: center; padding: 3.6rem 20px 7rem; max-width: none; }
h1 { margin: 0 auto; font-weight: 600; font-size: clamp(1.75rem, 3.3vw, 3.25rem); line-height: 1.22; letter-spacing: -.005em; }
h1 span { display: block; }
.caption p { margin: 1.8rem auto 0; max-width: 36em; }
.caption .fine { margin-top: .8rem; font-size: .95rem; color: var(--dim); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 2.2rem; }
.caption .actions { justify-content: center; }
.button { background: var(--white); color: var(--black); text-decoration: none; font-weight: 700; padding: .8em 1.4em; border-radius: 4px; }
.button:hover { background: #e2e2e2; }

.phone { border-radius: 40px; border: 6px solid var(--edge); background: var(--black); }

/* Speed: the real-time recording, phone-sized, with the reasons beside it */
.fast { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3rem 8vw; align-items: center; }
.fast h2 { grid-column: 1 / -1; font-size: clamp(2.4rem, 6vw, 5.5rem); line-height: 1; letter-spacing: -.025em; max-width: 11em; margin: 0; }
.fast .copy { max-width: var(--measure); }
.rec { margin: 0; display: grid; justify-items: center; gap: .9rem; }
.rec video { width: min(340px, 72vw); height: auto; aspect-ratio: 590 / 1282; }
.rec figcaption { font-size: .9rem; color: var(--dim); display: flex; gap: 1.4rem; align-items: baseline; justify-content: center; flex-wrap: wrap; text-align: center; }

/* Downloads: the list, at the size of a phone in the hand, beside its reasons */
.dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3rem 8vw; align-items: center; padding-left: max(var(--gutter), 12vw); }
.dl .copy { max-width: var(--measure); }
.dl h2, .away h2, .files h2 { font-size: clamp(2.1rem, 4.4vw, 4rem); line-height: 1.02; letter-spacing: -.02em; }
.dl img { width: min(320px, 72vw); }

/* Away from home: the app's own words, set large, carry it; the heading spans the page */
.away { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 2.5rem 7vw; align-items: start; }
.away h2 { grid-column: 1 / -1; font-size: clamp(2.1rem, 4.4vw, 4rem); line-height: 1.02; letter-spacing: -.02em; max-width: 14em; margin-bottom: 1rem; }
.setting { margin: 0; }
.setting img { width: 100%; max-width: 640px; border-radius: 22px; }
.setting figcaption { margin-top: .8rem; font-size: .9rem; color: var(--dim); }
.away .copy { max-width: var(--measure); }

/* Files as they are: type first, then the TV running wide to the page's edge */
.files { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem 5vw; align-items: center; padding-right: 0; max-width: none; margin: 0 0 0 max(0px, calc((100vw - 1400px) / 2)); }
.files h2 { font-size: clamp(2.1rem, 4.4vw, 4rem); line-height: 1.02; letter-spacing: -.02em; }
.formats { color: var(--white); font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.4; font-weight: 300; margin: 0 0 1.6rem; }
.files .copy { max-width: var(--measure); }
.tv { width: 100%; border-radius: 14px 0 0 14px; }
.files .tv { aspect-ratio: 1600 / 780; object-fit: cover; object-position: top; }

/* Set up and run: the words, then the app's own list of what it manages */
.setup { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: 3rem 7vw; align-items: start; }
.setup .copy { max-width: 38rem; }
.setup .setting img { max-width: 420px; }

/* Every screen: a plain list, the state in words */
.screens .copy { max-width: 40rem; margin-bottom: 2.6rem; }
.screens .tv { border-radius: 14px; max-width: 1000px; margin-bottom: 3rem; }
.plats { margin: 0; display: grid; grid-template-columns: minmax(13rem, 1fr) minmax(0, 2.4fr); gap: 1.5rem 4vw; max-width: 1000px; }
.plats dt { color: var(--white); font-weight: 600; font-size: 1.2rem; line-height: 1.45; }
.plats dd { margin: 0; }

/* Yours: the icon, the one quiet appearance of the moon */
.yours { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 3rem 7vw; align-items: center; }
.yours .icon { width: min(300px, 60vw); justify-self: end; }
.yours .copy { max-width: 38rem; }

/* Tonight: the commands */
.tonight .copy { max-width: 40rem; }
.tonight pre { margin: 1.6rem 0 2rem; padding: 1.2rem 1.4rem; background: #121212; color: var(--white); border-radius: 6px; overflow-x: auto; line-height: 1.65; max-width: 40rem; }
.tonight .support { margin-top: 2.2rem; }

footer { padding: 0 var(--gutter) 2.5rem; font-size: .875rem; color: var(--dim); max-width: 1400px; margin: 0 auto; }
footer p { max-width: 62em; margin: 0 0 .6em; }
footer a { color: var(--grey); }

/* Credits page */
.doc { padding: 1rem var(--gutter) 5rem; max-width: 1100px; margin: 0; }
.doc h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 0 0 1.4rem; }
.doc h2 { font-size: 1.5rem; margin-top: 2.6rem; }
.doc p, .doc li { max-width: 44rem; }
.table { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; font-size: .95rem; min-width: 640px; }
th, td { text-align: left; vertical-align: top; padding: .6rem 1.2rem .6rem 0; }
th { color: var(--white); font-weight: 600; }
td a { overflow-wrap: anywhere; }
td a[rel="license"] { white-space: nowrap; }

@media (max-width: 900px) {
  .fast, .dl, .away, .files, .setup, .yours { grid-template-columns: 1fr; }
  .yours .icon { justify-self: start; }
  .dl { padding-left: var(--gutter); }
  .dl img { justify-self: center; order: 2; }
  .rec { justify-self: center; }
  .yours .icon { width: 160px; }
  .files { margin: 0; }
  .files .copy { padding-right: var(--gutter); }
}
@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  section { padding-bottom: 5rem; }
  .scope video { aspect-ratio: 16 / 9; }
  .caption { padding: 3.4rem 20px 5rem; }
  h1 span { display: inline; }
  .phone { border-radius: 26px; border-width: 4px; }
  .dl img { width: 78vw; }
  .rec video { width: 78vw; }
  .setting img { border-radius: 14px; }
  .screens .tv { margin-left: calc(-1 * var(--gutter)); width: calc(100% + 2 * var(--gutter)); max-width: none; border-radius: 0; }
  .plats { grid-template-columns: 1fr; gap: .25rem; }
  .plats dd { margin-bottom: 1.3rem; }
}
