/* RadLab — editorial design system.
 *
 * One accent colour and the logo's own orange-to-red ramp, everything else
 * neutral. Two complete palettes: light is the default, dark applies through
 * prefers-color-scheme and through an explicit [data-theme] set by the toggle.
 * Layout and colour are separate — no rule below picks a colour without going
 * through a token, which is what makes the dark theme cost one block instead of
 * a rewrite.
 *
 * No framework, no build step, no external requests: the two font families are
 * self-hosted (see tools/fonts.py), the brand artwork is generated by
 * tools/brand.py, code highlighting ships as one extra stylesheet driven by the
 * same variables, and every animation has a prefers-reduced-motion off switch.
 */

/* Self-hosted, split by unicode-range so a reader who never sees Polish diacritics
 * never downloads latin-ext, and nobody downloads the italic axis unless the page
 * uses one. The variable weight range is declared per family, not per instance. */
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/newsreader-400-700-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/newsreader-400-700-normal-latin-ext.woff2") format("woff2");
  /* ł ń ó ś ź ż ą ć ę — without this range Polish falls back to another face mid-word. */
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2211, U+2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader"; font-style: italic; font-weight: 400 600; font-display: swap;
  src: url("../fonts/newsreader-400-600-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader"; font-style: italic; font-weight: 400 600; font-display: swap;
  src: url("../fonts/newsreader-400-600-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2211, U+2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter-400-700-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter-400-700-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2211, U+2C7F, U+A720-A7FF;
}


:root {
  /* ---- palette: light ---- */
  --bg: #ffffff;
  --bg-surface: #faf9f7;
  --bg-raised: #ffffff;
  --text: #17181c;
  --text-muted: #5b5f6a;
  --text-faint: #8b8f9a;
  --border: #e7e5e0;
  --border-strong: #d3d1cb;
  --accent: #c8102e;
  --accent-soft: rgba(200, 16, 46, 0.08);
  --accent-on: #ffffff;

  /* The logo's own ramp, sampled off the source artwork by tools/brand.py.
   * The deep variant is what buttons and rules use: the pale top stop of the
   * full ramp is too light to hold white type. */
  --brand-1: #f7a55f;
  --brand-2: #f6804f;
  --brand-3: #e93936;
  --brand-4: #cb273a;
  --brand-grad: linear-gradient(174deg, var(--brand-1), var(--brand-2) 34%, var(--brand-3) 68%, var(--brand-4));
  --brand-grad-deep: linear-gradient(135deg, var(--brand-3), var(--brand-4));
  --grid-line: rgba(23, 24, 28, 0.055);
  --hero-wash: rgba(246, 128, 79, 0.3);

  /* code tokens */
  --code-bg: #f6f5f2;
  --tok-keyword: #a3092c;
  --tok-name: #1f5cad;
  --tok-string: #2f7d3a;
  --tok-number: #8a5000;
  --tok-comment: #7e828c;
  --tok-punct: #5b5f6a;
  --tok-builtin: #6b3fa0;
  --tok-tag: #a3300a;

  --shadow-sm: 0 1px 2px rgba(23, 24, 28, 0.05);
  --shadow-md: 0 6px 24px -8px rgba(23, 24, 28, 0.18);
  --shadow-lg: 0 22px 48px -22px rgba(23, 24, 28, 0.32);

  /* ---- type ---- */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* ---- rhythm ---- */
  --measure: 68ch;          /* comfortable line length for long-form reading */
  --wide: 1280px;           /* the page: landing grids, not the reading column */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --space: clamp(3.5rem, 9vw, 7rem);
  --radius: 10px;
}

/* ---- palette: dark ----
 * Follows the OS, and follows the toggle when one has been set. The second
 * selector is not redundant: without it an explicit light choice would be
 * overridden inside a dark-mode OS. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
  :root:not([data-theme="light"]) {
    --bg: #0e0f12;
    --bg-surface: #15171b;
    --bg-raised: #191b20;
    --text: #e9e9ec;
    --text-muted: #9ba0aa;
    --text-faint: #747985;
    --border: #292c33;
    --border-strong: #3a3e47;
    --accent: #ff4d5e;
    --accent-soft: rgba(255, 77, 94, 0.14);
    --accent-on: #14101a;

    /* Brighter on a dark field, with near-black type on top of it. */
    --brand-3: #ff6a4d;
    --brand-4: #e0243f;
    --grid-line: rgba(233, 233, 236, 0.06);
  --hero-wash: rgba(246, 128, 79, 0.15);
    /* The same wash at half the strength: over near-black it turns to mud. */
    --hero-wash: rgba(246, 128, 79, 0.15);

    --code-bg: #131519;
    --tok-keyword: #ff7a8a;
    --tok-name: #79b8ff;
    --tok-string: #8ddb9a;
    --tok-number: #e0a56b;
    --tok-comment: #7a7f8b;
    --tok-punct: #9ba0aa;
    --tok-builtin: #c9a5ff;
    --tok-tag: #ffa06b;

    --shadow-sm: none;
    --shadow-md: 0 8px 30px -10px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 24px 54px -24px rgba(0, 0, 0, 0.85);
  }
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"] {
  --bg: #0e0f12;
  --bg-surface: #15171b;
  --bg-raised: #191b20;
  --text: #e9e9ec;
  --text-muted: #9ba0aa;
  --text-faint: #747985;
  --border: #292c33;
  --border-strong: #3a3e47;
  --accent: #ff4d5e;
  --accent-soft: rgba(255, 77, 94, 0.14);
  --accent-on: #14101a;
  --brand-3: #ff6a4d;
  --brand-4: #e0243f;
  --grid-line: rgba(233, 233, 236, 0.06);
  --code-bg: #131519;
  --tok-keyword: #ff7a8a;
  --tok-name: #79b8ff;
  --tok-string: #8ddb9a;
  --tok-number: #e0a56b;
  --tok-comment: #7a7f8b;
  --tok-punct: #9ba0aa;
  --tok-builtin: #c9a5ff;
  --tok-tag: #ffa06b;
  --shadow-sm: none;
  --shadow-md: 0 8px 30px -10px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 54px -24px rgba(0, 0, 0, 0.85);
}

/* ---------------------------------------------------------------- base */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

img, picture, video { max-width: 100%; height: auto; display: block; }

