/* SPDX-License-Identifier: AGPL-3.0-only */
/* Copyright (c) 2026 Matteo Savoia (msavox) */
/* Congegno — congegno.marunja.com
   Hand-written, no framework, no CDN, no JavaScript.

   The colours are the app's own design tokens, copied value for value from
   frontend/src/styles/tokens.css: the light "paper" theme by default, the dark
   one when the system asks for it. There is no toggle — the page follows the
   reader's system, and every colour below goes through a custom property.

   The language is the app's too: flat grounds, hairline rules, square corners,
   no shadows, one accent, Inter for words and JetBrains Mono for labels, numbers
   and code, and the slanted accent tag the panels carry on their headers. */

/* ---- Fonts: self-hosted, Latin subset, SIL OFL 1.1 (see fonts/LICENSE-*.txt) ---- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
}

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

/* ---- Tokens ---- */

:root {
  /* Light, "paper" — the app's default theme. */
  --bg: #f4f4f0;
  --surface: #ffffff;
  --surface-2: #ecece6;
  --line: #d4d4cc;
  --stroke: #a3a39b;
  --wire: #6e6e68;
  --grid: #dcdcd4;
  --text: #0b0b0c;
  --dim: #5e5e58;
  --accent: #e0a800;        /* fills and bars only: yellow does not read as text on paper */
  --accent-text: #0b0b0c;   /* where the accent would be text or a focus ring */
  --on-accent: #0b0b0c;
  --danger: #d92d20;
  --ok: #1e9e5a;
  --ax-x: #d93a2f;
  --ax-y: #1e9e5a;
  --ax-z: #2f6fe0;
  --plot-2: #1c7fb8;
  --solid: #8f8f88;
  /* The units in the code sample wear the accent as a highlighter on paper. */
  --unit-mark: rgba(224, 168, 0, 0.32);

  --font-ui: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --cut: 6px;
  --fast: 120ms;

  --wrap: 46rem;
  --wrap-wide: 76rem;
  --gutter: 1.25rem;
  --bar: 56px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #151517;
    --surface-2: #1c1c1f;
    --line: #2a2a2d;
    --stroke: #4b4b48;
    --wire: #8a8a86;
    --grid: #1f1f22;
    --text: #f4f4f0;
    --dim: #8a8a86;
    --accent: #ffd400;
    --accent-text: #ffd400;
    --on-accent: #0b0b0c;
    --danger: #ff3b30;
    --ok: #3ddc84;
    --ax-x: #ff5a4e;
    --ax-y: #3ddc84;
    --ax-z: #4d8dff;
    --plot-2: #7fd1ff;
    --solid: #c8c8c2;
    --unit-mark: rgba(255, 212, 0, 0.16);

    color-scheme: dark;
  }
}

/* ---- Base ---- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img,
video { height: auto; }

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}

p { margin: 0; }

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

a:hover { text-decoration-color: var(--text); }

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

code,
pre,
kbd { font-family: var(--font-mono); }

:not(pre) > code {
  padding: 0.05em 0.35em;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.86em;
  white-space: nowrap;
}

/* The sticky bar must not cover the heading an anchor jumps to. */
[id] { scroll-margin-top: calc(var(--bar) + 1rem); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus { top: 0.75rem; }

.wrap,
.wrap-wide {
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); }
.wrap-wide { max-width: calc(var(--wrap-wide) + 2 * var(--gutter)); }

/* ---- The tag: the slanted accent marker on the app's panel headers ---- */

.kicker,
.panel-head,
.micro {
  font-family: var(--font-mono);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--dim);
}

.kicker::before,
.panel-head::before {
  content: "";
  flex: none;
  width: 22px;
  height: 10px;
  background: var(--accent);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}

.micro {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--dim);
}

/* ---- Top bar ---- */

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

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--bar);
}

/* The house before the product, as on the CleeCode site, kept to one quiet
   word: "Marunja / [mark] CONGEGNO". */
.brand-line {
  display: flex;
  align-items: center;
  min-width: 0;
}

.house {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
}

.house:hover { color: var(--text); }

.house-sep {
  margin: 0 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--stroke);
}

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

.brand-mark {
  width: 28px;
  height: 28px;
}

.brand-word {
  width: auto;
  height: 13px;
}

