/* ==========================================================================
   Pranav Kushwaha portfolio
   Design tokens -> base -> layout -> components -> pages -> utilities
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #0a0b10;
  --bg-alt: #0e1017;
  --surface: #13161f;
  --surface-2: #191d29;
  --border: #232838;
  --border-strong: #343c54;

  /* Text (all pass WCAG AA on --bg and --surface) */
  --text: #eceef4;
  --text-muted: #a4abbd;
  --text-dim: #8a92a8;

  /* Accent: the photon-ring orange from the hero shader */
  --accent: #ff8a3d;
  --accent-strong: #ffa769;
  --accent-soft: rgb(255 138 61 / 0.12);
  --accent-ink: #1b0e04;

  /* Status */
  --ok: #5fe0a0;
  --ok-soft: rgb(95 224 160 / 0.12);
  --wip: #7cc4ff;
  --wip-soft: rgb(124 196 255 / 0.12);
  --warn: #ffc65c;

  /* Type */
  --font-sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.4rem, 1.25rem + 0.75vw, 1.85rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.5vw, 2.75rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.6vw, 5.25rem);

  /* Space & shape */
  --gutter: 16px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --section-space: clamp(72px, 10vw, 136px);
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; --header-h: 72px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.mono { font-family: var(--font-mono); font-size: 0.8em; letter-spacing: 0; }
.muted { color: var(--text-muted); }
.small { font-size: var(--step--1); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-space); position: relative; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.grid {
  display: grid;
  gap: clamp(16px, 2.5vw, 28px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: var(--step-3); }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px;
}
.section-lede { margin-top: 16px; color: var(--text-muted); font-size: var(--step-1); line-height: 1.5; }
.mini-head {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 14px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgb(10 11 16 / 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.site-header[data-scrolled] { border-bottom-color: var(--border); background: rgb(10 11 16 / 0.86); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark { color: var(--accent); flex: none; }
.brand:hover { color: var(--text); }
.brand:hover .brand-mark { transform: rotate(-24deg); }
.brand-mark { transition: transform 0.5s var(--ease); }

.site-nav ul { list-style: none; display: flex; gap: 4px; }
.site-nav a:not(.btn) {
  display: block; padding: 8px 12px; border-radius: 999px;
  color: var(--text-muted); text-decoration: none; font-size: 0.95rem;
  transition: color 0.2s, background-color 0.2s;
}
.site-nav a:not(.btn):hover, .site-nav a[aria-current] { color: var(--text); background: var(--surface-2); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle-close { display: none; }
.nav-toggle[aria-expanded='true'] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded='true'] .nav-toggle-close { display: block; }

@media (min-width: 860px) {
  .site-nav { display: flex; align-items: center; gap: 12px; }
}
@media (max-width: 859.98px) {
  .js .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    padding: 12px var(--gutter) 20px;
    background: var(--bg);
    box-shadow: 0 24px 40px -12px rgb(0 0 0 / 0.6);
    border-bottom: 1px solid var(--border);
    display: grid; gap: 12px;
  }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a:not(.btn) { padding: 12px; font-size: 1.05rem; }
  .site-nav .btn { justify-content: center; }
  .js .site-nav:not([data-open]) { display: none; }
  /* Without JS the nav stays visible as a wrapped row. */
  .no-js .site-header { height: auto; position: static; }
  .no-js .header-inner { flex-wrap: wrap; padding-block: 12px; }
  .no-js .site-nav { position: static; padding: 0; background: none; border: 0; }
  .no-js .site-nav ul { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.btn .icon { flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Badges, tags, pulse ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.badge-wip { color: var(--wip); background: var(--wip-soft); border-color: rgb(124 196 255 / 0.35); }
.badge-complete { color: var(--ok); background: var(--ok-soft); border-color: rgb(95 224 160 / 0.35); }
.badge-note { color: var(--wip); background: var(--wip-soft); border-color: rgb(124 196 255 / 0.35); }
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
  box-shadow: 0 0 0 0 currentColor; animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted);
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: rgb(255 255 255 / 0.02);
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(calc(100svh - var(--header-h)), 900px);
  display: flex; align-items: center;
  padding-block: clamp(56px, 9vw, 112px) clamp(72px, 9vw, 112px);
  margin-top: calc(var(--header-h) * -1);
  padding-top: calc(var(--header-h) + clamp(48px, 8vw, 96px));
  /* Fallback when WebGL is unavailable */
  background:
    radial-gradient(circle at 74% 52%, #ffd9ad 0 3px, #ff8a3d 16px, #7a2f6b 46px, #1a1030 76px, rgb(200 214 255 / 0.75) 80px, rgb(130 150 230 / 0.18) 86px, transparent 124px),
    radial-gradient(ellipse 60% 45% at 74% 52%, rgb(124 150 255 / 0.08), transparent 70%),
    var(--bg);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: 0; transition: opacity 1.2s var(--ease); }
.hero-canvas[data-ready] { opacity: 1; }
.hero-scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgb(10 11 16 / 0.92) 34%, rgb(10 11 16 / 0.35) 62%, transparent 80%),
    linear-gradient(0deg, var(--bg) 0%, transparent 22%);
}
@media (max-width: 859.98px) {
  .hero { background: radial-gradient(circle at 90% 7%, #ffd9ad 0 2px, #ff8a3d 9px, #7a2f6b 26px, #1a1030 42px, rgb(200 214 255 / 0.7) 45px, transparent 66px), var(--bg); }
  .hero-scrim { background: linear-gradient(180deg, rgb(10 11 16 / 0.1) 0%, rgb(10 11 16 / 0.82) 34%, var(--bg) 100%); }
}
.hero-inner { position: relative; }
.availability {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 12px; border-radius: 999px;
  border: 1px solid rgb(95 224 160 / 0.3); background: rgb(95 224 160 / 0.08);
  color: var(--ok); font-size: 0.88rem; font-weight: 500;
  margin-bottom: 28px;
}
.hero-title { font-size: var(--step-4); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.hero-role {
  margin-top: 14px; font-size: var(--step-2); font-weight: 500; letter-spacing: -0.015em;
  background: linear-gradient(90deg, var(--accent-strong), #ffd2a8 60%, var(--text));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  width: fit-content;
}
/* Short scannable lines instead of a paragraph; the first (current role) reads brightest. */
.hero-intro { list-style: none; display: grid; gap: 6px; margin-top: 22px; max-width: 40em; color: var(--text-muted); font-size: var(--step-1); line-height: 1.45; }
.hero-intro li { position: relative; padding-left: 20px; }
.hero-intro li::before { content: ''; position: absolute; left: 0; top: 0.68em; width: 8px; height: 2px; border-radius: 2px; background: var(--accent); }
.hero-intro li:first-child { color: var(--text); }
/* Core stack as readable chips: larger, brighter text with a clear outline. */
.hero-focus { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-focus li {
  padding: 6px 13px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 500; letter-spacing: 0; color: var(--text);
  background: rgb(255 255 255 / 0.05); border: 1px solid var(--border-strong);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  margin: clamp(44px, 7vw, 72px) 0 0; padding-top: 24px; border-top: 1px solid var(--border);
  max-width: 640px;
}
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.stat dd { margin: 0; font-size: var(--step-3); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.stat dt { color: var(--text-dim); font-size: var(--step--1); line-height: 1.35; }
.hero-caption {
  position: absolute; right: var(--gutter); bottom: 20px; z-index: 1;
  color: var(--text-dim); font-size: 0.72rem;
}
.hero-caption a { color: var(--text-muted); }
@media (max-width: 859.98px) { .hero-caption { display: none; } }
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; gap: 14px; }
  .stat { flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 12px; }
  .stat dd { font-size: var(--step-2); min-width: 2.4em; }
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- Featured project ---------- */
.featured {
  display: grid; gap: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-alt));
  margin-bottom: clamp(20px, 3vw, 32px);
}
@media (min-width: 1000px) { .featured { grid-template-columns: 1.08fr 1fr; } }
.featured-media { position: relative; display: block; background: #000; min-height: 240px; }
.featured-media { display: grid; place-items: center; }
.featured-media img { width: 100%; height: 100%; object-fit: contain; }
.featured-media .video-frame { width: 100%; }
@media (min-width: 1000px) { .featured-media { border-right: 1px solid var(--border); } }
.featured-flag {
  position: absolute; left: 16px; top: 16px;
  padding: 5px 10px; border-radius: 999px; font-size: 0.72rem;
  background: rgb(10 11 16 / 0.8); border: 1px solid var(--border-strong); color: var(--accent-strong);
  backdrop-filter: blur(6px);
}
.featured-body { padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; }
.featured-title { font-size: var(--step-3); margin-top: 16px; }
.featured-title a { text-decoration: none; }
.featured-tagline { margin-top: 12px; font-size: var(--step-1); color: var(--text); }
.featured-summary { margin-top: 8px; color: var(--text-muted); }
.progress-line { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 22px 0; font-size: 0.95rem; color: var(--text-muted); }
.progress-line li { display: inline-flex; align-items: center; gap: 8px; }
.progress-line li:first-child .icon { color: var(--ok); }
.progress-line li + li .icon { color: var(--accent); }
.progress-line strong { color: var(--text); font-weight: 600; }
.featured .actions { margin-top: auto; padding-top: 28px; }

/* Lists: checks, issues, roadmap */
.checklist, .issues { list-style: none; display: grid; gap: 10px; }
.checklist li, .issues li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 0.95rem; line-height: 1.45; }
.checklist .icon { color: var(--ok); margin-top: 2px; }
.issues .icon { color: var(--warn); margin-top: 2px; }
.checklist-lg li, .issues li { font-size: var(--step-0); padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }

.roadmap { list-style: none; counter-reset: step; display: grid; gap: 0; }
.roadmap li { counter-increment: step; position: relative; padding: 0 0 18px 44px; line-height: 1.45; }
.roadmap li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted);
}
.roadmap li:first-child::before { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.roadmap li:not(:last-child)::after { content: ''; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: var(--border-strong); }

/* ---------- Cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 24px 48px -24px rgb(0 0 0 / 0.7); }
.card:has(.card-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; border-bottom: 1px solid var(--border); }
.card-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s var(--ease); pointer-events: none; }
.card.is-playing .card-preview { opacity: 1; }
.media-badge {
  position: absolute; left: 12px; top: 12px; z-index: 2; pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px;
  font-size: 0.7rem; color: var(--text); background: rgb(10 11 16 / 0.78); border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px); transition: opacity 0.3s;
}
.media-badge .icon { fill: currentColor; stroke: none; }
.card.is-playing .media-badge { opacity: 0; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card:hover .card-media img { transform: scale(1.045); }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text-dim); }
.card-title { font-size: var(--step-1); margin-top: 4px; }
.card-link { text-decoration: none; }
.card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.card-link:focus-visible { outline: none; }
.card:hover .card-link { color: var(--accent-strong); }
.card-text { color: var(--text-muted); font-size: 0.97rem; margin-bottom: 6px; }
.card .tags { margin-top: auto; }

/* ---------- About ---------- */
.about { display: grid; gap: clamp(32px, 6vw, 72px); align-items: start; }
@media (min-width: 900px) { .about { grid-template-columns: minmax(280px, 380px) 1fr; } }
.portrait { margin: 0; position: relative; max-width: 420px; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.portrait::before {
  content: ''; position: absolute; inset: 14px -14px auto 14px; aspect-ratio: 4 / 5; z-index: -1;
  border-radius: var(--radius-lg); border: 1px solid var(--accent); opacity: 0.35;
}
.portrait figcaption { display: inline-flex; align-items: center; gap: 6px; margin-top: 26px; color: var(--text-dim); }
@media (min-width: 900px) { .portrait { position: sticky; top: calc(var(--header-h) + 32px); } }
.prose { display: grid; gap: 16px; color: var(--text-muted); max-width: 66ch; }
.prose p:first-child { color: var(--text); }
.about-body .mini-head { margin-top: 44px; }
.skills { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--border); }
.skill-row { display: grid; gap: 8px 20px; padding: 14px 0; border-bottom: 1px solid var(--border); }
@media (min-width: 560px) { .skill-row { grid-template-columns: 140px 1fr; align-items: center; } }
.skill-row dt { color: var(--text); font-weight: 500; font-size: 0.95rem; }
.skill-row dd { margin: 0; }

/* ---------- Professional work ---------- */
.pro-grid { display: grid; gap: clamp(16px, 2.5vw, 24px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.pro-card {
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(22px, 3vw, 28px); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.3s var(--ease);
}
.pro-card:hover { border-color: var(--border-strong); }
.pro-card.is-current { border-top: 3px solid var(--accent); }
.pro-org { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-strong); }
.pro-role { margin-top: 8px; font-size: var(--step-1); }
.pro-when { margin-top: 6px; color: var(--text-dim); }
.pro-summary { color: var(--text-muted); }
.pro-impact { display: grid; gap: 14px; margin: 0; padding-top: 16px; border-top: 1px solid var(--border); }
.pro-impact > div { display: flex; flex-direction: column-reverse; gap: 4px; }
.pro-impact dd { margin: 0; font-size: var(--step-2); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; color: var(--text); }
.pro-impact dt { color: var(--text-muted); font-size: 0.92rem; line-height: 1.45; }
.pro-card .tags { margin-top: auto; }
.pro-case { border-top: 1px solid var(--border); padding-top: 14px; }
/* An open case study shouldn't stretch the neighbouring cards. */
.pro-grid:has(.pro-case[open]) { align-items: start; }
.pro-case summary {
  cursor: pointer; list-style: none; width: fit-content;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-strong);
}
.pro-case summary::-webkit-details-marker { display: none; }
.pro-case summary::after { content: ' +'; }
.pro-case[open] summary::after { content: ' −'; }
.pro-case summary:hover { color: var(--text); }
.pro-case-body { display: grid; gap: 10px; margin-top: 14px; color: var(--text-muted); font-size: 0.93rem; line-height: 1.55; }
.pro-case-body strong { color: var(--text); font-weight: 600; }
.pro-case-body h4 { margin-top: 6px; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.pro-case-body .bullets { margin-top: 0; gap: 6px; }
#work .actions { margin-top: 28px; }

/* Career path: one dated line, newest first. Study steps are blue
   (matching the "After MSc" badge); the current role is the accent dot. */
.career-path { list-style: none; position: relative; display: grid; grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr)); margin: 0 0 clamp(28px, 4vw, 40px); }
.career-path::before {
  content: ''; position: absolute; left: 7px; right: 0; top: 6px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--border-strong) 40%, var(--border-strong));
}
.path-step { position: relative; display: grid; gap: 3px; align-content: start; padding: 26px 16px 0 0; }
.path-step::after {
  content: ''; position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border-strong);
}
.path-step.is-study::after { border-color: var(--wip); background: var(--wip-soft); }
.path-step.is-current::after { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.path-years { font-size: 0.75rem; color: var(--text-dim); }
.path-step.is-study .path-years { color: var(--wip); }
.path-step.is-current .path-years { color: var(--accent-strong); }
.path-org { font-weight: 600; color: var(--text); line-height: 1.3; }
.path-label { font-size: 0.88rem; color: var(--text-muted); line-height: 1.35; }
@media (max-width: 759.98px) {
  .career-path { grid-template-columns: 1fr; }
  .career-path::before { left: 6px; right: auto; top: 7px; bottom: 16px; width: 2px; height: auto; background: linear-gradient(180deg, var(--accent), var(--border-strong) 40%, var(--border-strong)); }
  .path-step { padding: 0 0 16px 30px; }
}

/* ---------- Personal achievements ---------- */
.awards { margin-top: clamp(40px, 5vw, 56px); }
.awards-list { list-style: none; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.awards-list li {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start;
  padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.awards-list .icon { color: var(--accent); margin-top: 2px; }
.awards-list span { display: grid; gap: 2px; }
.awards-list span span { color: var(--text-muted); font-size: 0.92rem; }

.about-body .actions { margin-top: 32px; }
.about-body .education { margin-top: 2px; }
.about-body .mini-head + .tags + .mini-head { margin-top: 32px; }
.plain .mono { color: var(--text-dim); font-size: 0.78rem; }
.bullets { margin-top: 12px; padding-left: 1.1em; display: grid; gap: 8px; color: var(--text-muted); }
.bullets li::marker { color: var(--accent); }
.plain { list-style: none; display: grid; gap: 14px; }
.plain li { display: grid; gap: 2px; }
.plain strong { font-weight: 600; }
.plain span { color: var(--text-muted); font-size: 0.93rem; }

/* ---------- Testimonial ---------- */
.testimonial { margin: 0; max-width: 900px; }
.testimonial blockquote { margin: 0; }
.pull {
  font-size: var(--step-2); line-height: 1.35; letter-spacing: -0.015em; font-weight: 500;
  padding-left: clamp(16px, 3vw, 28px); border-left: 3px solid var(--accent);
}
.full-quote { margin-top: 22px; color: var(--text-muted); }
.full-quote summary {
  cursor: pointer; width: fit-content; list-style: none;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-strong);
  padding: 8px 0;
}
.full-quote summary::-webkit-details-marker { display: none; }
.full-quote summary::after { content: ' +'; }
.full-quote[open] summary::after { content: ' −'; }
.full-quote p { margin-top: 14px; max-width: 70ch; }
.testimonial figcaption { display: flex; align-items: center; gap: 14px; margin-top: 30px; line-height: 1.4; }
.testimonial figcaption a { text-decoration: none; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid rgb(255 138 61 / 0.35);
}

/* ---------- Contact ---------- */
.contact { overflow: hidden; }
.contact::before {
  content: ''; position: absolute; inset: auto -20% -60% auto; width: 70vw; height: 70vw; max-width: 800px; max-height: 800px;
  background: radial-gradient(circle, rgb(255 138 61 / 0.1), transparent 65%); pointer-events: none;
}
.contact-inner { position: relative; }
.contact-email { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.email-link {
  font-size: clamp(1.35rem, 0.9rem + 2.8vw, 3rem); font-weight: 600; letter-spacing: -0.025em;
  text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size 0.4s var(--ease), color 0.2s;
}
.email-link:hover { background-size: 100% 2px; }
.contact-phone { margin-top: 16px; }
.contact-phone a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); text-decoration: none; }
.contact-socials { list-style: none; display: grid; gap: 12px; margin-top: 40px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.social-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius); text-decoration: none;
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.social-card > span { display: grid; line-height: 1.3; min-width: 0; }
.social-card .muted { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.social-card > .icon:last-child { color: var(--text-dim); }

.contact-form { display: grid; gap: 16px; margin-top: 40px; max-width: 760px; }
@media (min-width: 640px) { .contact-form { grid-template-columns: 1fr 1fr; } .field-full, .contact-form .btn { grid-column: 1 / -1; } .contact-form .btn { justify-self: start; } }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.9rem; color: var(--text-muted); }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 28px; color: var(--text-dim); font-size: var(--step--1); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.social-row { list-style: none; display: flex; gap: 4px; }
.social-row a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--text-muted); }
.social-row a:hover { background: var(--surface-2); color: var(--text); }
.back-to-top { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
/* ---------- Analytics consent ---------- */
.consent {
  position: fixed; z-index: 60; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(560px, calc(100% - 2 * var(--gutter)));
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  box-shadow: 0 24px 48px -16px rgb(0 0 0 / 0.7);
}
.consent[hidden] { display: none; }
.consent-text { flex: 1 1 280px; font-size: 0.92rem; color: var(--text-muted); line-height: 1.5; }
.consent-text strong { color: var(--text); }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }
.link-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.link-button:hover { color: var(--text); }
@media print { .consent { display: none !important; } }