a { color: var(--text); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.measure { max-width: var(--measure); }

/* Icons come from one inline <svg> sprite in base.html; they inherit colour. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.1em; height: 1.1em; flex: none; }
.icon-tiny { width: 0.85em; height: 0.85em; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-on);
  padding: 0.6rem 1rem; z-index: 100; font-family: var(--font-ui);
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------------------------------------------------------------- theme swap
 * An element pair where CSS cannot recolour the artwork itself: the wordmark is
 * black in one file and near-white in the other, and `filter: invert()` would
 * turn the brand gradient into its complement. Mirrors the toggle icons. */
.brand-logo-dark { display: none; }
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo-light { display: none; }
  :root:not([data-theme="light"]) .brand-logo-dark { display: block; }
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s ease;
}
.site-header.is-stuck { box-shadow: var(--shadow-md); }
.site-header .wrap {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 4rem; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
.brand-logo { height: 2.125rem; width: auto; }
@media (max-width: 640px) { .brand-logo { height: 1.875rem; } }

.nav { display: flex; gap: 1.35rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a {
  /* The underline grows out of the link instead of the colour changing, so a
   * hover is legible without a repaint of the whole row. */
  position: relative;
  font-family: var(--font-ui); font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none; letter-spacing: 0.01em;
  padding: 0.45rem 0; white-space: nowrap; flex: none;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.1rem;
  height: 1.5px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: 0.5rem; }

/* Phone header: the mark and the tools on one row, the nav scrollable on the
 * next. Wrapping the nav instead costs three rows of header on a 640px screen. */
@media (max-width: 780px) {
  .site-header .wrap { gap: 0 1rem; }
  .nav {
    order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, #000 92%, transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 0.6rem 0; }
  .header-tools { margin-left: auto; }
}

.lang-switch {
  font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 0.3rem 0.7rem; white-space: nowrap; transition: border-color 0.2s, color 0.2s;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

.theme-toggle {
  appearance: none; background: none; border: 1px solid transparent;
  border-radius: 999px; padding: 0.35rem; cursor: pointer; color: var(--text-muted);
  display: inline-flex; line-height: 0; transition: color 0.2s, background 0.2s;
}
.theme-toggle:hover { color: var(--text); background: var(--bg-surface); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: inline-block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
}

/* Reading position, painted by site.js. Absent script simply means no line. */
.scroll-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.scroll-progress span {
  display: block; height: 100%; width: 0;
  background: var(--brand-grad); transition: width 0.08s linear;
}

/* ---------------------------------------------------------------- hero */

.hero { position: relative; padding: clamp(2.5rem, 6vw, 4.5rem) 0 0; overflow: clip; }

.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: -20% -10% 0;
  background:
    radial-gradient(52% 58% at 74% 22%, var(--hero-wash), transparent 70%),
    radial-gradient(44% 50% at 6% 88%, var(--accent-soft), transparent 72%);
  /* Faded out at the bottom so the band above the first section stays a rule,
   * not a half-lit gradient that stops mid-page. */
  -webkit-mask-image: radial-gradient(110% 90% at 50% 12%, #000 45%, transparent 100%);
  mask-image: radial-gradient(110% 90% at 50% 12%, #000 45%, transparent 100%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(78% 70% at 68% 30%, #000, transparent 78%);
  mask-image: radial-gradient(78% 70% at 68% 30%, #000, transparent 78%);
}

.hero-inner {
  position: relative; z-index: 1;
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  padding-block: clamp(1.5rem, 4vw, 3.5rem);
}
@media (min-width: 1000px) {
  .hero-inner { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); }
}
.hero .eyebrow {
  font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.375rem, 1.35rem + 3.5vw, 4.25rem);
  max-width: 22ch; margin-bottom: 1.25rem;
}
.hero .lede {
  font-size: clamp(1.125rem, 1.05rem + 0.5vw, 1.4375rem);
  line-height: 1.55; color: var(--text-muted); max-width: 52ch;
}
.hero .actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2.25rem; }

/* The circle: the logo's own mark at display size, with the sphere shading the
 * original artwork has. */
.hero-stage {
  position: relative; width: 100%; max-width: 460px; aspect-ratio: 1; margin-inline: auto;
  /* One shared 3D context for the mark and the orbits: with the labels tilted
   * into it, the star occludes the ones that pass its far side, and the
   * perspective scales them by distance instead of a second animation. */
  perspective: 1500px; transform-style: preserve-3d;
}

/* The wrapper carries the pointer parallax site.js writes to `transform`, and
 * the slow roam in `translate` -- separate properties, so the animation cannot
 * swallow the inline style the way a second `transform` would, and the ball
 * keeps its own breathing transform underneath both. */
.orb-orbit {
  position: absolute; inset: 0; will-change: transform;
  transform-style: preserve-3d;
  animation: orb-roam 26s ease-in-out infinite;
}
.orb {
  position: absolute; top: 50%; left: 50%; width: 56%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--brand-grad);
  box-shadow:
    inset -14px -20px 54px rgba(58, 12, 6, 0.34),
    inset 12px 14px 40px rgba(255, 255, 255, 0.26),
    0 42px 90px -34px color-mix(in srgb, var(--brand-4) 68%, transparent);
  animation: orb-breathe 12s ease-in-out infinite;
}
/* A sheen that turns once every cycle: the only thing that makes it obvious the
 * circle is not a flat disc, so it stays slow, low-contrast and blurred enough
 * to read as light rather than as a wedge across the mark. */
.orb::after {
  content: ""; position: absolute; inset: -4%;
  border-radius: 50%;
  background: conic-gradient(from 210deg, transparent 0 56%, rgba(255, 255, 255, 0.13) 72%, transparent 90%);
  filter: blur(13px);
  animation: orb-sheen 18s linear infinite;
}

.hero-mesh { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--accent); opacity: 0.42; }
.mesh-lines path { stroke-dasharray: 5 11; animation: mesh-dash 16s linear infinite; }
.mesh-lines path:nth-child(2) { animation-duration: 22s; animation-direction: reverse; }
.mesh-lines path:nth-child(3) { animation-duration: 19s; }
.mesh-dots circle { animation: mesh-pulse 5.5s ease-in-out infinite; }
.mesh-dots circle:nth-child(2n) { animation-delay: -1.6s; }
.mesh-dots circle:nth-child(3n) { animation-delay: -3.1s; }

/* Named things we actually ship, in orbit around the mark. Each label rides a
 * ring tilted away from the screen, so it travels behind the star and returns
 * from the other side: a red dwarf with the system that gathers round it.
 *
 * Angles are unitless so one custom property drives both the transform (times
 * 1deg) and the timing; --start is part of the static transform as well as the
 * animation, which is what leaves the six parked on their rings under
 * prefers-reduced-motion instead of collapsing onto one line. */
.orbits {
  position: absolute; inset: 0; margin: 0; padding: 0; list-style: none;
  transform-style: preserve-3d;
  --dur: 150s;
  /* The system drifts with its star rather than the star sliding inside its own
   * rings; `translate` again so the script's `transform` still composes. */
  animation: orb-roam 26s ease-in-out infinite;
}
.orbit {
  position: absolute; left: 50%; top: 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2);
  margin: calc(var(--r) * -1);
  /* The orbit itself, drawn: a dashed rule the label never leaves. Faint
   * because six of them are a diagram, and the mark is the subject. */
  border: 1px dashed color-mix(in srgb, var(--accent) 13%, transparent);
  border-radius: 50%;
  transform: rotateX(calc(var(--inc) * 1deg));
  transform-style: preserve-3d;
  /* Undoing the plane's tilt for the label inside. */
  --plane-inverse: rotateX(calc(var(--inc) * -1deg));
  /* The far-side dim, shifted so its bottom lands on theta 270 whatever angle
   * this orbit starts at. One period is subtracted to keep the delay negative:
   * a positive one would hold the base value until it elapsed, and a label
   * would surface at full strength mid-transit. */
  --far-delay: calc(((270 - var(--start)) / 360 - 1) * var(--dur));
}
.orbit-arm {
  position: absolute; left: 50%; top: 50%;
  transform: rotateZ(calc(var(--start) * 1deg)) translateX(var(--r));
  transform-style: preserve-3d;
  animation: orbit-run var(--dur) linear infinite;
}
/* The counter-turn multiplies the plane's rotations out to a pure translation:
 * the label arrives at the tip of the arm upright and flat to the screen, while
 * its position keeps the tilt. Perspective on the stage does the rest of the
 * depth for free -- nearer is larger, and the star occludes the far side. */