.nav {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav a {
  padding: 0.5rem 0.7rem;
  color: var(--dim);
  text-decoration: none;
}

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

.nav .nav-lang {
  margin-left: 0.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  color: var(--text);
}

.nav .nav-lang:hover { border-color: var(--text); }

@media (max-width: 64rem) {
  .nav a:not(.nav-lang) { display: none; }
}

/* ---- Hero ---- */

.hero { padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(4rem, 9vw, 7rem); }

.lockup {
  width: min(100%, 34rem);
  height: auto;
  margin: 0 0 clamp(2.25rem, 5vw, 3.25rem);
  color: var(--text);
}

.lk-a { fill: var(--accent); }
.lk-bg { fill: var(--bg); }

.lk-tagline {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 6px;
}

.hero h1 {
  font-size: clamp(2.3rem, 7.4vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.032em;
}

.hero h1 .line { display: block; }

/* The last beat underlined in the accent, like the rule under the wordmark. */
.hero h1 .line:last-child {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.11em;
  text-underline-offset: 0.14em;
  text-decoration-skip-ink: none;
}

.lead {
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  line-height: 1.55;
  max-width: 40rem;
}

.hero .lead { margin-top: clamp(1.5rem, 3vw, 2rem); }

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2.25rem 0 0;
}

.platforms {
  margin: 1.5rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--dim);
}

/* ---- Buttons ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.5rem 1.4rem;
  border: 1px solid var(--wire);
  border-radius: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fast) linear, color var(--fast) linear;
}

/* The primary action, cut at 45 degrees on two corners like the mark's joints. */
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)),
                     calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

.button.primary:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

/* The clip would hide an outer ring, so the primary one draws it inside. */
.button.primary:focus-visible {
  outline: 2px solid var(--on-accent);
  outline-offset: -6px;
}

.button.primary:hover:focus-visible { outline-color: var(--bg); }

/* ---- The film under the hero ---- */

.hero-visual { margin-top: clamp(3rem, 6vw, 4.5rem); }

/* A run in progress: the hazard stripe, moving linearly (the app's running state). */

@keyframes stripe-run {
  to { transform: translateX(12px); }
}

/* ---- Sections: one idea each ---- */

.slide {
  padding: clamp(4.5rem, 10vw, 8rem) 0;
  border-top: 1px solid var(--line);
}

.slide.alt { background: var(--surface); }

.slide h2 {
  font-size: clamp(2rem, 5.2vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
}

.slide h2 + .lead { margin-top: 1.5rem; }

/* A heading that reads as one line: wider than the text column when the screen allows, and broken only at its
   comma when it does not. */
.slide h2.one-line {
  width: max-content;
  max-width: calc(100vw - 2 * var(--gutter));
}

.slide h2.one-line span { white-space: nowrap; }

.slide .lead + p,
.slide .lead + .lead { margin-top: 1rem; }

.body-copy {
  margin-top: 1rem;
  max-width: 40rem;
  color: var(--dim);
}

.note {
  max-width: 40rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--dim);
}

/* ---- Panels: figures framed the way the app frames its panels ---- */

figure { margin: 0; }

.figure-row { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* A gallery of screenshots under a large one: one column on a phone, two from a tablet up, each with its caption. */
.gallery {
  display: grid;
  gap: clamp(1.75rem, 3.5vw, 2.5rem) clamp(1rem, 2.5vw, 2rem);
  margin: clamp(1.75rem, 3.5vw, 2.5rem) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .gallery { grid-template-columns: 1fr 1fr; }
}

.gallery figcaption strong { color: var(--text); font-weight: 600; }

/* Thumbnails (the themes and the layouts): smaller pictures, so three abreast on a wide screen, two from a tablet,
   one on a phone; a one-line caption each. */
.gallery.thumbs { gap: clamp(1.5rem, 3vw, 2rem) clamp(1rem, 2vw, 1.5rem); }

@media (min-width: 40rem) {
  .gallery.thumbs { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 64rem) {
  .gallery.thumbs { grid-template-columns: repeat(3, 1fr); }
}

.gallery.thumbs figcaption { margin-top: 0.6rem; font-size: 0.88rem; line-height: 1.5; }

.looks-sub { margin-top: clamp(3rem, 6vw, 4.5rem); }

.looks-sub h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); letter-spacing: -0.01em; }

.looks-sub h3 + .lead { margin-top: 0.75rem; }

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.slide.alt .panel { background: var(--bg); }

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 34px;
  margin: 0;
  padding: 0.4rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--dim);
  overflow-wrap: anywhere;
}

.panel > img {
  width: 100%;
  background: var(--surface-2);
}

/* The films are recorded at the app window's 1600 x 968. Anything else is
   letterboxed into that frame rather than cropped, so a row of films lines up. */
.panel video {
  width: 100%;
  aspect-ratio: 1600 / 968;
  object-fit: contain;
  background: var(--surface-2);
}