/* ---------- Project page ---------- */
.project { padding-top: clamp(28px, 5vw, 56px); padding-bottom: var(--section-space); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--step--1); color: var(--text-dim); }
.breadcrumbs li + li::before { content: '/'; margin-right: 6px; color: var(--border-strong); }
.breadcrumbs a { text-decoration: none; color: var(--text-muted); }
.project-head { margin: clamp(28px, 5vw, 48px) 0 clamp(28px, 4vw, 44px); max-width: 860px; }
.project-title { font-size: var(--step-4); font-weight: 700; letter-spacing: -0.035em; }
.project-tagline { margin-top: 18px; font-size: var(--step-1); color: var(--text-muted); line-height: 1.5; }
.update-note { margin-top: 14px; color: var(--wip); }
.project-hero-media { margin: 0; }
.project-hero-media > img, .project-hero-media > .video-frame, .video { width: 100%; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: #000; }
.project-hero-media > img, .video img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.media-caption { margin-top: 12px; color: var(--text-dim); font-size: var(--step--1); }
.video { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / 0.25); border: 0; cursor: pointer; }
.video-play svg { transition: transform 0.2s var(--ease); }
.video-play:hover svg { transform: scale(1.08); }

.project-layout { display: grid; gap: clamp(32px, 5vw, 64px); margin-top: clamp(36px, 5vw, 64px); }
@media (min-width: 960px) {
  .project-layout { grid-template-columns: 280px 1fr; }
  .project-aside { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
}
.meta { margin: 0; display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.meta > div { display: grid; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.meta > div:last-child { border-bottom: 0; }
.meta dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.meta dd { margin: 0; }
@media (min-width: 560px) and (max-width: 959.98px) {
  .meta { grid-template-columns: repeat(2, 1fr); }
  .meta > div { border-right: 1px solid var(--border); }
  .meta .meta-wide { grid-column: 1 / -1; border-right: 0; }
}
.project-content { display: grid; gap: clamp(40px, 5vw, 56px); min-width: 0; }
.block-title { font-size: var(--step-2); margin-bottom: 18px; }
.block .prose { font-size: var(--step-0); }
.gallery { display: grid; gap: 20px; }
/* One snippet per row: code has to be legible to be worth showing. */
.shot { margin: 0; }
.shot a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #0d0f15; }
.shot a:hover { border-color: var(--accent); }
.shot img { width: 100%; }
.shot figcaption { display: grid; gap: 4px; margin-top: 12px; font-size: 0.93rem; color: var(--text-muted); }
.shot figcaption strong { color: var(--text); font-weight: 600; }

.next-project { margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--border); }
.next-project a { display: grid; gap: 6px; padding-top: 28px; text-decoration: none; }
.next-title { display: inline-flex; align-items: center; gap: 12px; font-size: var(--step-3); font-weight: 600; letter-spacing: -0.025em; }
.next-title .icon { transition: transform 0.3s var(--ease); }
.next-project a:hover .next-title .icon { transform: translateX(6px); }
.more-title { font-size: var(--step-2); margin-bottom: 28px; }

.not-found { min-height: 60vh; display: flex; align-items: center; }

/* ---------- Motion ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

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


/* ---------- Video ---------- */
.video-frame { position: relative; overflow: hidden; background: #000; }
.video-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Hide captured window chrome: the frame's aspect ratio excludes the cropped rows. */
.video-crop video { object-position: center bottom; }

/* ---------- Metrics ---------- */
.metrics {
  display: grid; gap: 16px 28px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 32px 0 0; padding-top: 22px; border-top: 1px solid var(--border); max-width: 760px;
}
.metric { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.metric dd { margin: 0; font-size: var(--step-3); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--accent-strong); }
.metric dt { color: var(--text-dim); font-size: var(--step--1); line-height: 1.35; }

/* ---------- CV page ---------- */
.cv { padding: clamp(28px, 5vw, 56px) 0 var(--section-space); }
.cv-container { max-width: 1040px; }
.cv-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px;
  margin: clamp(28px, 5vw, 48px) 0 0; padding-bottom: 32px; border-bottom: 1px solid var(--border);
}
.cv-name { font-size: var(--step-4); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.cv-role { margin-top: 12px; font-size: var(--step-1); color: var(--text-muted); }
.cv-contact { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 0.95rem; }
.cv-contact a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); text-decoration: none; }
.cv-contact a:hover { color: var(--text); }
.cv-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cv-section { display: grid; gap: 16px 40px; padding: 36px 0; border-bottom: 1px solid var(--border); }
.cv-section:last-child { border-bottom: 0; }
@media (min-width: 860px) { .cv-section { grid-template-columns: 190px 1fr; } }
.cv-section-title {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); padding-top: 6px;
}
.cv-section-body { display: grid; gap: 34px; min-width: 0; }
.cv-profile { font-size: var(--step-1); line-height: 1.55; max-width: 68ch; }
.cv-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.cv-item-head h3 { font-size: var(--step-1); }
.cv-item-head h3 a { text-decoration: none; }
.cv-item-head h3 a:hover { color: var(--accent-strong); }
.cv-item-head .at { color: var(--text-muted); font-weight: 500; }
.cv-when { color: var(--text-dim); }
.cv-item-summary { margin-top: 6px; }
.cv-group { margin-top: 18px; }
.cv-group h4 { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-strong); }
.cv-group .bullets { margin-top: 8px; }
.cv .skills { border-top: 0; }
.cv .skill-row:first-child { padding-top: 0; }
.print-only { display: none; }