.chip {
  position: absolute; left: 0; top: 0;
  /* Rotations pivot on the top-left corner, which is where the arm's tip is.
   * The default centre origin would swing the label on a radius of its own
   * half-size -- up to 63px off the orbit, worst at the far spoke. With the
   * corner as the pivot the counter-turn cancels exactly and the innermost
   * translate(-50%) drops it back centred on the tip. */
  transform-origin: 0 0;
  font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
  white-space: nowrap; color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-raised) 88%, transparent);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 0.32rem 0.66rem; box-shadow: var(--shadow-sm);
  transform: rotateZ(calc(var(--start) * -1deg)) var(--plane-inverse) translate(-50%, -50%);
  /* What the far-side ones look like when motion is off and no animation is
   * driving opacity: behind the mark, not sliced across it. */
  opacity: var(--rest, 1);
  /* Dimming through the far half, so a label dissolves behind the star rather
   * than being cut mid-word by its limb. */
  animation: orbit-upright var(--dur) linear infinite,
             orbit-far var(--dur) linear infinite;
  animation-delay: 0s, var(--far-delay);
}
/* One period for the whole system, so the six keep their distance for good: a
 * wheel of spokes at 60 degrees with the widest label on the innermost ring.
 * Differential periods here would put two of them on top of each other about
 * a third of the time -- measured, not guessed. The radii are the largest that
 * keep every label clear of the headline down to the 1000px breakpoint, and
 * each tilt is set so the far side of the inner rings grazes the star's disc.
 *
 *   label          radius  tilt   spoke
 *   pLLama3-8B        150    44       0
 *   bi-encoders       160    36      60
 *   RAG               180    46     240
 *   LLM Router        168    42     120
 *   QA                188    38     302
 *   word2vec          178    34     180
 */
.orbits li:nth-child(1) { --r: 150px; --inc: 44; --start: 0; }
.orbits li:nth-child(2) { --r: 160px; --inc: 36; --start: 60; }
.orbits li:nth-child(3) { --r: 180px; --inc: 46; --start: 240; --rest: 0.45; }
.orbits li:nth-child(4) { --r: 168px; --inc: 42; --start: 120; }
.orbits li:nth-child(5) { --r: 188px; --inc: 38; --start: 302; --rest: 0.45; }
.orbits li:nth-child(6) { --r: 178px; --inc: 34; --start: 180; }
/* Seven to ten labels keep tilted, individual rings and evenly spaced spokes.
 * The inner far sides cross behind the star, just like the six-label system. */
.orbits--extended .chip {
  width: max-content; max-width: 6.5rem; font-size: 0.6875rem; padding: 0.25rem 0.5rem;
  white-space: normal; text-align: center; overflow-wrap: anywhere;
}
.orbits--extended li:nth-child(1) { --r: 214px; --inc: 54; --start: 18; }
.orbits--extended li:nth-child(2) { --r: 218px; --inc: 55; --start: 54; }
.orbits--extended li:nth-child(3) { --r: 222px; --inc: 56; --start: 90; --rest: 1; }
.orbits--extended li:nth-child(4) { --r: 212px; --inc: 54; --start: 126; }
.orbits--extended li:nth-child(5) { --r: 220px; --inc: 55; --start: 162; --rest: 1; }
.orbits--extended li:nth-child(6) { --r: 216px; --inc: 54; --start: 198; }
.orbits--extended li:nth-child(7) { --r: 220px; --inc: 56; --start: 234; --rest: 0.45; }
.orbits--extended li:nth-child(8) { --r: 212px; --inc: 55; --start: 270; --rest: 0.45; }
.orbits--extended li:nth-child(9) { --r: 222px; --inc: 56; --start: 306; --rest: 0.45; }
.orbits--extended li:nth-child(10) { --r: 214px; --inc: 54; --start: 342; }
@media (max-width: 520px) {
  .orbits .chip { font-size: 0.6875rem; padding: 0.25rem 0.5rem; }
}

/* Between the stacked layout and the width where a system of six labels has
 * room to turn, they keep parked positions instead -- the same spokes without
 * the orbit. Below this the diagram would reach into the headline.
 *
 * The lower bound is not decoration: the parked offsets are margins, and under
 * the stacked layout the chips are flex items again, where a percentage
 * margin-top resolves against the column's inline size too. */
