/* ═══════════════════════════════════════════════════════════════════════════
   Kyrillos Isaak — portfolio
   Hand-written CSS. No framework, no build step.

   Design language: instrument modules. A light grey ground, panels outlined
   in hard 1px near-black, every panel wearing a lowercase monospace label
   strip. Square corners throughout. Colour appears only where it means
   something. Light is the default; the dark toggle inverts the same system.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────────────────────────────── */

:root {
  /* Inter carries the page. Host Grotesk appears once, on the name. */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'Host Grotesk', 'Inter Tight', Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --wrap: 1200px;
  --gutter: clamp(1rem, 4vw, 2.75rem);

  /* Square by intent. Tokens kept so it can be softened from one place. */
  --r-sm: 0px;
  --r-md: 0px;
  --r-lg: 0px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* --ease-out is easeOutExpo: ~97% travelled by 38% of the duration. Right for
     a settle, wrong for a sweep, so the portrait scan gets a symmetric curve
     with a near-linear middle and reads at a steady speed. */
  --ease-scan: cubic-bezier(0.65, 0, 0.35, 1);
}

html[data-theme='light'] {
  --bg: #e5e5e5;
  --panel: #fefefe;
  --panel-2: #dedede;
  --panel-3: #c4c4c4;

  --line: #1e1e1e;
  --line-soft: rgba(30, 30, 30, 0.16);

  --fg: #1e1e1e;
  --fg-2: #3d3d3d;
  --fg-3: #616161;

  --accent: #0a6b62;        /* text-safe teal  — 4.7:1 even on the grey panels */
  --accent-bright: #09aea1; /* fills and marks — never small text */
  --accent-fg: #ffffff;
  --accent-soft: rgba(9, 174, 161, 0.14);
  --accent-2: #4a6b7a;

  --grain-opacity: 0.02;
  color-scheme: light;
}

html[data-theme='dark'] {
  --bg: #1e1e1e;
  --panel: #262626;
  --panel-2: #2e2e2e;
  --panel-3: #383838;

  --line: #c4c4c4;
  --line-soft: rgba(196, 196, 196, 0.2);

  --fg: #fefefe;
  --fg-2: #c4c4c4;
  --fg-3: #9a9a9a;

  --accent: #2dd4bf;
  --accent-bright: #14b8a6;
  --accent-fg: #06201d;
  --accent-soft: rgba(20, 184, 166, 0.16);
  --accent-2: #9db4c0;

  --grain-opacity: 0.03;
  color-scheme: dark;
}

/* ── Reset ────────────────────────────────────────────────────────────── */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  background: var(--bg);
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.58;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 0; }
::selection { background: var(--accent-bright); color: #fff; }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  padding: 0.05em 0.34em;
  border-radius: 0;
}

strong { font-weight: 600; color: var(--fg); }
em { font-style: italic; color: var(--fg); }

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -300%);
  z-index: 200;
  background: var(--fg);
  color: var(--bg);
  padding: 0.7rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: lowercase;
  transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

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

.grain {
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ══ THE MODULE ═══════════════════════════════════════════════════════════
   The load-bearing pattern. Every panel on the page is a hard-outlined box
   with a lowercase monospace label strip across the top: what it is on the
   left, what it measures on the right.
   ═══════════════════════════════════════════════════════════════════════ */

.mod {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 0;
}

.mod__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.3;
  text-transform: lowercase;
  letter-spacing: 0.01em;
  color: var(--fg);
}
.mod__name { font-weight: 500; white-space: nowrap; }
.mod__tag {
  margin-left: auto;
  color: var(--fg-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mod__tag--live { color: var(--accent); }

.mod__body { padding: clamp(1.1rem, 2.4vw, 1.65rem); }

/* A screenshot let into the panel: full-bleed between the label strip and the
   body, so the outline of the module doubles as the bezel. The aspect-ratio is
   set inline from the asset's own dimensions, holding the space before it
   decodes so nothing below it jumps. */
.mod__shot {
  aspect-ratio: var(--shot-ratio, 16 / 9);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  overflow: hidden;
}
.mod__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Star readout lives in the label strip. */
.card__stars {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-3);
}
.card__stars svg { width: 11px; height: 11px; fill: currentColor; }
.card__stars.has-stars { color: var(--accent); }

/* ── Nav ──────────────────────────────────────────────────────────────── */

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

.nav__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0.65rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav__mark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: lowercase;
  color: var(--fg);
  white-space: nowrap;
}
.nav__portrait {
  width: 26px;
  height: 26px;
  flex: none;
  /* Its own square file, not the hero's 4:5 one. A square crop of the hero image
     shows a fixed 80% of its height, which leaves the face about 8px tall here —
     and object-position can only pan, not zoom, so no value fixes that. */
  object-fit: cover;
  border: 1px solid var(--line);
  filter: grayscale(1);
  transition: filter 0.25s var(--ease);
}
.nav__mark:hover .nav__portrait { filter: none; }

