/* =====================================================================
   style.css  :  colours, fonts and layout of the site
   ---------------------------------------------------------------------
   HOW TO CHANGE THE LOOK
   - COLOURS : BLUE  is the normal look (deep blue with brass and a
     cold-to-hot scale). COLOURS : LIGHT is the look after a visitor
     presses the sun button. Each line is one colour with a short note.
   - The three --font lines set the typefaces. --maxw sets the page width.
   Everything below those blocks is layout. You rarely need to touch it.
   ===================================================================== */

/* ---------- Typefaces (files are in assets/fonts) ---------- */
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-condensed-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: italic; font-display: swap; src: url("../assets/fonts/barlow-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("../assets/fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../assets/fonts/plex-mono-500.woff2") format("woff2"); }

:root {
  --maxw: 1180px;                 /* page width */
  --bar-h: 62px;                  /* height of the top bar */
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;   /* name, headings, big numbers */
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;   /* sentences */
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;   /* drawing lettering */

  /* ============ COLOURS : BLUE (the normal look) ============ */
  --bg: #061430;                  /* page background, deep blue */
  --bg-top: #0b2459;              /* lighter blue at the very top of the page */
  --bg-low: #040e25;              /* darkest blue, footer and edges */
  --glow-a: rgba(52, 128, 240, 0.36);   /* big soft light behind the gear train */
  --glow-b: rgba(30, 96, 210, 0.22);    /* second soft light on the left */
  --panel-a: rgba(18, 50, 110, 0.80);   /* cards, top */
  --panel-b: rgba(10, 32, 76, 0.80);    /* cards, bottom */
  --panel-solid: #0c2555;         /* solid card colour (menus, drawing fills) */
  --well: rgba(3, 12, 32, 0.55);  /* sunk areas: figures and form fields */
  --ink: #eef4ff;                 /* main text */
  --ink-soft: #b5c7e5;            /* secondary text */
  --ink-faint: #8198bd;           /* small labels */
  --line: #8cc0ff;                /* drawing lines */
  --rule: rgba(140, 192, 255, 0.17);          /* thin borders */
  --rule-strong: rgba(140, 192, 255, 0.36);   /* stronger borders */
  --grid: rgba(140, 192, 255, 0.055);         /* graph paper inside figures */
  --cool: #55c8ff;                /* cold end of the scale, links */
  --accent: #f4bc55;              /* brass text and thin lines */
  --accent-fill: #f2b441;         /* brass button */
  --accent-soft: rgba(255, 184, 64, 0.09);    /* brass tint */
  --on-accent: #1b1303;           /* text on brass */
  --hot: #ff8048;                 /* hot end of the scale */
  --metal-hi: #2f6cc8;            /* gears, lit centre */
  --metal: #153d7e;               /* gears and metal parts in drawings */
  --metal-dark: #0a2253;          /* ring gear body, outer edge */
  --pcm: #5a4212;                 /* phase change material in drawings */
  --edge: rgba(2, 9, 26, 0.72);   /* dark edge behind each gear */
  --shadow: rgba(0, 0, 0, 0.62);
  --name-a: #ffffff;              /* the name is filled from this colour ... */
  --name-b: #9cc6ff;              /* ... to this one */
  --dim-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8'%3E%3Cpath d='M0 4L10 0.6V7.4Z' fill='%238cc0ff' fill-opacity='.7'/%3E%3C/svg%3E");
  --dim-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8'%3E%3Cpath d='M10 4L0 0.6V7.4Z' fill='%238cc0ff' fill-opacity='.7'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* ============ COLOURS : LIGHT (after the sun button) ============ */
:root[data-theme="light"] {
  --bg: #e9eff8;
  --bg-top: #f6f9fd;
  --bg-low: #dbe5f2;
  --glow-a: rgba(64, 132, 230, 0.20);
  --glow-b: rgba(64, 132, 230, 0.12);
  --panel-a: rgba(255, 255, 255, 0.92);
  --panel-b: rgba(246, 250, 255, 0.92);
  --panel-solid: #f8fbff;
  --well: rgba(226, 235, 247, 0.75);
  --ink: #0c2140;
  --ink-soft: #3c526e;
  --ink-faint: #516782;
  --line: #1d4f90;
  --rule: rgba(29, 79, 144, 0.20);
  --rule-strong: rgba(29, 79, 144, 0.42);
  --grid: rgba(29, 79, 144, 0.07);
  --cool: #0b69b4;
  --accent: #8a4a00;
  --accent-fill: #f2b441;
  --accent-soft: rgba(196, 124, 10, 0.12);
  --on-accent: #1b1303;
  --hot: #c2470f;
  --metal-hi: #f6f9fd;
  --metal: #cfdcee;
  --metal-dark: #b6c9e3;
  --pcm: #ecd49a;
  --edge: rgba(20, 50, 100, 0.22);
  --shadow: rgba(24, 52, 96, 0.22);
  --name-a: #0c2140;
  --name-b: #1d4f90;
  --dim-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8'%3E%3Cpath d='M0 4L10 0.6V7.4Z' fill='%231d4f90' fill-opacity='.7'/%3E%3C/svg%3E");
  --dim-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8'%3E%3Cpath d='M10 4L0 0.6V7.4Z' fill='%231d4f90' fill-opacity='.7'/%3E%3C/svg%3E");
  color-scheme: light;
}

/* =====================================================================
   BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg-low);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bar-h) + 18px);
  scrollbar-color: var(--rule-strong) transparent;
}
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(1150px 680px at 84% 180px, var(--glow-a), transparent 70%),
    radial-gradient(880px 620px at -4% 620px, var(--glow-b), transparent 70%),
    linear-gradient(180deg, var(--bg-top) 0, var(--bg) 880px);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, svg, canvas { max-width: 100%; }
img, video { height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, dt, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
address { font-style: normal; }
a { color: var(--cool); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
sub { font-size: 0.72em; line-height: 0; }
strong { font-weight: 600; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(244, 188, 85, 0.36); }
:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 3px; border-radius: 3px; }
.sprite { position: absolute; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sep { color: var(--rule-strong); margin-inline: 0.35em; }
.nw { white-space: nowrap; }
.i { width: 1em; height: 1em; flex: none; vertical-align: -0.12em; }

.wrap {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}

.skip { position: absolute; left: 12px; top: -80px; z-index: 80; background: var(--accent-fill); color: var(--on-accent); padding: 8px 14px; font-weight: 600; text-decoration: none; border-radius: 4px; }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); }

/* the moving streamlines sit behind everything */
.flow { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
.flow.is-on { opacity: 1; }
main, .foot { position: relative; z-index: 1; }

/* =====================================================================
   TOP BAR
   ===================================================================== */
.bar {
  position: sticky; top: 0; z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(6, 20, 48, 0.86);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.bar.is-stuck { background: color-mix(in srgb, var(--bg) 95%, transparent); border-bottom-color: var(--rule); }
.bar__in { display: flex; align-items: center; gap: 18px; min-height: var(--bar-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand__mark { flex: none; width: 30px; height: 30px; fill: var(--accent-fill); transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.brand:hover .brand__mark { transform: rotate(108deg); }
.brand__name { font: 600 1.28rem/1 var(--font-display); letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  position: relative; padding: 8px 10px; color: var(--ink-soft); text-decoration: none;
  font-size: 0.95rem; font-weight: 500; white-space: nowrap; border-radius: 6px; transition: color 0.2s ease;
}
.nav a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; background: var(--accent-fill); transform: scaleX(0); transform-origin: left; transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="true"] { color: var(--ink); }
.nav a[aria-current="true"]::after { transform: scaleX(1); }

.bar__tools { display: flex; align-items: center; gap: 8px; }
.tool {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1px solid var(--rule-strong); border-radius: 8px; color: var(--ink); cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.tool:hover { border-color: var(--accent); color: var(--accent); }
.tool .i { width: 20px; height: 20px; }
.tool[aria-pressed="false"] { color: var(--ink-faint); border-style: dashed; }
.i--sun { display: none; }
:root[data-theme="light"] .i--moon { display: none; }
:root[data-theme="light"] .i--sun { display: block; }
.nav-toggle { display: none; }

/* the CV menu */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 216px; padding: 6px;
  background: var(--panel-solid); border: 1px solid var(--rule-strong); border-radius: 10px; box-shadow: 0 24px 48px -18px var(--shadow);
}
.menu__panel a { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 500; }
.menu__panel a:hover { background: var(--accent-soft); color: var(--ink); }
.menu__panel small { font: 400 0.72rem var(--font-mono); color: var(--ink-faint); }

/* the line under the bar: it fills from cold to hot as the page is scrolled */
.heatbar { height: 2px; background: var(--rule); overflow: hidden; }
.heatbar span, .heatbar i { display: block; width: 100%; height: 100%; will-change: transform; }
.heatbar span { overflow: hidden; transform: translateX(-100%); }
.heatbar i { background: linear-gradient(90deg, var(--cool), var(--accent-fill) 62%, var(--hot)); transform: translateX(100%); }
@keyframes heat-a { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes heat-b { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes needle { from { transform: rotate(-135deg); } to { transform: rotate(135deg); } }
@supports (animation-timeline: scroll()) {
  .heatbar span { animation: heat-a linear both; animation-timeline: scroll(root block); }
  .heatbar i { animation: heat-b linear both; animation-timeline: scroll(root block); }
  .dial__needle { animation: needle linear both; animation-timeline: scroll(root block); }
}

@media (max-width: 1139px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%; display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 12px max(18px, env(safe-area-inset-right, 0px)) 16px max(18px, env(safe-area-inset-left, 0px));
    background: var(--panel-solid); border-bottom: 1px solid var(--rule-strong); box-shadow: 0 30px 50px -24px var(--shadow);
    max-height: calc(100vh - var(--bar-h)); max-height: calc(100dvh - var(--bar-h)); overflow-y: auto;
  }
  .nav.is-open { display: grid; }
  .nav a { padding: 12px 12px; font-size: 1.02rem; border: 1px solid var(--rule); }
  .nav a::after { display: none; }
  .nav a[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
}
@media (max-width: 520px) {
  /* on a phone the bar holds the mark, the name and four buttons: everything is a little tighter */
  .bar__in { gap: 10px; }
  .bar__tools { gap: 6px; }
  .tool { width: 38px; height: 38px; }
  .brand { gap: 8px; }
  .brand__mark { width: 26px; height: 26px; }
  .brand__name { font-size: 1.15rem; letter-spacing: 0.06em; }
  .bar .btn--sm { min-height: 38px; padding-inline: 11px; }
}
@media (max-width: 380px) { .brand__name { display: none; } }

/* =====================================================================
   BUTTONS, CHIPS, SMALL TEXT
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 10px 20px;
  border: 1px solid var(--rule-strong); border-radius: 8px; background: color-mix(in srgb, var(--panel-solid) 55%, transparent);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1.1; white-space: nowrap; cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  border: 0; color: var(--on-accent); padding-inline: 26px 30px;
  background: linear-gradient(180deg, #ffd27a, var(--accent-fill) 55%, #dc9a22);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  border-radius: 0;
}
.btn--primary:hover { color: var(--on-accent); filter: brightness(1.07); }
.btn--sm { min-height: 40px; padding: 8px 13px; font-size: 0.92rem; border-radius: 8px; }
.btn .i { width: 1.05em; height: 1.05em; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips li { padding: 3px 9px; border: 1px solid var(--rule); border-radius: 5px; background: color-mix(in srgb, var(--line) 6%, transparent); font: 400 0.78rem/1.5 var(--font-mono); color: var(--ink-soft); }
.chips--lg li { padding: 7px 12px; font: 500 0.96rem/1.35 var(--font-body); color: var(--ink); border-color: var(--rule-strong); }

.kicker { font: 400 0.8rem/1.5 var(--font-mono); color: var(--cool); }
.meta { color: var(--ink-soft); font-size: 0.95rem; }
.plain { color: var(--ink); font-size: 1.06rem; }
.minor { font: 500 0.74rem/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin: 1.6em 0 0.7em; }
.when { font: 500 0.8rem/1.4 var(--font-mono); color: var(--accent); margin-bottom: 4px; }
.footnote { margin-top: 22px; font: 400 0.76rem/1.6 var(--font-mono); color: var(--ink-faint); }

.docs { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.doc { display: inline-flex; align-items: center; gap: 6px; font: 500 0.8rem/1.4 var(--font-mono); color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 0.28em; }
.doc:hover { color: var(--ink); text-decoration-color: currentColor; }
.hide-docs .doc, .hide-docs .docs { display: none; }

/* small square holding an icon */
.tile { display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; border: 1px solid var(--rule-strong); border-radius: 9px; color: var(--line); background: color-mix(in srgb, var(--line) 8%, transparent); }
.tile .i { width: 22px; height: 22px; }
.tile--warm { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--line) 6%, transparent); }
.tile--cool { color: var(--cool); border-color: color-mix(in srgb, var(--cool) 45%, transparent); background: color-mix(in srgb, var(--cool) 10%, transparent); }

/* cards */
.card {
  position: relative; padding: clamp(18px, 2.4vw, 26px);
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 16px 28px -20px var(--shadow);
}

/* =====================================================================
   HERO
   ===================================================================== */
.hero { position: relative; z-index: 1; padding-top: clamp(30px, 6vw, 76px); overflow-x: hidden; overflow-x: clip; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr); gap: clamp(28px, 5vw, 70px); align-items: center; }
.hero__text { container-type: inline-size; }
.hero__name {
  font: 700 clamp(3.3rem, 14.6vw, 6.4rem)/0.9 var(--font-display); letter-spacing: -0.005em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--name-a) 28%, var(--name-b)); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.06em;
}
@supports (font-size: 1cqw) { .hero__name { font-size: clamp(3.1rem, 19.4cqw, 6.6rem); } }
.hero__name span { display: block; }
.hero__role { margin-top: 12px; font: 600 clamp(1.25rem, 3.4vw, 1.8rem)/1.1 var(--font-display); letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); }
.hero__focus { margin-top: 20px; min-height: 3.1em; font: 400 0.98rem/1.55 var(--font-mono); color: var(--cool); }
.hero__focus-k { display: inline-block; margin-right: 8px; padding: 1px 8px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 4px; color: var(--accent); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; vertical-align: 0.08em; }
.caret { display: inline-block; width: 0.56em; height: 1.08em; margin-left: 3px; background: var(--accent-fill); vertical-align: -0.2em; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__lead { margin-top: 6px; max-width: 33em; font-size: clamp(1.06rem, 1.5vw, 1.2rem); color: var(--ink-soft); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero__links { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 24px; }
.hero__links a, .hero__links span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-soft); text-decoration: none; font: 400 0.82rem/1.4 var(--font-mono); transition: border-color 0.2s ease, color 0.2s ease; }
.hero__links a:hover { border-color: var(--accent); color: var(--accent); }
.hero__links .i { width: 16px; height: 16px; color: var(--cool); }

.hero__fig { position: relative; min-width: 0; }
.hero__fig::before { content: ""; position: absolute; left: 50%; top: 0; width: min(118%, 640px); aspect-ratio: 1; transform: translate(-50%, -8%); border-radius: 50%; background: radial-gradient(closest-side, var(--glow-a), color-mix(in srgb, var(--glow-a) 30%, transparent) 56%, transparent 74%); pointer-events: none; }
.hero__fig figcaption { margin-top: 16px; text-align: center; font: 400 0.78rem/1.6 var(--font-mono); color: var(--ink-faint); }
.figno { color: var(--accent); font-weight: 500; margin-right: 4px; }
.spec { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin-top: 10px; }
.spec span { padding: 3px 9px; border: 1px solid var(--rule); border-radius: 5px; white-space: nowrap; }
.spec b { color: var(--ink); font-weight: 500; }

/* ---------- the planetary gear train ---------- */
.pg { position: relative; width: 100%; max-width: 540px; aspect-ratio: 1; margin-inline: auto; overflow: hidden; }
.pg .pg__ring { position: absolute; inset: 0; width: 100%; height: 100%; }
/* .pg__s is turned by the scroll position, .pg__t inside it by time (see js/drawings.js) */
.pg__s, .pg__t { display: block; width: 100%; height: 100%; will-change: transform; }
.pg__s--carrier { position: absolute; inset: 0; }
.pg__s--sun { position: absolute; left: 23.6667%; top: 23.6667%; width: 52.6667%; height: 52.6667%; }
.pg__p { position: absolute; width: 17.3333%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.pg .pg__planet, .pg .pg__sun { display: block; width: 100%; height: 100%; }
.pg .pg__arms { position: absolute; left: 14.6667%; top: 14.6667%; width: 70.6667%; height: 70.6667%; }
.pg__t { animation: pg-spin 48s linear infinite; }
.pg__s--planet > .pg__t { transform: rotate(170deg); animation-name: pg-spin-planet; }
@keyframes pg-spin { to { transform: rotate(360deg); } }
@keyframes pg-spin-planet { from { transform: rotate(170deg); } to { transform: rotate(-190deg); } }
@keyframes pg-scroll { from { transform: rotate(0deg); } to { transform: rotate(calc(var(--turn, 0deg) * var(--k, 1))); } }
@supports (animation-timeline: scroll()) {
  .pg__s { animation: pg-scroll linear both; animation-timeline: scroll(root block); }
}
.no-motion .pg__t, .pg.is-away .pg__t { animation-play-state: paused; }
.pg__photo {
  position: absolute; left: 50%; top: 50%; width: 41.4%; height: 41.4%; transform: translate(-50%, -50%);
  border-radius: 50%; object-fit: cover; background: #fff;
  border: 3px solid var(--accent-fill);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 36px rgba(84, 164, 255, 0.4);
}
.pg:not(.is-built) .pg__photo { width: 70%; height: 70%; box-shadow: 0 0 0 10px var(--metal), 0 0 0 11px var(--line), 0 0 50px rgba(84, 164, 255, 0.4); }
.pg .gear { stroke: var(--line); stroke-width: 1.15; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pg .gear-edge { fill: none; stroke: var(--edge); stroke-width: 3.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pg .stop-m1 { stop-color: var(--metal-hi); } .pg .stop-m2 { stop-color: var(--metal); }
.pg .stop-r1 { stop-color: var(--metal); } .pg .stop-r2 { stop-color: var(--metal-dark); }
.pg .bolt { fill: var(--bg); stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pg .arm { fill: none; stroke: var(--accent-fill); stroke-width: 2.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: 0.9; }
.pg .pin { fill: var(--accent-fill); stroke: var(--on-accent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pg .pin-eye { fill: var(--on-accent); }

/* ---------- the four headline numbers ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: clamp(34px, 5.4vw, 64px); }
.stat { position: relative; overflow: hidden; padding: 18px 20px 18px; background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); border: 1px solid var(--rule); border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 16px 28px -20px var(--shadow); }
.stat::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--c), transparent 82%); }
.stat:nth-child(1) { --c: var(--cool); }
.stat:nth-child(2) { --c: var(--line); }
.stat:nth-child(3) { --c: var(--accent-fill); }
.stat:nth-child(4) { --c: var(--hot); }
.stat dt { font: 500 0.72rem/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.stat__v { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; margin: 8px 0 6px; font: 700 clamp(2.7rem, 5vw, 3.5rem)/1 var(--font-display); color: var(--ink); }
.stat__v small { font: 500 0.82rem/1 var(--font-mono); color: var(--accent); }
.stat__n { color: var(--ink-soft); font-size: 0.94rem; line-height: 1.38; }

/* rolling digits, like a mechanical counter */
.odo { display: inline-flex; line-height: 1; }
.odo__d { display: inline-block; height: 1em; overflow: hidden; }
.odo__s { display: block; transition: transform 1.7s cubic-bezier(0.16, 0.84, 0.24, 1); transition-delay: var(--dl, 0ms); }
.odo__s i { display: block; height: 1em; line-height: 1; font-style: normal; text-align: center; }
.is-in .odo__s { transform: translate3d(0, calc(var(--n) * -1em), 0); }

@media (max-width: 899px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__fig { max-width: 460px; width: 100%; margin-inline: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 520px) {
  .hero__cta .btn { flex: 1 1 auto; }
  .hero__cta .btn--primary { flex-basis: 100%; }
  .stat { padding: 15px 15px 15px; }
  .stat__n { font-size: 0.88rem; }
}

/* =====================================================================
   SECTIONS
   ===================================================================== */
.sec { position: relative; padding-top: clamp(68px, 9.5vw, 128px); }
.sec--last { padding-bottom: clamp(64px, 9vw, 112px); }
.sec__head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px clamp(14px, 3vw, 28px); margin-bottom: clamp(24px, 4vw, 42px); }
.sec__head h2 { font: 700 clamp(2.3rem, 6.4vw, 3.7rem)/0.95 var(--font-display); letter-spacing: 0.004em; text-transform: uppercase; color: var(--ink); text-wrap: balance; }
/* a dimension line, as on a drawing, carrying one measure of the section */
.dim { display: flex; align-items: center; gap: 12px; flex: 1 1 200px; min-width: 0; margin-bottom: 0.62em; }
.dim::before, .dim::after { content: ""; flex: 1 1 20px; height: 15px; }
.dim::before { border-left: 1px solid var(--rule-strong); background: var(--dim-l) left center / 10px 8px no-repeat, linear-gradient(var(--rule-strong), var(--rule-strong)) center / 100% 1px no-repeat; }
.dim::after { border-right: 1px solid var(--rule-strong); background: var(--dim-r) right center / 10px 8px no-repeat, linear-gradient(var(--rule-strong), var(--rule-strong)) center / 100% 1px no-repeat; }
.dim b { font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: clamp(26px, 4.4vw, 60px); align-items: start; }
.about__row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 16px; align-items: start; }
.about__row + .about__row { margin-top: 20px; }
.about__row p { color: var(--ink-soft); font-size: 1.08rem; }
.about__row strong { color: var(--ink); }
.status { display: flex; align-items: center; gap: 12px; margin-top: 26px; padding: 13px 16px; border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--panel-solid) 70%, transparent); color: var(--ink); font-weight: 500; }
.status__dot { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-fill); }
.status__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-fill); opacity: 0.55; animation: ping 2.4s ease-out infinite; }
@keyframes ping { 70%, 100% { transform: scale(3.2); opacity: 0; } }

/* the rating plate */
.plate {
  position: relative; padding: 30px 28px 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 46%, transparent); border-radius: 12px;
  background: linear-gradient(158deg, var(--panel-a), var(--panel-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), inset 0 0 0 5px color-mix(in srgb, var(--bg-low) 42%, transparent), 0 18px 32px -22px var(--shadow);
}
.rivet { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #ffe6ae, #c18722 58%, #5e3e07); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }
.rivet--a { left: 12px; top: 12px; } .rivet--b { right: 12px; top: 12px; } .rivet--c { left: 12px; bottom: 12px; } .rivet--d { right: 12px; bottom: 12px; }
.plate__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 14px; font: 500 0.76rem/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.proj { width: 58px; height: 24px; }
.proj .l { fill: none; stroke: var(--line); stroke-width: 1.3; }
.proj .cl { fill: none; stroke: var(--line); stroke-width: 0.7; stroke-dasharray: 5 2 1 2; }
.plate__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--rule-strong); border: 1px solid var(--rule-strong); border-radius: 6px; overflow: hidden; }
.pf { padding: 9px 13px 10px; background: color-mix(in srgb, var(--panel-solid) 92%, transparent); }
.pf--full { grid-column: 1 / -1; }
.pf dt { font: 400 0.66rem/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.pf dd { margin-top: 2px; font: 600 1.14rem/1.22 var(--font-display); letter-spacing: 0.012em; color: var(--ink); }

@media (max-width: 899px) { .about { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .about__row { grid-template-columns: 38px minmax(0, 1fr); gap: 13px; } .about__row p { font-size: 1.03rem; } .tile { width: 38px; height: 38px; } .plate { padding: 28px 18px 24px; } }

/* ---------- Education ---------- */
.tl { position: relative; display: grid; gap: 22px; }
.tl::before { content: ""; position: absolute; left: 37px; top: 40px; bottom: 40px; width: 1px; background: linear-gradient(var(--rule-strong), var(--rule)); }
.tl__item { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: clamp(12px, 2vw, 22px); align-items: start; }
.tl__dial { position: relative; width: 76px; height: 76px; margin-top: 6px; border-radius: 50%; background: var(--bg); }
.tl__dial:empty { visibility: hidden; }
.tl__dial svg { display: block; width: 100%; height: 100%; }
.dialring__track { fill: none; stroke: var(--rule-strong); stroke-width: 4; }
.dialring__val { fill: none; stroke: var(--accent-fill); stroke-width: 4; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s; }
.is-in .dialring__val, .no-js-dial .dialring__val { stroke-dashoffset: var(--off, 0); }
.dialring__n { font: 700 21px var(--font-display); fill: var(--ink); }
.dialring__m { font: 400 9.5px var(--font-mono); fill: var(--ink-faint); }
.tl__card h3 { font: 600 clamp(1.4rem, 2.6vw, 1.75rem)/1.14 var(--font-display); letter-spacing: 0.006em; }
.tl__card .meta { margin-top: 4px; }
.edu__row { display: grid; grid-template-columns: minmax(0, 1fr) clamp(180px, 21vw, 250px); gap: clamp(14px, 2vw, 22px); align-items: start; margin-top: 18px; }
.edu__row .fig--chart { margin-top: 0; }
.facts { margin-top: 12px; display: grid; gap: 3px; color: var(--ink-soft); }
.facts strong { color: var(--ink); }
.gradphoto img { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--rule-strong); }
.gradphoto figcaption { margin-top: 8px; font: 400 0.74rem/1.5 var(--font-mono); color: var(--ink-faint); text-align: center; }
@media (max-width: 760px) {
  .edu__row { grid-template-columns: minmax(0, 1fr); }
  .gradphoto { max-width: 250px; }
}
@media (max-width: 620px) {
  /* on a phone the ring moves into the corner of its card, so the card can use the full width */
  .tl::before { display: none; }
  .tl__item { position: relative; grid-template-columns: minmax(0, 1fr); }
  .tl__dial { position: absolute; right: 14px; top: 14px; z-index: 2; width: 62px; height: 62px; margin: 0; background: transparent; }
  .tl__card > .when, .tl__card > h3 { padding-right: 70px; }
  .tl__card .fig--chart { padding: 12px 8px 12px 4px; }
  .tl__card .fig--chart figcaption { padding-left: 8px; }
}

/* ---------- Figures ---------- */
.fig {
  position: relative; padding: clamp(14px, 2vw, 20px);
  background-color: var(--well);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid var(--rule); border-radius: 12px;
}
/* drafting corner marks */
.fig::before, .fig::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--accent); pointer-events: none; }
.fig::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.fig::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }
.fig figcaption { margin-top: 12px; font: 400 0.75rem/1.6 var(--font-mono); color: var(--ink-faint); }
.fig__title { margin-bottom: 12px; font: 500 0.78rem/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
.fig__title--gap { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--rule-strong); }
.fig__note { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--accent-fill); background: color-mix(in srgb, var(--panel-solid) 78%, transparent); border-radius: 0 8px 8px 0; font-size: 0.95rem; line-height: 1.5; color: var(--ink); }
.fig--chart { margin-top: 18px; }
.chart { min-height: 204px; }

