/* ---------- Design tokens (light; the dark blocks below override the colours) ---------- */
:root {
  --bg: #f2f5f9;
  --bg-2: #e6ecf3;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-solid: #ffffff;
  --paper: #ffffff;
  --pass: #ffffff;
  --border: rgba(15, 35, 70, 0.09);
  --ink: #0c1a2e;
  --ink-2: #46546a;
  --ink-3: #8590a2;
  --accent: #1d5fa8;     /* mid blue */
  --accent-2: #2f7fd0;   /* lighter blue */
  --accent-3: #5aa9e6;   /* sky */
  --warm: #a86b00;       /* amber: the one warm counter-accent, same hue as the departures board; used sparingly (text contrast >= 4.5:1) */
  --warm-hi: #ffc94a;    /* the bright amber itself (the departures board uses it as --amber), for graphics on dark surfaces in both themes */
  --on-accent: #ffffff;  /* text/icons on accent surfaces */
  /* "Höhenflug": blue only, deep navy to sky – no violet/pink (that reads as Gemini / Meta AI) */
  --gradient: linear-gradient(100deg, #0b2e5c 0%, var(--accent) 50%, var(--accent-3) 100%);
  --dot: rgba(15, 35, 70, 0.17);
  --dashed: rgba(15, 35, 70, 0.14);
  --shadow: 0 1px 2px rgba(15, 30, 55, 0.06), 0 6px 14px -10px rgba(15, 30, 55, 0.18);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable Display", "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: max(1.25rem, 5vw);
  /* Width of the content column (without the gutters): grows with the screen, so wide monitors don't get a narrow
     strip in the middle; capped so lines and cards don't get absurdly wide. */
  --content: clamp(64rem, 72vw, 92rem);
}

/* Dark tokens: used when the system is dark (unless the visitor picked "light"), or when "dark" was picked.
   theme.js sets <html data-theme="light|dark">; no attribute = follow the system. Keep both blocks identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070d18;
    --bg-2: #0d1626;
    --surface: rgba(18, 28, 46, 0.75);
    --surface-solid: #111b2c;
  --paper: #d7dee8;
    --paper: #d7dee8;
    --pass: #1c2a40;
    --border: rgba(180, 210, 255, 0.12);
    --ink: #eaf1fb;
    --ink-2: #a3b2c8;
    --ink-3: #66758c;
    --accent: #7cc4fa;
    --accent-2: #4f9be6;
    --accent-3: #2f7fd0;
    --warm: var(--warm-hi);
    --on-accent: #06162b;
    --gradient: linear-gradient(100deg, #d6ecff 0%, var(--accent) 45%, var(--accent-3) 100%);
    --dot: rgba(180, 210, 255, 0.18);
    --dashed: rgba(180, 210, 255, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  --bg: #070d18;
  --bg-2: #0d1626;
  --surface: rgba(18, 28, 46, 0.75);
  --surface-solid: #111b2c;
  --pass: #1c2a40;
  --border: rgba(180, 210, 255, 0.12);
  --ink: #eaf1fb;
  --ink-2: #a3b2c8;
  --ink-3: #66758c;
  --accent: #7cc4fa;
  --accent-2: #4f9be6;
  --accent-3: #2f7fd0;
  --warm: var(--warm-hi);
  --on-accent: #06162b;
  --gradient: linear-gradient(100deg, #d6ecff 0%, var(--accent) 45%, var(--accent-3) 100%);
  --dot: rgba(180, 210, 255, 0.18);
  --dashed: rgba(180, 210, 255, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* Also behind the status bar / notch, below the last content and when scrolling past the edges (iOS): the same
     colour as the page, so no band of another colour shows above the Safari toolbar or under the status bar. */
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

a { color: inherit; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  /* The gutters come on top of the content width – otherwise the growing 5vw gutters would eat into the column on
     wide screens and squeeze it. */
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  /* Safe areas: keep text clear of the notch and rounded corners (landscape). */
  padding-left: calc(var(--gutter) + env(safe-area-inset-left));
  padding-right: calc(var(--gutter) + env(safe-area-inset-right));
}

.skip {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus { transform: none; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Sides: aligned with the content column (.wrap) on wide screens, the gutter on smaller ones. */
  padding:
    calc(0.8rem + env(safe-area-inset-top))
    max(calc(var(--gutter) + env(safe-area-inset-right)), calc((100% - var(--content)) / 2))
    0.8rem
    max(calc(var(--gutter) + env(safe-area-inset-left)), calc((100% - var(--content)) / 2));
  /* iOS Safari 26 ignores theme-color and tints the status bar from the background of the fixed element just below
     the top edge – this nav. It must be one opaque colour: transparent or a backdrop blur comes out black (or a
     colour sampled once at load, which goes stale after a theme switch). So: always solid --bg, no blur; Safari
     follows it live, also when the theme changes. The hero fades into --bg at the top (.hero::after), so there is
     no edge below the nav. */
  background-color: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

/* site.js adds .is-scrolled once the page is scrolled. */
.nav.is-scrolled { border-bottom-color: var(--border); }

/* Reading progress: a hairline over the bottom border, filled left to right (site.js writes the scale). */
.nav-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.nav.is-scrolled .nav-progress { opacity: 0.55; }

/* Section in view next to the logo: small, quiet, wide screens only; fades in once a section is reached. */
.nav-where {
  display: none;
  align-items: baseline;
  gap: 0.45rem;
  padding-left: 0.8rem;
  border-left: 1px solid var(--border);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--ink-3);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
}

.nav-where-num { color: var(--warm); }

@media (min-width: 52rem) {
  .nav-where { display: inline-flex; }
}

.nav-where.is-on { opacity: 1; transform: none; }
.nav-where.is-swap { opacity: 0; transform: translateY(-3px); transition-duration: 0.15s; }

@media (prefers-reduced-motion: reduce) {
  .nav-where, .nav-where.is-swap { transform: none; }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

/* Wordmark (inline SVG): letters in --ink, plane and contrail in the brand colours. */
.logo-mark {
  flex: none;
  width: 62px;
  height: 34px;
  overflow: visible;
}

@media (min-width: 52rem) {
  .logo-mark { width: 73px; height: 40px; }
}

.logo-letters {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-trail {
  fill: none;
  stroke: url(#logo-trail);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 2 2.6;
}

.logo-plane { fill: url(#logo-plane); }

/* Contrail and plane colours follow the theme (the brighter dark-mode accents read better on black). */
.lt-1 { stop-color: var(--accent); }
.lt-2 { stop-color: var(--accent-2); }
.lt-3 { stop-color: var(--accent-3); }

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Account link (sign in / the signed-in person's first name), same pill as the segmented controls next to it. */
.account-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: calc(2rem + 8px);
  padding: 0 0.85rem 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--ink-2);
  font: 600 12px/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}

@media (hover: hover) {
  .account-link:hover { color: var(--ink); }
}

.account-link.signed-in { color: var(--ink); }

button.account-link { cursor: pointer; }

/* Admin button next to the account (project page of Tailkeeper, main administrator only; site.js shows it). */
.nav-admin[hidden] { display: none; }

.account-caret { transition: transform 0.2s var(--ease-out); }
.account-toggle[aria-expanded="true"] .account-caret { transform: rotate(180deg); }

/* Narrow phones: only the icon (the label stays for screen readers via aria-label). */
@media (max-width: 30rem) {
  /* A circle as tall as the segmented controls, with the icon or picture in its centre. */
  .account-link { justify-content: center; width: calc(2rem + 8px); padding: 0; }
  .account-label, .account-caret { display: none; }
  /* Alone in the circle: no pull towards the (hidden) name. Needs the extra class to beat .account-pic further down. */
  .account-link .account-pic { margin-left: 0; }
}

/* Account menu (signed in): who is signed in, "Your account", "Administration" (administrators only), "Sign out" – opened by the name button (site.js). */
.account { position: relative; }
.account [hidden] { display: none; }

.account-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  /* Wide enough for "Meldet dich bei allen Tools auf kiankohler.de ab." on one line (17rem broke it in two, and
     text-wrap: balance below then made both halves short, which left the right side empty). */
  width: min(20rem, calc(100vw - 2 * var(--gutter)));
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  animation: account-menu-in 0.18s var(--ease-out);
}

/* Phones: the button isn't at the right edge, so the menu hangs from the right end of the whole toolbar instead. */
@media (max-width: 40rem) {
  .nav-tools { position: relative; }
  .account { position: static; }
}

@keyframes account-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
}

@media (prefers-reduced-motion: reduce) {
  .account-menu { animation: none; }
}

.account-who {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.6rem 0.75rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.account-pic {
  width: 22px;
  height: 22px;
  margin-left: -0.25rem;
  border-radius: 50%;
  object-fit: cover;
}

.account-avatar {
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--on-accent);
  font: 600 0.85rem/1 var(--sans);
  letter-spacing: 0.02em;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-id {
  display: grid;
  min-width: 0;
}

.account-name,
.account-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name { font: 600 0.95rem/1.3 var(--sans); color: var(--ink); }
.account-email { font: 400 0.8rem/1.3 var(--sans); color: var(--ink-3); }

.account-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 0;
  border-radius: 0.6rem;
  background: none;
  color: var(--ink-2);
  font: 500 0.9rem/1.3 var(--sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-item:hover,
.account-item:focus-visible { background: var(--bg); color: var(--ink); }
.account-item:disabled { opacity: 0.6; cursor: default; }

.account-note {
  margin: 0.15rem 0 0;
  padding: 0 0.6rem 0.35rem;
  color: var(--ink-3);
  font: 400 0.75rem/1.35 var(--sans);
  /* Even lines instead of a lone last word ("… kiankohler.de / ab."). */
  text-wrap: balance;
}

/* Segmented controls (theme + language). */
.seg {
  position: relative;
  isolation: isolate;
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
}

.seg button {
  display: grid;
  place-items: center;
  min-width: 2.2rem;
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink-2);
  font: 600 12px/1.2 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.lang button { min-width: 2.5rem; }

.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* The pill under the chosen button (theme.js adds span.seg-pill and .has-pill, sets --seg-x/--seg-w): it slides and
   resizes in 0.4 s while the texts change colour; .seg-instant places it without motion (first paint, resize). */
.seg-pill {
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: var(--seg-w, 0px);
  border-radius: 7px;
  background: var(--ink);
  transform: translateX(var(--seg-x, 0px));
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1), width 0.4s cubic-bezier(0.65, 0, 0.35, 1), background-color 0.6s ease;
  pointer-events: none;
}
.seg.has-pill button[aria-pressed="true"] { background: none; }
.seg-instant .seg-pill { transition: none; }

@media (hover: hover) {
  .seg button[aria-pressed="false"]:hover { color: var(--ink); }
}

.seg button:focus-visible { outline-offset: 1px; }

/* Theme and language switch: the page cross-fades slowly from old to new (theme.js KKSoft, View Transitions API). */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
/* Browsers without View Transitions: colours fade for a moment instead of jumping (theme.js adds the class). */
html.theme-fade,
html.theme-fade *,
html.theme-fade *::before,
html.theme-fade *::after {
  transition: background-color 0.6s ease, color 0.6s ease, border-color 0.6s ease, fill 0.6s ease, stroke 0.6s ease, box-shadow 0.6s ease !important;
}
html.theme-fade .seg-pill {
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1), width 0.4s cubic-bezier(0.65, 0, 0.35, 1), background-color 0.6s ease !important;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  /* Clip sideways only: the glow may fade out below the hero instead of ending in a hard edge. */
  overflow-x: clip;
}

/* Top of the hero fades into the page colour, so the solid nav (see .nav) has no visible edge over the glow/dots. */
.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: -1;
  height: calc(env(safe-area-inset-top) + 10rem);
  background: linear-gradient(var(--bg) 42%, color-mix(in srgb, var(--bg) 0%, transparent));
  pointer-events: none;
}

/* The globe (hero-globe.js) is the background of the whole start page: one canvas that stays on screen behind the
   content (z-index -1 in the body's stacking context, above the orbs). It never moves with the page, so nothing
   slides or gets cut while the page scrolls; hero-globe.js tilts it towards the southern hemisphere, makes it smaller
   and fades the Earth (not the planes) while scrolling, so the content stays easy to read. Its height is the largest
   viewport (lvh): on phones the address bar coming and going then never resizes it.
   Sticky, not fixed: Safari 26 on the iPhone cuts fixed elements off at the top of its floating address bar and fills
   the strip behind the bar with one flat colour (the dark box at the bottom of the screen, Kian 2026-10-20), while
   page content (sticky included) runs on behind the bar. It is the first box in the page, sticks at the top for the
   whole page, and its negative bottom margin takes it out of the flow, so main starts at the top as before.
   Touch screens get a strip of globe below the viewport (--globe-bleed): Safari 26 makes even 100lvh end about the
   height of its floating address bar above the bottom of the screen, so without it the globe stopped there with a
   hard edge and the page colour showed behind the bar (Kian 2026-10-20). hero-globe.js reads --globe-bleed and lays
   the globe out in the viewport part only, so the strip just carries on the picture.
   No pointer events: the page listens for them. */
.globe-field {
  --globe-bleed: 0px;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: calc(100vh + var(--globe-bleed));
  height: calc(100lvh + var(--globe-bleed));
  margin-bottom: calc(-100vh - var(--globe-bleed));
  margin-bottom: calc(-100lvh - var(--globe-bleed));
  pointer-events: none;
}
@media (pointer: coarse) {
  .globe-field { --globe-bleed: 200px; }
}
/* Under the solid nav the globe fades into the page colour, so there is no edge below the nav (like .hero::after). */
.globe-field::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top) + 7rem);
  background: linear-gradient(var(--bg) 45%, color-mix(in srgb, var(--bg) 0%, transparent));
}

.globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Over the globe the mouse pointer becomes a small aiming dot drawn on the canvas (a click sends a plane there). */
html.globe-aim, html.globe-aim body, html.globe-aim main, html.globe-aim section, html.globe-aim .hero { cursor: none; }

/* A quiet, still colour light behind the globe. */
.hero-glow {
  position: absolute;
  inset: -20% -10% auto auto;
  z-index: -2;
  width: min(70rem, 140vw);
  aspect-ratio: 1;
  background:
    radial-gradient(closest-side at 35% 40%, color-mix(in srgb, var(--accent) 26%, transparent), transparent),
    radial-gradient(closest-side at 65% 55%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent),
    radial-gradient(closest-side at 50% 75%, color-mix(in srgb, var(--accent-3) 14%, transparent), transparent);
  opacity: 0.45;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent);
  mask-image: radial-gradient(closest-side, #000 60%, transparent);
}