.nav__mark-glyph {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  background: var(--fg);
  color: var(--bg);
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav__mark-glyph[hidden] { display: none; }
.nav__mark:hover .nav__mark-glyph { background: var(--accent-bright); color: #fff; }

.nav__links {
  display: flex;
  gap: 1.15rem;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: lowercase;
}
.nav__links a {
  color: var(--fg-3);
  position: relative;
  padding-block: 0.3rem;
  transition: color 0.2s var(--ease);
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--fg); }
.nav__links a.is-active::after, .nav__links a:hover::after { transform: scaleX(1); }

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

/* Clock is a module too, shrunk to one line. */
.nav__clock {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  padding: 0.24rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: lowercase;
  color: var(--fg-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.nav__clock b { font-weight: 500; color: var(--fg); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  color: var(--fg);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.theme-toggle:hover { background: var(--fg); color: var(--bg); }
.theme-toggle svg {
  width: 14px; height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  grid-area: 1 / 1;
  transition: opacity 0.2s var(--ease);
}
html[data-theme='dark'] .theme-toggle__sun { opacity: 1; }
html[data-theme='dark'] .theme-toggle__moon { opacity: 0; }
html[data-theme='light'] .theme-toggle__sun { opacity: 0; }
html[data-theme='light'] .theme-toggle__moon { opacity: 1; }

.nav__progress {
  height: 2px;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: var(--accent-bright);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.62rem 1.1rem;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: lowercase;
  white-space: nowrap;
  color: var(--fg);
  background: var(--panel);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.btn svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.22s var(--ease-out);
}
.btn:hover svg { transform: translateX(3px); }

.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary:hover { background: var(--accent-bright); color: #fff; border-color: var(--accent-bright); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--fg); color: var(--bg); }

.btn--sm { padding: 0.28rem 0.6rem; font-size: 0.7rem; }

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem);
}

/* Copy and portrait sit side by side. Flex, not grid, on purpose: while the
   portrait is `hidden` it leaves the flow entirely, so no empty track and no
   stray gap are left behind — the copy simply runs full width. */
.hero__grid {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.hero__copy { flex: 1 1 auto; min-width: 0; }
.hero__portrait {
  flex: 0 0 clamp(190px, 21vw, 264px);
  margin: 0;
  overflow: hidden;
}
.hero__portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--panel-2);
}
.hero__portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Greyscale at rest so the portrait sits inside the palette instead of
     fighting it; full colour on hover, matching the nav mark. */
  filter: grayscale(1) contrast(1.03);
  transition: filter 0.45s var(--ease-out);
}
.hero__portrait:hover .hero__portrait-frame img,
.hero__portrait:focus-within .hero__portrait-frame img { filter: none; }

/* A teal line rides the wipe edge on the way down, then fades. */
.hero__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--accent-bright);
  box-shadow: 0 0 14px 1px var(--accent-bright);
  opacity: 0;
  pointer-events: none;
}

.hero__portrait.is-shown .hero__portrait-frame img {
  animation: portrait-wipe 1.15s var(--ease-scan) both;
}
.hero__portrait.is-shown .hero__scan {
  animation: portrait-scan 1.15s var(--ease-scan) both;
}

@keyframes portrait-wipe {
  from { clip-path: inset(0 0 100% 0); transform: scale(1.07); }
  to   { clip-path: inset(0 0 0 0);    transform: scale(1); }
}
@keyframes portrait-scan {
  0%   { top: 0;    opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* The wipe is decoration; the portrait is the content. Reduced motion keeps
   the photo and drops the movement. */
@media (prefers-reduced-motion: reduce) {
  .hero__portrait.is-shown .hero__portrait-frame img,
  .hero__portrait.is-shown .hero__scan { animation: none; }
  .hero__scan { display: none; }
}

@media (max-width: 860px) {
  .hero__grid { flex-direction: column-reverse; }
  .hero__portrait { flex-basis: auto; width: min(240px, 58%); }
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0.35rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: lowercase;
  color: var(--fg);
}

.pulse {
  position: relative;
  width: 6px; height: 6px;
  background: var(--accent-bright);
  flex: none;
}
.pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-bright);
  animation: ping 2.2s var(--ease-out) infinite;
}
@keyframes ping { to { transform: scale(3); opacity: 0; } }

