/*
 * The one stylesheet of the site.
 *
 * The colours are the ones the mobile application uses, copied from its own palette. Only what
 * these pages need is here: a partial copy reads as what it is, where a full one would look like
 * something kept in step. Light and dark follow the visitor's device; there is no switch and no
 * script, so nothing on these pages runs.
 */
:root {
  color-scheme: light dark;
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f2f2ee;
  --text: #131316;
  --text-secondary: #56565c;
  --muted: #8c8c92;
  --border: rgba(16, 16, 18, 0.12);
  /* The signature gold reaches 1.7:1 on a light background, so small text steps down to a darker
     one. Fills keep the real gold: there the contrast is between the ink and the gold. */
  --accent: #e8c000;
  --accent-text: #8a6f00;
  --accent-soft: rgba(232, 192, 0, 0.16);
  --on-accent: #1a1500;
  --tile: #070708;
  --glow: rgba(232, 192, 0, 0.28);
  --todo-bg: #fff3c4;
  --todo-text: #5a4600;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070708;
    --surface: #121215;
    --surface-2: #18181b;
    --text: #f6f6f4;
    --text-secondary: #a6a6ac;
    --muted: #6e6e76;
    --border: rgba(255, 255, 255, 0.12);
    --accent-text: #e8c000;
    --accent-soft: rgba(232, 192, 0, 0.12);
    --glow: rgba(232, 192, 0, 0.16);
    --todo-bg: #3b3000;
    --todo-text: #ffe680;
  }
}

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-400-r1.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-700-r1.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-800-italic-r1.woff2') format('woff2');
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-600-r1.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  /* A real fallback behind each face: `swap` means the page is read in these first, and a stack
     that falls back to a serif would change shape as the real font arrives. */
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

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

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

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: 20px;
}

/* Off the screen until a keyboard reaches it: the first stop for somebody who tabs. */
.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* ---- Header ---------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--tile);
  border: 1px solid var(--border);
}

.mark svg {
  width: 22px;
  height: auto;
}

.wordmark {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wordmark span {
  display: block;
  color: var(--accent-text);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav {
  display: none;
  gap: 4px;
}

.nav a,
.lang {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
}

.nav a:hover,
.lang:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav a[aria-current='page'] {
  color: var(--text);
  background: var(--accent-soft);
}

.lang {
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (min-width: 760px) {
  .nav {
    display: flex;
  }
}

/* ---- Home ------------------------------------------------------------------------------ */

/* The header and the hero are dark in both themes. The brand gold is 1.7:1 on a light page and 12:1
   on this one, so here it can be the real gold instead of the darker one small text on light needs. */
.hero,
.site-header {
  --bg: #070708;
  --surface: #121215;
  --surface-2: #18181b;
  --text: #f6f6f4;
  --text-secondary: #a6a6ac;
  --border: rgba(255, 255, 255, 0.12);
  --accent-text: #e8c000;
  --accent-soft: rgba(232, 192, 0, 0.12);
  --glow: rgba(232, 192, 0, 0.2);
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  padding-block: clamp(56px, 12vw, 128px) clamp(48px, 9vw, 96px);
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto;
  height: 90%;
  background: radial-gradient(60% 60% at 50% 0%, var(--glow), transparent 70%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
}

.hero .mark {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  margin-bottom: 28px;
  box-shadow: 0 18px 50px -18px var(--glow);
}

.hero .mark svg {
  width: 52px;
}

.kicker {
  margin: 0 0 16px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

h1,
h2,
h3 {
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 20px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(38px, 8vw, 76px);
}

h1 em {
  font-style: inherit;
  color: var(--accent-text);
}

.lead {
  margin: 0 auto;
  max-width: 34em;
  font-size: clamp(18px, 2.4vw, 21px);
  color: var(--text-secondary);
}

.soon {
  display: inline-block;
  margin-top: 32px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  font-size: 15px;
}

.section {
  padding-block: clamp(40px, 7vw, 80px);
}

.section > .wrap > h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
}

.section > .wrap > p.intro {
  margin: 0 0 32px;
  max-width: 38em;
  color: var(--text-secondary);
}

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.card .num {
  display: block;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent-text);
}

.split {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.panel {
  padding: clamp(24px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
}

.panel p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.panel p:last-child {
  margin-bottom: 0;
}

.ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ticks li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--text-secondary);
}

.ticks li::before {
  content: '';
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 0.45em;
  border-radius: 3px;
  background: var(--accent);
  transform: rotate(45deg);
}

.ticks + p {
  margin-top: 20px;
}

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.05);
}

/* ---- Text pages ------------------------------------------------------------------------ */

.page-head {
  padding-block: clamp(40px, 8vw, 80px) 8px;
}

.page-head h1 {
  font-size: clamp(32px, 6vw, 52px);
  margin-bottom: 12px;
}

.page-head .updated {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.prose {
  max-width: 44rem;
  padding-block: 24px clamp(48px, 8vw, 96px);
}

.prose h2 {
  margin: 2.4em 0 0.5em;
  font-size: 24px;
  font-weight: 700;
}

.prose h3 {
  margin: 1.8em 0 0.4em;
  font-size: 18px;
  font-weight: 700;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose .fact {
  margin: 1.4em 0;
  padding: 18px 20px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
}

.prose .fact p:last-child {
  margin-bottom: 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.4em;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.prose table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 15px;
}

.prose th,
.prose td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.prose th {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-2);
}

.prose tr:last-child td {
  border-bottom: 0;
}

/* A gap that still has to be filled by a person. It is loud on purpose, and the release build
   refuses to go out while one is left. */
.todo {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--todo-bg);
  color: var(--todo-text);
  font-weight: 700;
}

/* ---- Footer ---------------------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-block: 32px 40px;
  color: var(--text-secondary);
  font-size: 15px;
}

.site-footer .wrap {
  display: grid;
  gap: 20px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .card,
  .button {
    transition: transform 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
  }

  .card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
  }
}