/* ---------- Research, experience and project entries ---------- */
.entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 54px); align-items: start; }
.entry + .entry { margin-top: clamp(48px, 7vw, 84px); padding-top: clamp(48px, 7vw, 84px); border-top: 1px solid var(--rule); }
.entry h3 { margin-top: 8px; font: 600 clamp(1.5rem, 2.9vw, 2rem)/1.14 var(--font-display); letter-spacing: 0.004em; text-wrap: balance; }
.entry .plain { margin-top: 12px; }
.entry .meta { margin-top: 10px; }
.entry .chips { margin-top: 18px; }

.readouts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.readout { flex: 1 1 150px; padding: 12px 14px 12px 16px; border: 1px solid var(--rule); border-left: 3px solid var(--cool); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--panel-solid) 60%, transparent); }
.readout--hot { border-left-color: var(--hot); }
.readout dt { font: 400 0.7rem/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.readout dd { margin-top: 4px; font: 700 clamp(1.7rem, 3vw, 2.15rem)/1 var(--font-display); color: var(--ink); white-space: nowrap; }
.readout small { margin-left: 6px; font: 500 0.78rem var(--font-mono); color: var(--accent); }
.readouts--center { justify-content: center; }
.readouts--center .readout { flex: 1 1 130px; max-width: 200px; }

/* "Method and results" opens on request */
.more { margin-top: 20px; border: 1px solid var(--rule-strong); border-radius: 10px; background: color-mix(in srgb, var(--panel-solid) 46%, transparent); }
.more > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; list-style: none; cursor: pointer; font-weight: 600; color: var(--ink); border-radius: 10px; transition: color 0.2s ease; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { color: var(--accent); }
.more > summary .i { width: 20px; height: 20px; color: var(--accent); transition: transform 0.3s ease; }
.more[open] > summary .i { transform: rotate(180deg); }
.more .points { padding: 2px 16px 16px; }

.points { display: grid; gap: 11px; }
.points--open { margin-top: 16px; }
.points li { position: relative; padding-left: 1.45em; color: var(--ink-soft); }
.points li::before { content: ""; position: absolute; left: 0.14em; top: 0.6em; width: 7px; height: 7px; border: 1.5px solid var(--accent); transform: rotate(45deg); }
.points strong { color: var(--ink); }

/* the buttons above the thesis drawing */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.seg button { padding: 7px 11px; border: 1px solid var(--rule-strong); border-radius: 7px; background: color-mix(in srgb, var(--panel-solid) 60%, transparent); color: var(--ink-soft); font: 500 0.78rem/1.3 var(--font-mono); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease; }
.seg button:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.seg--len { align-items: center; margin-bottom: 12px; }
.seg__label { margin-right: 6px; font: 400 0.72rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.fig__canvas { min-height: 60px; }
.key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 0.86rem; color: var(--ink-soft); }
.key li { display: inline-flex; align-items: center; gap: 8px; }
.key__sw { width: 22px; height: 12px; border: 1px solid var(--line); border-radius: 2px; }
.key__sw--metal { background: repeating-linear-gradient(45deg, var(--metal), var(--metal) 3px, color-mix(in srgb, var(--line) 45%, var(--metal)) 3px, color-mix(in srgb, var(--line) 45%, var(--metal)) 4px); }
.key__sw--pcm { background: var(--pcm); }
.key__sw--chan { width: 13px; height: 13px; border-radius: 50%; background: var(--bg); }
.key__ln { width: 26px; height: 3px; border-radius: 2px; }
.key__ln--cold { background: var(--cool); } .key__ln--warm { background: var(--accent-fill); } .key__ln--hot { background: var(--hot); }

/* the linked model of the CO2 study */
.flowline { display: grid; gap: 16px; }
.flowline li { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; border: 1px solid var(--rule-strong); border-radius: 8px; background: color-mix(in srgb, var(--panel-solid) 70%, transparent); font-weight: 600; color: var(--ink); }
.flowline li small { font: 400 0.72rem var(--font-mono); color: var(--ink-faint); text-align: right; }
.flowline li + li::before { content: ""; position: absolute; left: 26px; top: -17px; height: 16px; width: 2px; background: repeating-linear-gradient(var(--accent-fill) 0 4px, transparent 4px 8px); animation: drip 0.9s linear infinite; }
.flowline li + li::after { content: ""; position: absolute; left: 22px; top: -7px; border: 5px solid transparent; border-top: 7px solid var(--accent-fill); border-bottom: 0; }
@keyframes drip { to { background-position: 0 8px; } }
.flowline__under { margin-top: 14px; padding: 9px 12px; border: 1px dashed var(--rule-strong); border-radius: 8px; text-align: center; font: 400 0.76rem/1.6 var(--font-mono); color: var(--ink-soft); }
.checks { display: grid; gap: 12px; counter-reset: chk; }
.checks li { position: relative; display: grid; gap: 2px; padding-left: 36px; counter-increment: chk; }
.checks li::before { content: counter(chk); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); font: 500 0.74rem var(--font-mono); }
.checks__k { font-weight: 600; color: var(--ink); }
.checks__v { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; }
.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 16px; margin-top: 14px; counter-reset: prt; font-size: 0.9rem; color: var(--ink-soft); }
.parts li { position: relative; padding-left: 30px; counter-increment: prt; }
.parts li::before { content: counter(prt); position: absolute; left: 0; top: 2px; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font: 500 0.68rem var(--font-mono); color: var(--ink); }
.parts--card { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }

.fig--gauge .fig__canvas { max-width: 330px; margin-inline: auto; }
.video { display: block; width: 100%; aspect-ratio: 848 / 478; background: #000; border-radius: 8px; border: 1px solid var(--rule-strong); }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.thumb { padding: 0; border: 1px solid var(--rule-strong); border-radius: 8px; overflow: hidden; background: none; cursor: zoom-in; transition: border-color 0.2s ease, transform 0.25s ease; }
.thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

@media (min-width: 941px) { .entry__fig { position: sticky; top: calc(var(--bar-h) + 22px); } }
@media (max-width: 940px) { .entry { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .parts { grid-template-columns: minmax(0, 1fr); } .seg button { padding: 7px 9px; font-size: 0.74rem; } }

/* ---------- Project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: clamp(40px, 6vw, 64px); }
.card--proj h3 { margin-top: 8px; font: 600 1.42rem/1.16 var(--font-display); letter-spacing: 0.006em; text-wrap: balance; }
.card--proj .meta { margin-top: 6px; font-size: 0.9rem; }
.card--proj .points { margin-top: 14px; font-size: 0.97rem; }
.card--proj .chips { margin-top: 16px; }
.card__fig { position: relative; aspect-ratio: 16 / 10; min-height: 0; margin-bottom: 16px; border: 1px solid var(--rule); border-radius: 9px; background-color: var(--well); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 22px 22px; }
.card__fig .dw { position: absolute; left: 12px; top: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
@media (max-width: 1020px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.skill--wide { grid-column: 1 / -1; }
.skill h3 { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; font: 600 1.45rem/1.1 var(--font-display); letter-spacing: 0.01em; }
.skill__sub { margin: 14px 0 8px; font: 400 0.76rem/1.5 var(--font-mono); color: var(--ink-faint); }
.skill .chips + .skill__sub:last-child { margin-bottom: 0; }
@media (max-width: 700px) { .skills { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Awards ---------- */
.awards { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 16px 28px -20px var(--shadow); }
.award { display: grid; grid-template-columns: 92px 42px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px clamp(16px, 2.4vw, 24px); }
.award + .award { border-top: 1px solid var(--rule); }
.award__when { font: 500 0.8rem/1.4 var(--font-mono); color: var(--accent); }
.award h3 { font: 600 1.26rem/1.2 var(--font-display); letter-spacing: 0.006em; }
.award p { margin-top: 2px; font-size: 0.93rem; color: var(--ink-soft); }
@media (max-width: 680px) {
  .award { grid-template-columns: 42px minmax(0, 1fr); gap: 4px 14px; }
  .award__when { grid-column: 2; grid-row: 1; }
  .award .tile { grid-column: 1; grid-row: 1 / span 3; align-self: start; }
  .award__what { grid-column: 2; }
  .award .doc { grid-column: 2; justify-self: start; margin-top: 6px; }
}

/* ---------- References ---------- */
.refs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ref__tag { display: inline-block; margin-bottom: 12px; padding: 2px 9px; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 5px; background: var(--accent-soft); font: 500 0.72rem/1.6 var(--font-mono); color: var(--accent); }
.ref__tag--cool { border-color: color-mix(in srgb, var(--cool) 50%, transparent); background: color-mix(in srgb, var(--cool) 10%, transparent); color: var(--cool); }
.ref__tag--plain { border-color: var(--rule-strong); background: transparent; color: var(--ink-faint); }
.ref h3 { font: 600 1.5rem/1.15 var(--font-display); letter-spacing: 0.006em; }
.ref h3 a { color: var(--ink); text-decoration: none; }
.ref h3 a:hover { color: var(--accent); }
.ref h3 .i { width: 0.62em; height: 0.62em; margin-left: 4px; color: var(--ink-faint); vertical-align: 0.1em; }
.ref__role { margin-top: 6px; font-size: 0.96rem; line-height: 1.45; color: var(--ink-soft); }
.ref__role + .ref__role { margin-top: 2px; }
.ref__mail { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); font: 400 0.88rem/1.4 var(--font-mono); overflow-wrap: anywhere; }
.ref__mail .i { width: 17px; height: 17px; color: var(--cool); }
@media (max-width: 760px) { .refs { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(26px, 4.4vw, 60px); align-items: start; }
.contact__lead { font-size: 1.14rem; color: var(--ink-soft); }
.reach { display: grid; margin-top: 18px; border-top: 1px solid var(--rule); }
.reach__row { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.reach dt { display: flex; align-items: center; gap: 9px; font: 400 0.8rem/1.4 var(--font-mono); color: var(--ink-faint); }
.reach dt .i { width: 17px; height: 17px; color: var(--cool); }
.reach dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 1.12rem; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.reach dd a { color: var(--ink); text-decoration-color: var(--rule-strong); }
.reach dd a:hover { color: var(--accent); }
.reach__row:first-child dd a { font: 600 clamp(1.3rem, 2.6vw, 1.62rem)/1.2 var(--font-display); letter-spacing: 0.01em; }
.btn--copy { min-height: 34px; padding: 5px 11px; font-size: 0.82rem; }
.cvlinks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cvlink { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--rule-strong); border-radius: 10px; background: color-mix(in srgb, var(--panel-solid) 55%, transparent); color: var(--ink); text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease; }
.cvlink:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }
.cvlink__t { font: 600 1.3rem/1.1 var(--font-display); letter-spacing: 0.01em; }
.cvlink__s { grid-column: 1; font: 400 0.74rem var(--font-mono); color: var(--ink-faint); }
.cvlink .i { grid-column: 2; grid-row: 1 / span 2; width: 22px; height: 22px; color: var(--accent); }

.form { display: grid; gap: 14px; }
.form h3 { font: 600 1.6rem/1.1 var(--font-display); letter-spacing: 0.006em; }
.field { display: grid; gap: 6px; }
.field span { font-size: 0.9rem; font-weight: 500; color: var(--ink-soft); }
.field input, .field textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--well); color: var(--ink); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form .btn { justify-self: start; }
.form__note { font: 400 0.76rem/1.6 var(--font-mono); color: var(--ink-faint); }
.form__note.is-warn { color: var(--hot); }