.hero__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.4rem, 13vw, 8.75rem);
  line-height: 0.88;
  letter-spacing: -0.05em;
  text-transform: lowercase;
  color: var(--fg);
  margin-top: 1.4rem;
}
.hero__name em { font-style: normal; color: var(--accent); }

.hero__lede {
  max-width: 58ch;
  margin-top: 1.75rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--fg-2);
  text-wrap: pretty;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.9rem; }

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: lowercase;
}
.hero__links a {
  color: var(--fg-3);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.hero__links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Spec strip — one module, cells divided by hard rules. */
.hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 2.25rem;
  border: 1px solid var(--line);
  background: var(--panel);
}
.hero__facts > div {
  padding: 0.9rem 1rem;
  border-right: 1px solid var(--line-soft);
}
.hero__facts > div:last-child { border-right: 0; }
.hero__facts dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: lowercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.hero__facts dd {
  font-size: 0.875rem;
  color: var(--fg);
  line-height: 1.45;
  text-wrap: pretty;
}

/* ── Proof band ───────────────────────────────────────────────────────────
   The big-number moment. Every figure here is sourced from his own papers
   or shipped work; the caption under each says where it comes from.
   ────────────────────────────────────────────────────────────────────── */

.proof {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.proof__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-width: var(--wrap);
  margin-inline: auto;
}
.proof__cell {
  padding: clamp(1.5rem, 4vw, 2.6rem) var(--gutter);
  border-right: 1px solid var(--line-soft);
}
.proof__cell:last-child { border-right: 0; }
.proof__n {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 6.5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.proof__n span { color: var(--accent); }
.proof__what {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  color: var(--fg);
  line-height: 1.45;
}
.proof__src {
  margin-top: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: lowercase;
  color: var(--fg-3);
  line-height: 1.4;
}

/* ── Affiliation strip, closing the proof band ────────────────────────── */

.aff { border-top: 1px solid var(--line-soft); }
.aff__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem clamp(1.1rem, 3vw, 2rem);
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 1.05rem var(--gutter);
}
.aff__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: lowercase;
  letter-spacing: 0.01em;
  color: var(--fg-3);
  white-space: nowrap;
}
.aff__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem clamp(1.2rem, 3.2vw, 2.3rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.aff__item { display: flex; align-items: center; }
/* Wordmarks run far wider than glyphs at a shared height, so the strip trims
   the height and caps the width — otherwise the widest mark sets the rhythm. */
.aff__row .tl__logo { height: 22px; max-width: 88px; }

/* ── Sections ─────────────────────────────────────────────────────────── */

.section { padding-block: clamp(3rem, 7vw, 5.5rem); position: relative; }
.section--alt { background: var(--panel-2); border-block: 1px solid var(--line); }

.section__head { margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem); }

.section__label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: lowercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}
.section__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.0;
  letter-spacing: -0.045em;
  text-transform: lowercase;
  color: var(--fg);
  text-wrap: balance;
}
.section__title em { font-style: normal; color: var(--accent); }

.section__sub {
  margin-top: 0.9rem;
  max-width: 60ch;
  color: var(--fg-2);
  font-size: 0.97rem;
  text-wrap: pretty;
}
.section__sub a { color: var(--fg); border-bottom: 1px solid var(--accent); }
.section__sub a:hover { color: var(--accent); }

/* ── Timeline ─────────────────────────────────────────────────────────── */

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

.tl {
  position: relative;
  padding: clamp(1.1rem, 2.5vw, 1.6rem);
  border-bottom: 1px solid var(--line-soft);
}
.timeline .tl:last-child { border-bottom: 0; }
.tl.is-current { background: var(--accent-soft); }

.tl__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  margin-bottom: 0.35rem;
}

/* Company logo — sits bare, no container I draw. Several of these marks carry
   their own background (AWS and UCSC ship as square tiles), so adding one
   would double it up. Common height, width from the artwork's own ratio. */
.tl__logo {
  height: 26px;
  width: auto;
  aspect-ratio: var(--ratio, 1);
  max-width: 64px;
  object-fit: contain;
  flex: none;
}
/* Single-colour black artwork only. Marks with their own background, and
   full-colour marks, are left alone. */
html[data-theme='dark'] .tl__logo--mono { filter: invert(1); }

/* Two-tone marks on a transparent ground ship one file per theme, because an
   invert would swing the brand colour too, not just the ink. Both are in the
   DOM; exactly one is ever displayed. */
.tl__logo--dark { display: none; }
html[data-theme='dark'] .tl__logo--light { display: none; }
html[data-theme='dark'] .tl__logo--dark { display: block; }