@media (min-width: 1000px) and (max-width: 1279px) {
  .orbit, .orbit-arm { display: contents; }
  .chip {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    animation: none;
  }
  /* --pk pulls the parked ring in where the hero column is narrow: at 376px of
   * stage, a label at 58% hung off the edge of the window. */
  .orbits { --pk: 1; }
  .orbits li:nth-child(1) .chip { margin-left: calc(-16% * var(--pk)); margin-top: -62%; }
  .orbits li:nth-child(2) .chip { margin-left: calc(36% * var(--pk));  margin-top: -76%; }
  .orbits li:nth-child(3) .chip { margin-left: calc(58% * var(--pk));  margin-top: -8%; }
  .orbits li:nth-child(4) .chip { margin-left: calc(44% * var(--pk));  margin-top: 64%; }
  .orbits li:nth-child(5) .chip { margin-left: calc(-4% * var(--pk));  margin-top: 78%; }
  .orbits li:nth-child(6) .chip { margin-left: calc(-40% * var(--pk)); margin-top: 16%; }
}
@media (min-width: 1000px) and (max-width: 1279px) {
  .orbits { --pk: 0.85; }
}
@media (min-width: 1000px) and (max-width: 1149px) {
  .orbits { --pk: 0.72; }
}
@media (min-width: 1000px) and (max-width: 1279px) {
  .orbits--extended li .chip { max-width: 8rem; white-space: normal; text-align: center; overflow-wrap: anywhere; }
  .orbits--extended li:nth-child(1) .chip { margin-left: 0; margin-top: -45%; }
  .orbits--extended li:nth-child(2) .chip { margin-left: 32%; margin-top: -36%; }
  .orbits--extended li:nth-child(3) .chip { margin-left: 38%; margin-top: -13%; }
  .orbits--extended li:nth-child(4) .chip { margin-left: 38%; margin-top: 13%; }
  .orbits--extended li:nth-child(5) .chip { margin-left: 32%; margin-top: 36%; }
  .orbits--extended li:nth-child(6) .chip { margin-left: 0; margin-top: 45%; }
  .orbits--extended li:nth-child(7) .chip { margin-left: -32%; margin-top: 36%; }
  .orbits--extended li:nth-child(8) .chip { margin-left: -38%; margin-top: 13%; }
  .orbits--extended li:nth-child(9) .chip { margin-left: -38%; margin-top: -13%; }
  .orbits--extended li:nth-child(10) .chip { margin-left: -32%; margin-top: -36%; }
}

@media (max-width: 999px) {
  /* Stacked. An absolutely positioned orbit does not survive a 360px column
   * without landing on the paragraph above, so the mark stops floating behind
   * the pills and the pills become a row beneath it. */
  .hero-stage {
    aspect-ratio: auto; max-width: 380px; margin-block: 1.5rem 0;
    display: flex; flex-direction: column; align-items: center; gap: 1.35rem;
  }
  .hero-mesh { display: none; }
  /* The parallax wrapper steps out of the box tree so the ball is a flex item
   * of the stage again; the pointer effect does not run at this width, and
   * neither does the roam -- there is no box left to move. */
  .orb-orbit { position: static; display: contents; animation: none; }
  .orb {
    position: relative; top: auto; left: auto; width: min(72%, 290px);
    transform: none; animation: orb-pulse 12s ease-in-out infinite;
  }
  /* width: 100% because a centred column flex item would otherwise size to its
   * content and let the last pill run past the screen. animation: none for the
   * same reason: the roam is a drift of the star inside a square of sky, and a
   * row of pills at the screen's edge has no such margin -- measured, it pushed
   * the row 18px past the right gutter and 15px past the left at 360px. */
  .orbits {
    position: static; width: 100%; display: flex; flex-wrap: wrap;
    justify-content: center; align-items: center; gap: 0.45rem;
    transform-style: flat; animation: none;
  }
  /* The ring and its arm stop being boxes, so the labels are flex items again. */
  .orbit, .orbit-arm { display: contents; }
  /* align-items above and margin: 0 together: a parked -62% margin-top on a
   * wrapped line stretches every pill to that line's height -- a 999px radius
   * over a 200px tall box is the column of capsules this used to render.
   * opacity: 1 because --rest marks the labels behind the star, and in a row
   * underneath it two of six just read as disabled. */
  .chip { position: static; margin: 0; opacity: 1; transform: none; animation: none; }
}

/* More than ten labels need normal flow, not additional overlapping rings.
 * Keep the mark's square above a list that can grow by any number of rows. */
.hero-stage--dense {
  aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; gap: 1.35rem;
}
@media (min-width: 1000px) {
  .hero-stage--dense .orb-orbit {
    position: relative; inset: auto; width: 100%; aspect-ratio: 1;
  }
  .hero-stage--dense .hero-mesh { height: auto; aspect-ratio: 1; }
}
.orbits.orbits--wrapped {
  position: static; width: 100%; display: flex; flex-wrap: wrap;
  justify-content: center; align-items: center; gap: 0.45rem;
  transform-style: flat; transform: none; animation: none;
}
.orbits--wrapped .orbit, .orbits--wrapped .orbit-arm { display: contents; }
.orbits.orbits--wrapped li .chip {
  position: static; left: auto; top: auto; margin: 0; max-width: 100%;
  white-space: normal; overflow-wrap: anywhere; text-align: center;
  opacity: 1; transform: none; animation: none;
}

.stats {
  display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3.25rem);
  list-style: none; margin: 2.75rem 0 0; padding: 1.5rem 0 0;
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-num {
  font-family: var(--font-display); font-size: clamp(1.75rem, 1.35rem + 1.2vw, 2.5rem);
  font-weight: 600; line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  /* The number counts up from zero; the label has to hold its line while it does. */
  min-width: 3.5ch;
}
.stat-label { font-family: var(--font-ui); font-size: 0.8125rem; color: var(--text-faint); }

/* Model and product names on a loop: the strip is aria-hidden, its content is
 * decoration for a page that says the same things in prose. */
.ticker {
  position: relative; z-index: 1; margin-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--border); background: var(--bg-surface);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: ticker-run 46s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-group { display: flex; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 1.1rem;
  font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted);
  padding: 0.75rem 1.5rem; white-space: nowrap;
}
.ticker-item::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); opacity: 0.65;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 600;
  text-decoration: none; border-radius: 999px; padding: 0.7rem 1.3rem;
  display: inline-flex; align-items: center; gap: 0.45rem; border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
              border-color 0.18s ease, color 0.18s ease;
}
.btn-primary {
  background: var(--brand-grad-deep); color: var(--accent-on);
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--brand-4) 78%, transparent);
}
.btn-primary:hover {
  color: var(--accent-on); transform: translateY(-1px);
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--brand-4) 78%, transparent);
}
.btn-quiet { border-color: var(--border-strong); color: var(--text); background: var(--bg-raised); }
.btn-quiet:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ---------------------------------------------------------------- sections */