@media (max-width: 899px) { .contact { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .reach__row { grid-template-columns: minmax(0, 1fr); gap: 4px; } .cvlinks { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   FOOTER, PAGE GAUGE, PHOTO VIEWER
   ===================================================================== */
.foot { margin-top: 0; border-top: 1px solid var(--rule); background: color-mix(in srgb, var(--bg-low) 82%, transparent); }
.foot__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 24px 22px; font: 400 0.8rem/1.6 var(--font-mono); color: var(--ink-faint); }
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot__links a { color: var(--ink-soft); }
.foot__links a:hover { color: var(--accent); }
/* a steel rule closes the page */
.rule { height: 18px; padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: content-box; opacity: 0.8;
  background:
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 50px) left bottom / 100% 16px no-repeat,
    repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 10px) left bottom / 100% 8px no-repeat; }

.dial { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 4px); z-index: 30; width: 54px; height: 54px; border-radius: 50%; box-shadow: 0 8px 16px -6px var(--shadow); opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.92); transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s; }
.dial.is-on { opacity: 1; visibility: visible; transform: none; }
.dial svg { display: block; width: 100%; height: 100%; }
.dial__face { fill: var(--panel-solid); stroke: var(--accent-fill); stroke-width: 1.6; }
.dial__scale { fill: none; stroke: var(--rule-strong); stroke-width: 2; stroke-linecap: round; }
.dial__ticks { fill: none; stroke: var(--line); stroke-width: 1.4; stroke-linecap: round; }
.dial__needle { position: absolute; left: 50%; top: 50%; width: 4px; height: 19px; margin: -19px 0 0 -2px; background: var(--hot); clip-path: polygon(50% 0, 100% 100%, 0 100%); transform-origin: 50% 100%; transform: rotate(-135deg); will-change: transform; }
.dial__hub { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent-fill); border: 1px solid var(--on-accent); }
.dial:hover .dial__face { fill: var(--metal); }