/* Per-theme brand tint for the inlined monochrome tech marks. Both hexes keep
   the brand hue and clear 3:1 against every background of their theme; see
   tools/logos.mjs. Company logos are exempt — WCAG 1.4.11 excludes logotypes. */
.stack__ico[style*="--tint"],
.chip__ico[style*="--tint"] { color: var(--tint-light); }
html[data-theme='dark'] .stack__ico[style*="--tint"],
html[data-theme='dark'] .chip__ico[style*="--tint"] { color: var(--tint-dark); }

.tl__company {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--fg);
}
.tl__now {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: lowercase;
  color: #fff;
  background: var(--accent-bright);
  border: 1px solid var(--accent-bright);
  padding: 0.1rem 0.42rem;
}
.tl.is-upcoming .tl__now {
  color: var(--fg-2);
  background: transparent;
  border-color: var(--line-soft);
  border-style: dashed;
}
.tl__period {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: lowercase;
  color: var(--fg-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tl__role { font-size: 0.93rem; font-weight: 600; color: var(--fg); }
.tl__where {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  color: var(--fg-3);
  margin-top: 0.15rem;
}
.tl__summary {
  margin-top: 0.75rem;
  color: var(--fg-2);
  font-size: 0.93rem;
  max-width: 66ch;
  text-wrap: pretty;
}

.tl__points { display: grid; gap: 0.55rem; margin-top: 0.9rem; max-width: 76ch; }
.tl__points li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.58;
  color: var(--fg-2);
  text-wrap: pretty;
}
.tl__points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 6px; height: 1px;
  background: var(--accent-bright);
}

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 1rem; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: lowercase;
  color: var(--fg-2);
  border: 1px solid var(--line-soft);
  padding: 0.16rem 0.45rem;
}
.chip.has-ico {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding-left: 0.34rem;
}
.chip__ico {
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--fg-3);
}
.chip__ico svg { width: 100%; height: 100%; fill: currentColor; }

/* ── Project modules ──────────────────────────────────────────────────── */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }

.card { transition: box-shadow 0.2s var(--ease); }
.card:hover { box-shadow: 4px 4px 0 var(--line); }

.card__kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: lowercase;
  color: var(--fg-3);
  margin-bottom: 0.4rem;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-transform: lowercase;
  color: var(--fg);
}
.card__blurb { margin-top: 0.75rem; color: var(--fg-2); font-size: 0.9rem; line-height: 1.6; text-wrap: pretty; }

.card__metrics { display: grid; margin-top: 1.1rem; border-top: 1px solid var(--line-soft); }
.card__metric {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.55rem;
  font-size: 0.83rem;
  line-height: 1.4;
}
.card__metric dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: lowercase;
  color: var(--fg-3);
  flex: none;
  width: 80px;
  padding-top: 0.15em;
}
.card__metric dd { color: var(--fg); }

.card__links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.2rem; }
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: lowercase;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  color: var(--fg);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.link-pill::after { content: '↗'; opacity: 0.5; }
.link-pill--internal::after { content: '→'; }
.link-pill:hover { background: var(--fg); color: var(--bg); }
.link-pill--primary { background: var(--fg); color: var(--bg); }
.link-pill--primary:hover { background: var(--accent-bright); color: #fff; border-color: var(--accent-bright); }

/* ── Spotlight ────────────────────────────────────────────────────────── */

.spot { margin-bottom: 1rem; }
.spot .mod__body {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: clamp(1.4rem, 3.5vw, 2.5rem);
  align-items: start;
}
.spot__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  line-height: 1.0;
  letter-spacing: -0.05em;
  text-transform: lowercase;
  color: var(--fg);
}
.spot__tagline { font-size: 1.02rem; color: var(--accent); margin-top: 0.4rem; }
.spot__blurb { margin-top: 1rem; color: var(--fg-2); font-size: 0.93rem; line-height: 1.65; max-width: 62ch; text-wrap: pretty; }

.spot__side { border: 1px solid var(--line); background: var(--bg); }
.spot__row { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line-soft); }
.spot__row:last-child { border-bottom: 0; }
.spot__row dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: lowercase;
  color: var(--fg-3);
  margin-bottom: 0.2rem;
}
.spot__row dd { font-size: 0.85rem; color: var(--fg); line-height: 1.4; }

/* ── More repos ───────────────────────────────────────────────────────── */

.more { margin-top: 1rem; border: 1px solid var(--line); background: var(--panel); }
.more summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: lowercase;
  color: var(--fg);
  cursor: pointer;
  list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { border-bottom: 1px solid var(--line); }