.section { padding: clamp(3.25rem, 7vw, 5.75rem) 0; border-top: 1px solid var(--border); }
.section .eyebrow {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.85rem;
}
.section .eyebrow::before {
  content: ""; height: 1px; width: 1.5rem; background: currentColor;
  transition: width 0.4s ease;
}
.section:hover .eyebrow::before { width: 2.75rem; }
.section h2 { font-size: clamp(1.875rem, 1.3rem + 2.1vw, 3rem); margin-bottom: 0.4em; }
.section .intro { color: var(--text-muted); max-width: 60ch; font-size: 1.0625rem; }

/* Title left, standfirst right: the extra page width goes to the pairing, not
 * to a longer measure — 60ch of body copy is still 60ch. */
.section-head { display: grid; gap: 0.75rem 3rem; align-items: end; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
@media (min-width: 900px) {
  .section-head { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); }
  .section-head .intro { padding-bottom: 0.35rem; }
  .section-head .section-cta { justify-self: end; }
}
.section-cta { margin-top: 0.5rem; }

/* Two columns on a wide page. A single 68ch paragraph on the left of 1280px
 * looked like a mistake next to grids that use the whole row; the measure per
 * column stays inside what reads well. Articles are unaffected. */
@media (min-width: 1040px) {
  .section .prose--split { max-width: none; columns: 2; column-gap: 3.75rem; }
  .section .prose--split > * { break-inside: avoid; }
}

/* How many cards go across is the section's decision: four areas in one row,
 * four products in a square. --cell-min is a fraction of the row, floored so a
 * card never becomes a column of eleven characters. */
.grid {
  --cell-min: 285px;
  display: grid; gap: clamp(0.9rem, 2vw, 1.4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--cell-min)), 1fr));
}
.grid--2 { --cell-min: max(260px, calc(50% - 1.25rem)); }
.grid--3 { --cell-min: max(240px, calc(33.333% - 1.5rem)); }
.grid--4 { --cell-min: max(230px, calc(25% - 1.5rem)); }
@media (min-width: 700px) and (max-width: 1000px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) { .grid { --cell-min: 100%; } }
.cell {
  position: relative; display: flex; flex-direction: column; gap: 0.6rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
/* A ramp that runs in along the top edge: brand colour as feedback, not as
 * decoration painted over everything. */
.cell::before {
  content: ""; position: absolute; left: -1px; top: -1px; height: 2px; width: 0;
  border-radius: var(--radius) 0 0 0; background: var(--brand-grad);
  transition: width 0.35s ease;
}
.cell:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.cell:hover::before { width: calc(100% + 2px); }
.cell-icon { width: 1.5rem; height: 1.5rem; color: var(--accent); margin-bottom: 0.35rem; }
.cell-index {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint);
  letter-spacing: 0.06em;
}
.cell h3 { font-size: 1.3125rem; margin: 0; }
.cell p { font-size: 1rem; color: var(--text-muted); margin: 0; max-width: 46ch; }
.cell-link {
  margin-top: auto; padding-top: 0.85rem;
  font-family: var(--font-ui); font-size: 0.875rem; font-weight: 600;
  text-decoration: none; color: var(--accent);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.cell-link .icon { transition: transform 0.2s ease; }
.cell-link:hover .icon { transform: translateX(3px); }

/* ---------------------------------------------------------------- tech stack */

.section--stack { position: relative; }

.stack-bar {
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
  padding: clamp(0.85rem, 2vw, 1.25rem) clamp(1rem, 2.5vw, 1.75rem);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stack-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.85rem;
}
.stack-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.stack-pill:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--text);
}
.stack-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-3);
  flex-shrink: 0;
}
.stack-pill-name {
  color: var(--text);
  font-weight: 600;
}
.stack-pill-role {
  font-size: 0.75rem;
  color: var(--text-faint);
  padding-left: 0.15rem;
}
.stack-grid { align-items: stretch; }
.stack-cell { gap: 0.75rem; }
.stack-cell h3 { font-size: 1.25rem; }
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.85rem;
}
.tag-tech {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-surface) 75%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.22rem 0.55rem;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.stack-cell:hover .tag-tech {
  border-color: var(--border-strong);
  color: var(--text);
}

/* ---------------------------------------------------------------- contact */

.contact-card {
  position: relative; overflow: hidden;
  display: grid; gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.75rem, 4vw, 3.25rem);
  background:
    radial-gradient(120% 150% at 100% 0%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 62%),
    var(--bg-raised);
  border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.6);
}
@media (min-width: 920px) { .contact-card { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; } }
.contact-card h2 { margin-bottom: 0.35em; }
.contact-scenarios {
  margin: 1.25rem 0 0;
  padding: 0 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.contact-scenarios li strong {
  color: var(--text);
}
.contact-card .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.contact-side { display: flex; flex-direction: column; gap: 1.5rem; }

.social { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.social a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 0.4rem 0.8rem;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

/* ---------------------------------------------------------------- blog */

.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2.25rem); }
.page-head h1 { font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem); margin-bottom: 0.6rem; }
.page-head .intro { color: var(--text-muted); max-width: 60ch; margin: 0; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list > li { border-top: 1px solid var(--border); }
.post-item {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 1.75rem;
  padding: 2rem 0; align-items: start;
}
@media (max-width: 680px) { .post-item { grid-template-columns: 1fr; gap: 0.85rem; } }

.post-item .meta {
  font-family: var(--font-ui); font-size: 0.8125rem; color: var(--text-faint);
  line-height: 1.6; padding-top: 0.35rem;
}
.post-item .meta time { display: block; font-variant-numeric: tabular-nums; }
.post-item h2 { font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem); margin: 0 0 0.4rem; }
.post-item h2 a { text-decoration: none; }
.post-item h2 a:hover { color: var(--accent); }
.post-item .excerpt { color: var(--text-muted); margin: 0; max-width: 62ch; font-size: 1.03125rem; }
.post-item .flags { margin-top: 0.7rem; }

/* A picture beside every index entry: the archive is mostly screenshots of
 * models and dashboards, and a page of titles alone does not show that. */
.thumb {
  display: block; width: 100%; aspect-ratio: 1; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg-surface);
}
/* <picture> is inline, so a height of 100% on the image would otherwise be a
 * percentage of the line box and letterbox every square crop. */
