/* ==========================================================================
   Charis Savva: personal site
   Plain CSS, no build step. Light/dark via color-scheme + light-dark().
   ========================================================================== */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light dark;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;

  --bg: light-dark(#f6f7fb, #07090e);
  --bg-soft: light-dark(#eceff5, #0e121a);
  --surface: light-dark(rgb(255 255 255 / 0.78), rgb(255 255 255 / 0.03));
  --surface-strong: light-dark(#ffffff, rgb(255 255 255 / 0.06));
  --surface-solid: light-dark(#ffffff, #0e121a);
  --border: light-dark(rgb(15 23 42 / 0.09), rgb(255 255 255 / 0.08));
  --border-strong: light-dark(rgb(15 23 42 / 0.17), rgb(255 255 255 / 0.16));
  --text: light-dark(#0b1220, #e8edf5);
  --text-muted: light-dark(#4a5565, #9ba6b7);
  --text-faint: light-dark(#5f6978, #7a8597);
  --accent: light-dark(#2563eb, #6ea8ff);
  --accent-2: light-dark(#0891b2, #22d3ee);
  --accent-3: light-dark(#7c3aed, #a78bfa);
  --accent-soft: light-dark(rgb(37 99 235 / 0.08), rgb(110 168 255 / 0.1));
  --accent-ring: light-dark(rgb(37 99 235 / 0.22), rgb(110 168 255 / 0.26));
  --ok: light-dark(#059669, #34d399);
  --grid-line: light-dark(rgb(15 23 42 / 0.055), rgb(255 255 255 / 0.045));
  --glow-1: light-dark(rgb(37 99 235 / 0.09), rgb(56 120 255 / 0.16));
  --glow-2: light-dark(rgb(30 64 175 / 0.06), rgb(96 165 250 / 0.09));
  --glow-3: light-dark(rgb(8 145 178 / 0.05), rgb(34 211 238 / 0.06));
  --spot: light-dark(rgb(37 99 235 / 0.07), rgb(110 168 255 / 0.09));
  --shadow-color: light-dark(rgb(15 23 42 / 0.08), rgb(0 0 0 / 0.45));
  --card-shadow: light-dark(rgb(15 23 42 / 0.05), transparent);

  --radius: 20px;
  --radius-sm: 12px;
  --container: 1160px;
  --gutter: clamp(20px, 4vw, 32px);
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p, figure { margin: 0; }
/* :where() keeps this reset at zero specificity so single-class rules can set margins. */
:where(ul[class], ol[class]) { list-style: none; margin: 0; padding: 0; }
button { font: inherit; }
strong { font-weight: 600; }

::selection { background: var(--accent-ring); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mono { font-family: var(--font-mono); }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.site-header.is-scrolled,
.site-header:has(.nav.is-open) {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom-color: var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
}
.header__inner { display: flex; align-items: center; gap: 16px; height: 100%; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: #2563eb;
}

.nav__list { display: flex; gap: 2px; }
.nav__list a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.925rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.nav__list a:hover { color: var(--text); }
.nav__list a[aria-current="true"] {
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px var(--border);
}

.header__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-strong); }
.icon-btn .icon { width: 18px; height: 18px; grid-area: 1 / 1; }

/* Theme toggle: show the icon for the theme you'd switch TO. */
.theme-toggle .icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon--sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon--moon { display: none; }
}
html:not(.js) .theme-toggle { display: none; }

.nav-toggle { display: none; }
.nav-toggle .icon--close,
.nav-toggle[aria-expanded="true"] .icon--menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon--close { display: block; }

@media (max-width: 859.98px) {
  .js .nav-toggle { display: inline-grid; }
  .js .nav {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    right: var(--gutter);
    left: var(--gutter);
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-solid); /* fully opaque: even 4% bleed shows the hero title through */
    box-shadow: 0 24px 60px -20px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s linear 0.25s;
  }
  .js .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s;
  }
  .js .nav__list { flex-direction: column; }
  .js .nav__list a { padding: 12px 16px; border-radius: 12px; font-size: 1rem; }

  /* No-JS fallback: keep the links reachable in a scrollable row. */
  html:not(.js) .brand__name { display: none; }
  html:not(.js) .nav { min-width: 0; overflow-x: auto; }
}

/* ---------- Buttons & links ---------- */
.btn {
  --_bg: var(--surface);
  --_fg: var(--text);
  --_bd: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--_bd);
  border-radius: 999px;
  background: var(--_bg);
  color: var(--_fg);
  font-size: 0.95rem;
  font-weight: 550;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn .icon--trail { width: 14px; height: 14px; margin-left: -4px; opacity: 0.6; }
.btn--primary {
  --_bg: var(--text);
  --_fg: var(--bg);
  --_bd: transparent;
  box-shadow: 0 10px 30px -12px var(--shadow-color);
}
.btn--primary:hover { box-shadow: 0 14px 34px -12px var(--accent-ring); }
.btn--ghost:hover { --_bd: var(--border-strong); --_bg: var(--surface-strong); }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--accent);
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link .icon { width: 15px; height: 15px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-block: calc(var(--header-h) + clamp(48px, 9vh, 112px)) clamp(24px, 5vh, 56px);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 160px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center -1px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 0%, #000 35%, transparent 80%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 0%, #000 35%, transparent 80%);
}
.hero__glow { position: absolute; border-radius: 50%; }
.hero__glow--1 { top: -280px; left: -200px; width: 680px; height: 680px; background: radial-gradient(closest-side, var(--glow-1), transparent); }
.hero__glow--2 { top: -220px; right: -180px; width: 600px; height: 600px; background: radial-gradient(closest-side, var(--glow-2), transparent); }
.hero__glow--3 { bottom: -300px; left: 30%; width: 560px; height: 560px; background: radial-gradient(closest-side, var(--glow-3), transparent); }

.hero__inner { display: grid; gap: clamp(48px, 7vw, 80px); align-items: center; }
@media (min-width: 1024px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Photo sits beside the name; both scale together so the name stays on one line. */
.hero__name { display: flex; align-items: center; gap: clamp(14px, 1.7vw, 24px); }
.avatar {
  display: block;
  flex: none;
  width: clamp(64px, 40px + 3.6vw, 96px);
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 50%;
  background: var(--surface-strong);
  box-shadow: 0 0 0 1px var(--border-strong), 0 12px 32px -18px var(--shadow-color);
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.hero__title {
  min-width: 0;
  font-size: clamp(2.5rem, 1.5rem + 3vw, 4.25rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--text);
}
.hero__role {
  margin-top: 20px;
  font-size: clamp(1.1rem, 0.95rem + 0.8vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.4;
  color: var(--text-muted);
  text-wrap: balance;
}
.hero__role strong { color: var(--accent); }
.hero__lead {
  max-width: 54ch;
  margin-top: 20px;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  color: var(--text-muted);
  text-wrap: pretty;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 32px;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.hero__meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta .icon { color: var(--accent); }

/* ---------- Terminal ---------- */
.terminal {
  position: relative;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.09);
  border-radius: 18px;
  background: linear-gradient(180deg, #0f141d, #0a0e15);
  box-shadow:
    0 40px 80px -32px light-dark(rgb(15 23 42 / 0.3), rgb(0 0 0 / 0.65)),
    0 0 120px -40px rgb(79 140 255 / 0.25);
  font-family: var(--font-mono);
  font-size: clamp(12px, 11px + 0.25vw, 13.5px);
  line-height: 1.8;
  color: #c7d1df;
}
.terminal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.25), transparent);
}
.terminal__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
  background: rgb(255 255 255 / 0.025);
}
.terminal__dots { display: flex; gap: 8px; }
.terminal__dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.terminal__dots i:nth-child(2) { background: #febc2e; }
.terminal__dots i:nth-child(3) { background: #28c840; }
.terminal__title { font-size: 12px; color: #7d8799; }
.terminal__body {
  padding: 20px 22px 24px;
  overflow-x: auto;
  scrollbar-color: rgb(255 255 255 / 0.15) transparent;
  scrollbar-width: thin;
}
.t-line { min-height: 1.8em; white-space: pre; }
.t-line.is-pending { visibility: hidden; }
.t-gap { margin-top: 0.85em; }
.t-prompt { color: #34d399; }
.t-cmd { color: #f1f5f9; }
.t-key { color: #c4b5fd; }
.t-val { color: #7dd3fc; }
.t-dim { color: #7c8aa0; }
.t-cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: #e2e8f0;
}

/* ---------- Sections ---------- */
.section { position: relative; padding-block: clamp(64px, 7vw, 96px); }
.section__head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.6; }
.section__title {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.section__intro {
  max-width: 62ch;
  margin-top: 18px;
  font-size: 1.075rem;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* ---------- Cards (with pointer spotlight) ---------- */
.card {
  position: relative;
  isolation: isolate;
  overflow: clip; /* not hidden: keeps position: sticky working inside cards */
  padding: clamp(22px, 2.6vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px var(--card-shadow), 0 12px 32px -18px var(--card-shadow);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, -30%), var(--spot), transparent 42%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover { border-color: var(--border-strong); }
.card:hover::before { opacity: 1; }

.icon-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.icon-badge .icon { width: 22px; height: 22px; }
.icon-badge--sm { width: 36px; height: 36px; border-radius: 11px; }
.icon-badge--sm .icon { width: 18px; height: 18px; }

/* Inline dot-separated metadata; empty items (e.g. durations before JS) collapse. */
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.meta > * + *::before { content: "·"; margin-inline: 0.55em; color: var(--text-faint); }
.meta > :empty { display: none; }

/* ---------- About (bento) ---------- */
.bento { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento__about, .bento__now, .bento__path { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "about about now  now"
      "about about loc  lang"
      "path  path  path path";
  }
  .bento__about { grid-area: about; }
  .bento__now { grid-area: now; }
  .bento__loc { grid-area: loc; }
  .bento__lang { grid-area: lang; }
  .bento__path { grid-area: path; }
}
.bento__about { display: grid; align-content: center; gap: 16px; }
.bento__about p { font-size: 1.05rem; color: var(--text-muted); text-wrap: pretty; }
.bento__about strong { color: var(--text); }

.tile__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.tile__label .icon { width: 15px; height: 15px; color: var(--accent); }
.tile__big {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.tile__sub { margin-top: 6px; color: var(--text-muted); }
.tile__meta { margin-top: 14px; font-family: var(--font-mono); font-size: 0.8rem; }

.langs { display: grid; gap: 14px; }
.langs li { display: grid; }
.langs li span:first-child { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; }
.langs li span:last-child { font-size: 0.875rem; color: var(--text-muted); }

.path { display: grid; margin-top: 6px; }
.path__step { position: relative; padding: 0 0 22px 28px; }
.path__step::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
}
.path__step::after {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 2px;
  left: 5.5px;
  width: 1px;
  background: var(--border-strong);
}
.path__step:last-child { padding-bottom: 0; }
.path__step:last-child::after { display: none; }
.path__step.is-current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.path__year { display: block; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); }
.path__role { display: block; margin-top: 2px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.path__org { display: block; font-size: 0.875rem; color: var(--text-muted); }
.path__step.is-current .path__year { color: var(--accent); }
@media (min-width: 720px) {
  .path { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .path__step { padding: 28px 18px 0 0; }
  .path__step:last-child { padding-right: 0; }
  .path__step::before { top: 0; }
  .path__step::after { top: 5.5px; right: 6px; bottom: auto; left: 20px; width: auto; height: 1px; }
}

/* ---------- Focus areas ---------- */
.focus-grid,
.skills-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.focus .icon-badge { margin-bottom: 20px; }
.focus h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; }
.focus p { margin-top: 8px; font-size: 0.97rem; color: var(--text-muted); text-wrap: pretty; }

/* ---------- Experience ---------- */
.timeline { display: grid; gap: 20px; }
.company__head { display: flex; align-items: center; gap: 16px; }
/* Company logos: pre-composed square tiles in assets/img/logos (3x), framed by a hairline. */
.company__logo {
  display: block;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border-strong);
}
.company__name { font-size: 1.25rem; font-weight: 650; line-height: 1.25; letter-spacing: -0.025em; }
.company__head .meta { margin-top: 2px; }
/* Total tenure gets its own line, so a wrap never starts with a dangling separator. */
.company__head .meta > [data-from] { flex-basis: 100%; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-faint); }
.company__head .meta > [data-from]::before { content: none; }

/* Roles sit under the company row: dots centred under the 52px logo, titles aligned with the name. */
.roles { display: grid; gap: 22px; margin: 22px 0 0 20px; }
.role { position: relative; padding-left: 48px; }
.role::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 13px;
  height: 13px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
}
.role.is-current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-ring); }
.role:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 26px;
  bottom: -16px; /* stops just short of the next role's dot (gap 22px) */
  left: 6px;
  width: 1px;
  background: linear-gradient(var(--border-strong), var(--border));
}
.role__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.role__title { font-size: 1.075rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.015em; }
.role__dates { font-family: var(--font-mono); font-size: 0.8rem; }

.role__summary { margin-top: 6px; max-width: 92ch; color: var(--text-muted); text-wrap: pretty; }
/* Narrow screens: the role duration drops to its own line instead of wrapping after a dangling "·". */
@media (max-width: 639.98px) {
  .role__dates > [data-from] { flex-basis: 100%; }
  .role__dates > [data-from]::before { content: none; }
}

/* ---------- Skills ---------- */
.skill h3 { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ---------- Education & certifications ---------- */
.edu-grid { display: grid; gap: 48px; }
@media (min-width: 960px) {
  .edu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
.col-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.col-title .icon { color: var(--accent); }
.col-title--spaced { margin-top: 40px; }
.stack { display: grid; gap: 16px; }

.edu h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 10px;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.edu .meta { font-size: 0.8rem; }
.edu__school { margin-top: 4px; color: var(--text-muted); }
.edu__thesis {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.95rem;
  color: var(--text-muted);
  text-wrap: pretty;
}
.edu__label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-ring);
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: 0;
  color: var(--accent);
  white-space: nowrap;
}

.cert { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.cert .icon-badge { width: 42px; height: 42px; border-radius: 12px; }
.cert .icon-badge .icon { width: 20px; height: 20px; }
.cert h4 { font-size: 1rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; }
.cert .meta { margin-top: 4px; }
.cert .text-link { margin-top: 10px; }

.training li {
  padding: 14px 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-muted);
}
.training li:last-child { border-bottom: 1px solid var(--border); }
.training strong { color: var(--text); }
.training li span { display: block; margin-top: 2px; font-size: 0.85rem; color: var(--text-faint); }

/* ---------- Contact ---------- */
.section--contact { padding-top: clamp(40px, 6vw, 72px); }
.contact {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(48px, 8vw, 96px) clamp(22px, 6vw, 72px);
  border: 1px solid var(--border);
  border-radius: 32px;
  background: var(--surface);
  text-align: center;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 90% at 50% 0%, var(--glow-1), transparent 70%),
    radial-gradient(45% 70% at 90% 100%, var(--glow-2), transparent 70%);
}
.contact::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 20%, transparent 75%);
}
.contact .eyebrow { justify-content: center; }
.contact__title {
  font-size: clamp(2.3rem, 1.4rem + 4vw, 4.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.contact__text {
  max-width: 54ch;
  margin: 20px auto 0;
  font-size: 1.075rem;
  color: var(--text-muted);
  text-wrap: pretty;
}
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.contact__actions .btn--primary { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .contact__actions { flex-direction: column; }
  .contact__actions .btn { width: 100%; }
}
[data-copy] .icon--check,
[data-copy].is-copied .icon--copy { display: none; }
[data-copy].is-copied .icon--check { display: block; color: var(--ok); }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 32px 40px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }

/* ---------- 404 ---------- */
.not-found {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: clip;
  padding-block: 96px;
  text-align: center;
}
.not-found__inner { display: grid; justify-items: center; gap: 20px; max-width: 560px; }
.not-found__title { font-size: clamp(2.4rem, 1.6rem + 4vw, 4rem); font-weight: 700; line-height: 1; letter-spacing: -0.045em; }
.not-found p { color: var(--text-muted); }

/* ---------- Motion (all decorative; skipped for reduced motion) ---------- */
.reveal { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), border-color 0.3s; }
.reveal-ready .reveal:not(.is-visible) { opacity: 0; transform: translateY(20px); }
/* Row-wise stagger for the 3-column grids: each row cascades left to right. */
.stagger > .reveal:nth-child(3n + 2) { transition-delay: 0.07s, 0.07s, 0s; }
.stagger > .reveal:nth-child(3n + 3) { transition-delay: 0.14s, 0.14s, 0s; }

@media (prefers-reduced-motion: no-preference) {
  .hero__copy > *, .hero__visual { animation: rise 0.9s var(--ease) both; }
  .hero__copy > :nth-child(2) { animation-delay: 0.06s; }
  .hero__copy > :nth-child(3) { animation-delay: 0.12s; }
  .hero__copy > :nth-child(4) { animation-delay: 0.18s; }
  .hero__copy > :nth-child(5) { animation-delay: 0.24s; }
  .hero__copy > :nth-child(6) { animation-delay: 0.3s; }
  .hero__visual { animation-delay: 0.2s; }
  .t-cursor { animation: blink 1.1s steps(1, end) infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; }
}

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }

/* Circular reveal for the theme switch (View Transitions API); JS drives the clip-path. */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Print: the page doubles as a clean one-column CV ---------- */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; font-size: 10.5pt; }
  .site-header, .skip-link, .hero__bg, .hero::after, .hero__visual, .hero__cta,
  .theme-toggle, .contact__actions, .site-footer .text-link,
  .bento__loc, #focus { display: none !important; }
  .hero { padding-block: 0 16px; }
  .hero__title { color: #000; }
  .section { padding-block: 18px; }
  .section__head { margin-bottom: 14px; }
  .card, .contact { border-color: #d0d5dd; background: none; box-shadow: none; break-inside: avoid; }
  .card::before, .contact::before, .contact::after { display: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  a { text-decoration: none; }
}