/* ---------- Print (CV "Save as PDF", and any page) ---------- */
@media print {
  @page { margin: 13mm 14mm; }
  :root {
    --bg: #fff; --bg-alt: #fff; --surface: #fff; --surface-2: #fff;
    --text: #111; --text-muted: #333; --text-dim: #555;
    --border: #d9d9d9; --border-strong: #c8c8c8;
    --accent: #a8480f; --accent-strong: #a8480f;
  }
  html { scroll-padding-top: 0; }
  body { background: #fff; color: var(--text); font-size: 10pt; line-height: 1.42; }
  .site-header, .site-footer, .skip-link, .nav-toggle, .no-print, .hero-canvas, .hero-scrim, .hero-caption { display: none !important; }
  .print-only { display: list-item; list-style: none; }
  a { color: inherit; text-decoration: none; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .cv { padding: 0; }
  .cv-container { max-width: none; padding: 0; }
  .cv-head { margin: 0; padding-bottom: 10pt; align-items: flex-start; }
  .cv-name { font-size: 22pt; }
  .cv-role { font-size: 11pt; margin-top: 4pt; }
  .cv-contact { margin-top: 6pt; gap: 2pt 14pt; font-size: 9pt; }
  .cv-contact .icon { display: none; }
  .cv-section { grid-template-columns: 92pt 1fr; gap: 4pt 14pt; padding: 9pt 0; }
  .cv-section-title { font-size: 8pt; padding-top: 2pt; }
  .cv-section-body { gap: 9pt; }
  .cv-profile { font-size: 10pt; }
  .cv-item { break-inside: avoid; }
  .cv-item-head h3 { font-size: 10.5pt; }
  .cv-when { font-size: 8.5pt; }
  .cv-group { margin-top: 5pt; }
  .bullets { gap: 2pt; margin-top: 4pt; }
  .skill-row { padding: 3pt 0; grid-template-columns: 92pt 1fr; }
  .tags { gap: 0 8pt; }
  .tags li { border: 0; padding: 0; background: none; font-size: 9pt; color: var(--text-muted); }
  .plain { gap: 4pt; }
  .plain span { font-size: 9pt; }
  .skill-row dt { font-size: 9.5pt; }
}