.thumb picture { display: block; width: 100%; height: 100%; }
.thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-item:hover .thumb-img { transform: scale(1.06); }
/* A row reads date, picture, text -- but a picture track may only be declared
 * for an entry that renders one, because grid places children by position: an
 * entry without a thumbnail would drop its text into the empty 6rem column and
 * wrap every line at two words. `post-item--media` is set by the same template
 * test that renders the picture, so the two cannot disagree. */
.post-list--compact .post-item { grid-template-columns: 1fr; gap: 1.15rem; padding: 1.35rem 0; }
.post-list--compact .post-item--media { grid-template-columns: 5.5rem minmax(0, 1fr); }
.post-list--compact .post-item h2 { font-size: 1.1875rem; }
.post-list--compact .post-body { display: flex; flex-direction: column; gap: 0.3rem; }
.post-list--compact .meta { padding-top: 0; }
.post-list--index .post-item { grid-template-columns: 9rem minmax(0, 1fr); }
.post-list--index .post-item--media { grid-template-columns: 9rem 6rem minmax(0, 1fr); }
/* The picture drops out before the layout gets cramped. */
@media (max-width: 940px) {
  .post-list--index .post-item--media { grid-template-columns: 9rem minmax(0, 1fr); }
  .post-list--index .thumb { display: none; }
}
@media (max-width: 680px) {
  .post-list--compact .post-item, .post-list--compact .post-item--media,
  .post-list--index .post-item, .post-list--index .post-item--media { grid-template-columns: 1fr; }
  .post-list--compact .thumb { display: none; }
}

.feature {
  display: grid; gap: clamp(1.25rem, 3vw, 2.25rem);
  padding: 0 0 clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--border);
}
@media (min-width: 860px) { .feature { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); } }
.feature-media {
  display: block; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--border);
  /* No picture on the post: the brand ramp stands in for one. */
  background: var(--brand-grad);
}
.feature-media picture { display: block; width: 100%; height: 100%; }
.feature-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.feature:hover .feature-img { transform: scale(1.035); }
.feature-body { display: flex; flex-direction: column; justify-content: center; gap: 0.6rem; }
.feature-body .meta {
  font-family: var(--font-ui); font-size: 0.8125rem; color: var(--text-faint);
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.feature-body h3 { font-size: clamp(1.625rem, 1.3rem + 1.3vw, 2.25rem); margin: 0; }
.feature-body h3 a { text-decoration: none; }
.feature-body h3 a:hover { color: var(--accent); }
.feature-body .excerpt { color: var(--text-muted); max-width: 58ch; margin: 0; }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0.85rem 0 0; padding: 0; }
.tag {
  font-family: var(--font-ui); font-size: 0.75rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.15rem 0.6rem;
}
a.tag:hover { color: var(--accent); border-color: var(--accent); }

.note {
  font-family: var(--font-ui); font-size: 0.875rem;
  background: var(--accent-soft); border-left: 2px solid var(--accent);
  padding: 0.7rem 1rem; border-radius: 0 6px 6px 0; color: var(--text-muted);
}
.note a { color: var(--accent); font-weight: 600; }

.pager {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 2.5rem 0 1rem; border-top: 1px solid var(--border); margin-top: 1rem;
  font-family: var(--font-ui); font-size: 0.875rem;
}
.pager a { text-decoration: none; color: var(--accent); font-weight: 600; }
.pager .spacer { width: 5.5rem; }
.pager .count { color: var(--text-faint); }

/* The archive keeps its images on small screens, unlike the compact LP list. */
.blog-index { max-width: 1100px; font-family: var(--font-ui); font-size: 1rem; }
.blog-index h1, .blog-index h2 { font-family: var(--font-ui); font-weight: 600; }
.blog-index .page-head { border-bottom: 3px solid var(--accent); margin-bottom: 1.5rem; }
.blog-index .post-list > li { border-top: 0; border-bottom: 1px solid var(--border); }
.blog-index .post-item { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; padding: 1.75rem 0; }
.blog-index .post-item--media { grid-template-columns: 15rem minmax(0, 1fr); }
.blog-index .thumb { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius); }
.blog-index .post-entry-body { min-width: 0; }
.blog-index .meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; color: var(--text-muted); padding: 0; margin-bottom: 0.65rem; }
.blog-index .post-item h2 { font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem); line-height: 1.3; overflow-wrap: anywhere; }
.blog-index .excerpt { font-size: 0.9375rem; line-height: 1.65; }
.post-read-link { display: inline-block; margin-top: 1rem; padding-block: 0.3rem; color: var(--accent); font-size: 0.875rem; font-weight: 600; text-decoration: none; }
.post-read-link:hover { text-decoration: underline; }
@media (max-width: 800px) {
  .blog-index .post-item--media { grid-template-columns: 11rem minmax(0, 1fr); gap: 1.25rem; }
}
@media (max-width: 600px) {
  .blog-index .post-item--media { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}

/* ---------------------------------------------------------------- article */

.article { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.article-head { margin-bottom: 2.5rem; }
.article-head h1 {
  font-size: clamp(2rem, 1.35rem + 3vw, 3.25rem);
  max-width: 28ch; margin-bottom: 1rem;
}
.article-head .lede { font-size: 1.1875rem; color: var(--text-muted); max-width: 58ch; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1.15rem; align-items: baseline;
  font-family: var(--font-ui); font-size: 0.8125rem; color: var(--text-faint);
  margin-bottom: 1.5rem;
}
.article-meta time { font-variant-numeric: tabular-nums; }

.prose { max-width: var(--measure); }
.prose h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin: 2.5em 0 0.6em; }
.prose h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); margin: 2em 0 0.5em; }
.prose h4 { font-size: 1.125rem; margin: 1.75em 0 0.4em; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 5rem; }
.prose img, .prose picture { margin: 2rem 0; }
.prose figure { margin: 2.25rem 0; }
.prose figure img, .prose figure picture { margin: 0; }
.prose figcaption, .prose figure + em {
  display: block; font-family: var(--font-ui); font-size: 0.875rem;
  color: var(--text-faint); margin-top: 0.65rem; line-height: 1.55; text-align: center;
}
.prose ul, .prose ol { padding-left: 1.35rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose li > ul, .prose li > ol { margin-top: 0.4em; margin-bottom: 0; }

.prose blockquote {
  margin: 2em 0; padding-left: 1.25rem; border-left: 2px solid var(--accent);
  color: var(--text-muted); font-style: italic;
}
.prose blockquote cite { display: block; font-style: normal; font-size: 0.9rem; margin-top: 0.6rem; }

.prose table { width: 100%; border-collapse: collapse; margin: 2em 0; font-size: 0.9375rem; font-family: var(--font-ui); }
.prose th, .prose td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 600; color: var(--text-muted); border-bottom-width: 2px; }
.prose code {
  font-family: var(--font-mono); font-size: 0.875em;
  background: var(--code-bg); border-radius: 4px; padding: 0.12em 0.35em;
}
.prose pre code { background: none; padding: 0; font-size: 0.8125rem; }
.prose .codehilite { margin: 1.75em 0; border: 1px solid var(--border); }
.code-copy-wrapper { display: flow-root; }
.code-copy {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}
.code-copy-status { margin-inline-start: 0.65rem; font-size: 0.8125rem; }
a.tag-tech:hover { color: var(--accent); border-color: currentColor; }

