/*
 * Niklaus Gerber slides, v2.0 (2026-11-11). Web master for presentation/web/*.html.
 * Tokens: tokens/tokens.css (values repeated here so a deck works as a single folder).
 * Canvas 1920 x 1080. Three surfaces: canvas (content), indigo (contents, chapters), dark (cover, closing).
 * Below 1024px wide the deck reflows into a readable page; print always gives one slide per page.
 */

:root {
    --canvas: #f5f3ef; --ink: #141414; --ink-2: #5a564f; --ghost: #8c877e; --hair: #e0ddd8;
    --indigo: #26357a; --on-indigo: #f7f6ff; --on-indigo-2: #aab4f0; --on-indigo-ghost: #7f8bcb; --on-indigo-rule: #4a5796;
    --dark: #121212; --on-dark: #ecebe7; --on-dark-2: #a8a399; --on-dark-ghost: #6b675f; --on-dark-rule: #33312e;
    --font-ui: "Instrument Sans", "Instrument Sans Fallback", system-ui, sans-serif;
    --font-read: "Newsreader", "Newsreader Fallback", Georgia, serif;
    --mx: 112px;   /* side margin */
    --mt: 96px;    /* top margin */
    --stage: #c9c6c0;
}
@font-face { font-family: "Instrument Sans Fallback"; src: local("Arial"), local("Helvetica Neue"); size-adjust: 102.83%; ascent-override: 94.33%; descent-override: 24.31%; line-gap-override: 0%; }
@font-face { font-family: "Newsreader Fallback"; src: local("Georgia"); size-adjust: 93.37%; ascent-override: 78.72%; descent-override: 28.38%; line-gap-override: 0%; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--stage); }
body { font-family: var(--font-ui); color: var(--ink); -webkit-font-smoothing: antialiased; font-kerning: normal; }
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 4px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ the stage */
.deck { counter-reset: slide; display: flex; flex-direction: column; align-items: center; gap: 40px; padding: 40px 40px 80px; }
/* The frame scales the 1920 slide to the window. No container query here: containment would scope the page counter. */
:root { --fw: min(100vw - 96px, 1920px); }
.frame { counter-increment: slide; width: var(--fw); height: calc(var(--fw) * 9 / 16); overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.slide {
    position: relative;
    width: 1920px; height: 1080px;
    transform-origin: 0 0;
    transform: scale(tan(atan2(var(--fw), 1920px)));
    display: flex; flex-direction: column;
    padding: var(--mt) var(--mx) 0;
    overflow: hidden;
    background: var(--canvas); color: var(--ink);
    --fg-2: var(--ink-2); --fg-ghost: var(--ghost); --rule: var(--hair); --rule-strong: var(--ink);
}
.s-indigo { background: var(--indigo); color: var(--on-indigo); --fg-2: var(--on-indigo-2); --fg-ghost: var(--on-indigo-ghost); --rule: var(--on-indigo-rule); --rule-strong: var(--on-indigo); }
.s-dark   { background: var(--dark);   color: var(--on-dark);   --fg-2: var(--on-dark-2);   --fg-ghost: var(--on-dark-ghost);   --rule: var(--on-dark-rule);   --rule-strong: var(--on-dark); }
.s-indigo :focus-visible, .s-dark :focus-visible { outline-color: var(--on-indigo-2); }
.notes { display: none; }

/* ------------------------------------------------------------- footer */
.foot {
    position: absolute; left: var(--mx); right: var(--mx); bottom: 48px;
    display: flex; align-items: center; gap: 32px;
    padding-top: 22px; border-top: 1px solid var(--rule);
    font-size: 18px; line-height: 24px; color: var(--fg-2);
    font-variant-numeric: tabular-nums;
}
.foot::before { content: counter(slide, decimal-leading-zero); color: inherit; min-width: 28px; }
.foot .mark { margin-left: auto; }
.mark { display: inline-flex; flex-direction: column; align-items: stretch; gap: 3px; font-size: 26px; line-height: 20px; font-weight: 500; color: var(--rule-strong); }
.mark::after { content: ""; height: 3px; background: currentColor; }

/* --------------------------------------------------------------- type */
.label { font-size: 20px; line-height: 28px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 40px; }

/* Ghost headline: the claim in ink, the turn in ghost. Both lines one weight step apart. */
.gh { font-weight: 500; letter-spacing: -0.022em; text-wrap: balance; }
.gh > span { display: block; }
.gh > span + span { color: var(--fg-ghost); font-weight: 400; }
.gh-xl { font-size: 160px; line-height: 152px; }
.gh-l  { font-size: 120px; line-height: 120px; }
.gh-m  { font-size: 88px;  line-height: 92px; letter-spacing: -0.02em; }
.gh-s  { font-size: 64px;  line-height: 70px; letter-spacing: -0.018em; }
.gh-m > span + span, .gh-s > span + span { margin-top: 0.08em; }

.body   { font-family: var(--font-read); font-size: 32px; line-height: 46px; text-wrap: pretty; }
.body-2 { font-family: var(--font-read); font-size: 28px; line-height: 40px; color: var(--fg-2); text-wrap: pretty; }
.title  { font-size: 40px; line-height: 48px; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }

/* Spacing utilities, from the scale. */
.measure { max-width: 1040px; }
.mt-32 { margin-top: 32px; } .mt-44 { margin-top: 44px; } .mt-48 { margin-top: 48px; } .mt-64 { margin-top: 64px; }

/* Push a block to the bottom of the slide, clear of the footer. */
.end { margin-top: auto; margin-bottom: 176px; }
/* Or run it under the headline. */
.under { margin-top: 96px; }

/* -------------------------------------------------------------- cover */
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 64px; margin-top: 64px; max-width: 1500px; }
.meta .body-2 { margin-top: 10px; color: inherit; opacity: 1; }
.s-dark .meta .body-2 { color: var(--on-dark-2); }