.more summary:hover { color: var(--accent); }
.more summary svg {
  width: 13px; height: 13px;
  margin-left: auto;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.25s var(--ease-out);
}
.more[open] summary svg { transform: rotate(180deg); }

.more__item {
  display: grid;
  grid-template-columns: minmax(150px, 200px) 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.18s var(--ease);
}
.more__list li:last-child .more__item { border-bottom: 0; }
.more__item:hover { background: var(--panel-2); }
.more__name { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; color: var(--fg); }
.more__item:hover .more__name { color: var(--accent); }
.more__blurb { color: var(--fg-2); font-size: 0.85rem; line-height: 1.5; }
.more__tech { font-family: var(--font-mono); font-size: 0.68rem; text-transform: lowercase; color: var(--fg-3); white-space: nowrap; }

/* ── Publications ─────────────────────────────────────────────────────── */

.papers { display: grid; gap: 1rem; }

.paper .mod__bar { background: var(--panel-2); }
.paper--published .mod__bar { background: var(--fg); color: var(--bg); }
.paper--published .mod__tag { color: var(--bg); opacity: 0.7; }
.paper--review .mod__bar { border-bottom-style: dashed; }

.paper__body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
  color: var(--fg);
  text-wrap: balance;
}
.paper__body p {
  margin-top: 0.9rem;
  color: var(--fg-2);
  font-size: 0.93rem;
  line-height: 1.68;
  max-width: 72ch;
  text-wrap: pretty;
}
.paper__meta {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--fg-3);
  max-width: 80ch;
}
.paper__meta li { position: relative; padding-left: 0.95rem; }
.paper__meta li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.6em;
  width: 6px; height: 1px;
  background: var(--fg-3);
}
.paper__links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.1rem; }
.paper__links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 0.3rem 0.65rem;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.paper__links a:hover { background: var(--fg); color: var(--bg); }

/* ── Education ────────────────────────────────────────────────────────── */

.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.edu__degree {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--fg);
}
.edu__school { margin-top: 0.35rem; font-size: 0.92rem; color: var(--fg-2); }
.edu__where {
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  color: var(--fg-3);
}
.edu__note {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
}

/* ── Stack ────────────────────────────────────────────────────────────── */

.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }
.stack__items { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.stack__items li {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: lowercase;
  color: var(--fg-2);
  border: 1px solid var(--line-soft);
  padding: 0.22rem 0.5rem;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.stack__items li.has-ico { padding-left: 0.4rem; }
.stack__items li:hover { color: var(--fg); border-color: var(--line); }

.stack__ico { display: grid; place-items: center; width: 13px; height: 13px; flex: none; color: var(--fg-3); }
.stack__ico svg { width: 100%; height: 100%; fill: currentColor; }
.stack__ico[style*="--tint"] { color: var(--tint); }

/* ── Contact ──────────────────────────────────────────────────────────── */

.contact__card { text-align: center; }
.contact__card .mod__body { padding: clamp(2rem, 5vw, 3.25rem); }
.contact__lede { color: var(--fg-2); max-width: 48ch; margin-inline: auto; font-size: 1rem; text-wrap: pretty; }
.contact__mail {
  display: block;
  margin: 1.4rem auto 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 4.2vw, 2.3rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--fg);
  word-break: break-word;
  transition: color 0.2s var(--ease);
}
.contact__mail:hover { color: var(--accent); }
.contact__mail-hint {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: lowercase;
  color: var(--fg-3);
}
.contact__mail-hint.is-copied { color: var(--accent); }

.contact__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: lowercase;
}
.contact__links a { color: var(--fg-3); transition: color 0.2s var(--ease); }
.contact__links a:hover { color: var(--accent); }

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--line); padding-block: 1.4rem; }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  color: var(--fg-3);
}

/* ── Reveal animation ─────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 55ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 1040px) { .nav__clock { display: none; } }

@media (max-width: 900px) {
  .spot .mod__body { grid-template-columns: 1fr; }
  .more__item { grid-template-columns: 1fr; gap: 0.3rem; }
  .more__tech { white-space: normal; }
  .hero__facts > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .hero__facts > div:last-child { border-bottom: 0; }
  .proof__cell { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .proof__cell:last-child { border-bottom: 0; }
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .nav__links { display: none; }
  .nav__mark-text { display: none; }
  .nav__actions { margin-left: auto; }
  .tl__period { margin-left: 0; width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .card__metric { flex-direction: column; gap: 0.1rem; }
  .card__metric dt { width: auto; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ── Reduced motion ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ── Print ────────────────────────────────────────────────────────────── */

@media print {
  .nav, .grain, .theme-toggle { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .reveal { opacity: 1; transform: none; }
  .mod, .paper, .card { break-inside: avoid; }
}