.hero-inner {
  position: relative;
  /* The headline sizes itself to this column (cqi), see .headline. */
  container-type: inline-size;
  padding-top: calc(7rem + env(safe-area-inset-top));
  padding-bottom: clamp(3rem, 9vh, 6rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.35rem 0.8rem 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  font: 500 13px/1.3 var(--mono);
  color: var(--ink-2);
  animation: rise 0.9s var(--ease-out) both;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30d158;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 2.2s ease-out infinite;
}

@keyframes ping {
  from { transform: scale(1); opacity: 0.7; }
  to   { transform: scale(3.2); opacity: 0; }
}

.headline {
  margin: 1.4rem 0 0;
  font-size: clamp(3.4rem, 12.5vw, 10rem);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.055em;
  /* Without JS (no word split) the whole line rises in. */
  animation: rise 1s var(--ease-out) 0.1s both;
}

/* Wider screens: one line ("Hi, ich bin Kian." is the longer one, about 6.6em) across the text column instead of
   breaking before the name; same size in both languages. Phones keep the two-line headline above. */
@media (min-width: 52rem) {
  .headline { font-size: min(10rem, 14.5cqi); }
}

/* site.js wraps every word in .w > .w-in; each word slides up out of its own clip box. */
.headline.is-split { animation: none; }

.headline .w {
  display: inline-block;
  overflow: hidden;
  /* Room for descenders and the gradient's overhang, without changing the line height. */
  padding: 0.04em 0.06em 0.12em;
  margin: -0.04em -0.06em -0.12em;
  vertical-align: top;
}

.headline .w-in {
  display: inline-block;
  animation: word 1.1s var(--ease-out) both;
  animation-delay: calc(0.15s + var(--i, 0) * 0.09s);
}

.headline.is-static .w-in { animation: none; }

.headline .w-last { padding-right: 0.12em; margin-right: -0.12em; }

.headline .w-last .w-in {
  /* The tight letter-spacing pushes the full stop past the end of the word box, and background-clip: text only
     paints inside the box – extra room on the right keeps the dot whole (the margin takes it back out). */
  padding-right: 0.08em;
  margin-right: -0.08em;
  background: var(--gradient);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: word 1.1s var(--ease-out) both, shimmer 6s ease-in-out infinite alternate;
  animation-delay: calc(0.15s + var(--i, 0) * 0.09s), 1.2s;
}

.headline.is-static .w-last .w-in { animation: shimmer 6s ease-in-out infinite alternate; }

@keyframes word {
  from { transform: translateY(105%) rotate(6deg); }
  to   { transform: none; }
}

@keyframes shimmer {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

.lead {
  max-width: 32rem;
  margin: 1.6rem 0 0;
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.5;
  color: var(--ink-2);
  animation: rise 1s var(--ease-out) 0.55s both;
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
  animation: rise 1s var(--ease-out) 0.8s both;
  transition: filter 0.4s ease;
}

/* site.js adds .is-scrolled to the nav once the visitor scrolls – the cue has done its job.
   (filter instead of opacity: the intro animation already owns opacity.) */
.is-scrolled ~ main .scroll-cue { filter: opacity(0); pointer-events: none; }

.scroll-track {
  position: relative;
  width: 1px;
  height: 2.6rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 15%, transparent);
}

/* A short bright segment glides down the track; invisible at both ends, so the loop has no visible jump. */
.scroll-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 40%;
  background: var(--ink);
  animation: cue 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes cue {
  0%   { transform: translateY(-100%); opacity: 0; }
  25%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { transform: translateY(250%); opacity: 0; }
}

/* ---------- Page background with parallax ---------- */
body {
  position: relative;
  isolation: isolate;   /* lets the z-index:-1 background layer paint above the body background */
}

.bg-orbs {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.35;   /* quiet: a hint of colour, not glowing blobs */
}

.orb {
  --size: min(48rem, 120vw);
  position: absolute;
  width: var(--size);
  aspect-ratio: 1;
  view-timeline: --orb block;   /* the wrapper stays put; its ::before moves (CSS parallax below) */
}

.orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  will-change: translate;
}

/* --s = parallax speed: 0.6 = moves 60 % slower than the page. */
.orb-1 { --s: 0.6; top: 95vh; left: -20%; }
.orb-2 { --s: 0.45; top: 165vh; right: -25%; }
.orb-3 { --s: 0.7; top: 235vh; left: 10%; }
.orb-1::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent); }
.orb-2::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 15%, transparent), transparent); }
.orb-3::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-3) 12%, transparent), transparent); }

/* Holder for shared SVG definitions (filters); takes no space. */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Sections ---------- */
.section {
  padding-top: clamp(4.5rem, 12vh, 8rem);
}

/* The ghost words may be wider than the screen. Clipped here at the screen edges, not per section: a section is
   only as wide as the content column, and on wide screens the word would be cut off there. */
main { overflow-x: clip; }

.section-head {
  position: relative;
  view-timeline: --head block;   /* drives the sideways drift of its .ghost word */
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Huge outlined word behind a section title; drifts sideways while scrolling (site.js, data-parallax-x). */
.ghost {
  position: absolute;
  left: -0.05em;
  bottom: -0.12em;
  z-index: -1;
  font-size: clamp(5rem, 17vw, 14rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.06em;
  white-space: nowrap;
  /* Solid text turned into a single outline by the SVG filter #ghost-outline (index.html); the faintness comes from
     opacity, which applies after the filter. Without filter support the word is simply a faint solid shape. */
  color: var(--ink);
  filter: url(#ghost-outline);
  opacity: 0.12;
  pointer-events: none;
  user-select: none;
  will-change: translate;
}

.ghost-l { --sx: 1; }
.ghost-r { --sx: -1; }

.section-num {
  font: 500 14px/1 var(--mono);
  color: var(--warm);
}

.section-title {
  margin: 0;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -0.035em;
}

/* Scroll reveal: site.js adds .is-hidden only to elements that start below the fold, then removes it when they
   scroll in. Without JS (or with reduced motion) everything is simply visible. */
[data-reveal] {
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  transition-delay: var(--d, 0s);
}

[data-reveal].is-hidden {
  opacity: 0;
  transform: translateY(24px);
}

/* ---------- About ---------- */
/* Big statement text. With JS (.is-scrub) every word starts faint and lights up while the paragraph scrolls
   through the viewport (site.js toggles .on on span.sw); without JS it is simply fully visible. */
.about-text {
  max-width: 48rem;
  margin: 0;
  font-size: clamp(1.6rem, 3.9vw, 2.9rem);
  line-height: 1.16;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.about-hl {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Split by site.js: the gradient sits on every word (background-position set per word, so it runs across). */
.about-hl.is-split { background: none; }
.about-hl .sw {
  background: var(--gradient);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.is-scrub .sw {
  opacity: 0.14;
  transition: opacity 0.45s ease;
}

.is-scrub .sw.on { opacity: 1; }

/* About: text left, photo right from 52rem; on phones the photo follows the text. */
.about-grid { display: grid; gap: clamp(2rem, 5vw, 3rem); }

@media (min-width: 52rem) {
  .about-grid { grid-template-columns: minmax(0, 1fr) 22rem; align-items: center; }
  .about-grid .about-text { font-size: clamp(1.9rem, 2.9vw, 2.45rem); }
}

.about-photo { position: relative; margin: 0; max-width: 24rem; }

/* Soft colour light behind the picture (radial gradients: cheap, no blur filter). */
.about-photo::before {
  content: "";
  position: absolute;
  inset: -12% -14%;
  z-index: -1;
  background:
    radial-gradient(closest-side at 30% 35%, color-mix(in srgb, var(--accent) 26%, transparent), transparent),
    radial-gradient(closest-side at 72% 70%, color-mix(in srgb, var(--accent-3) 20%, transparent), transparent);
  opacity: 0.35;
  pointer-events: none;
}

.ap-frame {
  view-timeline: --photo block;   /* drives the reveal and the drift of the picture (see the @supports block) */
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-2);
  box-shadow: var(--shadow);
}

.ap-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;   /* the face sits in the lower middle of the picture */
}

/* Interests: a row of small chips; on hover (mouse) a chip lifts and its icon turns into the accent. */
.interests { margin-top: clamp(2.2rem, 5vh, 3rem); }

.interests-label {
  margin: 0 0 0.9rem;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition: transform 0.4s var(--ease-out), border-color 0.3s ease, box-shadow 0.4s var(--ease-out);
}

.chip svg { flex: none; color: var(--accent); transition: color 0.3s ease, transform 0.4s var(--ease-out); }

@media (hover: hover) {
  .chip:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent-2) 40%, transparent);
    box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--accent-2) 60%, transparent);
  }
  .chip:hover svg { transform: rotate(-10deg) scale(1.1); }
}

/* Timeline ("logbook"): a rail on the left (phones) or between date and content (from 52rem). */
.timeline {
  --rail: 0.45rem;
  position: relative;
  /* .tl-fly is as high as the rail and moves down by its own height, so its (empty) box ends a whole rail below the
     timeline; without the clip that box made the page scrollable far past the footer. */
  overflow-y: clip;
  margin-top: clamp(4rem, 11vh, 7rem);
}

@media (min-width: 52rem) {
  .timeline { --rail: 11rem; }
}

.tl-label {
  margin: 0 0 2.4rem;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.interests-label::before,
.tl-label::before {
  content: "";
  display: inline-block;
  width: 1.6rem;
  height: 1px;
  margin-right: 0.7rem;
  vertical-align: middle;
  background: var(--warm);
}

/* The track: dashed, from "Today" down to the last entry. site.js sets its exact height (--h). */
.tl-rail {
  position: absolute;
  left: var(--rail);
  top: 4.4rem;
  bottom: 2rem;
  width: 2px;
  margin-left: -1px;
  background: repeating-linear-gradient(to bottom, var(--dashed) 0 5px, transparent 5px 11px);
  pointer-events: none;
}

.js-timeline.is-live .tl-rail { bottom: auto; height: var(--h, 0px); }

/* The contrail: grows downwards behind the plane (scaleY 0 → 1). Only transform is animated, so it runs on the
   compositor: driven by CSS scroll-driven animations where supported, otherwise site.js writes the transform. */
.tl-fill {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2) 55%, var(--accent-3));
  transform-origin: 50% 0;
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent-2) 45%, transparent);
  will-change: transform;
}

/* As high as the rail; moving it down by 100 % of its own height carries the plane (at its top) to the end. */
.tl-fly {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;   /* the plane flies over the waypoints and the "+N more" markers, never under them */
  will-change: transform;
}

.js-timeline.is-live .tl-fly { display: block; }

.tl-plane {
  position: absolute;
  left: 50%;
  top: 0;
  display: grid;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent);
  transition: opacity 0.5s ease;
}

/* Arrived at the oldest entry: the plane "lands" and fades into the last waypoint. */
.js-timeline.is-landed .tl-plane { opacity: 0; }

/* Nose down: the plane flies back in time, from today to the oldest entry. Scrolling back up (.is-up, site.js)
   it turns round (through nose-right) and flies nose up. */
.tl-plane svg { display: block; transform: rotate(90deg); overflow: visible; transition: transform 0.45s ease; }
.js-timeline.is-up .tl-plane svg { transform: rotate(-90deg); }
.tl-plane path { fill: var(--ink); }

.tl-now {
  position: absolute;
  left: var(--rail);
  top: 3.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  transform: translateX(-0.75rem);
}

.tl-now .pulse { width: 7px; height: 7px; }

.tl-list {
  list-style: none;
  margin: 0;
  padding: 3.6rem 0 0;
}

.tl-item {
  position: relative;
  padding: 0 0 clamp(2.6rem, 6vh, 3.6rem) calc(var(--rail) + 2rem);
}

.tl-item:last-child { padding-bottom: 0; }

/* Waypoint on the rail. Lights up (gradient + one ping) when the plane passes it. */
.tl-node {
  position: absolute;
  left: var(--rail);
  top: 0.35rem;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  transition: border-color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

.tl-node::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-2);
  opacity: 0;
}

.tl-date {
  margin: 0 0 0.45rem;
  font: 500 13px/1.3 var(--mono);
  letter-spacing: 0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 52rem) {
  .tl-date {
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: calc(var(--rail) - 2rem);
    margin: 0;
    text-align: right;
  }
}

.tl-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.tl-org {
  margin: 0.35rem 0 0;
  color: var(--ink-2);
}

.tl-loc { color: var(--ink-3); }

.tl-points {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  color: var(--ink-2);
}

.tl-points li {
  position: relative;
  padding-left: 1.1rem;
}

.tl-points li + li { margin-top: 0.2rem; }

.tl-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.45rem;
  height: 1.5px;
  border-radius: 1px;
  background: var(--accent-2);
}