.lightbox { max-width: min(92vw, 880px); padding: 16px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--panel-solid); color: var(--ink); }
.lightbox::backdrop { background: rgba(2, 8, 22, 0.82); }
.lightbox img { display: block; max-width: 100%; max-height: 74vh; margin-inline: auto; border-radius: 8px; }
.lightbox figcaption { margin: 10px 0 12px; font: 400 0.8rem var(--font-mono); color: var(--ink-soft); text-align: center; }
.lightbox form { text-align: center; }

/* =====================================================================
   DRAWINGS  (classes used by js/drawings.js)
   ===================================================================== */
.dw { display: block; width: 100%; height: auto; overflow: visible; }
.dw .l { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dw .l--cold { stroke: var(--cool); stroke-width: 2.2; }
.dw .l--warm { stroke: var(--accent-fill); stroke-width: 2.2; }
.dw .l--hot { stroke: var(--hot); stroke-width: 2.2; }
.dw .thin { fill: none; stroke: var(--line); stroke-width: 1; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dw .cl { fill: none; stroke: var(--line); stroke-width: 0.8; stroke-dasharray: 14 4 2 4; opacity: 0.5; vector-effect: non-scaling-stroke; }
.dw .dash { stroke-dasharray: 6 4; }
.dw .gridl { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dw .acc { stroke: var(--accent); }
.dw .solid { fill: var(--line); stroke: none; }
.dw .solid-acc { fill: var(--accent-fill); stroke: none; }
.dw .f-sheet { fill: var(--panel-solid); }
.dw .f-metal { fill: var(--metal); stroke: none; }
.dw .f-pcm { fill: var(--pcm); stroke: none; }
.dw .f-cycle { fill: color-mix(in srgb, var(--cool) 18%, transparent); stroke: none; }
.dw .hatched { stroke: none; }
.dw .hatchline { stroke: var(--line); stroke-width: 1; opacity: 0.5; }
.dw .comp { fill: var(--panel-solid); stroke: var(--line); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dw .channel { fill: var(--bg); stroke: var(--cool); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.dw .balloon { fill: var(--panel-solid); stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dw .ball { fill: var(--accent-fill); stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.dw .pt { fill: var(--panel-solid); stroke: var(--cool); stroke-width: 2; vector-effect: non-scaling-stroke; }
.dw .area { stroke: none; }
.dw .stop-area { stop-color: var(--cool); stop-opacity: 0.30; }
.dw .stop-clear { stop-color: var(--cool); stop-opacity: 0; }
.dw .stop-cool { stop-color: var(--cool); }
.dw .stop-warm { stop-color: var(--accent-fill); }
.dw .stop-hot { stop-color: var(--hot); }
.dw .t { font-family: var(--font-mono); font-size: 12px; font-weight: 400; fill: var(--ink-soft); letter-spacing: 0.02em; }
.dw .t-ink { fill: var(--ink); }
.dw .t-accent { fill: var(--accent); }
.dw .t-b { font-weight: 500; }
.dw--fins .t { font-size: 21px; }
.dw--cycle .t { font-size: 14px; }
.dw--gauge .t { font-size: 13.5px; }
.dw--ts .t, .dw--room .t, .dw--beam .t { font-size: 15px; }
.dw--gpa .t { font-size: 12.5px; }
.dw--gpa-s .t { font-size: 11px; }
/* a halo keeps numbers readable where they cross a line */
.dw .halo { paint-order: stroke; stroke: var(--bg-low); stroke-width: 4px; stroke-linejoin: round; }
:root[data-theme="light"] .dw .halo { stroke: #f1f5fb; }
/* GPA curve */
.dw--gpa .curve { stroke: var(--cool); stroke-width: 2.4; }
.js .dw--gpa .curve { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.9s cubic-bezier(0.3, 0.6, 0.2, 1) 0.2s; }
.js .dw--gpa .area, .js .dw--gpa .pt { opacity: 0; transition: opacity 0.9s ease 1.1s; }
.js .is-in .dw--gpa .curve { stroke-dashoffset: 0; }
.js .is-in .dw--gpa .area, .js .is-in .dw--gpa .pt { opacity: 1; }
/* gauge */
.dw--gauge .bezel { fill: var(--metal); stroke: var(--accent-fill); stroke-width: 2; vector-effect: non-scaling-stroke; }
.dw--gauge .face { fill: var(--bg-low); stroke: var(--rule-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
:root[data-theme="light"] .dw--gauge .face { fill: #f8fbff; }
.dw--gauge .scale { fill: none; stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.dw--gauge .hub { fill: var(--accent-fill); stroke: var(--on-accent); stroke-width: 1; }
.dw--gauge .hub-eye { fill: var(--on-accent); }
/* moving dashes show the direction of flow */
.dw .dashflow { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-dasharray: 2 22; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: dashflow 1.6s steps(24) infinite; }
.dw .dashflow--b { animation-duration: 2.4s; animation-timing-function: steps(36); stroke: var(--cool); }
@keyframes dashflow { to { stroke-dashoffset: -24; } }
/* ball balancing sketch */
.dw--beam .tilt { transform-origin: 170px 96px; animation: tilt 5s ease-in-out infinite; }
.dw--beam .roll { animation: roll 5s ease-in-out infinite; }
@keyframes tilt { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes roll { 0%, 100% { transform: translateX(70px); } 50% { transform: translateX(30px); } }
/* drawings move only while they are on screen */
.js [data-live]:not(.is-live) .dashflow, .js [data-live]:not(.is-live) .tilt, .js [data-live]:not(.is-live) .roll, .js .flowline:not(.is-live) li::before { animation-play-state: paused; }

/* =====================================================================
   MOTION
   ===================================================================== */
/* the opening of the page: the name, then the lines under it, then the gear train */
@keyframes rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }
@keyframes fig-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.hero__name, .hero__role, .hero__focus, .hero__lead, .hero__cta, .hero__links { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero__role { animation-delay: 0.08s; } .hero__focus { animation-delay: 0.16s; } .hero__lead { animation-delay: 0.24s; } .hero__cta { animation-delay: 0.32s; } .hero__links { animation-delay: 0.4s; }
.hero__fig { animation: fig-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.12s both; }

/* blocks lower on the page ease in once, the first time they are seen */
.js.rv-ready .rv { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity 0.75s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0ms); }
.js.rv-ready .rv.is-in { opacity: 1; transform: none; }

/* the motion button, or a device that asks for less motion, stops everything that moves by itself */
.no-motion .caret, .no-motion .status__dot::after, .no-motion .dashflow, .no-motion .tilt, .no-motion .roll, .no-motion .flowline li::before { animation: none; }
.no-motion .flow { display: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .js.rv-ready .rv { opacity: 1; transform: none; }
  .js .dw--gpa .curve { stroke-dashoffset: 0; }
  .js .dw--gpa .area, .js .dw--gpa .pt { opacity: 1; }
}

/* =====================================================================
   PRINT
   ===================================================================== */
@media print {
  :root, :root[data-theme="light"] { --bg: #fff; --bg-top: #fff; --bg-low: #fff; --panel-a: #fff; --panel-b: #fff; --panel-solid: #fff; --well: #fff; --ink: #000; --ink-soft: #222; --ink-faint: #444; --line: #1d4f90; --rule: #bbb; --rule-strong: #888; --accent: #7a4200; --cool: #0b4f8a; --metal: #e3ebf5; --metal-dark: #d3deed; --name-a: #000; --name-b: #000; --shadow: transparent; }
  body { background: #fff; font-size: 11pt; }
  .bar, .flow, .dial, .video, .thumbs, .seg, .form, .hero__cta, .btn--copy, .skip, .rule { display: none !important; }
  .js.rv-ready .rv { opacity: 1 !important; transform: none !important; }
  .more > .points { display: grid !important; }
  .sec { padding-top: 28px; }
  .entry, .card, .fig, .award { break-inside: avoid; }
  a { color: #000; }
}