.prose details {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.85rem 1.1rem; margin: 1.75em 0; background: var(--bg-surface);
}
.prose details > summary {
  cursor: pointer; font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 600;
}
.prose details[open] > summary { margin-bottom: 1rem; }

.prose .callout {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 1.1rem 1.3rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.75em 0;
}

.embed { position: relative; aspect-ratio: 16 / 9; margin: 2em 0; background: var(--bg-surface); border-radius: var(--radius); overflow: hidden; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Self-hosted video keeps its own aspect ratio instead of the 16:9 box. */
.embed-video { position: static; aspect-ratio: auto; background: none; overflow: visible; }
.embed-video video { width: 100%; border-radius: var(--radius); background: #000; }

/* Blog-specific reading layout; product pages keep their own presentation. */
.blog-post { font-family: var(--font-ui); font-size: 1rem; }
.blog-post > .wrap { max-width: 1100px; }
.blog-post-head {
  padding: clamp(1.25rem, 3vw, 2.5rem); border: 1px solid var(--border);
  border-top: 3px solid var(--accent); border-radius: var(--radius); background: var(--bg-surface);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.blog-post-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.blog-post-head h1 { font-family: var(--font-ui); font-weight: 600; line-height: 1.2; letter-spacing: -0.035em; max-width: 32ch; overflow-wrap: anywhere; }
.blog-post-head .lede { font-size: clamp(1rem, 0.95rem + 0.4vw, 1.1875rem); max-width: 70ch; line-height: 1.65; }
.blog-post-head .article-meta { color: var(--text-muted); margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.blog-post-layout { max-width: 76ch; margin-inline: auto; }
.blog-post-layout--outline { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 3rem; max-width: none; align-items: start; }
.blog-post-body { min-width: 0; }
.blog-post-body > .note { margin-bottom: 2rem; }
.blog-prose { max-width: none; font-size: 1.0625rem; line-height: 1.8; overflow-wrap: anywhere; }
.blog-prose h2, .blog-prose h3, .blog-prose h4 { font-family: var(--font-ui); font-weight: 600; line-height: 1.3; scroll-margin-top: 8rem; }
.blog-prose > :first-child { margin-top: 0; }
.blog-prose h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); }
.blog-prose h3 { font-size: 1.25rem; }
.blog-prose a { text-decoration-color: var(--border-strong); }
.blog-prose a:hover { text-decoration-color: var(--accent); }
.blog-prose .codehilite { border-radius: var(--radius); overflow: hidden; }
.blog-prose pre { max-width: 100%; overflow-x: auto; }
.blog-prose table { display: block; max-width: 100%; overflow-x: auto; }
.blog-prose picture { margin: 2rem 0; }
.blog-prose picture img { margin: 0; }
.blog-prose img, .blog-prose video { border-radius: var(--radius); }
.blog-prose blockquote { padding: 1.25rem 1.5rem; background: var(--bg-surface); border-radius: 0 var(--radius) var(--radius) 0; font-style: normal; }
.blog-outline { grid-column: 2; grid-row: 1; position: sticky; top: 6rem; max-height: calc(100vh - 8rem); overflow-y: auto; font-size: 0.8125rem; }
.blog-outline details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); padding: 1rem 1.25rem; }
.blog-outline summary { cursor: pointer; font-weight: 600; }
.blog-outline summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.blog-outline ol { list-style: none; padding: 0; margin: 1rem 0 0; }
.blog-outline li + li { margin-top: 0.65rem; }
.blog-outline .outline-h3 { padding-left: 0.85rem; font-size: 0.75rem; }
.blog-outline a { color: var(--text-muted); text-decoration: none; display: block; padding-block: 0.15rem; overflow-wrap: anywhere; }
.blog-outline a:hover { color: var(--accent); text-decoration: underline; }
.blog-post .article-foot { max-width: none; }
@media (max-width: 940px) {
  .blog-post-layout--outline { display: flex; flex-direction: column; gap: 2rem; max-width: 76ch; }
  .blog-outline { position: static; max-height: none; width: 100%; }
  .blog-post-body { width: 100%; }
}
@media (max-width: 600px) {
  .blog-post-head h1 { font-size: 1.75rem; }
  .blog-post-head .lede { font-size: 0.9375rem; }
  .blog-prose { font-size: 1rem; line-height: 1.75; }
}
@media print {
  .blog-outline, .blog-post .breadcrumb { display: none; }
  .blog-post-layout--outline { display: block; }
}

/* ---------------------------------------------------------------- product page */

.breadcrumb {
  margin-bottom: 1.75rem;
}
.breadcrumb a {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumb a:hover {
  color: var(--accent);
}

.product-head {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
}
.product-page > .wrap { max-width: 1100px; }
.product-page { font-family: var(--font-ui); font-size: 1rem; }
.product-page h1, .product-prose h2, .product-prose h3, .product-prose h4 {
  font-family: var(--font-ui); font-weight: 600; line-height: 1.25;
}
.product-head h1 {
  font-size: clamp(2rem, 1.25rem + 3vw, 3.25rem);
  letter-spacing: -0.04em; margin-bottom: 0.6rem; overflow-wrap: anywhere;
}
.product-head .lede {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.1875rem);
  color: var(--text-muted); max-width: 60ch; margin: 0;
}
.product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.85rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}
.product-version {
  font-family: var(--font-mono); border-left: 1px solid var(--border-strong);
  padding-left: 0.85rem;
}

