/* Pixtopia's changelog (pixtopia.net/changelog), written by scripts/changelog-site.ts from CHANGELOG.md. The tokens are
   the app's (src/theme/tokens.ts, DESIGN.md): charcoal steps and ink, the Prism only in the mark. It follows the
   reader's own light or dark setting, so there's no script here at all. */

@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_400Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_500Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_600SemiBold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Geist; src: url(/keychain/fonts/Geist_700Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/keychain/fonts/GeistMono_400Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --canvas: #0b0b0c;
  --surface: #151515;
  --raised: #1c1c1c;
  --hover: #232323;
  --border: #262626;
  --border-strong: #363636;
  --ink: #f5f5f5;
  --ink-2: #a3a3a3;
  --ink-3: #737373;
  --primary: #f5f5f5;
  --on-primary: #0b0b0c;
  --glass: rgba(11, 11, 12, 0.8);
  --focus: rgba(76, 168, 255, 0.55);
  --gutter: clamp(16px, 4vw, 48px);
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --canvas: #fafafa;
    --surface: #ffffff;
    --raised: #f4f4f5;
    --hover: #ededee;
    --border: #e7e7e9;
    --border-strong: #d4d4d8;
    --ink: #0b0b0c;
    --ink-2: #52525b;
    --ink-3: #71717a;
    --primary: #0b0b0c;
    --on-primary: #fafafa;
    --glass: rgba(250, 250, 250, 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; background: var(--canvas); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }

.top { position: sticky; top: 0; z-index: 2; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.top-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.home { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.home svg { width: 28px; height: 28px; flex: none; }
.mark-ink { fill: var(--ink); }
.prism-a { fill: #ff4f8b; }
.prism-b { fill: #ffb547; }
.prism-c { fill: #3ee0a1; }
.prism-d { fill: #4ca8ff; }
.top nav { display: flex; align-items: center; gap: 24px; }
.top nav a { font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.top nav a:hover { color: var(--ink); }
.top nav .button { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 10px; background: var(--raised); border: 1px solid var(--border); color: var(--ink); }
.top nav .button:hover { background: var(--hover); }
@media (max-width: 720px) { .top nav .wide { display: none; } }

.intro { padding: clamp(48px, 9vw, 104px) 0 clamp(32px, 6vw, 64px); }
h1 { margin: 0; font-size: clamp(40px, 8vw, 72px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.intro p { margin: 16px 0 0; max-width: 34em; font-size: clamp(17px, 2.2vw, 20px); line-height: 1.5; color: var(--ink-2); }

/* A day: its date holds to the left on a wide page while that day's changes scroll past, and sits above them on a phone. */
.day { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0 48px; padding: 40px 0 48px; border-top: 1px solid var(--border); }
.when { position: sticky; top: 88px; align-self: start; }
h2 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; }
h2 a { text-decoration: none; }
h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
h2 .year { color: var(--ink-3); font-weight: 500; }
.when p { margin: 6px 0 0; font: 400 12px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }

.what { display: grid; gap: 28px; min-width: 0; }
.group { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 24px; }
h3 { margin: 0; padding-top: 3px; font-size: 13px; line-height: 1.5; font-weight: 600; letter-spacing: 0.01em; color: var(--ink); }
ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
li { color: var(--ink-2); max-width: 62ch; overflow-wrap: anywhere; }
li a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
li a:hover { text-decoration-color: currentColor; }

/* The day someone followed a link to, picked out by a line beside its date as well as by where the page stops. */
.day:target .when { padding-left: 14px; margin-left: -17px; border-left: 3px solid var(--ink); }

@media (max-width: 860px) {
  .day { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 28px 0 36px; }
  .when { position: static; }
  .day:target .when { margin-left: 0; }
  .group { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  h3 { padding-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
}

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 28px; padding-bottom: 48px; border-top: 1px solid var(--border); color: var(--ink-3); font-size: 13px; }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }

.languages { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 24px; font-size: 14px; color: var(--ink-2); }
.languages a { text-underline-offset: 4px; }
.languages a[aria-current="page"] { color: var(--ink); font-weight: 600; }
/* System fonts supply the Chinese and Thai glyphs missing from Geist. */
:lang(zh-Hans), :lang(th) { --mono: 'Geist Mono', ui-monospace, system-ui, sans-serif; }
:lang(th) body { line-height: 1.87; }
html:lang(th) * { letter-spacing: 0; }
:lang(th) h1 { line-height: 1.19; }
:lang(th) h2 { line-height: 1.46; }
:lang(th) h3, :lang(th) .intro p { line-height: 1.75; }
:lang(th) .when p { line-height: 1.64; }
:lang(th) .top-inner { min-height: 64px; height: auto; padding-top: 10px; padding-bottom: 10px; }
:lang(th) .top nav .button { min-height: 40px; height: auto; }

/* Each language's flag beside its name. Our own pixels (src/lib/flags.ts, written to /flags by scripts/flags-site.ts),
   not emoji: flag emoji differ from system to system and Windows has none. */
.languages a::before { content: ""; display: inline-block; width: 18px; height: 12px; margin-right: 6px; vertical-align: -1px; background: center / 100% 100% no-repeat; image-rendering: pixelated; }
.languages a[hreflang="en"]::before { background-image: url("/flags/en.svg"); }
.languages a[hreflang="es"]::before { background-image: url("/flags/es.svg"); }
.languages a[hreflang="de"]::before { background-image: url("/flags/de.svg"); }
.languages a[hreflang="fr"]::before { background-image: url("/flags/fr.svg"); }
.languages a[hreflang^="zh"]::before { background-image: url("/flags/zh.svg"); }
.languages a[hreflang="th"]::before { background-image: url("/flags/th.svg"); }
