/*
 * The full Quicksand, Nunito Sans and JetBrains Mono families, Latin and
 * Latin Extended, downloaded from Google Fonts and served from this site:
 * the app bundles glyph subsets, and loading from Google's servers would hand
 * every visitor's IP address to Google. Licences beside the files (SIL OFL).
 */
/* JetBrains Mono, latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* JetBrains Mono, latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Nunito Sans, latin-ext */
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/nunito-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Nunito Sans, latin */
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(/fonts/nunito-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Quicksand, latin-ext */
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/fonts/quicksand-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Quicksand, latin */
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/fonts/quicksand-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Colours are the app's own, copied from lib/theme/palettes.dart as the same
 * oklch() values, so a token here can be traced to the palette field of the
 * same name. Day is the light palette, night the dark one; the page follows
 * the visitor's system setting, as the app's Auto theme does.
 */
:root {
  color-scheme: light dark;

  --paper: oklch(0.965 0.018 82);
  --head: oklch(0.30 0.035 48);
  --ink: oklch(0.30 0.035 48);
  --sub: oklch(0.49 0.025 52);
  --line: oklch(0.86 0.025 72);
  --accent: oklch(0.62 0.13 44);
  --accent-text: oklch(0.50 0.15 40);
  --chip-bg: oklch(0.995 0.008 85);
  --card-bg: oklch(0.995 0.008 85);
  --card-border: var(--line);
  --card-shadow: 0 18px 40px -30px oklch(0.50 0.05 55 / 0.8);
  --note-bg: oklch(0.985 0.012 84);
  --wash: none;
  /* The screenshots sit on the accent by day and stand out on their own. */
  --shot-rim: transparent;

  /* trailVeil: paper over the painting, 70% of it showing through. */
  --veil: oklch(0.965 0.018 82 / 0.30);

  /* groundHalo: the veil's colour at full strength behind type set on the
     painting, a close layer twice and a wide one that lets the art back in. */
  --halo:
    0 0 0.14em var(--paper),
    0 0 0.14em var(--paper),
    0 0 0.46em oklch(0.965 0.018 82 / 0.8);

  --icon-shadow: 0 22px 40px -22px oklch(0.45 0.10 44 / 0.9);

  --font-head: 'Quicksand', ui-rounded, system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  --font-meta: 'JetBrains Mono', ui-monospace, monospace;

  --card-radius: 28px;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* `night`: where the dark grounds settle. */
    --paper: oklch(0.175 0.028 268);
    --head: oklch(0.97 0.015 88);
    --ink: oklch(0.93 0.02 88);
    --sub: oklch(0.77 0.02 275);
    --line: oklch(0.55 0.03 275 / 0.35);
    --accent: oklch(0.84 0.13 80);
    --accent-text: oklch(0.84 0.13 80);
    --chip-bg: oklch(0.26 0.03 274 / 0.8);
    --card-bg: oklch(0.27 0.032 275 / 0.86);
    --card-border: oklch(0.62 0.04 90 / 0.22);
    --card-shadow: 0 20px 46px -28px oklch(0.09 0.03 270 / 0.95);
    --note-bg: oklch(0.24 0.028 272 / 0.72);
    /* By night they sit on a ground darker than the page's, and the warm rim
       the app gives its dark cards is what shows where they end. */
    --shot-rim: oklch(0.62 0.04 90 / 0.22);

    /* homeBg: lit from the upper right. */
    --wash: radial-gradient(120% 100% at 84% -6%, oklch(0.34 0.05 285), transparent 64%);

    /* Five points heavier than by day: FLUX paints night with more contrast. */
    --veil: oklch(0.175 0.028 268 / 0.35);
    --halo:
      0 0 0.14em var(--paper),
      0 0 0.14em var(--paper),
      0 0 0.46em oklch(0.175 0.028 268 / 0.8);

    --icon-shadow: 0 0 44px -6px oklch(0.84 0.13 80 / 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  background-image: var(--wash);
  background-repeat: no-repeat;
  background-size: 100% 900px;
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--head);
  font-family: var(--font-head);
  font-weight: 700;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* The uppercase mono label the app sets chapter names and counts in. */
.overline {
  font: 600 0.75rem/1.4 var(--font-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(48px, 11vw, 112px) var(--gutter) 40px;
  text-align: center;
}

/*
 * The clearing, by day or by night, behind the hero. It fades into the ground
 * at every edge that is not the screen's, the way the trail's painting does:
 * at the foot always, and at the sides only once the screen is wider than it.
 */
.hero-art {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  width: min(100%, 760px);
  aspect-ratio: 2 / 3;
  transform: translateX(-50%);
  -webkit-mask-image: linear-gradient(#000 30%, transparent 88%);
  mask-image: linear-gradient(#000 30%, transparent 88%);
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--veil);
}

@media (min-width: 761px) {
  .hero-art {
    -webkit-mask-image:
      linear-gradient(#000 30%, transparent 88%),
      linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(#000 30%, transparent 88%),
      linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    mask-composite: intersect;
  }
}

.app-icon {
  width: clamp(104px, 26vw, 136px);
  height: auto;
  margin: 0 auto 22px;
  border-radius: 22.4%;
  box-shadow: var(--icon-shadow);
}

.hero h1 {
  font-size: clamp(3.75rem, 16vw, 5.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: var(--halo);
}

.hero .overline {
  margin-top: 14px;
  text-shadow: var(--halo);
}

.pitch {
  max-width: 31em;
  margin: 26px auto 0;
  font-size: clamp(1.0625rem, 2.6vw, 1.25rem);
  line-height: 1.55;
  font-weight: 600;
  text-shadow: var(--halo);
}

.pitch span {
  display: block;
  text-wrap: balance;
}

.pitch span + span {
  margin-top: 0.6em;
}

.store {
  margin-top: 30px;
}

/* Stands where the App Store badge will. A chip, as the app draws one. */
.soon {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--sub);
  font: 600 0.75rem/1.4 var(--font-meta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------- gallery */

/*
 * A row that scrolls sideways on a phone, each shot snapping to the middle
 * with the next one peeking in, and that sits still and centred once all four
 * fit. Only the row scrolls; the page never does sideways.
 */
.gallery {
  /* Positioned so it paints over the hero, whose painting runs on below it
     on a wide screen; a positioned hero would otherwise paint over it. */
  position: relative;
  padding: 8px 0 56px;
}

.gallery ul {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 12px var(--gutter) 28px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}

.gallery ul::-webkit-scrollbar {
  display: none;
}

.gallery li {
  flex: 0 0 min(70vw, 300px);
  scroll-snap-align: center;
}

/* Auto margins centre the row when it fits, without clipping it when not. */
.gallery li:first-child {
  margin-left: auto;
}

.gallery li:last-child {
  margin-right: auto;
}

@media (min-width: 900px) {
  .gallery li {
    flex: 0 1 280px;
  }
}

.gallery img {
  width: 100%;
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--shot-rim), var(--card-shadow);
}

/* ------------------------------------------------------- support, privacy */

.doc-head {
  padding: 20px var(--gutter) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--head);
  font: 700 1.375rem/1 var(--font-head);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 22.4%;
}

.doc {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 36px var(--gutter) 56px;
}

.doc > h1 {
  font-size: clamp(2.25rem, 8vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.doc > .overline {
  margin-top: 10px;
}

.lede {
  margin-top: 18px;
  font-size: 1.125rem;
  color: var(--ink);
}

.doc h2 {
  margin: 44px 0 12px;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
}

.doc p + p,
.doc p + ul,
.doc ul + p {
  margin-top: 12px;
}

.doc ul {
  margin: 0;
  padding-left: 1.25em;
}

.doc li + li {
  margin-top: 6px;
}

.doc li::marker {
  color: var(--accent);
}

.card {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
}

.card h2 {
  margin-top: 0;
}

.card .email {
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* The short version above the full policy: a note, as the app sets one. */
.note {
  margin-top: 28px;
  padding: 20px 24px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--note-bg);
}

.note h2 {
  margin: 0 0 10px;
  font-size: 1.1875rem;
}

.faq h3 {
  margin-top: 28px;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--sub);
  font-size: 0.9375rem;
  text-align: center;
}

.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  font-weight: 700;
}

.site-footer p {
  margin-top: 10px;
  font-size: 0.875rem;
}

/* ------------------------------------------------------------------- 404 */

.not-found {
  display: grid;
  place-items: center;
  padding: 72px var(--gutter);
  text-align: center;
}

.not-found h1 {
  font-size: clamp(2.25rem, 8vw, 2.75rem);
  letter-spacing: -0.03em;
}

.not-found p {
  margin-top: 14px;
  font-size: 1.125rem;
}