.product-header-content {
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 3vw, 1.75rem);
}
.product-summary { min-width: 0; flex: 1; }
.product-icon-badge {
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 14px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.product-icon-badge .icon {
  width: 2.1rem;
  height: 2.1rem;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1.75rem;
}
.product-resource-link {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem;
  font-size: 0.875rem; font-weight: 500; color: var(--text-muted);
  text-decoration: none;
}
.product-resource-link:hover { color: var(--accent); text-decoration: underline; }
.product-actions a { max-width: 100%; overflow-wrap: anywhere; }
.product-actions a span { min-width: 0; }
.product-tags {
  margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
}
.product-tags .tag { background: transparent; color: var(--text-muted); font-size: 0.75rem; }
.product-prose, .product-page .article-foot { max-width: 82ch; margin-inline: auto; }
.product-prose { overflow-wrap: anywhere; }
.product-prose > h2:first-child { margin-top: 0; }
.product-prose h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); margin-top: 2.25em; }
.product-prose h3 { font-size: 1.125rem; }
.product-prose hr { margin-block: 2.5rem; }
.product-prose .codehilite { border-radius: var(--radius); overflow: hidden; }
.product-prose pre { overflow-x: auto; }
.product-prose table { display: block; overflow-x: auto; }

.product-flow { margin-block: 1.75rem; }
.product-flow-endpoint {
  text-align: center; padding: 0.85rem 1rem; color: var(--text-muted);
  font-size: 0.875rem; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.product-prose .product-flow-steps { list-style: none; padding: 0; margin: 0; }
.product-flow-steps > li {
  position: relative; margin: 2.5rem 0; padding: 1.25rem 1.5rem;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--bg-raised);
}
.product-flow-steps > li::before, .product-flow-steps > li:last-child::after {
  content: "↓"; position: absolute; left: 50%; transform: translateX(-50%);
  color: var(--accent); font-size: 1.25rem; line-height: 2.5rem;
}
.product-flow-steps > li::before { top: -2.5rem; }
.product-flow-steps > li:last-child::after { bottom: -2.5rem; }
.product-flow-steps h3 { margin: 0 0 0.5rem; }
.product-flow-steps p { color: var(--text-muted); font-size: 0.9375rem; }

@media (max-width: 640px) {
  .product-header-content { flex-direction: column; }
  .product-icon-badge { width: 3.5rem; height: 3.5rem; }
  .product-icon-badge .icon { width: 1.75rem; height: 1.75rem; }
  .product-actions { align-items: flex-start; flex-direction: column; gap: 0.5rem; }
  .product-flow-steps > li { padding: 1rem; }
}

.article-foot {
  max-width: var(--measure); margin-top: 3.5rem; padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
}
.article-foot a { font-family: var(--font-ui); font-size: 0.9375rem; font-weight: 600; text-decoration: none; color: var(--accent); }

/* ---------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--border); background: var(--bg-surface); margin-top: 0; }
.site-footer .wrap { padding-block: clamp(2.5rem, 6vw, 4rem); }
.footer-grid { display: grid; gap: 2.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.footer-grid h4 {
  font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.9rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-grid a { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--text-muted); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border); margin-top: 2.5rem; padding-top: 1.5rem;
  font-family: var(--font-ui); font-size: 0.8125rem; color: var(--text-faint);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.to-top {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--text-muted); text-decoration: none; font-weight: 600;
}
.to-top:hover { color: var(--accent); }
.to-top .icon { transition: transform 0.2s ease; }
.to-top:hover .icon { transform: translateY(-2px); }

/* --------------------------------------------------------- analytics consent */
.consent-panel[hidden], .consent-settings[hidden] { display: none; }
.consent-panel {
  position: fixed; z-index: 100; inset: auto 1rem 1rem; margin-inline: auto;
  width: min(46rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto;
  padding: clamp(1rem, 3vw, 1.75rem); border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--bg-raised); color: var(--text);
  box-shadow: var(--shadow-sm);
}
.consent-panel h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
.consent-panel p { font-size: 0.9375rem; margin: 0 0 1rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.consent-actions .btn { flex: 1 1 12rem; justify-content: center; }
.consent-settings {
  padding: 0; border: 0; background: none; color: var(--text-muted);
  font: inherit; text-decoration: underline; cursor: pointer;
}
@media print { .consent-panel, .consent-settings { display: none; } }

/* ---------------------------------------------------------------- motion
 * Everything below is opt-in twice over: only after site.js has marked the
 * document with .js, and never under prefers-reduced-motion. A page whose
 * script is blocked therefore shows everything, still. */

html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .reveal.is-in { opacity: 1; transform: none; }
/* Staggered so a grid of four does not arrive as one slab. */
html.js .reveal:nth-child(2) { transition-delay: 0.07s; }
html.js .reveal:nth-child(3) { transition-delay: 0.14s; }
html.js .reveal:nth-child(4) { transition-delay: 0.21s; }

@keyframes orb-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -52%) scale(1.055); }
}
/* The mark drifts on its own between pointer visits. Unequal distances on the
 * two axes and an off-centre turning point keep the path from reading as a
 * circle the eye can predict after one lap. */
@keyframes orb-roam {
  /* Roomier up and down than side to side: the hero has height in hand, while
   * its width ends at the headline, and the labels ride along with the mark. */
  0%, 100% { translate: 0 0; }
  22% { translate: -19px 27px; }
  47% { translate: 22px -31px; }
  71% { translate: 12px 20px; }
}
/* Same breath without the centring transform, for when the orb is in flow. */
@keyframes orb-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
@keyframes orb-sheen { to { transform: rotate(360deg); } }
@keyframes mesh-dash { to { stroke-dashoffset: -160; } }
@keyframes mesh-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes orbit-run {
  from { transform: rotateZ(calc(var(--start) * 1deg)) translateX(var(--r)); }
  to { transform: rotateZ(calc(var(--start) * 1deg + 360deg)) translateX(var(--r)); }
}
@keyframes orbit-far {
  0%, 100% { opacity: 0.28; }
  42%, 58% { opacity: 1; }
}
@keyframes orbit-upright {
  from { transform: rotateZ(calc(var(--start) * -1deg)) var(--plane-inverse) translate(-50%, -50%); }
  to { transform: rotateZ(calc(var(--start) * -1deg - 360deg)) var(--plane-inverse) translate(-50%, -50%); }
}
@keyframes ticker-run { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  .orb-orbit, .orb, .orb::after, .mesh-lines path, .mesh-dots circle, .orbit-arm, .chip, .ticker-track {
    animation: none !important;
  }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .cell, .btn, .social a, .feature-img, .thumb-img, .nav a::after { transition: none; }
}

@media print {
  .code-copy, .code-copy-status { display: none; }
  .site-header, .site-footer, .theme-toggle, .lang-switch, .hero-stage, .ticker { display: none; }
  body { background: #fff; color: #000; }
}