/* -------------------------------------------------- index (contents) */
.index { border-top: 1px solid var(--rule); }
.index li { display: flex; align-items: baseline; gap: 40px; padding: 20px 0 22px; border-bottom: 1px solid var(--rule); }
.index .n { flex: none; width: 48px; font-size: 20px; line-height: 28px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.index .t { font-size: 36px; line-height: 44px; font-weight: 500; letter-spacing: -0.01em; }
.index .d { margin-left: auto; font-size: 20px; line-height: 28px; color: var(--fg-2); text-align: right; white-space: nowrap; }
.index-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 80px; align-items: start; }  /* wraps two .index lists: read down, then across */
.index-2 .t { font-size: 30px; line-height: 38px; }
/* More than eight entries: compact rows (pair with a gh-s headline). Up to 14 entries in two columns. */
.index-compact li { padding: 12px 0 14px; }
.index-compact .t { font-size: 26px; line-height: 34px; }

/* ------------------------------------------------- content: lead + blocks */
.content { display: grid; grid-template-columns: 760px minmax(0, 1fr); gap: 96px; margin-top: 8px; }
.content .label { margin-bottom: 40px; }
.blocks > * + * { margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--rule); }
.blocks .label { margin-bottom: 12px; }
.blocks .body + .body { margin-top: 20px; }