figcaption {
  max-width: var(--wrap);
  margin-top: 0.9rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--dim);
}

/* ---- Films ---- */

/* The flagship spans the row; the others share the rows below, two or three
   abreast, so a fourth film needs no change here. */
.films {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: clamp(2rem, 4vw, 2.75rem) 1.5rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.film.is-flagship { grid-column: 1 / -1; }

.film figcaption h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}

.film.is-flagship figcaption h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }

.film figcaption .micro { margin-bottom: 0.4rem; }

.film-frame { position: relative; }

/* Shown only while a video is still to come: build.sh marks such a figure
   is-pending, and leaves its sources out of the published page. */
.film-soon {
  display: none;
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.film-soon::before {
  content: "";
  width: 16px;
  height: 8px;
  background: var(--accent);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}

.film.is-pending .film-soon { display: inline-flex; }

/* ---- Code ---- */

.code {
  margin: 0;
  padding: 1.15rem 1.25rem 1.25rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.7;
  tab-size: 2;
  color: var(--text);
}

.code .k { color: var(--dim); }
.code .c { color: var(--dim); }
.code .x { color: var(--text); border-bottom: 1px dotted var(--wire); }

.code .u {
  padding: 0 1px;
  background: linear-gradient(transparent 55%, var(--unit-mark) 55%);
}

@media (prefers-color-scheme: dark) {
  .code .u {
    background: none;
    color: var(--accent-text);
  }
}

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

@media (min-width: 60rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .split .figure-row { margin-top: 0; }
}

/* ---- Cards ---- */

.cards {
  display: grid;
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

@media (min-width: 44rem) {
  .cards { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 64rem) {
  .cards.cards-three { grid-template-columns: repeat(3, 1fr); }
}

.card {
  position: relative;
  padding: 1.75rem 1.5rem 2rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.card h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.card p:last-child {
  max-width: 30rem;
  color: var(--dim);
}

.glyph {
  width: 44px;
  height: 44px;
  color: var(--text);
  overflow: visible;
}

.glyph .a { stroke: var(--accent); }
.glyph .af { fill: var(--accent); }

/* ---- How it works: model, compiler, engine, run ---- */

.flow {
  display: grid;
  gap: 0;
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
}

.flow > li {
  position: relative;
  padding: 0 0 2.75rem 0;
}

.flow h3 {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.flow p:last-child { color: var(--dim); }

.flow .glyph {
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
}

.flow > li:last-child { padding-bottom: 0; }

/* The connector between two steps: a hairline with a 45-degree chevron.
   Down the page on a phone, across it on a wide screen. */
.flow-arrow {
  position: absolute;
  color: var(--wire);
}

.flow-arrow.is-v {
  left: 22px;
  bottom: 0.35rem;
  width: 20px;
  height: 32px;
}

.flow-arrow.is-h { display: none; }

@media (min-width: 56rem) {
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .flow > li { padding: 0 3rem 0 0; }
  .flow-arrow.is-v { display: none; }
  .flow-arrow.is-h {
    display: block;
    top: 22px;
    right: 0.6rem;
    width: 36px;
    height: 20px;
  }
}

/* ---- Domains: the six glyphs of the logo, and two machines that need several ---- */

.domains {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

@media (min-width: 42rem) {
  .domains { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 68rem) {
  .domains { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.domain {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.domain-glyph {
  width: 100%;
  max-width: 7.5rem;
  height: auto;
  margin: 0 0 1rem;
  color: var(--text);
}

/* Planned domains keep their glyph, a step back; the label says why. */
.domain.is-planned .domain-glyph { opacity: 0.45; }

.domain h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.domain p:not(.micro):not(.domain-state) {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--dim);
}

.domain-state {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.domain-state::before {
  content: "";
  width: 14px;
  height: 8px;
  border: 1px solid var(--text);
  background: var(--text);
}

.domain.is-planned .domain-state { color: var(--dim); }

.domain.is-planned .domain-state::before {
  border: 1px dashed var(--wire);
  background: none;
}

/* Two machines drawn on the canvas, as Congegno will build them. */
.examples {
  display: grid;
  gap: clamp(2.5rem, 5vw, 3.5rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.example figcaption .micro { margin-bottom: 0.4rem; }

.example figcaption h3 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}

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

footer {
  padding: 3rem 0 3.5rem;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand .brand-mark {
  width: 24px;
  height: 24px;
}

.footer-brand .brand-word { height: 11px; }

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.8;
  color: var(--dim);
}

.footer-meta .sep {
  margin: 0 0.5rem;
  color: var(--stroke);
}

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

@media (min-width: 52rem) {
  .footer-inner {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
  .footer-meta { text-align: right; }
  .counter { grid-column: 2; justify-content: flex-end; }
}

/* The visit counter: an eye for visits, two heads for unique visitors, as on the CleeCode site. It stays out of the
   layout until /counter.js fills it in. */
.counter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--dim);
}
.counter[hidden] { display: none; }

/* The visits, then the downloads: an arrow into a tray for every installer, then each system's. */
.counter-group {
  display: inline-flex;
  gap: 0.9rem;
}
.counter-group[hidden] { display: none; }

.counter-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.counter-icon {
  width: 13px;
  height: 13px;
  flex: none;
}

/* ---- Small pages: 404 ---- */

.page-simple {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.page-simple main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.page-simple h1 {
  font-size: clamp(2.2rem, 6.5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.page-simple .lead { margin-top: 1.5rem; }
.page-simple .cta { margin-top: 2rem; }

.also {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
}

/* ---- Small screens ---- */

@media (max-width: 25rem) {
  :root { --gutter: 1rem; }
  body { font-size: 16px; }
  .cta .button { flex: 1 1 100%; }
  .card { padding: 1.5rem 1.15rem 1.75rem; }
  .code { font-size: 0.78rem; }
}

/* ---- The scroll: each block rises and lights up as it enters the viewport ----
   The same pure-CSS, scroll-driven animation as the CleeCode site: no script.
   Browsers without animation-timeline get the page unchanged, and a reader who
   asked for reduced motion is taken at their word. */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .slide > .wrap,
    .split > div,
    .slide figure,
    .cards,
    .domains,
    .flow {
      animation: rise-in both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }

    .slide figure { animation-range: entry 0% entry 70%; }

    @keyframes rise-in {
      from {
        opacity: 0;
        transform: translateY(44px) scale(0.985);
      }
      to {
        opacity: 1;
        transform: none;
      }
    }
  }
}

/* ---- Motion and contrast preferences ---- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .kicker::before,
  .panel-head::before,
  .film-soon::before {
    forced-color-adjust: none;
    background: CanvasText;
  }
  .button.primary { border: 1px solid ButtonText; }
}

/* ---- Download (the hero's): a tab per system, the visitor's chosen by site.js; without it, all four in a column ---- */

.dl { margin-top: clamp(1.8rem, 4vw, 2.6rem); max-width: 54rem; }
.dl-tabs { display: none; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; }
.dl.is-tabbed .dl-tabs { display: flex; }
.dl-tabs button { font: 600 0.95rem var(--font-ui); padding: 0.7rem 1.1rem; border: 0; border-bottom: 3px solid transparent;
  margin-bottom: -1px; background: none; color: var(--dim); cursor: pointer; }
.dl-tabs button:hover { color: var(--text); }
.dl-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.dl-tabs button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }
.dl-panel { display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: start; margin-bottom: 1.6rem; }
.dl.is-tabbed .dl-panel { margin-bottom: 0; }
.dl.is-tabbed .dl-panel[hidden] { display: none; }
.dl-big { min-height: 72px; padding: 0.8rem 1.8rem; font-size: 1.15rem; text-align: left; }
.dl-big small { display: block; font-weight: 400; font-size: 0.85rem; opacity: 0.8; margin-top: 0.15rem; }
.dl-icon { font-size: 1.6rem; line-height: 1; }
.dl-then { border-left: 3px solid var(--accent); padding: 0.2rem 0 0.2rem 1rem; }
.dl-then-title { font: 600 0.75rem var(--font-ui); text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); margin: 0 0 0.4rem; }
.dl-then ol { margin: 0; padding-left: 1.2rem; line-height: 1.55; }
.dl-then code { font: 0.85rem var(--font-mono); background: var(--surface); border: 1px solid var(--line); padding: 0.1rem 0.35rem; overflow-wrap: anywhere; }
.dl-foot { margin-top: 1.4rem; font-size: 0.9rem; color: var(--dim); line-height: 1.6; }
.dl-foot a { color: var(--text); }
@media (max-width: 720px) {
  .dl-panel { grid-template-columns: 1fr; }
  .dl-big { width: 100%; justify-content: flex-start; }
  .dl-tabs button { flex: 1 1 50%; padding: 0.6rem 0.5rem; font-size: 0.85rem; }
}

/* ---- The page, shorter (2026-10-29): the films two by two, the domains a strip, the thumbnails small ---- */

.film-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.6rem; align-items: start; }
.film-grid > .film, .film-grid > .film.is-flagship { margin: 0; grid-column: auto; }
.film-grid .film figcaption h3 { font-size: 1.05rem; }
.film-grid .film figcaption p { font-size: 0.9rem; }
.film-grid > .domains-strip, .film-grid > ul { grid-column: 1 / -1; }
.domains-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem; }
.domains-strip li { padding: 0.8rem; }
.domains-strip li > p:not(.micro) { display: none; }
.domains-strip .domain-glyph { width: 3rem; height: auto; }
.domains-strip h3 { font-size: 0.95rem; margin: 0.3rem 0 0; }
.gallery.thumbs { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.8rem; }
.gallery.thumbs figcaption { font-size: 0.8rem; }
@media (max-width: 720px) { .film-grid { grid-template-columns: 1fr; } }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.hero-top .lockup { width: min(100%, 26rem); margin-bottom: 1.5rem; }
.hero-top h1 { font-size: clamp(2rem, 3.4vw, 3.3rem); }
.hero-top .hero-film { margin: 0; grid-column: auto; }
.hero-top .hero-film figcaption { display: none; }
@media (max-width: 900px) { .hero-top { grid-template-columns: 1fr; } }

/* The film at the top: its sound turned on (site.js), a button over the picture where the browser started it muted */
.film-frame { position: relative; }
.sound-on { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; padding: 0.8rem 1.4rem;
  font: 600 1.05rem var(--font-ui); color: var(--on-accent); background: var(--accent); border: 0; cursor: pointer;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.sound-on:hover { filter: brightness(1.08); }
.sound-on:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.sound-on[hidden] { display: none; }

/* ---- News: the home page's latest posts, the index and the posts (site/tools/news.mjs) ---- */
.news-strip { padding: clamp(3rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--line); }
.news-strip h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.1; letter-spacing: -0.02em; }
.news-strip .cards { margin-top: clamp(1.5rem, 3vw, 2rem); }
.news-cards { gap: 1rem; border: 0; }
.news-cards .card { border: 1px solid var(--line); }
.news-cards h3 { margin-top: 0.4rem; }
.news-cards h3 a, .news-list h2 a { text-decoration: none; }
.news-cards h3 a:hover, .news-list h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.news-more, .post-foot { margin-top: 1.25rem; font-size: 0.92rem; color: var(--dim); }
.news-more .sep, .post-foot .sep { margin: 0 0.6rem; color: var(--stroke); }
.page-news main { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(4rem, 9vw, 6.5rem); }
.page-news h1 { font-size: clamp(2.2rem, 5.6vw, 3.4rem); line-height: 1.06; letter-spacing: -0.028em; }
.page-news h1 + .lead { margin-top: 1.25rem; }
.page-news .kicker a { color: inherit; }
.news-list { list-style: none; margin: 2.5rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.news-list li { padding: 1.6rem 0; border-bottom: 1px solid var(--line); }
.news-list h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.015em; }
.news-list h2 + p { margin-top: 0.5rem; color: var(--dim); }
.prose { margin-top: 2.5rem; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { margin-top: 2.6rem; font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.015em; }
.prose h3 { margin-top: 1.8rem; font-size: 1.15rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.5rem; }
.prose pre { overflow-x: auto; padding: 0.9rem 1rem; border: 1px solid var(--line); background: var(--surface-2); font-size: 0.85rem; line-height: 1.5; }
.prose :not(pre) > code { white-space: normal; overflow-wrap: anywhere; }
.prose .film { margin: 2rem 0; }
.post-foot { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---- The licence page (licence.html): the News's layout, and the box that says from when it applies ---- */
.licence-when { margin-top: 2rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface-2); font-size: 0.95rem; line-height: 1.6; }
.page-licence .post-foot code { overflow-wrap: anywhere; }

/* The registration for Inductio (licence-request.html, ADR 0204 §6) */
.licence-form { display: grid; gap: 1rem; margin-top: 2rem; max-width: 34rem; }
.lf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lf-field { display: grid; gap: 0.35rem; }
.lf-field > span { font: 600 0.8rem var(--font-ui); color: var(--dim); }
.lf-field input, .lf-field select, .lf-field textarea { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.lf-field input:focus-visible, .lf-field select:focus-visible, .lf-field textarea:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.lf-tick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.lf-note { margin: 0; color: var(--dim); font-size: 0.85rem; }
.lf-said { margin: 0; min-height: 1.5em; }
.lf-bad { flex-basis: 100%; color: var(--danger, #c92a2a); font-size: 0.85rem; }
.licence-form .button { justify-self: start; }
@media (max-width: 560px) { .lf-two { grid-template-columns: 1fr; } }