/* With JS: entries wait faint until the plane reaches them. */
.is-live .tl-item > :not(.tl-node) {
  opacity: 0.28;
  transform: translateX(10px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.is-live .tl-item.is-passed > :not(.tl-node) { opacity: 1; transform: none; }
.is-live .tl-item:not(.is-passed) .tl-node { border-color: var(--dashed); }

.is-live .tl-item.is-passed .tl-node {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.is-live .tl-item.is-passed .tl-node::after { animation: ring 1.4s ease-out 1; }

/* Less important entries (.tl-minor): a little quieter. */
.tl-minor .tl-title { font-size: clamp(1.1rem, 1.9vw, 1.3rem); }
.tl-minor .tl-node { width: 11px; height: 11px; margin-left: -5.5px; top: 0.45rem; }

/* Short / Full switch next to the "Logbook" label (shown and wired by site.js). The short logbook is in index.html, the
   full one is fetched from /members/ (signed-in visitors only). Signed out, "Full" opens p.tl-lock: a small note
   under the switch, absolutely positioned so the rail below does not move. */
.tl-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin: 0 0 2.4rem;
}
.tl-head .tl-label { margin: 0; }
.tl-mode[hidden] { display: none; }
.tl-mode button { min-height: 1.7rem; padding: 0.2rem 0.75rem; font-size: 11px; }
.tl-lock {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  z-index: 4;
  max-width: min(22rem, 100%);
  margin: 0;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.5;
}
.tl-lock[hidden] { display: none; }
.tl-lock a { color: var(--accent); font-weight: 600; }

/* ---------- Project cards ---------- */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

/* Pinboard: every tile has its own size – 12 columns, each card placed by its class. Roughly the order of the
   departures board: the uni projects first, then my own projects; ADAPT and the flight simulator get the most room.
     rows 1–2: desk lamp 4 × 2 (a tall tile, the sketch fills it) | Astromechanics 4 × 1 and CabinFlexLab 4 × 1
               (row 1), flight simulator 8 × 2 below them (rows 2–3); drawings above the text
     row 3:    Tailkeeper 4 × 1 below the lamp, left of the flight simulator (before ADAPT in time)
     row 4:    Tailkeeper in the browser 4 × 1 below it, a small one-row tile (the flight simulator spans rows 2–4)
     row 5:    ADAPT 12 × 1 below all of them (text left, the model right)
     rows 6–7: Travel Planner 8 × 2 | Food Planner 4 × 2
     rows 8–9: My world map 7 × 2   | Atlas 5 × 1 (row 8), next project 5 × 1 (row 9)
   Every tile hangs slightly crooked on a pin and straightens up on hover (the big ones only a little crooked, a large
   tilt looks broken on a wide tile). Phones: one column in the order of the HTML (the same order). */
@media (min-width: 52rem) {
  .cards {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.25rem;
  }
  .cards-cad { grid-column: 1 / span 4; grid-row: 1 / span 2; }
  .cards-astro { grid-column: 5 / span 4; grid-row: 1; }
  .cards-fm { grid-column: 9 / span 4; grid-row: 1; }
  .cards-sim { grid-column: 5 / span 8; grid-row: 2 / span 3; }
  .cards-tb { grid-column: 1 / span 4; grid-row: 3; }
  .cards-tbweb { grid-column: 1 / span 4; grid-row: 4; }
  .cards-adapt { grid-column: 1 / span 12; grid-row: 5; }
  .cards-main { grid-column: 1 / span 8; grid-row: 6 / span 2; }
  .cards-food { grid-column: 9 / span 4; grid-row: 6 / span 2; }
  .cards-map { grid-column: 1 / span 12; grid-row: 8; }
  .cards-atlas { grid-column: 1 / span 4; grid-row: 9; }
  .cards-iv { grid-column: 5 / span 4; grid-row: 9; }
  .cards-soon { grid-column: 9 / span 4; grid-row: 9; }
}

.cards > li { display: flex; position: relative; }

.cards > li { rotate: var(--tilt, 0deg); transform-origin: 50% 22px; transition: rotate 0.9s linear(0.000, 0.212, 0.384, 0.523, 0.634, 0.723, 0.792, 0.846, 0.887, 0.919, 0.943, 0.961, 0.974, 0.984, 0.991, 0.995, 0.998, 1.001, 1.002, 1.003, 1.003, 1.003, 1.003, 1.003, 1.002, 1.002, 1.002, 1.002, 1.001, 1.001, 1); }
.cards-main { --tilt: -0.4deg; }
.cards-food { --tilt: 0.9deg; }
.cards-soon { --tilt: -0.7deg; }
.cards-map { --tilt: 0.2deg; }
.cards-atlas { --tilt: 1.1deg; }
.cards-iv { --tilt: -0.6deg; }
.cards-adapt { --tilt: -0.25deg; }
.cards-cad { --tilt: -0.5deg; }
.cards-astro { --tilt: 0.6deg; }
.cards-fm { --tilt: 0.3deg; }
.cards-sim { --tilt: -0.3deg; }
.cards-tb { --tilt: 0.5deg; }
.cards-tbweb { --tilt: -0.9deg; }

@media (hover: hover) {
  .cards > li:hover { rotate: 0deg; }
}

/* The pin: a small ball-head pin stuck in the card face (pin.svg, flat colours, one flat shade, its shadow falls on the
   card). The tile hangs from it: every tile turns around the point where the needle goes in (50% / 22px), so pin and
   tile stay joined, and on hover it straightens with a soft overshoot. */
.card-pin {
  position: absolute;
  top: 3px;
  left: 50%;
  z-index: 2;
  width: 30px;
  height: 30px;
  margin-left: -17px;
  background: url("pin.svg") 0 0 / 30px 30px no-repeat;
  pointer-events: none;
}

.cards-side .card-title { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
/* The four project tiles share one title size, label and text style (Astromechanics is a side tile but not smaller). */
.cards-astro .card-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }

/* The big tile is as tall as the two on the right: its route fills the room in the middle. */
.cards-main .card-art,
.cards-food .card-art { flex: 1; display: flex; align-items: center; }

/* ADAPT: a wide tile – icon/tag and text on the left, the rendering on the right from 52rem; on phones the picture sits
   between the top row and the text like the other cards' art. */
.adapt-art { position: relative; overflow: hidden; border: 1px solid var(--border); }
/* The turning model (site.js loads the viewer) lies over the photo. Once it is ready its panel covers the photo at
   once and only the model itself fades in; fading the whole layer let the photo shine through the model's edges. */
.adapt-model {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: var(--bg-2);
}
.adapt-model.is-ready { opacity: 1; }
/* Once the model covers it, hide the photo: at the rounded clip edge both layers are only partly drawn, and the
   bright photo showed through as a thin light frame (seen on the small phone thumbnail). */
.adapt-art:has(.adapt-model.is-ready) img { visibility: hidden; }
.adapt-model.is-error { display: none; }

.adapt-model .model-canvas { display: block; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 0.9s var(--ease-out); }
.adapt-model.is-ready .model-canvas { opacity: 1; }
.adapt-art img { display: block; width: 100%; height: auto; transition: transform 0.8s var(--ease-out); }
@media (hover: hover) {
  .cards-adapt a.card:hover .adapt-art img { transform: scale(1.03); }
}
/* The design animation on the ADAPT tile (desktop only, it fills the room above the text), the way the aircraft was
   designed: the requirements are ticked off (payload, range, take-off distance), the constraint diagram is drawn
   (power-to-weight over wing loading, the curves of the sizing cases, the feasible region and the design point), then
   the HAR configuration appears in top view, its outline traced from the 3D model. The step names below light up in
   turn. SMIL; with reduced motion site.js stops it at data-rest (the finished aircraft). */
.adapt-flow { display: none; }
.adapt-flow svg { display: block; width: 100%; max-width: 24rem; height: auto; overflow: visible; }
.af-box { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.af-tick { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; }
.af-req { font: 500 11px/1 var(--mono); fill: var(--ink-2); }
.af-val { font: 600 12px/1 var(--mono); fill: var(--warm); }
.af-axis { fill: none; stroke: color-mix(in srgb, var(--ink-3) 70%, transparent); stroke-width: 1.2; }
.af-ax { font: 500 10px/1 var(--mono); fill: var(--ink-3); }
.af-curve { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 1 1; }
.af-land { stroke-dasharray: 1 1; stroke: var(--ink-3); }
.af-region { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.af-ring { fill: none; stroke: var(--warm); stroke-width: 1.2; }
.af-dot { fill: var(--warm); }
.af-plane { fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linejoin: round; stroke-dasharray: 1 1; }
.af-plane-fill { fill: color-mix(in srgb, var(--accent) 24%, transparent); }
.af-step { font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; fill: var(--ink-2); }
.adapt-sub { display: block; margin-top: 0.35rem; font: 500 13px/1.3 var(--mono); color: var(--ink-3); }
@media (min-width: 52rem) {
  /* ADAPT, the one wide tile: icon, tag and arrow across the top; below it on the left the small design
     animation above the text, the turning model right. */
  .cards-adapt .card {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
  }
  .cards-adapt .card-top { grid-column: 1 / -1; grid-row: 1; }
  /* The animation only takes the room the model panel leaves free above the text (it never makes the tile taller):
     it fills its grid cell absolutely and scales to fit it (preserveAspectRatio meet, left-aligned). */
  .cards-adapt .adapt-flow { display: block; position: relative; grid-column: 1; grid-row: 2; min-height: 6rem; margin: 0.25rem 0 1rem; }
  .cards-adapt .adapt-flow svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
  .cards-adapt .card-body { grid-column: 1; grid-row: 3; align-self: end; }
  .cards-adapt .adapt-art { grid-column: 2; grid-row: 2 / -1; margin-bottom: 0; }
  /* A tile that is taller than its drawing (its row neighbour sets the height): the drawing takes the free room and
     sits centred in it instead of leaving a gap above the text. The lamp's sketch becomes a portrait 2 : 3, centred (its SVG
     crops the empty sides, preserveAspectRatio slice), so the lamp is drawn big; in the link preview the card has no fixed height, so it keeps
     its normal size there. */
  .cards-cad .dl-art { display: flex; align-items: center; }
  .cards-cad .dl-art svg { height: auto; aspect-ratio: 2 / 3; }
  .cards-cad .dl-art,
  .cards-fm .fm-art,
  .cards-tb .tb-art,
  .cards-sim .sim-art { flex: 1; }
}

/* Desk lamp: a CAD sketch of the lamp that draws itself. Every 11 s base plate, arm, socket and bulb are traced, the
   dimensions fade in, the bulb lights up, and everything fades for the next round. The resting state (reduced motion,
   link preview) is the finished sketch with the bulb on. */
.dl-art { display: flex; align-items: center; }
.dl-art svg { display: block; width: 100%; height: auto; overflow: visible; }
/* Dash 1, gap 2 (not 1 1): with a gap of only 1 the next dash starts exactly at the end of an undrawn path, and its
   round cap shows as a dot (on the closed bulb circle even before it is drawn). */
.dl-line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 2; }
.dl-base { stroke: var(--warm); }
.dl-bulb { stroke: color-mix(in srgb, var(--accent) 70%, var(--ink)); stroke-width: 1.8; }
.dl-fil { stroke: var(--warm); stroke-width: 1.3; }
.dl-dim path { fill: none; stroke: color-mix(in srgb, var(--accent) 60%, transparent); stroke-width: 1; }
.dl-dim text { font: 500 10px/1 var(--mono); fill: var(--ink-3); }
.dl-glow-1 { stop-color: var(--warm); stop-opacity: 0.45; }
.dl-glow-2 { stop-color: var(--warm); stop-opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .dl-base { animation: dl-base 11s linear infinite; }
  .dl-arm { animation: dl-arm 11s linear infinite; }
  .dl-socket { animation: dl-socket 11s linear infinite; }
  .dl-bulb { animation: dl-bulb 11s linear infinite; }
  .dl-fil { animation: dl-fil 11s linear infinite; }
  .dl-dim { animation: dl-dim 11s linear infinite; }
  .dl-light { animation: dl-light 11s ease-in-out infinite; }
}
@keyframes dl-base {
  0% { stroke-dashoffset: 1; opacity: 1; }
  10%, 90% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes dl-arm {
  0%, 8% { stroke-dashoffset: 1; opacity: 1; }
  26%, 90% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes dl-socket {
  0%, 25% { stroke-dashoffset: 1; opacity: 1; }
  31%, 90% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes dl-bulb {
  0%, 30% { stroke-dashoffset: 1; opacity: 1; }
  42%, 90% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes dl-fil {
  0%, 42% { stroke-dashoffset: 1; opacity: 1; }
  48%, 90% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes dl-dim {
  0%, 46% { opacity: 0; }
  54%, 90% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes dl-light {
  0%, 56% { opacity: 0; }
  62% { opacity: 1; }
  64% { opacity: 0.55; }
  67%, 88% { opacity: 1; }
  100% { opacity: 0; }
}

/* CabinFlexLab: a sketch of one module. Every 9.5 s the frame and the roller blind are traced, the module pulls
   apart (the right post on its inner rods, the blind following), the pins drop into the hole grid, the QR markers
   appear and link up to the VR headset, then everything fades for the next round. The resting state (reduced motion,
   link preview) is the extended module with markers and headset. The post moves 144 px = 9 holes of the grid. */
.fm-art { display: flex; align-items: center; }
.fm-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.fm-floor { fill: none; stroke: color-mix(in srgb, var(--ink-3) 50%, transparent); stroke-width: 1.2; }
.fm-holes { fill: color-mix(in srgb, var(--ink-3) 70%, transparent); }
.fm-line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.fm-rods { stroke: var(--ink-3); stroke-width: 1.6; }
.fm-roll { stroke: var(--warm); }
.fm-blind {
  fill: color-mix(in srgb, var(--accent) 16%, transparent);
  stroke: color-mix(in srgb, var(--accent) 60%, transparent);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: left center;
  transform: scaleX(1.923);
}
.fm-move { transform: translateX(144px); }
.fm-pin { fill: none; stroke: var(--warm); stroke-width: 3; stroke-linecap: round; }
.fm-qr rect { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 1.6; }
.fm-qr path { fill: var(--accent); }
.fm-ray { fill: none; stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-width: 1.2; stroke-dasharray: 3 5; }
.fm-vr path, .fm-vr circle { stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.fm-vr-strap { fill: none; stroke-width: 7; opacity: 0.75; }
.fm-vr-visor { fill: var(--surface-solid); stroke-width: 2.2; }
.fm-vr-lens { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke-width: 1.6; }
@media (prefers-reduced-motion: no-preference) {
  .fm-frame { animation: fm-frame 9.5s linear infinite; }
  .fm-roll { animation: fm-roll 9.5s linear infinite; }
  .fm-rods, .fm-post { animation: fm-frame 9.5s linear infinite; }
  .fm-blind { animation: fm-blind 9.5s ease-in-out infinite; }
  .fm-move { animation: fm-move 9.5s ease-in-out infinite; }
  .fm-pin { animation: fm-pin 9.5s ease-in-out infinite; }
  .fm-qr { animation: fm-qr 9.5s linear infinite; }
  .fm-ray, .fm-vr { animation: fm-vr 9.5s linear infinite; }
  .fm-holes, .fm-floor { animation: fm-fade 9.5s linear infinite; }
}
@keyframes fm-frame {
  0% { stroke-dashoffset: 1; opacity: 1; }
  16%, 90% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes fm-roll {
  0%, 14% { stroke-dashoffset: 1; opacity: 1; }
  22%, 90% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes fm-blind {
  0%, 20% { transform: scaleX(1); opacity: 0; }
  26% { transform: scaleX(1); opacity: 1; }
  46%, 90% { transform: scaleX(1.923); opacity: 1; }
  100% { transform: scaleX(1.923); opacity: 0; }
}
@keyframes fm-move {
  0%, 26% { transform: translateX(0); opacity: 1; }
  46%, 90% { transform: translateX(144px); opacity: 1; }
  100% { transform: translateX(144px); opacity: 0; }
}
@keyframes fm-pin {
  0%, 48% { opacity: 0; transform: translateY(-10px); }
  54%, 90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}
@keyframes fm-qr {
  0%, 56% { opacity: 0; }
  62%, 90% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fm-vr {
  0%, 64% { opacity: 0; }
  72%, 90% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fm-fade {
  0%, 90% { opacity: 1; }
  100% { opacity: 0; }
}

/* Flight simulator: a small glass cockpit, the primary flight display (PFD) left and the navigation display (ND) right,
   while the autopilot flies a mission every 13.4 s: takeoff roll, climb, level off, a turn, descent, ILS approach,
   landing. The SVG and all motion (SMIL on one clock) are written by tools/flight-sim-card.py, only the look is here.
   The screens stay dark in both themes like real displays, with the usual cockpit colours (green modes, magenta
   targets, cyan selections, yellow aircraft symbol). The resting state (reduced motion, link preview) is data-rest:
   the turn in cruise. */
.card-art.sim-art { display: flex; align-items: center; }
.sim-art svg { display: block; width: 100%; height: auto; }
.sim-svg {
  --sim-ink: #e6edf6; --sim-dim: #7f8ea5; --sim-green: #5fd38a; --sim-cyan: #5ed3f0; --sim-magenta: #e66ad9;
  --sim-yellow: var(--warm-hi);
}
.sim-screen { fill: #0a111d; stroke: color-mix(in srgb, var(--ink-3) 45%, transparent); stroke-width: 1.5; }
.sim-t { font: 600 8px/1 var(--mono); fill: var(--sim-ink); text-anchor: middle; }
.sim-sky { fill: #2f6db0; }
.sim-ground { fill: #7a4f2c; }
.sim-horizon { fill: none; stroke: #fff; stroke-width: 1.2; }
.sim-ladder { fill: none; stroke: #fff; stroke-width: 1; opacity: .85; }
.sim-ladder-t text { font-size: 6.5px; }
.sim-roll { fill: none; stroke: #fff; stroke-width: 1.1; }
.sim-roll-zero, .sim-roll-ptr { fill: var(--sim-yellow); }
.sim-symbol { fill: #05080d; stroke: var(--sim-yellow); stroke-width: 1.6; stroke-linejoin: round; }
.sim-fd { fill: none; stroke: var(--sim-green); stroke-width: 1.6; stroke-linecap: round; opacity: .9; }
.sim-dev-scale { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.sim-dev { fill: var(--sim-magenta); }
.sim-tape { fill: rgba(255, 255, 255, 0.07); }
.sim-tick, .sim-compass { fill: none; stroke: var(--sim-ink); stroke-width: 1; }
.sim-tape-t { text-anchor: end; }
.sim-alt-t, .sim-tape-t text { font-size: 7.5px; }
.sim-alt-t { text-anchor: start; }
.sim-gnd { fill: #e5484d; }
.sim-ref { fill: var(--sim-yellow); stroke: var(--sim-yellow); stroke-width: 2; }
.sim-bug { fill: var(--sim-magenta); }
.sim-sel { fill: #05080d; stroke: var(--sim-cyan); stroke-width: 1; }
.sim-lelev { fill: var(--sim-cyan); }
.sim-ra { fill: var(--sim-green); font-size: 8px; }
.sim-ra-a { fill: var(--sim-yellow); font-size: 8px; }
.sim-limit { fill: none; stroke: var(--sim-green); stroke-width: 1.2; }
.sim-hdg-t { font-size: 6.5px; }
.sim-ils { fill: var(--sim-magenta); text-anchor: start; font-size: 7px; }
.sim-ils .sim-ils-c { fill: var(--sim-cyan); font-size: 6px; }
.sim-spd-s { fill: var(--sim-green); font-size: 7px; }
.sim-gdot { fill: none; stroke: var(--sim-green); stroke-width: 1.2; }
.sim-qnh { fill: var(--sim-ink); text-anchor: start; font-size: 6.5px; }
.sim-qnh-v { fill: var(--sim-cyan); }
.sim-std { fill: var(--sim-cyan); font-size: 6.5px; }
.sim-std-box { fill: none; stroke: var(--sim-yellow); stroke-width: 0.9; }
.sim-tc { fill: none; stroke: var(--sim-ink); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.sim-vs-bg { fill: rgba(255, 255, 255, 0.07); }
.sim-vs-t { fill: var(--sim-ink); text-anchor: end; font-size: 5.5px; }
.sim-vs-v { fill: var(--sim-green); font-size: 6px; }
.sim-sel-t { fill: var(--sim-cyan); }
.sim-sel-big { fill: var(--sim-cyan); font-size: 9px; text-anchor: end; }
.sim-sel-small { fill: var(--sim-cyan); font-size: 7px; text-anchor: end; }
.sim-sel-bg { fill: #0a111d; }
.sim-vs { stroke: var(--sim-ink); stroke-width: 1.6; stroke-linecap: round; }
.sim-fma { fill: var(--sim-green); }
.sim-fma-w { fill: var(--sim-ink); }
.sim-fma-b { fill: var(--sim-cyan); }
.sim-fma, .sim-fma-w, .sim-fma-b { font-size: 6.6px; }
.sim-fma-sep { fill: none; stroke: var(--sim-dim); stroke-width: 1; }
.sim-fma-box { fill: none; stroke: var(--sim-ink); stroke-width: 0.9; }
.sim-compass-t text { font-size: 8.5px; }
.sim-route { fill: none; stroke: var(--sim-green); stroke-width: 2; stroke-linejoin: round; }
.sim-rwy { fill: none; stroke: var(--sim-ink); stroke-width: 1.4; }
.sim-wpt path { fill: none; stroke: var(--sim-green); stroke-width: 1.2; }
.sim-wpt text { fill: var(--sim-green); text-anchor: start; font-size: 7px; }
.sim-vor path, .sim-vor circle { fill: none; stroke: var(--sim-cyan); stroke-width: 1; }
.sim-vor text { fill: var(--sim-cyan); text-anchor: start; font-size: 7px; }
.sim-vor1 { fill: none; stroke: var(--sim-ink); stroke-width: 1.1; stroke-linecap: round; }
.sim-vor1-t text { text-anchor: start; font-size: 7px; }
.sim-wpt-to path { fill: none; stroke: var(--sim-ink); stroke-width: 1.2; }
.sim-wpt-to text { fill: var(--sim-ink); text-anchor: start; font-size: 7px; }
.sim-compass-t .sim-compass-s { font-size: 6px; }
.sim-range-t { fill: var(--sim-cyan); font-size: 6.5px; }
.sim-lubber { stroke: var(--sim-yellow); stroke-width: 2; stroke-linecap: round; }
.sim-trk { fill: none; stroke: var(--sim-green); stroke-width: 1.2; }
.sim-wind { fill: none; stroke: var(--sim-green); stroke-width: 1.2; stroke-linecap: round; }
.sim-nd-l { fill: var(--sim-ink); text-anchor: start; font-size: 6.5px; }
.sim-nd-v { fill: var(--sim-green); text-anchor: start; font-size: 7.25px; }
.sim-nd-to { fill: var(--sim-ink); text-anchor: end; font-size: 7.25px; }
.sim-nd-c { fill: var(--sim-cyan); text-anchor: end; font-size: 6.5px; }
.sim-alt-win { fill: #05080d; stroke: var(--sim-yellow); stroke-width: 1.2; }
.sim-alt-big { fill: var(--sim-green); font-size: 9px; }
.sim-alt-small { fill: var(--sim-green); font-size: 7px; }
.sim-vam { fill: #e5484d; }
.sim-vap { fill: url(#sim-ab); }
.sim-vls { fill: #f5a524; }
.sim-vmax { fill: url(#sim-rb); }
.sim-v1 { fill: var(--sim-cyan); text-anchor: start; font-size: 7px; }
.sim-bug-t { fill: var(--sim-magenta); font-size: 7px; }
.sim-trend { stroke: var(--sim-yellow); stroke-width: 1.2; }
.sim-trend-head { fill: none; stroke: var(--sim-yellow); stroke-width: 1.2; stroke-linejoin: round; }
.sim-range { fill: none; stroke: var(--sim-dim); stroke-width: 1; stroke-dasharray: 3 4; }
.sim-hdg-ptr { fill: var(--sim-yellow); }
.sim-own { fill: none; stroke: var(--sim-yellow); stroke-width: 2; stroke-linecap: round; }

/* Astromechanics: the mission in miniature. Every 10 s the probe flies from Earth to Jupiter (the transfer draws behind
   it), then the steep observation orbit, and the drawing fades for the next round. The motion is SMIL in index.html
   written by tools/astromechanics-card.py: the probe timed by Kepler's second law (fast near the Sun, slow far out), the
   planets up to Jupiter circling at their real speed from the launch constellation, small labels on the Sun, Earth,
   Jupiter and the probe. The resting state (reduced motion, link preview) is data-rest: the finished drawing without
   the probe. */
/* The art takes the free height next to the taller desk lamp card, the drawing centred in it. */
.cards-astro .am-art { flex: 1; display: flex; align-items: center; }
.am-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.am-orb { fill: none; stroke-width: 1.4; }
.am-orb-e { stroke: color-mix(in srgb, var(--accent) 55%, transparent); }
.am-orb-j { stroke: color-mix(in srgb, var(--ink-3) 45%, transparent); stroke-dasharray: 2 5; }
.am-orb-p { stroke: color-mix(in srgb, var(--ink-3) 25%, transparent); stroke-width: 1; }
.am-pl { fill: var(--ink-3); }
.am-label { font: 600 10px/1 var(--mono); fill: var(--ink-3); letter-spacing: 0.02em; }
.am-tr, .am-ob { fill: none; stroke-linecap: round; stroke-dasharray: 1; }
.am-tr { stroke: var(--accent); stroke-width: 2; }
.am-ob { stroke: var(--warm); stroke-width: 2.6; }
.am-sun { fill: var(--warm); }
.am-sun-glow { fill: color-mix(in srgb, var(--warm) 22%, transparent); }
.am-earth { fill: var(--accent); stroke: var(--surface-solid); stroke-width: 1.5; }
.am-jup { fill: color-mix(in srgb, var(--warm) 55%, var(--ink-3)); stroke: var(--surface-solid); stroke-width: 1.5; }
.am-probe {
  fill: var(--ink);
  stroke: var(--surface-solid);
  stroke-width: 1.5;
}

/* My world map: my map (an SVG image from Atlas, one per theme) and live numbers with progress bars (site.js). From
   52rem the tile spans the full width: map large on the left, title, text and the numbers (2 × 2) on the right. */
.mymap { display: flex; flex: 1; align-items: center; margin-top: 1rem; }
.mymap-stage { position: relative; display: block; width: 100%; }
.mymap img { display: block; width: 100%; height: auto; }
.mymap-foot { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
@media (min-width: 52rem) {
  .cards-map .card {
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    grid-template-rows: auto 1fr;
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
  }
  .cards-map .card-top { grid-column: 1 / -1; }
  .cards-map .mymap { grid-column: 1; grid-row: 2; margin-top: 0.5rem; }
  .cards-map .mymap-foot { grid-column: 2; grid-row: 2; justify-content: flex-end; margin-top: 0; }
  .cards-map .atlas-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Progress under every number: countries of 195, share of the world, continents of 7; cities have no fixed goal, so
   their bar runs to the next round mark, named below it. */
.atlas-meter {
  display: block;
  height: 6px;
  margin-top: 0.4rem;
  overflow: hidden;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink-3) 22%, transparent);
}
.atlas-meter i { display: block; width: var(--share, 0%); height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.9s var(--ease-out); }
.atlas-stat .atlas-next { margin-top: 0.2rem; font-size: 0.72rem; }
.atlas-stats.is-loading .atlas-meter, .atlas-stats.is-loading .atlas-next { visibility: hidden; }
/* City pings: the marked cities light up one after another, a dot and a ring that grows and fades (site.js). */
.map-pings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* One city lights up at a time (site.js adds .is-on): the ring grows from the dot and fades, the dot fades in and out.
   Own layer, so the animation repaints only this small picture, not the card under it. */
.map-pings { will-change: transform; }
.map-ping { fill: none; stroke: var(--warm); stroke-width: 1.8; opacity: 0; transform-box: fill-box; transform-origin: center; }
.map-ping-dot { fill: var(--warm); stroke: var(--surface-solid); stroke-width: 1; opacity: 0; }
.map-ping-g.is-on .map-ping { animation: map-ring 3.2s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.map-ping-g.is-on .map-ping-dot { animation: map-dot 3.2s ease-in-out both; }
.map-pings.is-still .map-ping-dot { opacity: 1; }
@keyframes map-ring {
  0% { opacity: 0; transform: scale(0.15); }
  12% { opacity: 0.8; }
  100% { opacity: 0; transform: scale(1); }
}
@keyframes map-dot {
  0% { opacity: 0; }
  15%, 70% { opacity: 1; }
  100% { opacity: 0; }
}
.mymap-foot .card-body { margin-top: 0; }
.atlas-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 36rem) {
  .atlas-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.atlas-stats[hidden] { display: none; }
.atlas-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.atlas-stat b { font-size: clamp(1.3rem, 2.2vw, 1.65rem); font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.atlas-stat small { font-size: 0.8rem; color: var(--ink-3); }
/* One map per theme – the hidden one is never loaded (loading="lazy"). Same two blocks as the dark tokens. */
.atlas-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .atlas-light { display: none !important; }
  :root:not([data-theme="light"]) .atlas-dark { display: block !important; }
}
:root[data-theme="dark"] .atlas-light { display: none !important; }
:root[data-theme="dark"] .atlas-dark { display: block !important; }

/* Atlas (the app): a globe turning, pins popping up on it, and badges being earned one after the other. */
.at-art svg { display: block; width: 100%; max-height: 7.5rem; overflow: visible; }
.at-globe { fill: color-mix(in srgb, var(--accent) 8%, var(--surface-solid)); stroke: var(--accent); stroke-width: 2; }
.at-lat { fill: none; stroke: color-mix(in srgb, var(--accent) 35%, transparent); stroke-width: 1.2; }
.at-mer {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 45%, transparent);
  stroke-width: 1.2;
  transform-box: fill-box;
  transform-origin: center;
  animation: meridian 9s linear infinite;
}
.at-m2 { animation-delay: -3s; }
.at-m3 { animation-delay: -6s; }
.at-pin { fill: var(--warm-hi); stroke: var(--warm); stroke-width: 1.2; transform-box: fill-box; transform-origin: 50% 100%; animation: pin-pop 6s var(--ease-out) infinite; }
.at-p2 { animation-delay: 0.6s; }
.at-p3 { animation-delay: 1.2s; }
.at-badge { fill: none; stroke: var(--dashed); stroke-width: 2; stroke-dasharray: 4 4; }
.at-num { font: 700 13px var(--sans); text-anchor: middle; fill: var(--ink-3); }
.at-b1, .at-b2 { animation: badge 6s ease-in-out infinite; }
.at-n1, .at-n2 { animation: badge-num 6s ease-in-out infinite; }
.at-b2, .at-n2 { animation-delay: 1s; }
/* A meridian seen from the side: full circle → line → full circle (the globe turns). */
@keyframes meridian {
  0% { transform: scaleX(1); }
  50% { transform: scaleX(0.02); }
  100% { transform: scaleX(1); }
}
@keyframes pin-pop {
  0%, 12% { transform: scale(0); opacity: 0; }
  20%, 82% { transform: scale(1); opacity: 1; }
  92%, 100% { transform: scale(0); opacity: 0; }
}
@keyframes badge {
  0%, 25% { fill: transparent; stroke: var(--dashed); stroke-dasharray: 4 4; }
  35%, 85% { fill: var(--accent); stroke: var(--accent); stroke-dasharray: none; }
  95%, 100% { fill: transparent; stroke: var(--dashed); stroke-dasharray: 4 4; }
}
@keyframes badge-num {
  0%, 25% { fill: var(--ink-3); }
  35%, 85% { fill: var(--on-accent); }
  95%, 100% { fill: var(--ink-3); }
}

/* Interviewer: talking points ticking themselves off on a note sheet, two speech bubbles appearing in turn. The base
   styles are the finished state (reduced motion, link preview). */
.iv-art svg { display: block; width: 100%; max-height: 7.5rem; overflow: visible; }
.iv-sheet { fill: var(--surface-solid); stroke: var(--border); stroke-width: 1.5; }
.iv-line { fill: none; stroke: var(--ink-3); stroke-width: 2.5; stroke-linecap: round; }
.iv-box { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.iv-tick { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12; stroke-dashoffset: 0; animation: tick 6.6s ease-in-out infinite; }
.iv-t2 { animation-delay: 0.8s; }
.iv-t3 { animation-delay: 1.6s; }
.iv-q { fill: color-mix(in srgb, var(--accent) 8%, var(--surface-solid)); stroke: var(--border); stroke-width: 1.5; }
.iv-a { fill: var(--accent); }
.iv-aline { fill: none; stroke: var(--on-accent); stroke-width: 2.5; stroke-linecap: round; opacity: 0.85; }
.iv-say { transform-box: fill-box; transform-origin: 20% 100%; animation: iv-say 6.6s var(--ease-out) infinite; }
.iv-s2 { transform-origin: 80% 100%; animation-delay: 1.2s; }
@keyframes iv-say {
  0%, 10% { opacity: 0; transform: translateY(4px) scale(0.92); }
  18%, 82% { opacity: 1; transform: none; }
  92%, 100% { opacity: 0; transform: translateY(4px) scale(0.92); }
}

/* Tailkeeper: a flight is entered on the phone (three fields write themselves, Save is tapped), a dot carries it over to
   the browser and it appears there as a new row of the logbook (pilot C), briefly highlighted. In the card icon the
   tail fin of the logo draws itself. 8 s loop, transform/opacity only; the base styles are the finished state (all
   fields and rows written), which is what reduced motion and the link preview show. */
.tb-art { display: flex; align-items: center; }
.tb-art svg { display: block; width: 100%; height: auto; max-height: 9rem; overflow: visible; }
.tb-sheet { fill: var(--surface-solid); stroke: var(--border); stroke-width: 1.5; }
.tb-head { stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; opacity: 0.6; }
.tb-rule { stroke: var(--border); stroke-width: 1; }
.tb-ava { fill: color-mix(in srgb, var(--accent) 14%, var(--surface-solid)); stroke: var(--accent); stroke-width: 1.4; }
.tb-who { font: 600 8px/1 var(--mono); fill: var(--accent); text-anchor: middle; }
.tb-line { stroke: var(--ink-3); stroke-width: 2.5; stroke-linecap: round; }
.tb-min { stroke: var(--warm); stroke-width: 2.5; stroke-linecap: round; }
.tb-dots circle { fill: var(--ink-3); opacity: 0.45; }
.tb-btn { fill: var(--accent); }
.tb-new { fill: color-mix(in srgb, var(--accent) 12%, var(--surface-solid)); opacity: 0; }
.tb-packet { fill: var(--accent); opacity: 0; }
/* Tailkeeper in the browser: a small tile right below the Tailkeeper tile (top row, then a short title and text,
   no drawing); its calendar drawing only shows as the thumbnail on phones (the phone list rule shows .card-art). */
.card .tw-art { display: none; }
.tw-days circle { fill: var(--ink-3); opacity: 0.45; }
.tw-res { fill: color-mix(in srgb, var(--accent) 16%, var(--surface-solid)); stroke: var(--accent); stroke-width: 1.4; }
.tw-plane { fill: var(--accent); }
/* Its own small loop, out of step with the other tiles (7.3 s, starting late): on desktop the tick in the calendar
   icon draws itself and the icon gives a short nod; on phones the reservation bar runs over its three days and the
   plane rolls in. Nothing moves with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .tw-check { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tw-check 7.3s var(--ease-out) 1.7s infinite; }
  .cards-tbweb .card-icon svg { animation: tw-nod 7.3s var(--ease-out) 1.7s infinite; }
  .tw-res { transform-box: fill-box; transform-origin: left center; animation: tw-res 7.3s var(--ease-out) 1.7s infinite both; }
  .tw-fly { animation: tw-fly 7.3s var(--ease-out) 1.7s infinite both; }
}
@keyframes tw-check { 0%, 8% { stroke-dashoffset: 1; } 22%, 84% { stroke-dashoffset: 0; } 94%, 100% { stroke-dashoffset: 1; } }
@keyframes tw-nod { 0%, 19% { transform: none; } 24% { transform: scale(1.12) rotate(-4deg); } 30%, 100% { transform: none; } }
@keyframes tw-res { 0%, 8% { transform: scaleX(0); opacity: 0; } 10% { opacity: 1; } 24%, 84% { transform: scaleX(1); opacity: 1; } 94%, 100% { transform: scaleX(1); opacity: 0; } }
@keyframes tw-fly { 0%, 18% { transform: translateX(-34px); opacity: 0; } 32%, 84% { transform: none; opacity: 1; } 94%, 100% { transform: none; opacity: 0; } }
.cards-tbweb .card-title { font-size: clamp(1.25rem, 2vw, 1.45rem); }
.cards-tbweb .card-text { margin-top: 0.3rem; font-size: 14.5px; line-height: 1.45; }
.cards-tbweb .card-body { margin-top: 0.9rem; }
@media (min-width: 52rem) {
  .cards-tbweb .card { padding: 1.15rem 1.35rem 1.3rem; }
}
.tb-row, .tb-field { transform-box: fill-box; transform-origin: left center; }
.tb-btn { transform-box: fill-box; transform-origin: center; }
.tb-play { animation: tb-fade 8s ease-in-out infinite; }
.tb-fin { stroke-dasharray: 1; animation: tb-fin 8s var(--ease-out) infinite; }
.tb-f1 { animation: tb-f1 8s var(--ease-out) infinite; }
.tb-f2 { animation: tb-f2 8s var(--ease-out) infinite; }
.tb-f3 { animation: tb-f3 8s var(--ease-out) infinite; }
.tb-btn { animation: tb-tap 8s ease-in-out infinite; }
.tb-packet { animation: tb-send 8s var(--ease-out) infinite; }
.tb-new { animation: tb-new 8s ease-in-out infinite; }
.tb-arrive { animation: tb-arrive 8s var(--ease-out) infinite; }
@keyframes tb-fade { 0%, 86% { opacity: 1; } 94%, 100% { opacity: 0; } }
@keyframes tb-fin { 0%, 2% { stroke-dashoffset: 1; } 16%, 88% { stroke-dashoffset: 0; } 96%, 100% { stroke-dashoffset: 1; } }
@keyframes tb-f1 { 0%, 5% { transform: scaleX(0); } 14%, 100% { transform: scaleX(1); } }
@keyframes tb-f2 { 0%, 14% { transform: scaleX(0); } 22%, 100% { transform: scaleX(1); } }
@keyframes tb-f3 { 0%, 22% { transform: scaleX(0); } 30%, 100% { transform: scaleX(1); } }
@keyframes tb-tap { 0%, 33% { transform: none; } 36% { transform: scale(0.9); } 40%, 100% { transform: none; } }
@keyframes tb-send { 0%, 37% { opacity: 0; transform: none; } 39% { opacity: 1; transform: none; } 50% { opacity: 1; transform: translate(44px, 1px); } 53%, 100% { opacity: 0; transform: translate(44px, 1px); } }
@keyframes tb-new { 0%, 49% { opacity: 0; } 53%, 70% { opacity: 1; } 82%, 100% { opacity: 0; } }
@keyframes tb-arrive { 0%, 50% { transform: scaleX(0); } 60%, 100% { transform: scaleX(1); } }

/* Meal tray + a shopping list that ticks itself off. */
.fp-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.fp-tray { fill: color-mix(in srgb, var(--accent) 7%, var(--surface-solid)); stroke: var(--border); stroke-width: 1.5; }
.fp-plate, .fp-bowl, .fp-cup { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 2; }
.fp-food { fill: color-mix(in srgb, var(--warm-hi) 55%, transparent); stroke: var(--warm); stroke-width: 1.5; stroke-dasharray: 3 4; }
.fp-cutlery, .fp-line { stroke: var(--ink-3); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.fp-steam { fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; animation: steam 3s ease-in-out infinite; }
.fp-list { fill: var(--surface-solid); stroke: var(--border); stroke-width: 1.5; }
.fp-box { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.fp-tick { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12; stroke-dashoffset: 0; animation: tick 6.6s ease-in-out infinite; }
.fp-t2 { animation-delay: 0.8s; }
.fp-t3 { animation-delay: 1.6s; }

@keyframes steam {
  0%, 100% { opacity: 0.2; transform: translateY(2px); }
  50% { opacity: 0.8; transform: translateY(-2px); }
}

/* Draw the tick, keep it, then clear the list for the next round. */
@keyframes tick {
  0%, 8% { stroke-dashoffset: 12; }
  18%, 80% { stroke-dashoffset: 0; }
  90%, 100% { stroke-dashoffset: 12; }
}

.card {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 14px;
  /* Opaque instead of frosted glass: a backdrop blur over the moving background costs a re-blur per frame. */
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out), border-color 0.3s ease;
}

/* No pointer spotlight and no glowing gradient border (that read as "liquid glass"); hover only tints the border. */
@media (hover: hover) {
  a.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
}

a.card:active { transform: perspective(1000px) scale(0.985); }

.card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
}

.card-tag {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card-arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink);
  transition: transform 0.5s var(--ease-out), background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

@media (hover: hover) {
  a.card:hover .card-arrow { transform: rotate(45deg); background: var(--ink); border-color: var(--ink); color: var(--bg); }
}

.card-art {
  display: block;
  margin: 1.25rem calc(-1 * clamp(0.25rem, 1vw, 0.75rem));
  border-radius: 8px;
}

.route {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.route-base,
.route-dash {
  fill: none;
  stroke-linecap: round;
}

.route-base { stroke: color-mix(in srgb, var(--accent) 18%, transparent); stroke-width: 6; }

.route-dash {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 8;
  animation: dash 1.6s linear infinite;
}

@keyframes dash { to { stroke-dashoffset: -28; } }

.pin { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 2.5; }
.pin-c { stroke: var(--warm); }   /* destination */

.pin-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: ring 2.4s ease-out infinite;
}

.land-ring { stroke: var(--warm); stroke-width: 1.5; }

@keyframes ring {
  from { transform: scale(1); opacity: 0.9; }
  to   { transform: scale(3.4); opacity: 0; }
}

.plane path { fill: var(--ink); }

/* Travel Planner: the trip on a map (left) and its itinerary (right) that fills up as the plane flies – flight,
   stay, activity, then the PDF export lights up. Same look as the Food Planner tray and list. */
.tp-art svg { max-height: 16rem; }
.tp-map { fill: color-mix(in srgb, var(--accent) 6%, var(--surface-solid)); stroke: var(--border); stroke-width: 1.5; }
.tp-land { fill: color-mix(in srgb, var(--accent) 9%, transparent); }
.tp-code { font: 600 12px var(--mono); letter-spacing: 0.08em; fill: var(--ink-3); text-anchor: middle; }
.tp-sheet { fill: var(--surface-solid); stroke: var(--border); stroke-width: 1.5; }
.tp-bar { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; opacity: 0.8; }
.tp-rail, .tp-rail-on { fill: none; stroke-width: 2; }
.tp-rail { stroke: var(--dashed); stroke-dasharray: 3 4; }
.tp-rail-on { stroke: var(--accent); stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.tp-chip { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 1.6; }
.tp-chip-on { fill: var(--accent); stroke: var(--accent); stroke-width: 1.6; }
.tp-glyph { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tp-glyph .tp-fill { fill: var(--accent); stroke: none; }
.tp-glyph-on { stroke: var(--on-accent); }
.tp-glyph-on .tp-fill { fill: var(--on-accent); }
.tp-time { font: 600 13px var(--mono); fill: var(--ink-2); }
.tp-line { stroke: var(--ink-3); stroke-width: 2.5; stroke-linecap: round; opacity: 0.6; }
.tp-pdf { fill: none; stroke: color-mix(in srgb, var(--accent) 45%, transparent); stroke-width: 1.5; }
.tp-pdf-on { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.tp-pdf-icon { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tp-pdf-text { font: 700 11px var(--mono); letter-spacing: 0.1em; fill: var(--accent); }

.card-body { margin-top: auto; }

.card-title {
  display: block;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.card-text {
  display: block;
  max-width: 34rem;
  margin-top: 0.5rem;
  font-size: 16px;
  color: var(--ink-2);
  /* Even lines instead of a short last one ("export." alone on the second line). */
  text-wrap: balance;
}

/* "In the works": the next project as a boarding pass for a flight that is not announced yet. A plain card
   frame like the project card; the pass lies slightly tilted on it. Deliberately no hover, no pointer cursor,
   no button-like shapes – it is not clickable. */
.card-soon {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 14rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 14px;
  /* Opaque like every other card (it was the only half transparent one, the globe showed through). */
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  cursor: default;
}

.pass-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.75rem 0.25rem;
}

/* Ticket: two parts with round notches at the perforation (radial gradients cut them out of the background). */
.pass {
  --notch: 9px;
  --at: 74%;
  display: flex;
  width: min(100%, 20rem);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--mono);
  background:
    radial-gradient(circle at var(--at) 0, transparent var(--notch), var(--pass) calc(var(--notch) + 0.5px)) top / 100% 51% no-repeat,
    radial-gradient(circle at var(--at) 100%, transparent var(--notch), var(--pass) calc(var(--notch) + 0.5px)) bottom / 100% 51% no-repeat;
  filter: drop-shadow(0 1px 1px rgba(15, 20, 35, 0.08)) drop-shadow(0 14px 22px rgba(15, 20, 35, 0.12));
  transform: rotate(-3deg);
}

.pass-main {
  flex: 0 0 var(--at);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.9rem 1rem 1rem;
  /* Perforation: dashes drawn as a gradient, not a dashed border – Safari draws thin dashed borders in its own
     pattern (on the iPhone only a single bright dot showed below the top notch). Centred, so both ends match. */
  background: linear-gradient(var(--dashed) 0 5px, transparent 5px) right center / 1.5px 9px repeat-y;
  margin: calc(var(--notch) + 2px) 0;
  padding-block: calc(0.9rem - var(--notch) - 2px) calc(1rem - var(--notch) - 2px);
}

.pass-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.pass-route {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pass-port { display: flex; flex-direction: column; gap: 0.15rem; }
.pass-port b { font: 700 26px/1 var(--mono); letter-spacing: 0.02em; }
.pass-port small { font-size: 9.5px; color: var(--ink-3); white-space: nowrap; }
.pass-to { align-items: flex-end; text-align: right; }
.pass-to b { color: var(--ink-3); }

/* Dotted line with the plane halfway. */
.pass-line {
  flex: 1;
  display: grid;
  place-items: center;
  height: 16px;
  margin-bottom: 1rem;
  background: radial-gradient(circle, var(--ink-3) 1px, transparent 1.3px) center / 6px 6px repeat-x;
}

.pass-line svg { padding: 0 3px; background: var(--pass); fill: var(--accent); }

.pass-fields {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 12px;
  font-weight: 600;
}

.pass-fields > span { display: flex; flex-direction: column; gap: 0.2rem; }
.pass-fields small { font-size: 9px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }

.pass-stub {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0.9rem 0.6rem;
}

/* Barcode: bars of different widths. */
.pass-code {
  width: 100%;
  height: 78%;
  min-height: 4.5rem;
  opacity: 0.75;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px,
    var(--ink) 8px 11px, transparent 11px 12px, var(--ink) 12px 13px, transparent 13px 16px);
}

.soon-title {
  display: block;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.soon-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.soon-dots { display: inline-flex; gap: 3px; }

.soon-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.4s ease-in-out infinite;
}

.soon-dots i:nth-child(2) { animation-delay: 0.2s; }
.soon-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: none; }
  40% { opacity: 1; transform: translateY(-2px); }
}

.card-soon .card-text { margin-top: 0.35rem; }

/* Cards scrolled out of view pause their animations (site.js sets .is-idle), so phones don't redraw them every frame. */
.is-idle, .is-idle * { animation-play-state: paused !important; }

/* Group headings ("University projects", "Web apps") above the tiles: phones only, the pinboard needs none. */
.cards > .cards-label { display: none; }

/* Phones: the tiles become a compact list, one row per project: the card's drawing as a small square on the left
   (the same art, scaled down with zoom), title, label and text on the right; no top row, pin or tilt. The texts are
   cut after three lines. The uni projects come first (HTML order); the pinboard above places every tile itself. */
@media (max-width: 40rem) {
  .cards { --thumb: min(112px, 28vw); gap: 10px; }
  .cards > .cards-label {
    display: block;
    margin: 0.9rem 0 0.15rem;
    font: 500 11px/1 var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  .cards-label:first-child { margin-top: 0; }
  .cards > li { rotate: none; }
  .card-pin { display: none; }
  .card,
  .card-soon {
    display: grid;
    grid-template-columns: var(--thumb) minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    min-height: 0;
    padding: 10px 14px 10px 10px;
    border-radius: 12px;
  }
  .card .card-top,
  .card-soon .card-top,
  .card .atlas-stats { display: none; }
  .card .card-art,
  .card .mymap,
  .card-soon .pass-wrap {
    position: relative;
    grid-column: 1;
    display: grid;
    place-items: center;
    width: var(--thumb);
    height: var(--thumb);
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background-color: var(--bg-2);
  }
  .card .card-art > :not(.adapt-model):not(img),
  .card .mymap .mymap-stage,
  .card-soon .pass { width: 300px; max-width: none; zoom: 0.34; }
  .card-soon .pass { rotate: none; }
  /* The lamp is tall and narrow: scaled down like the others it would be tiny, so its sketch fills the square
     instead (the SVG crops the empty sides, preserveAspectRatio slice). */
  .cards .cards-cad .card .dl-art > svg { width: 90%; height: 90%; zoom: 1; }
  .adapt-art img { height: 100%; object-fit: cover; }
  .card .card-body,
  .card .mymap-foot,
  .card-soon .card-body { grid-column: 2; margin: 0; }
  .cards .card-title,
  .cards .soon-title { font-size: 1.15rem; }
  .cards .card-title::after { content: " \2197"; content: " \2197" / ""; font-size: 0.8em; color: var(--ink-3); }
  .cards .adapt-sub { margin-top: 0.15rem; font-size: 11px; }
  .cards .card-text {
    display: -webkit-box;
    margin-top: 0.25rem;
    overflow: hidden;
    font-size: 13.5px;
    line-height: 1.4;
    text-wrap: pretty;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
}

/* ---------- Departures board ---------- */
/* A classic split-flap airport board (Kian chose variant "A1, all dark" of the design preview, 2026-10-18).
   Always dark, in both themes: a black housing with a frame, a dark head bar, rows of character modules with two
   flat tones (upper half lighter), a seam and two axle pins each. Flight and gate in amber, destination and
   remark in white. Own stacking layer (z-index 1): the hero's glow slides down over it while scrolling (parallax)
   and would sit on top of it otherwise. content-visibility: the browser skips the board's layout and paint while it
   is far off screen. */
.board-section { margin-top: clamp(4.5rem, 12vh, 8rem); }

.board {
  --mod: clamp(11px, 1.45vw, 19px);   /* font size of one module; every size below follows it */
  --mod-w: 0.86;                      /* module width in em of --mod */
  --mod-gap: 2px;
  --mod-up: #23272e;
  --mod-dn: #1a1d23;
  --amber: var(--warm-hi);
  position: relative;
  z-index: 1;
  padding: clamp(0.8rem, 2vw, 1.4rem);
  border: clamp(6px, 0.9vw, 10px) solid #141a24;
  border-radius: 14px;
  background: #0b0d11;
  color: #f3f1ea;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

/* Head bar: title (with the other language small and grey) and the clocks. */
.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  background: #12161d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.board-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font: 700 clamp(1.15rem, 2.4vw, 1.6rem)/1 var(--sans);
  letter-spacing: -0.01em;
  color: #f3f1ea;
}

.board-title svg { color: var(--amber); }
.board-title-2 { margin-left: 0.15rem; font-weight: 400; color: #7d8696; }

.board-meta,
.board-foot {
  margin: 0;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7d8696;
}

.board-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.25rem;
}

.board-meta[hidden] { display: none; }

.board-tz { display: inline-flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.board-clock { color: var(--amber); }

/* Rows: flight, destination (takes the rest), gate, remark. Every field is a fixed number of modules. */
.board-cols,
.board-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: calc(var(--mod) * 1.4);
}

.board-cols {
  padding: 0 0.5rem 0.45rem;
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7d8696;
}

/* Column heads sit over the module fields: same widths as the fields (n modules). */
.board-cols span { box-sizing: content-box; width: calc(var(--mod) * var(--mod-w) * var(--n) + var(--mod-gap) * (var(--n) - 1)); }
.board-cols span:nth-child(1),
.board-cols span:nth-child(3) { --n: 7; }
.board-cols span:nth-child(2) { width: auto; }
.board-cols span:nth-child(4) { --n: 9; padding-left: calc(7px * 2 + 3px + 0.5rem); }   /* past the lamps */

.board-rows { list-style: none; margin: 0; padding: 0; }
.board-rows li + li { border-top: 2px solid #050608; }   /* the slats between module rows */

.board-row {
  padding: calc(var(--mod) * 0.32) 0.5rem;
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.25s ease;
}

a.board-row:hover { background: #12161c; }
a.board-row:focus-visible { outline-offset: -2px; }

.b-flight, .b-dest, .b-gate, .b-status { display: inline-flex; align-items: center; min-width: 0; }
/* Fixed field widths (n modules), so the columns line up also before the modules exist (no JS: plain text). */
.b-flight, .b-gate { --n: 7; }
.b-flight, .b-gate { width: calc(var(--mod) * var(--mod-w) * var(--n) + var(--mod-gap) * (var(--n) - 1)); }
.b-status { width: calc(7px * 2 + 3px + 0.5rem + var(--mod) * var(--mod-w) * 9 + var(--mod-gap) * 8); }
.flap:empty { display: none; }
.b-dest { overflow: hidden; }
.b-flight, .b-gate, .board-clock { color: var(--amber); }
.b-status { gap: 0.5rem; }

/* Without JS: the plain text on a dark module strip. With JS (.is-flap) every character becomes a module. */
.flap {
  display: inline-block;
  max-width: 100%;
  padding: 0.25em 0.4em;
  border-radius: 3px;
  background: var(--mod-dn);
  font-size: var(--mod);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.js-flap.is-flap { padding: 0; background: none; letter-spacing: 0; }

.mods { display: inline-flex; gap: var(--mod-gap); vertical-align: middle; }

/* One module: two halves + two leaves that fold (site.js), plus the seam and the axle pins. */
.m {
  position: relative;
  display: inline-block;
  flex: none;
  width: calc(var(--mod-w) * 1em);
  height: 1.45em;
  font-weight: 650;
  line-height: 1;
  contain: strict;   /* a character change never lays out anything outside the module */
}

.mh { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; }
.mu { top: 0; border-radius: 2px 2px 0 0; background: var(--mod-up); transform-origin: 50% 100%; }
.md { bottom: 0; border-radius: 0 0 2px 2px; background: var(--mod-dn); transform-origin: 50% 0; }
.mh i { position: absolute; left: 0; right: 0; height: 200%; display: grid; place-items: center; font-style: normal; }
.mu i { top: 0; }
.md i { bottom: 0; }
.ml { visibility: hidden; z-index: 1; }   /* the leaves only show while they fold (site.js animates scaleY) */
.mu.ml { background: #2b3038; }           /* the falling leaf catches a little light */

/* Seam across the module, and the two axle pins that stick out left and right of it. */
.m::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 0.5px);
  height: 1px;
  background: #050608;
  z-index: 2;
}

.m::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 1px);
  height: 2px;
  border-left: 1.5px solid #3c4350;
  border-right: 1.5px solid #3c4350;
  z-index: 3;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Status lamps: off on every row, except "Boarding": there the two lights blink green, alternately left/right. */
.lamp { display: inline-flex; gap: 3px; flex: none; }

.lamp i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #262a31;
}

.is-board .lamp i { animation: lamp 0.9s steps(1, end) infinite; }
.is-board .lamp i:last-child { animation-delay: -0.45s; }

@keyframes lamp {
  0%  { background: #34d15f; }
  50% { background: #262a31; }
}

.board-foot { margin-top: 0.9rem; font-weight: 500; font-size: 10px; color: #6c7484; }

@media (max-width: 52rem) {
  .b-gate, .b-gate-col { display: none; }
  .board-cols,
  .board-row { grid-template-columns: auto minmax(0, 1fr) auto; }
}

@media (max-width: 40rem) {
  /* Phones: flight, destination (cut like a real board) and the lamps, so the board stays short. The remark is
     only read out to screen readers; the lamps still show it (green and blinking = boarding). Only the Berlin
     clock, no column heads, no "last update" line. */
  .board { --mod: min(11px, 2.75vw); border-width: 5px; padding: 0.6rem; }
  .board-head { flex-wrap: nowrap; margin-bottom: 0.6rem; padding: 0.45rem 0.55rem; }
  .board-title { font-size: 1.15rem; }
  .board-title-2,
  .board-tz-label,
  .board-meta .board-tz + .board-tz { display: none; }
  .board-cols { display: none; }
  .board-row { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 0.45rem; padding: 3px 0.2rem; }
  .b-status { width: auto; }
  .b-status .js-flap {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .board-foot { display: none; }
}

/* ---------- Contact ---------- */
.contact-text {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(2.2rem, 6.5vw, 4.8rem);
  line-height: 1.02;
  font-weight: 650;
  letter-spacing: -0.045em;
}

.mail-button {
  --tx: 0px;
  --ty: 0px;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2.2rem;
  padding: 0.5rem 0.5rem 0.5rem 1.6rem;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font: 600 17px/1.2 var(--sans);
  text-decoration: none;
  transform: translate(var(--tx), var(--ty));
  transition: transform 0.5s var(--ease-out), box-shadow 0.4s ease;
}

.mail-arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--warm-hi) 60%, #fff), var(--warm-hi));   /* the call to action */
  color: #1f1600;
  transition: transform 0.5s var(--ease-out);
}

@media (hover: hover) {
  .mail-button:hover .mail-arrow { transform: rotate(-45deg); }
}

.mail-button:active { transform: translate(var(--tx), var(--ty)) scale(0.97); }

/* ---------- Project pages (site/projects/<name>/index.html) ---------- */
/* Same tokens and section heads as the homepage; .pj-* only for what a project page has on top: a hero with a big
   image, key facts, 3D viewers (viewer.js), a video, points, tool chips and the team. */
.pj-hero { padding-top: calc(6.5rem + env(safe-area-inset-top)); }

.pj-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font: 500 13px/1 var(--mono);
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.2s ease;
}
.pj-back:hover { color: var(--ink); }
.pj-back svg { transition: transform 0.3s var(--ease-out); }
.pj-back:hover svg { transform: translateX(-3px); }

.pj-eyebrow { display: flex; width: fit-content; }

.pj-title {
  /* background-clip: text paints only inside the box, and line-height 0.95 cut off the descenders (g, p): room
     below for them, kept as space so they don't run into .pj-sub. */
  margin: 1.2rem 0 0;
  padding-bottom: 0.2em;
  /* One size on every project page; 11vw on phones so the longest single word (Astromechanics, Flugsimulator)
     still fits the width. */
  font-size: clamp(2.4rem, 11vw, 9rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.055em;
  /* background-clip: text paints only inside the box – a little room on the right for the T. */
  padding-right: 0.06em;
  width: fit-content;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rise 1s var(--ease-out) 0.1s both;
}

.pj-sub {
  margin: 0.6rem 0 0;
  font: 500 clamp(0.95rem, 1.8vw, 1.15rem)/1.4 var(--mono);
  color: var(--ink-2);
  animation: rise 1s var(--ease-out) 0.2s both;
}

.pj-lead {
  max-width: 46rem;
  margin: 1.6rem 0 0;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.45;
  text-wrap: pretty;
  animation: rise 1s var(--ease-out) 0.3s both;
}

.pj-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 46rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  animation: rise 1s var(--ease-out) 0.4s both;
}
@media (min-width: 36rem) {
  .pj-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.pj-facts li,
.pj-stats div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
/* Values line up at the bottom even when a label wraps. */
.pj-facts b { margin-top: auto; }
.pj-facts small,
.pj-stats dt {
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pj-facts b,
.pj-stats dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.pj-figure { margin: 0; }
.pj-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--bg-2);
}
/* Diagrams and plots (transparent PNG exports with black text): a light "paper" card, white in the light theme and a
   muted grey in the dark one, so thin lines stay readable without a glaring white box. */
.pj-figure.is-paper img,
.pj-gallery .is-paper img { padding: clamp(0.75rem, 2.5vw, 1.75rem); background: var(--paper); box-sizing: border-box; }
.pj-tools-figure { margin-top: 2rem; }
.pj-model-figure { margin-top: 2rem; }
.pj-figure figcaption {
  margin-top: 0.75rem;
  font: 13px/1.4 var(--mono);
  color: var(--ink-3);
}
/* Tailkeeper: the map and the row of three screenshots below the billing figure. */
.pj-figure.tb-more,
.pj-gallery.tb-more { margin-top: 2rem; }

/* ---------- Tailkeeper page (projects/tailkeeper/): the product at tailkeeper.eu ----------
   Pitch hero (text and the new logo tile next to two phone screenshots), a strip with the platforms and their state,
   the year in three columns, the roadmap by area and a band about the company. The download box of the first version
   at the end keeps its .tb-dl styles. */
.tk-titlerow { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.4rem); margin-top: 1.2rem; }
.tk-titlerow .pj-title { margin-top: 0; }
.tk-logo { width: clamp(3rem, 6vw, 4.25rem); height: auto; flex: none; border-radius: 22%; box-shadow: var(--shadow); animation: rise 1s var(--ease-out) 0.05s both; }
.tk-title-s { font-size: clamp(2.4rem, 9vw, 4.75rem); }
.tk-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.6rem 0 0; }
.tk-cta .tb-dl-button { gap: 0.5rem; }
.tk-trial { margin: 0.9rem 0 0; font: 500 13px/1.4 var(--mono); color: var(--ink-3); }
.tk-note { margin-top: 1.5rem; }
.tk-pitch { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 52rem) { .tk-pitch { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; } }
.tk-phones { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; max-width: 34rem; width: 100%; margin-inline: auto; animation: rise 1.1s var(--ease-out) 0.45s both; }
.tk-ph img { border-radius: 14px; }
.tk-ph-2 { margin-top: 3rem; }
/* Links per language (the roadmap on tailkeeper.eu has one address per language). */
:root:not(:lang(de)) .tk-lang-de, :root:lang(de) .tk-lang-en { display: none !important; }
.tk-more-link { margin: 1.75rem 0 0; }
.tk-more-link a { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--accent); font-weight: 600; text-decoration: none; }
.tk-more-link a:hover { text-decoration: underline; }
/* Status chips: available (green), in progress (amber), planned (quiet). */
.tk-st { display: inline-block; width: fit-content; padding: 0.3rem 0.55rem; border-radius: 7px; font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--border); color: var(--ink-3); }
.tk-st-live { color: #1f7a4d; border-color: color-mix(in srgb, #1f7a4d 40%, transparent); background: color-mix(in srgb, #1f7a4d 8%, transparent); }
.tk-st-wip { color: var(--warm); border-color: color-mix(in srgb, var(--warm) 45%, transparent); background: color-mix(in srgb, var(--warm) 8%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tk-st-live { color: #6fd6a2; border-color: color-mix(in srgb, #6fd6a2 40%, transparent); } }
:root[data-theme="dark"] .tk-st-live { color: #6fd6a2; border-color: color-mix(in srgb, #6fd6a2 40%, transparent); }
.tk-strip { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 2.5rem 0 0; padding: 0; list-style: none; }
.tk-strip li { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-solid); }
.tk-strip b { font-weight: 650; font-size: 15px; }
.tk-strip .tk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.tk-strip .is-live .tk-dot { background: #1f9d5f; }
.tk-strip .is-wip .tk-dot { background: var(--warm-hi); }
.tk-year { display: grid; gap: 1.75rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 52rem) { .tk-year { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }
.tk-year img.tk-cover { aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.tk-year h3 { margin: 1rem 0 0; font-size: 1.25rem; font-weight: 650; letter-spacing: -0.02em; }
.tk-year p { margin: 0.45rem 0 0; color: var(--ink-2); text-wrap: pretty; }
@media (min-width: 52rem) { .tk-points3.pj-points { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tk-areas { display: grid; gap: 1rem; margin-top: 1.75rem; align-items: start; }
@media (min-width: 36rem) { .tk-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 60rem) { .tk-areas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tk-area { padding: 1.2rem 1.3rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-solid); box-shadow: var(--shadow); }
.tk-area-name { margin: 0 0 0.9rem; font: 500 12px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.tk-area ul { display: grid; gap: 1.1rem; margin: 0; padding: 0; list-style: none; }
.tk-area li { display: grid; gap: 0.35rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.tk-area li:first-child { padding-top: 0; border-top: 0; }
.tk-area h4 { margin: 0.1rem 0 0; font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; hyphens: auto; overflow-wrap: break-word; }
.tk-area p { margin: 0; font-size: 14.5px; color: var(--ink-2); text-wrap: pretty; }
.tk-band { display: grid; gap: 1.5rem; padding: clamp(1.25rem, 4vw, 2.5rem); border: 1px solid var(--border); border-radius: 14px; background: var(--surface-solid); box-shadow: var(--shadow); }
@media (min-width: 52rem) { .tk-band { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem; align-items: center; } }
.tk-band-tag { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 1.1rem; }
.tk-band-tag .tk-logo { width: 2.25rem; animation: none; box-shadow: none; }
.tk-band-text > p:not(.tk-band-tag):not(.tk-cta) { margin: 0.9rem 0 0; color: var(--ink-2); text-wrap: pretty; }
.tk-band-tag + p { margin-top: 1rem !important; }
.tk-band-facts { margin: 0; max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; animation: none; }
.tk-chips-row { margin-top: 2rem; }
.tk-band .tk-band-text > p.tk-co-note { font-size: 14px; color: var(--ink-3); }
.pj-hero-img { margin-top: clamp(2.5rem, 6vh, 4rem); animation: rise 1.1s var(--ease-out) 0.45s both; }
/* Screenshots inverted to the site's theme (Tailkeeper page): the light site shows the program in dark mode
   (.on-light-site), the dark site in light mode (.on-dark-site), so the image stands out. Both <img> are
   loading="lazy", so the hidden one is never loaded. Same two blocks as the dark tokens (and the Atlas map). */
.on-dark-site { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .on-light-site { display: none !important; }
  :root:not([data-theme="light"]) .on-dark-site { display: block !important; }
}
:root[data-theme="dark"] .on-light-site { display: none !important; }
:root[data-theme="dark"] .on-dark-site { display: block !important; }

/* Images per language (Tailkeeper screenshots): <html lang> is set by theme.js in <head>, so the hidden language is
   never loaded (the images are loading="lazy"). More specific than the theme rules above, so both apply. */
:root:not(:lang(de)) img.only-de { display: none !important; }
:root:lang(de) img.only-en { display: none !important; }

/* Text left, a box on the right (research question, tools) from 52rem; stacked on phones. */
.pj-split { display: grid; gap: 1.5rem; }
@media (min-width: 52rem) {
  .pj-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3rem; align-items: start; }
}

.pj-prose p {
  max-width: 42rem;
  margin: 0 0 1.1rem;
  font-size: clamp(1.05rem, 1.6vw, 1.15rem);
  color: var(--ink-2);
  text-wrap: pretty;
}
.pj-prose p:last-child { margin-bottom: 0; }

/* Privacy policy: one subheading per processing, then its facts (data, purpose, legal basis, storage) as a list. */
.pj-prose h3 {
  max-width: 42rem;
  margin: 2.25rem 0 0.6rem;
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.pj-prose h3:first-child { margin-top: 0; }
.pv-facts {
  max-width: 42rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}
.pv-facts li {
  padding-left: 0.9rem;
  border-left: 2px solid var(--border);
  font-size: clamp(0.98rem, 1.4vw, 1.05rem);
  color: var(--ink-2);
  text-wrap: pretty;
}
.pv-facts strong { color: var(--ink); font-weight: 600; }
.pv-list {
  max-width: 42rem;
  margin: -0.5rem 0 1.1rem;
  padding-left: 1.25rem;
  font-size: clamp(1.05rem, 1.6vw, 1.15rem);
  color: var(--ink-2);
}
.pv-list li { margin: 0.2rem 0; }
.pj-prose ul:last-child { margin-bottom: 0; }

/* Privacy and terms (body.legal): a narrower column than the project pages, centred like the nav, with the
   contents list on the left from 64rem. The text gets the rest of the column, so a wide screen has no empty
   right half and the page does not look shifted to the left. */
body.legal { --content: clamp(56rem, 66vw, 78rem); }
.legal-toc { display: none; }
@media (min-width: 64rem) {
  .legal-body {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: clamp(2.5rem, 4vw, 4.5rem);
    align-items: start;
  }
  .legal-toc {
    display: block;
    position: sticky;
    top: 6rem;
    /* Lines up with the first section title, which sits below the section padding. */
    margin-top: clamp(4.5rem, 12vh, 8rem);
  }
  .legal .pj-prose p,
  .legal .pj-prose h3,
  .legal .pv-facts,
  .legal .pv-list { max-width: 54rem; }
  /* The hero has only the lead (no facts box), so it may run wider than half the column. */
  .legal .pj-head { display: block; }
  .legal .pj-lead { max-width: 62rem; }
  /* The outlined word sits at the right end of the title line and stays put: drifting to the left it ran into
     the contents list and made the page look off centre. !important: site.js sets translate inline as a fallback. */
  .legal .ghost { left: auto; right: 0; animation: none; translate: none !important; }
}
.legal-toc-title {
  margin: 0 0 0.9rem;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.legal-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.15rem; border-left: 1px solid var(--border); }
.legal-toc a {
  display: flex;
  gap: 0.6rem;
  margin-left: -1px;
  padding: 0.35rem 0 0.35rem 0.9rem;
  border-left: 2px solid transparent;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.25s, border-color 0.25s, background-color 0.25s;
}
.legal-toc a:hover { color: var(--ink); border-left-color: var(--ink-3); }
/* The section in view (site.js, same rule as the label next to the logo): lit up with the accent. */
.legal-toc a.is-active {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--accent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 85%);
}
.legal-toc a.is-active .legal-toc-num { color: var(--accent); }
@media (min-width: 64rem) {
  /* The list shows the section in view, so the same label next to the logo would only repeat it. */
  .legal .nav-where { display: none; }
}
.legal-toc-num { font: 500 12px/1.6 var(--mono); color: var(--warm); }

.pj-quote {
  margin: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warm-hi);
  border-radius: 20px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}
.pj-quote small {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
}
.pj-quote p {
  margin: 0.75rem 0 0;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.4;
  font-weight: 550;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.pj-intro {
  max-width: 46rem;
  margin: 0 0 1.75rem;
  font-size: clamp(1.05rem, 1.6vw, 1.15rem);
  color: var(--ink-2);
  text-wrap: pretty;
}

/* A long intro above a gallery, table or models runs in two columns on wide screens, so it uses the full width
   without overlong lines. */
@media (min-width: 64rem) {
  .pj-intro.is-cols { max-width: none; columns: 2; column-gap: 3rem; }
}

.pj-note {
  max-width: 52rem;
  margin: 1.25rem 0 0;
  font-size: 14px;
  color: var(--ink-3);
}
.pj-note a { color: var(--accent); }

/* 3D: two cards side by side from 60rem; the viewer is a 4:3 stage with a soft floor glow behind the model. */
.pj-models { display: grid; gap: 1.25rem; }
@media (min-width: 60rem) {
  .pj-models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Three plain cards without a model (the module sizes of CabinFlexLab), below a gallery. */
@media (min-width: 60rem) {
  .pj-models-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pj-gallery + .pj-models { margin-top: 1.25rem; }
.pj-model-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  box-shadow: var(--shadow);
}
.pj-model-body { padding: clamp(1.25rem, 3vw, 1.75rem); }
.pj-model-title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.pj-model-text { margin: 0.5rem 0 0; color: var(--ink-2); text-wrap: pretty; }
.pj-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1.25rem 0 0;
}
/* Six figures: two columns on phones, three when the card is wide enough, never a lone tile. */
.pj-model-body { container-type: inline-size; }
@container (min-width: 26rem) {
  .pj-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.model {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(60% 45% at 50% 62%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-2), color-mix(in srgb, var(--bg-2) 40%, var(--surface-solid)));
  border-bottom: 1px solid var(--border);
  cursor: grab;
}
.model:active { cursor: grabbing; }
/* !important beats the touch-action OrbitControls sets on the canvas: vertical swipes keep scrolling the page,
   horizontal drags turn the model. */
.model-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y !important; }
.model-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  font: 13px/1.4 var(--mono);
  color: var(--ink-3);
}
.model-status[hidden] { display: none; }
.model.is-error { cursor: default; }
.model-reset {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-solid);
  color: var(--ink-2);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, color 0.2s ease;
}
.model.is-ready .model-reset { opacity: 1; }
.model-reset:hover { color: var(--ink); }

/* The frame (border, corners, shadow) sits on the figure, which clips the video. The black background stays inside
   the translucent border (padding-box), otherwise it shows through as a thin black ring; the video fills the frame
   (object-fit: cover) and is scaled up by 1 %, which also hides the slightly dark edge pixels of the export. */
.pj-video {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #000 padding-box; /* not under the translucent border, or it reads as a black ring */
  box-shadow: var(--shadow);
}
.pj-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
}

.pj-points {
  display: grid;
  gap: 1rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 40rem) {
  .pj-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .pj-points { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* .pj-points-fill: an odd last row stretches its last point, so no hole is left (5 points in 3 columns: span 2;
   7 points: the full row). */
@media (min-width: 64rem) {
  .pj-points-fill li:last-child:nth-child(3n + 2) { grid-column: span 2; }
  .pj-points-fill li:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
}
/* Astromechanics hero: orbits.js draws the scene live on a canvas over the picture and fades it in. */
.am-sky { position: relative; display: block; }
.am-live {
  position: absolute;
  inset: 1px;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  border-radius: 27px;
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}
.js-orbits.is-live .am-live { opacity: 1; }
/* The live view can be turned (drag) and zoomed; the date and time of the mission sit in its corner and a timeline
   with play/pause and zoom buttons below it. Both appear only with the live view (orbits.js adds them). */
.am-live { cursor: grab; touch-action: pan-y; }
.am-live:active { cursor: grabbing; }
.am-clock {
  position: absolute;
  right: 1.1rem;
  bottom: 0.9rem;
  font: 600 0.8rem/1 var(--mono);
  letter-spacing: 0.02em;
  color: rgba(223, 233, 255, 0.85);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}
.am-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}
.js-orbits.is-live .am-clock, .js-orbits.is-live .am-bar { opacity: 1; }
.am-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--ink);
  font: 600 1.1rem/1 var(--sans);
  cursor: pointer;
}
.am-btn:hover { border-color: var(--accent); color: var(--accent); }
.am-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.am-time { flex: 1; min-width: 0; accent-color: var(--accent); cursor: pointer; }
/* Reset (top right of the picture): appears once the visitor moved the camera or picked another focus. */
.am-reset { position: absolute; top: 0.9rem; right: 0.9rem; }
.am-reset[hidden] { display: none; }
/* .pj-head (every project page): lead left, the facts as a 2 × 2 grid right, so a wide screen has no empty
   right half in the hero. Both start at the top, right below the subtitle, so every page has the same spacing
   whatever the length of its lead. */
@media (min-width: 64rem) {
  .pj-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3rem; align-items: start; margin-top: 1.6rem; }
  .pj-head .pj-lead { max-width: none; margin-top: 0; }
  .pj-head .pj-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; margin-top: 0; }
}
.pj-points li {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-solid);
}
.pj-points h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.pj-points h3::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.12em;
}
.pj-points p { margin: 0.45rem 0 0; font-size: 15px; color: var(--ink-2); }

/* Tools below a gallery (the Astromechanics page) need room above them. */
.pj-gallery + .pj-tools { margin-top: 2rem; }
.pj-tools-label {
  margin: 0 0 0.9rem;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pj-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.pj-chips li {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  font: 500 14px/1.2 var(--mono);
  color: var(--ink-2);
}

.pj-team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pj-team li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-solid);
}
.pj-team b { font-weight: 650; letter-spacing: -0.01em; }
.pj-team span { font: 13px/1.3 var(--mono); color: var(--ink-3); }
.pj-team .is-me { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pj-team .is-me span { color: var(--accent); }

/* Photo gallery (final event): two columns from 40rem, .is-wide photos span both. */
.pj-gallery {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 40rem) {
  .pj-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-gallery .is-wide { grid-column: 1 / -1; }
}
.pj-gallery figure { margin: 0; }
.pj-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  background: var(--bg-2);
}
.pj-gallery figcaption {
  margin-top: 0.6rem;
  font: 13px/1.4 var(--mono);
  color: var(--ink-3);
}
/* Rows of three equal images (desk lamp renderings); a second gallery right below keeps the grid gap. */
@media (min-width: 40rem) { .pj-gallery.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pj-gallery + .pj-gallery-next { margin-top: 1.25rem; }
.pj-team-img { margin-bottom: 1.5rem; }
/* Team section without a photo: text left, the way back ("All projects") at the right end from 52rem. */
.pj-team-row { display: grid; gap: 0.5rem; }
/* Pages without a team section end with the way back alone, on the same side as in .pj-team-row. */
@media (min-width: 52rem) { .pj-end { text-align: right; } }
@media (min-width: 52rem) {
  .pj-team-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: 3rem; align-items: end; }
  .pj-team-row .pj-intro { margin-bottom: 0; }
  .pj-team-row .mail-button { margin-top: 0; }
  .pj-team-row > p { margin: 0; }
  .pj-team-row > .pj-note { margin-top: 0; }
}
.pj-split + .pj-gallery { margin-top: 2rem; }
/* Four points (desk lamp): two columns instead of three, so none is left alone in a row. */
@media (min-width: 40rem) {
  .pj-points.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Parameter tables: the wide one scrolls sideways on narrow phones instead of squeezing. */
.pj-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--surface-solid) 94%, transparent); box-shadow: var(--shadow); }
.pj-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pj-table th,
.pj-table td { padding: 0.7rem 1rem; text-align: left; vertical-align: top; border-top: 1px solid var(--border); }
.pj-table thead th {
  border-top: 0;
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pj-table tbody th { font-weight: 600; }
.pj-table td { color: var(--ink-2); }
@media (max-width: 36rem) {
  .pj-table th,
  .pj-table td { padding: 0.6rem 0.65rem; font-size: 14px; }
  .pj-table th code { display: none; }
}
.pj-table td { white-space: nowrap; }
.pj-table td:last-child { color: var(--ink); font-weight: 600; }
.pj-table code { display: block; margin-top: 0.15rem; font: 12px/1.3 var(--mono); font-weight: 400; color: var(--ink-3); }
.pj-table small { display: block; font: 12px/1.3 var(--mono); color: var(--ink-3); }
.pj-table-small { align-self: start; border: 1px solid var(--border); border-radius: 22px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.pj-params-more { margin-top: 1.5rem; }

.pj-steps img {
  display: block;
  width: 100%;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #fff;
}
/* Steps: picture left, text right; the picture column is narrow, the screenshots are tall. */
.pj-steps { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
@media (min-width: 48rem) {
  .pj-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pj-steps li {
  display: grid;
  grid-template-columns: clamp(5.5rem, 22vw, 7.5rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  counter-increment: step;
}
.pj-steps img { height: 10rem; padding: 0.5rem; border-radius: 14px; }
.pj-steps h3 { margin: 0.2rem 0 0; font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; }
.pj-steps h3::before { content: counter(step, decimal-leading-zero) "  "; font: 500 12px/1 var(--mono); color: var(--accent); white-space: pre; }
.pj-steps p { margin: 0.45rem 0 0; font-size: 15px; color: var(--ink-2); text-wrap: pretty; }
/* Desk lamp: the coloured NX assembly next to the text, on white like NX itself (both themes). */
.pj-asm-fig img { max-height: 30rem; object-fit: contain; padding: 1.25rem; background: #fff; }
@media (min-width: 52rem) {
  .pj-build { align-items: center; }
}


.pj .mail-button { margin-top: 2rem; }

/* Tailkeeper: the download box (site.js fills it). Signed in: an accent button with version and size; signed out
   (the HTML's default): "Sign in to download"; no release: one calm line. .is-pending keeps the room but hides the
   content until site.js knows both answers, so the sign-in button does not flash for a signed-in visitor. */
.tb-dl {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}
.tb-dl.is-pending > * { visibility: hidden; }
.tb-dl-app { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1rem; font-size: 18px; letter-spacing: -0.01em; }
.tb-dl-app img { display: block; border-radius: 6px; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.45); }
.tb-dl [hidden] { display: none; }
.tb-dl-text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.tb-dl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 0; }
.tb-dl-actions + .tb-dl-text { margin-top: 0.85rem; }
/* The program and the browser side by side, each explanation under its own button; stacked when narrow. */
.tb-dl-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.5rem 2.5rem; align-items: start; }
.tb-dl-button {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3rem;
  padding: 0.6rem 1.3rem 0.6rem 1.1rem;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 16px/1.2 var(--sans);
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}
.tb-dl-label { display: flex; flex-direction: column; gap: 0.15rem; }
.tb-dl-label small { font: 500 12px/1.2 var(--mono); opacity: 0.85; }
.tb-dl-link { color: var(--accent); font-weight: 600; font-size: 15px; }
@media (hover: hover) {
  .tb-dl-button:hover { transform: translateY(-1px); }
}
.tb-dl-button:active { transform: scale(0.97); }
/* "Open in the browser" (Tailkeeper in the account service): a quieter second button in its own column. */
.tb-dl-button-2 { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
@media (hover: hover) {
  .tb-dl-button-2:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
}

/* ---------- Error pages (404.html, maintenance.html – served by Caddy's handle_errors) ---------- */
.err {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: calc(6rem + env(safe-area-inset-top));
  padding-bottom: calc(4rem + env(safe-area-inset-bottom));
}

.err-title {
  /* No width limit: one line wherever it fits; on phones it wraps into even lines. */
  text-wrap: balance;
  margin: 1.4rem 0 0;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: -0.045em;
  /* background-clip: text only paints inside the box: room for the full stop (right) and for descenders (g, p –
     deeper in Segoe UI on Windows than in other fonts); the negative margin keeps the spacing below. */
  padding: 0 0.08em 0.2em 0;
  margin-bottom: -0.2em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.err-text {
  max-width: 64rem;
  margin: 1.2rem 0 0;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  text-wrap: pretty;
}

/* Status dot in the code pill: amber (off course), pulsing on the maintenance page (busy). */
.err-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm-hi);
}

.err-dot.is-busy { animation: err-blink 1.6s ease-in-out infinite; }

@keyframes err-blink { 50% { opacity: 0.25; } }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(5rem, 14vh, 9rem);
  padding: 1.5rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font: 13px/1.4 var(--mono);
  color: var(--ink-3);
}

/* Desktop: the GitHub button sits exactly in the middle, whatever the widths on the left and right. */
@media (min-width: 64rem) {
  .footer { display: grid; grid-template-columns: 1fr auto 1fr; }
  .footer .to-top { justify-self: end; }
}

.footer p { margin: 0; }
.footer-line { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.footer-item { white-space: nowrap; }

/* The two legal links are one unit: if the left column is too narrow the unit drops below the copyright, never between the links. */
.footer-links { display: inline-flex; gap: 1.1rem; white-space: nowrap; }

/* Phones and tablets (under 64rem): two rows, two columns. Copyright and GitHub on top, Privacy and Terms (never broken apart) and Back to top below. */
@media (max-width: 63.99rem) {
  .footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.9rem 1rem; }
  .footer-line { display: contents; }
  .footer-line > .footer-item { grid-area: 1 / 1; }
  .gh-button { grid-area: 1 / 2; justify-self: end; }
  .footer-links { display: block; grid-area: 2 / 1; white-space: nowrap; font-size: clamp(11px, 3.1vw, 13px); }
  .footer-links .footer-link + .footer-link { margin-left: 1.1rem; }
  .footer .to-top { grid-area: 2 / 2; justify-self: end; white-space: nowrap; font-size: clamp(11px, 3.1vw, 13px); }
}

/* Very narrow phones: Back to top drops to its own row on the right so the two legal links keep their line. */
@media (max-width: 22rem) {
  .footer .to-top { grid-area: 3 / 2; }
}

.footer-link { color: inherit; text-decoration: none; transition: color 0.2s ease; }
.footer-link:hover { color: var(--ink); text-decoration: underline; }

.gh-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-2, var(--ink));
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.gh-button:hover { color: var(--ink); border-color: var(--ink-3); }

.to-top { text-decoration: none; transition: color 0.2s ease; }
.to-top:hover { color: var(--ink); }

/* ---------- Parallax ----------
   Where CSS scroll-driven animations exist (Chrome/Edge, Safari 26+), the parallax runs entirely on the
   compositor – no JavaScript while scrolling, so it stays smooth. Other browsers get the same effect from
   site.js (it checks CSS.supports first). Only `translate`/`opacity` are animated, never `transform`, so the
   reveal/tilt transforms are untouched. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero { view-timeline: --hero block; }
    .hero-inner {
      animation: px-hero-inner linear both;
      animation-timeline: --hero;
      animation-range: exit 0% exit 100%;
    }
    .hero-glow {
      animation: px-hero-glow linear both;
      animation-timeline: --hero;
      animation-range: exit 0% exit 100%;
    }
    .orb::before {
      animation: px-y linear both;
      animation-timeline: --orb;
    }
    .ghost {
      animation: px-x linear both;
      animation-timeline: --head;
    }
    /* Photo: the frame opens (rounded rectangle grows to full size) while it enters, the picture drifts inside it. */
    .ap-frame {
      animation: ap-open linear both;
      animation-timeline: --photo;
      animation-range: entry 0% entry 70%;
    }
    .ap-frame img {
      scale: 1.2;
      animation: ap-drift linear both;
      animation-timeline: --photo;
      animation-range: entry 0% exit 100%;
    }

    /* Timeline flight: progress 0 when the top of the rail is at 60 % of the viewport, 1 when its end is. */
    .js-timeline.is-live .tl-rail { view-timeline: --rail block; }
    .js-timeline.is-live .tl-fill,
    .js-timeline.is-live .tl-fly,
    .js-timeline.is-live .tl-plane {
      animation: tl-fill linear both;
      animation-timeline: --rail;
      /* End = start + rail height (not "100% - 60vh": the cover range is shortened by scroll-padding-top). */
      animation-range: cover 40vh cover calc(40vh + var(--h, 0px));
    }
    .js-timeline.is-live .tl-fly { animation-name: tl-fly; }
    .js-timeline.is-live .tl-plane { animation-name: tl-land; }
  }
}

/* Hero: the text sinks at half speed and fades out, the light lags even more (the globe is fixed, hero-globe.js). */
@keyframes px-hero-inner {
  from { translate: 0 0; opacity: 1; }
  65%  { opacity: 0; }
  to   { translate: 0 50svh; opacity: 0; }
}
@keyframes px-hero-glow { from { translate: 0 0; } to { translate: 0 45svh; } }
/* Background light: over its whole pass through the viewport it moves (100vh + its size) × --s along. */
@keyframes px-y {
  from { translate: 0 calc((100vh + var(--size)) * var(--s) / -2); }
  to   { translate: 0 calc((100vh + var(--size)) * var(--s) / 2); }
}
@keyframes ap-open { from { clip-path: inset(14% 10% round 14px); } to { clip-path: inset(0 round 14px); } }
@keyframes ap-drift { from { translate: 0 8%; } to { translate: 0 -8%; } }
@keyframes tl-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes tl-fly { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes tl-land { 0%, 97% { opacity: 1; } to { opacity: 0; } }
/* Outlined section words drift 60vw sideways while their heading passes. */
@keyframes px-x {
  from { translate: calc(var(--sx) * 30vw) 0; }
  to   { translate: calc(var(--sx) * -30vw) 0; }
}

/* ---------- Reduced motion: everything static, nothing moves. ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  [data-reveal].is-hidden { opacity: 1; transform: none; }
  .card { transform: none; }
  .plane, .land-ring { display: none; }
  .fp-steam { opacity: 0.5; }
  .js-timeline.is-live .tl-fly { display: none; }
}

/* Phones: the board (about 750 elements with flat modules, 4,600 with full ones) is not painted while far off screen. Every repaint
   anywhere on the page made the browser sort all of its modules into layers again (tens of milliseconds per frame on a
   phone, the short freezes). site.js sets .cv-on once the page has been laid out, so the board keeps its real height
   (contain-intrinsic-size: auto remembers it) and anchors land where they should. Not used on the cards: Chromium's
   renderer crashed with it there (tested 2026-10-18). */
@media (max-width: 40rem) {
  .board { contain-intrinsic-size: auto 560px; }
  .cv-on .board { content-visibility: auto; overflow-clip-margin: 1rem; }
}

/* Off screen (site.js adds .anim-off to cards, hero and board out of view): every CSS animation inside holds still. */
.anim-off, .anim-off *, .anim-off *::before, .anim-off *::after { animation-play-state: paused !important; }

/* ---------- Loading placeholders ----------
   Parts that site.js fills after loading (Atlas card numbers and map, Tailkeeper download box, account button) show
   quiet pulsing shapes instead of empty room. Colour and corners come from these variables, so a new card style
   changes every placeholder in one place. */
:root {
  --skeleton: color-mix(in srgb, var(--ink) 8%, transparent);
  --skeleton-radius: 8px;
}
@keyframes skeleton-pulse {
  50% { opacity: 0.55; }
}
/* Atlas card: the four numbers as bars until the answer is in (the labels below them are already there). */
.atlas-stats.is-loading b {
  display: block;
  width: 4.5ch;
  height: 1.1em;
  border-radius: var(--skeleton-radius);
  background: var(--skeleton);
  animation: skeleton-pulse 2s ease-in-out infinite;
}
/* Atlas card: the map area until the picture has loaded (aspect ratio comes from the image's width/height). */
.mymap.is-loading img { border-radius: var(--skeleton-radius); background: var(--skeleton); animation: skeleton-pulse 2s ease-in-out infinite; }
/* Tailkeeper download box: three bars (title, line, button) over the hidden content. */
.tb-dl { position: relative; }
.tb-dl.is-pending::before {
  content: "";
  position: absolute;
  inset: clamp(1.25rem, 3vw, 1.75rem);
  background:
    linear-gradient(var(--skeleton), var(--skeleton)) 0 0 / 11rem 1.4rem no-repeat,
    linear-gradient(var(--skeleton), var(--skeleton)) 0 2.6rem / min(100%, 26rem) 0.9rem no-repeat,
    linear-gradient(var(--skeleton), var(--skeleton)) 0 4.4rem / 13rem 2.8rem no-repeat;
  border-radius: var(--skeleton-radius);
  animation: skeleton-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
/* Account button: the label is a bar until the account service answered, so "Sign in" does not flash for someone
   who is signed in. */
.account-toggle.is-pending .account-label {
  color: transparent;
  border-radius: var(--skeleton-radius);
  background: var(--skeleton);
  animation: skeleton-pulse 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .atlas-stats.is-loading b, .mymap.is-loading img, .tb-dl.is-pending::before, .account-toggle.is-pending .account-label { animation: none; }
}