/* ----------------------------------------------------------- steps (3) */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; }
.steps li { border-top: 4px solid var(--rule-strong); padding-top: 24px; }
.steps .n { display: block; font-size: 20px; line-height: 28px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.steps .title { margin: 12px 0 16px; }

/* --------------------------------------------------------------- stat */
.stat { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 96px; align-items: end; }
.stat-n { font-size: 240px; line-height: 200px; font-weight: 500; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.stat .body { max-width: 760px; }
.stat .label { margin-top: 24px; }

/* -------------------------------------------------------------- quote */
.quote { max-width: 1440px; }
.quote p { font-family: var(--font-read); font-style: italic; font-size: 64px; line-height: 80px; letter-spacing: -0.01em; text-wrap: balance; }
.quote figcaption { margin-top: 48px; font-size: 24px; line-height: 32px; font-weight: 500; }
.quote figcaption span { display: block; font-weight: 400; font-size: 20px; line-height: 28px; color: var(--fg-2); }

/* ------------------------------------------------------------ compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 96px; }
.compare > div { border-top: 4px solid var(--rule-strong); padding-top: 24px; }
.compare .title { margin: 12px 0 20px; }

/* ----------------------------------------------------------- timeline */
.timeline { border-top: 1px solid var(--rule-strong); }
.timeline li { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: baseline; padding: 22px 0 24px; border-bottom: 1px solid var(--rule); }
.timeline .when { font-size: 36px; line-height: 44px; font-weight: 500; font-variant-numeric: tabular-nums; }
.timeline .title { font-size: 32px; line-height: 40px; }
.timeline .body-2 { font-size: 24px; line-height: 34px; }

/* ----------------------------------------------------- rows (key: value) */
.rows { border-top: 1px solid var(--rule-strong); }
.rows > div { display: grid; grid-template-columns: 560px minmax(0, 1fr); gap: 40px; padding: 22px 0 24px; border-bottom: 1px solid var(--rule); }
.rows dt { font-size: 28px; line-height: 38px; font-weight: 500; }
.rows dd { font-family: var(--font-read); font-size: 28px; line-height: 40px; text-wrap: pretty; }

/* -------------------------------------------------------------- chart */
/* Simple columns in HTML; for anything more, an SVG chart on the same colours. Indigo is the series that matters. */
.bars { display: flex; align-items: flex-end; gap: 48px; height: 440px; border-bottom: 1px solid var(--rule-strong); }
.bars li { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars .v { font-size: 24px; line-height: 32px; font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.bars .bar { height: var(--h); background: var(--indigo); }
.s-indigo .bars .bar, .s-dark .bars .bar { background: var(--on-indigo-2); }
.bars .bar.muted { background: var(--fg-ghost); }  /* 3:1 or more on every surface */
.bars-x { display: flex; gap: 48px; margin-top: 14px; }
.bars-x li { flex: 1; font-size: 20px; line-height: 28px; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- image + text */
.s-media { display: grid; grid-template-columns: 1fr 1fr; padding: 0; }
.s-media .media { position: relative; overflow: hidden; background: var(--hair); }
.s-media .media img { width: 100%; height: 100%; object-fit: cover; }
.s-media .media-empty { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--ink-2); }
.s-media .text { display: flex; flex-direction: column; padding: var(--mt) var(--mx) 0 96px; }
.s-media .foot { left: calc(50% + 96px); }
.s-media figcaption { position: absolute; left: 32px; bottom: 28px; font-size: 18px; line-height: 24px; color: var(--on-indigo); background: rgb(20 20 20 / 0.6); padding: 4px 10px; }

/* ------------------------------------------------------------ closing */
.contact { display: flex; gap: 64px; margin-top: 56px; font-size: 28px; line-height: 36px; }
.contact a { text-underline-offset: 6px; }

/* ===================================================== reflow: phones */
@media (max-width: 1023px) {  /* reflow, except while presenting */
    html:not(.presenting), html:not(.presenting) body { background: var(--canvas); }
    html:not(.presenting) .deck { gap: 0; padding: 0; }
    html:not(.presenting) .frame { width: 100%; height: auto; box-shadow: none; }
    html:not(.presenting) .slide { width: 100%; height: auto; transform: none; display: block; padding: clamp(40px, 9vw, 64px) clamp(20px, 6vw, 48px) clamp(28px, 7vw, 44px); }
    html:not(.presenting) .gh-xl { font-size: clamp(44px, 13vw, 96px); line-height: 1.02; }
    html:not(.presenting) .gh-l { font-size: clamp(38px, 11vw, 84px); line-height: 1.04; }
    html:not(.presenting) .gh-m { font-size: clamp(32px, 9.4vw, 68px); line-height: 1.08; }
    html:not(.presenting) .gh-s { font-size: clamp(28px, 8vw, 56px); line-height: 1.1; }
    html:not(.presenting) .label { font-size: 15px; line-height: 22px; }
    html:not(.presenting) .body { font-size: clamp(18px, 4.8vw, 22px); line-height: 1.5; }
    html:not(.presenting) .body-2 { font-size: clamp(16px, 4.3vw, 20px); line-height: 1.5; }
    html:not(.presenting) .title { font-size: clamp(20px, 5.4vw, 28px); line-height: 1.25; }
    html:not(.presenting) .end, html:not(.presenting) .under { margin: clamp(32px, 8vw, 56px) 0 0; }
    html:not(.presenting) .meta, html:not(.presenting) .content, html:not(.presenting) .steps, html:not(.presenting) .steps-4, html:not(.presenting) .compare, html:not(.presenting) .stat, html:not(.presenting) .s-media { grid-template-columns: 1fr; gap: clamp(20px, 6vw, 40px); }
    html:not(.presenting) .meta { margin-top: 32px; }
    html:not(.presenting) .content .label { margin-bottom: 16px; }
    html:not(.presenting) .blocks > * + * { margin-top: 20px; padding-top: 20px; }
    html:not(.presenting) .index li { gap: 16px; padding: 14px 0; }
    html:not(.presenting) .index .n { width: 32px; font-size: 13px; }
    html:not(.presenting) .index .t, html:not(.presenting) .index-2 .t { font-size: clamp(18px, 5vw, 26px); line-height: 1.3; }
    html:not(.presenting) .index .d { font-size: 13px; }
    html:not(.presenting) .index-2 { grid-template-columns: 1fr; }
    html:not(.presenting) .index-2 > .index + .index { border-top: 0; }
    html:not(.presenting) .stat-n { font-size: clamp(88px, 28vw, 180px); line-height: 0.9; }
    html:not(.presenting) .quote p { font-size: clamp(26px, 7vw, 44px); line-height: 1.25; }
    html:not(.presenting) .quote figcaption { margin-top: 24px; font-size: 18px; }
    html:not(.presenting) .quote figcaption span { font-size: 15px; }
    html:not(.presenting) .timeline li, html:not(.presenting) .rows > div { grid-template-columns: 1fr; gap: 6px; padding: 16px 0; }
    html:not(.presenting) .timeline .when { font-size: 22px; line-height: 1.3; }
    html:not(.presenting) .timeline .title, html:not(.presenting) .rows dt { font-size: 20px; line-height: 1.3; }
    html:not(.presenting) .timeline .body-2, html:not(.presenting) .rows dd { font-size: 17px; line-height: 1.5; }
    html:not(.presenting) .s-media { padding: 0; }
    html:not(.presenting) .s-media .media { aspect-ratio: 4 / 3; }
    html:not(.presenting) .s-media .text { padding: clamp(32px, 8vw, 56px) clamp(20px, 6vw, 48px) clamp(28px, 7vw, 44px); }
    html:not(.presenting) .bars { height: 220px; gap: 16px; }
    html:not(.presenting) .bars .v { font-size: 14px; }
    html:not(.presenting) .bars-x { gap: 16px; }
    html:not(.presenting) .bars-x li { font-size: 13px; }
    html:not(.presenting) .contact { flex-direction: column; gap: 12px; font-size: 20px; margin-top: 28px; }
    html:not(.presenting) .foot { position: static; margin-top: clamp(32px, 8vw, 52px); padding-top: 16px; gap: 14px; font-size: 13px; line-height: 18px; flex-wrap: wrap; }
    html:not(.presenting) .s-media .foot { margin-top: 32px; }
    html:not(.presenting) .mark { font-size: 18px; line-height: 14px; gap: 2px; }
    html:not(.presenting) .mark::after { height: 2px; }
    html:not(.presenting) .steps li, html:not(.presenting) .compare > div { padding-top: 16px; }
    html:not(.presenting) .s-media .foot { margin-inline: clamp(20px, 6vw, 48px); padding-bottom: 28px; }
}

/* ============================================ print: always a deck */
@page { size: 1920px 1080px; margin: 0; }
@media print {
    html, body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .deck { display: block; padding: 0; gap: 0; }
    .frame { width: 1920px; height: 1080px; box-shadow: none; break-after: page; }
    .slide { transform: none; }
    .deck-help { display: none; }
}

/* ===================================================== presenting */
.deck-help { position: fixed; right: 16px; bottom: 16px; z-index: 5; font-size: 13px; line-height: 18px; color: var(--ink-2); background: var(--canvas); padding: 8px 12px; border: 1px solid var(--hair); }
html.presenting body { background: #000; overflow: hidden; }
html.presenting .deck { padding: 0; gap: 0; height: 100vh; justify-content: center; }
html.presenting { --fw: min(100vw, 100vh * 16 / 9); }
/* Hidden slides stay rendered, so the page counter still counts them. */
html.presenting .frame { position: absolute; left: -200vw; visibility: hidden; box-shadow: none; }
html.presenting .frame.is-current { position: static; visibility: visible; }
html.presenting .deck-help { display: none; }
@media (max-width: 1023px) { .deck-help { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
