/* ==========================================================================
   Abhijith Pradeep, portfolio
   Plain CSS, no build step. Tokens first, then layout, then components.

   Shape rule: containers (tiles, panels, photos) use --r-card (16px).
   Interactive elements (buttons, chips) are pills. Nothing else.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("assets/fonts/GeistVF.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/GeistMonoVF.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Warm light, default */
  --bg: #f4f2ee;
  --bg-alt: #ebe8e2;
  --surface: #fbfaf8;
  --surface-2: #f0ede7;
  --line: rgba(33, 29, 25, 0.11);
  --line-strong: rgba(33, 29, 25, 0.22);
  --text: #211d19;
  --muted: #5f5850;
  --dim: #8a8277;
  --accent: #b9451f;
  --accent-strong: #9c3814;
  --accent-soft: rgba(185, 69, 31, 0.11);
  --on-accent: #fff6f1;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 12px 32px -16px rgba(60, 40, 20, 0.25);

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

  --r-card: 16px;
  --r-pill: 999px;
  --max: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --nav-h: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171411;
    --bg-alt: #1e1a16;
    --surface: #231e19;
    --surface-2: #2b251f;
    --line: rgba(255, 244, 232, 0.1);
    --line-strong: rgba(255, 244, 232, 0.22);
    --text: #f1ece5;
    --muted: #b0a699;
    --dim: #7e7569;
    --accent: #e5865a;
    --accent-strong: #f09a72;
    --accent-soft: rgba(229, 134, 90, 0.14);
    --on-accent: #1e130c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #171411;
    --bg-alt: #1e1a16;
    --surface: #231e19;
    --surface-2: #2b251f;
    --line: rgba(255, 244, 232, 0.1);
    --line-strong: rgba(255, 244, 232, 0.22);
    --text: #f1ece5;
    --muted: #b0a699;
    --dim: #7e7569;
    --accent: #e5865a;
    --accent-strong: #f09a72;
    --accent-soft: rgba(229, 134, 90, 0.14);
    --on-accent: #1e130c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

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

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }
p { margin: 0; }
p + p { margin-top: 0.75em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
img { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--accent); color: var(--on-accent);
  padding: 0.5rem 0.9rem; border-radius: var(--r-pill); z-index: 100;
}
.skip:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- buttons and chips ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.25rem; border-radius: var(--r-pill);
  font-weight: 560; font-size: 0.95rem; line-height: 1; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform 0.18s var(--ease), background-color 0.18s, border-color 0.18s, color 0.18s;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-strong); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text); }
.btn--lg { padding: 0.95rem 1.5rem; font-size: 1.05rem; font-family: var(--mono); font-weight: 500; letter-spacing: -0.01em; }

.chip, .skill {
  display: inline-flex; align-items: center;
  padding: 0.45rem 0.9rem; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: transparent;
  font-size: 0.9rem; line-height: 1; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.18s var(--ease);
}
.chip:hover, .skill:hover { border-color: var(--text); }
.chip:active, .skill:active { transform: scale(0.97); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.skill.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 600; text-decoration: none; letter-spacing: -0.01em;
}
.nav__mark {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.nav__links { display: flex; align-items: center; gap: 0.25rem; }
.nav__links a {
  padding: 0.45rem 0.8rem; border-radius: var(--r-pill);
  text-decoration: none; color: var(--muted); font-size: 0.95rem;
  transition: color 0.15s, background-color 0.15s;
}
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__links a.is-current { color: var(--text); }

.nav__toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
}
.nav__toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s var(--ease); }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.25rem;
    padding: 0.75rem var(--gutter) 1rem;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.75rem 0.9rem; font-size: 1.05rem; }
}

/* ---------- layout primitives ---------- */

.section {
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
}
.section--alt { background: var(--bg-alt); }
.section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section__head { margin-bottom: 2.5rem; }
.section__head p { margin-top: 0.75rem; max-width: 62ch; color: var(--muted); font-size: 1.1rem; }

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

.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  display: grid; grid-template-columns: 7fr 5fr; gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: min(calc(100dvh - var(--nav-h)), 820px);
}
.hero__title {
  font-size: clamp(2.25rem, 4.2vw, 3.4rem);
  font-weight: 620; letter-spacing: -0.035em; line-height: 1.06;
  max-width: 22ch;
  animation: rise 0.9s var(--ease) both;
}
.hero__sub {
  margin-top: 1.5rem; max-width: 46ch;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted);
  animation: rise 0.9s var(--ease) 0.08s both;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; animation: rise 0.9s var(--ease) 0.16s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.plant { margin: 0; animation: rise 1s var(--ease) 0.2s both; }
.plant__frame {
  position: relative; aspect-ratio: 1 / 1;
  border-radius: var(--r-card); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
  cursor: crosshair; touch-action: none;
}
.plant__frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plant__hud {
  position: absolute; left: 1rem; bottom: 1rem;
  font-family: var(--mono); font-size: 0.72rem; line-height: 1.5;
  color: var(--muted); pointer-events: none;
}
.hud__row { display: flex; gap: 0.75rem; justify-content: space-between; min-width: 8.5rem; }
.hud__row b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.plant__caption { margin-top: 0.85rem; font-size: 0.85rem; color: var(--dim); max-width: 44ch; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__title { max-width: 16ch; }
  .plant { max-width: 520px; }
}

/* ---------- reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__title, .hero__sub, .hero__actions, .plant { animation: none; }
  .btn, .chip, .skill, .tile { transition: none; }
}

/* ---------- projects bento ---------- */

.bento {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem;
}
.tile {
  position: relative; display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.5rem; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform 0.25s var(--ease), border-color 0.2s, opacity 0.3s, box-shadow 0.25s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.tile p { color: var(--muted); font-size: 0.98rem; }
.tile h3 { color: var(--text); }
.tile__kicker { font-size: 0.85rem; color: var(--dim); font-weight: 500; }
.tile__tags { margin-top: auto; padding-top: 0.5rem; font-size: 0.82rem; color: var(--dim); }
.tile.is-dimmed { opacity: 0.28; }

.tile--feature { grid-column: 1 / 5; grid-row: 1 / 3; padding: 0; overflow: hidden; }
.tile--feature .tile__body { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.75rem; flex: 1; }
.tile--feature h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); max-width: 18ch; }
.tile--feature .tile__body > p:not(.tile__kicker):not(.tile__tags) { max-width: 60ch; }
.tile__link {
  display: block; padding: 0.9rem 1.75rem; border-top: 1px solid var(--line);
  text-decoration: none; font-weight: 560; color: var(--accent);
  background: var(--surface-2);
}
.tile__link:hover { color: var(--accent-strong); }
.tile--feature::before {
  content: ""; position: absolute; inset: -40% -40% auto auto; width: 70%; aspect-ratio: 1;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%); pointer-events: none;
}

.tile--tint-a { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.tile--tint-b { background: var(--surface-2); }
.tile--tint-c { background: linear-gradient(200deg, var(--surface-2), var(--surface)); }
.tile--tint-d { background: linear-gradient(120deg, var(--surface), var(--accent-soft)); }
.tile--wide { grid-column: span 3; }

.bento > .tile:nth-child(2) { grid-column: 5 / 7; grid-row: 1; }
.bento > .tile:nth-child(3) { grid-column: 5 / 7; grid-row: 2; }
.bento > .tile:nth-child(4) { grid-column: 1 / 3; }
.bento > .tile:nth-child(5) { grid-column: 3 / 5; }
.bento > .tile:nth-child(6) { grid-column: 5 / 7; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0.75rem 0 0; }
.stats div { display: flex; flex-direction: column-reverse; gap: 0.15rem; }
.stats dt { font-size: 0.78rem; color: var(--dim); line-height: 1.35; }
.stats dd { margin: 0; font-family: var(--mono); font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.stats dd small { font-size: 0.8rem; color: var(--dim); font-weight: 400; }
.stats--row { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .bento > .tile, .bento > .tile:nth-child(n) { grid-column: span 2; grid-row: auto; }
  .bento > .tile:nth-child(4), .bento > .tile:nth-child(5), .bento > .tile:nth-child(6) { grid-column: span 1; }
  .bento > .tile:nth-child(6) { grid-column: span 2; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento > .tile:nth-child(n) { grid-column: 1; }
  .stats, .stats--row { grid-template-columns: 1fr 1fr; }
}

.filter { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.filter__label { font-size: 0.9rem; color: var(--muted); }
.filter__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- hackathons ---------- */

.hack {
  padding: 2rem; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
  display: grid; grid-template-columns: 7fr 5fr; gap: 1.5rem 3rem; align-items: start;
}
.hack__feature { display: flex; flex-direction: column; gap: 0.7rem; }
.hack__feature h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); max-width: 22ch; }
.hack__feature p, .hack__note { color: var(--muted); }
.hack__side { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.25rem; border-radius: 12px; background: var(--surface-2); }
.hack__side h3 { font-size: 1rem; color: var(--muted); font-weight: 500; }
.hack__note { font-size: 0.95rem; }
.hack__stats { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.hack__stats .stats { margin: 0; }

.rank { width: 100%; height: auto; margin: 0.25rem 0 0.5rem; overflow: visible; }
.rank__axis { stroke: var(--line-strong); stroke-width: 1; }
.rank__line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.rank__dot { fill: var(--accent); stroke: var(--surface-2); stroke-width: 3; }
.rank__t { font-family: var(--mono); font-size: 12px; fill: var(--text); text-anchor: middle; }
.rank__t--axis { fill: var(--dim); font-size: 11px; }

@media (max-width: 860px) { .hack { grid-template-columns: 1fr; padding: 1.5rem; } }

/* ---------- research ---------- */

.research { display: grid; grid-template-columns: 7fr 5fr; gap: 1.5rem; align-items: start; }
.paper {
  padding: 2rem; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.9rem;
}
.paper__venue { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); }
.paper__title { font-size: clamp(1.3rem, 2.2vw, 1.75rem); letter-spacing: -0.02em; max-width: 30ch; }
.paper__authors { color: var(--text); font-weight: 500; }
.paper__abstract { color: var(--muted); font-size: 0.98rem; max-width: 70ch; }
.paper__links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.recognition__finding {
  margin-top: 0.75rem; padding: 1rem 1.25rem; border-radius: 12px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  font-size: 0.95rem; color: var(--text);
}

.recognition { display: flex; flex-direction: column; gap: 1rem; }
.recognition__photo { margin: 0; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.recognition__photo img { aspect-ratio: 12 / 13; object-fit: cover; width: 100%; }
.recognition h3 { margin-top: 0.5rem; }
.recognition__list { display: flex; flex-direction: column; gap: 1rem; }
.recognition__list li { display: flex; flex-direction: column; gap: 0.15rem; padding-left: 1rem; border-left: 2px solid var(--line-strong); }
.recognition__list b { font-weight: 600; }
.recognition__list span { color: var(--muted); font-size: 0.95rem; }

@media (max-width: 860px) { .research { grid-template-columns: 1fr; } }

/* ---------- skills ---------- */

.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 3rem; }
.skills__group h3 { font-size: 1.05rem; margin-bottom: 0.9rem; color: var(--muted); font-weight: 500; }
.skills__list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skills__evidence {
  grid-column: 1 / -1; margin-top: 0.5rem;
  padding: 1rem 1.25rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.98rem; color: var(--text); min-height: 3.6rem;
  display: flex; align-items: center;
  position: sticky; bottom: 1rem;
  box-shadow: var(--shadow);
}
.skills__evidence.is-idle { color: var(--dim); }

@media (max-width: 720px) { .skills { grid-template-columns: 1fr; gap: 1.75rem; } }

/* ---------- experience ---------- */

.cv { display: grid; grid-template-columns: 7fr 5fr; gap: 3rem; align-items: start; }
.cv__label { font-family: var(--mono); font-size: 0.78rem; font-weight: 500; color: var(--dim); text-transform: none; margin-bottom: 1.25rem; }
.cv__col--side .cv__label:not(:first-child) { margin-top: 2.5rem; }

.role { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: 1.25rem 0; }
.role + .role { border-top: 1px solid var(--line); }
.role__when { font-family: var(--mono); font-size: 0.8rem; color: var(--dim); padding-top: 0.25rem; }
.role__what p { margin-top: 0.4rem; color: var(--muted); font-size: 0.98rem; }

.edu + .edu { margin-top: 1.25rem; }
.edu p { margin-top: 0.35rem; color: var(--muted); font-size: 0.95rem; }

.plain { display: flex; flex-direction: column; gap: 0.75rem; color: var(--muted); font-size: 0.95rem; }
.plain b { color: var(--text); font-weight: 600; }

@media (max-width: 860px) {
  .cv { grid-template-columns: 1fr; gap: 2.5rem; }
  .role { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* ---------- now ---------- */

.now {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem;
}
.now__card {
  padding: 1.5rem 0; border-top: 1px solid var(--line-strong);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.now__card h3 { font-size: 1.15rem; }
.now__card p { color: var(--muted); font-size: 0.98rem; max-width: 52ch; }
.now__state { margin-top: 0.25rem; font-size: 0.9rem; color: var(--accent); font-weight: 500; }

@media (max-width: 860px) {
  .now { grid-template-columns: 1fr; }
}

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

.contact__grid { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.contact__photo { border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.contact__photo img { aspect-ratio: 34 / 45; object-fit: cover; width: 100%; }
.contact__copy h2 { font-size: clamp(2rem, 4vw, 3rem); }
.contact__copy > p { margin-top: 1rem; max-width: 54ch; color: var(--muted); font-size: 1.1rem; }
.contact__copy .btn { margin-top: 1.75rem; }
.contact__links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1.25rem; }
.contact__links a { color: var(--muted); }
.contact__links a:hover { color: var(--text); }

@media (max-width: 860px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact__photo { max-width: 320px; }
}

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

.footer {
  max-width: var(--max); margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.85rem; color: var(--dim);
  border-top: 1px solid var(--line);
}


/* ==========================================================================
   Multi-page additions
   ========================================================================== */

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

.page-head {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--gutter) 0;
}
.page-head h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); letter-spacing: -0.03em; }
.page-head p { margin-top: 0.9rem; max-width: 60ch; color: var(--muted); font-size: 1.1rem; }
.page-head + .section { padding-top: 2.5rem; }
.nav__links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* ---------- start page dashboard ---------- */

.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.dash__tile {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.5rem; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s;
}
.dash__tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.dash__tile h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.dash__tile h3 small { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--dim); }
.dash__tile p { color: var(--muted); font-size: 0.98rem; }
.dash__tile ul { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.25rem; font-size: 0.95rem; }
.dash__tile li { color: var(--text); padding-left: 0.9rem; position: relative; }
.dash__tile li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.dash__go { margin-top: auto; padding-top: 0.75rem; color: var(--accent); font-weight: 560; font-size: 0.95rem; }
.dash__tile--6 { grid-column: span 6; }
.dash__tile--4 { grid-column: span 4; }
.dash__tile--8 { grid-column: span 8; }
.dash__tile--photo { padding: 0; overflow: hidden; }
.dash__tile--photo img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }

.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 2.5rem; }
.numbers div { padding: 1.25rem 0 0; border-top: 1px solid var(--line-strong); }
.numbers b { display: block; font-family: var(--mono); font-size: 1.75rem; font-weight: 500; letter-spacing: -0.02em; }
.numbers span { color: var(--muted); font-size: 0.92rem; }

@media (max-width: 960px) {
  .dash__tile--6, .dash__tile--4, .dash__tile--8 { grid-column: span 12; }
  .dash__tile--photo img { aspect-ratio: 16 / 9; }
  .numbers { grid-template-columns: 1fr 1fr; }
}

/* ---------- tabs (category filter) ---------- */

.tabs {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.35rem; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  width: fit-content; max-width: 100%;
  margin-bottom: 2rem;
}
.tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 0.5rem 1rem; border-radius: var(--r-pill);
  font-size: 0.92rem; color: var(--muted);
  transition: background-color 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.tab small { font-family: var(--mono); font-size: 0.72rem; margin-left: 0.35rem; color: var(--dim); }

/* ---------- project entries ---------- */

.proj-list { display: flex; flex-direction: column; gap: 1rem; }
.proj {
  display: grid; grid-template-columns: 7fr 4fr; gap: 1.5rem 3rem;
  padding: 1.75rem; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
  transition: opacity 0.25s;
}
.proj[hidden] { display: none; }
.proj__status { font-size: 0.85rem; font-weight: 500; color: var(--dim); }
.proj__status.is-live { color: var(--accent); }
.proj h2, .proj h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); margin-top: 0.25rem; }
.proj__main p { color: var(--muted); font-size: 0.98rem; margin-top: 0.75rem; max-width: 62ch; }
.proj__main p.proj__lead { color: var(--text); margin-top: 0.5rem; }
.proj__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.25rem; }
.proj__facts div { display: flex; flex-direction: column-reverse; gap: 0.1rem; }
.proj__facts dt { font-size: 0.78rem; color: var(--dim); line-height: 1.35; }
.proj__facts dd { margin: 0; font-family: var(--mono); font-size: 1.25rem; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.proj__side { display: flex; flex-direction: column; gap: 1.25rem; padding-top: 0.25rem; }
.proj__side h4 { font-size: 0.8rem; font-weight: 500; color: var(--dim); margin-bottom: 0.5rem; }
.tools { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tools li {
  font-size: 0.85rem; padding: 0.3rem 0.7rem; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
.proj__links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.proj__links a { font-size: 0.9rem; }

@media (max-width: 860px) {
  .proj { grid-template-columns: 1fr; padding: 1.5rem; }
  .proj__facts { grid-template-columns: 1fr 1fr; }
}

/* compact repo list */
.repos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 2rem; }
.repos li { padding: 0.9rem 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.15rem; }
.repos a { font-weight: 560; }
.repos span { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 720px) { .repos { grid-template-columns: 1fr; } }

/* ---------- hackathon page ---------- */

.build-log { display: grid; grid-template-columns: 6rem 1fr 9rem; gap: 0.5rem 1.25rem; font-size: 0.95rem; }
.build-log > div { display: contents; }
.build-log b { font-family: var(--mono); font-weight: 500; color: var(--text); }
.build-log span { color: var(--muted); }
.build-log em { font-style: normal; font-family: var(--mono); font-size: 0.85rem; color: var(--accent); text-align: right; }
.build-log > div > * { padding: 0.55rem 0; border-top: 1px solid var(--line); }
.rejects { columns: 2; column-gap: 2.5rem; color: var(--muted); font-size: 0.95rem; }
.rejects li { break-inside: avoid; padding: 0.3rem 0; }
@media (max-width: 720px) {
  .build-log { grid-template-columns: 4.5rem 1fr; }
  .build-log em { grid-column: 2; text-align: left; border-top: 0; padding-top: 0; }
  .rejects { columns: 1; }
}

/* ---------- research directions ---------- */

.directions { display: flex; flex-direction: column; }
.direction {
  display: grid; grid-template-columns: 4fr 8fr; gap: 0.5rem 3rem;
  padding: 1.75rem 0; border-top: 1px solid var(--line-strong);
}
.direction:last-child { border-bottom: 1px solid var(--line-strong); }
.direction h3 { font-size: 1.2rem; grid-column: 1; }
.direction .proj__status { grid-column: 1; margin-top: 0.5rem; }
.direction p { grid-column: 2; color: var(--muted); font-size: 0.98rem; max-width: 62ch; }
.direction p + p { margin-top: 0.5rem; }
@media (max-width: 860px) {
  .direction { grid-template-columns: 1fr; }
  .direction h3, .direction .proj__status, .direction p { grid-column: 1; }
  .direction .proj__status { order: 3; }
}

/* ---------- contact strip on start page ---------- */

.strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  padding: 1.5rem 1.75rem; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
}
.strip p { color: var(--muted); max-width: 50ch; }
.strip__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- folds: experience accordion and project details ---------- */

.fold { border-top: 1px solid var(--line-strong); }
.fold:last-of-type { border-bottom: 1px solid var(--line-strong); }
.fold summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 9.5rem 1fr auto; gap: 1rem; align-items: baseline;
  padding: 1.1rem 0;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
  content: "+"; font-family: var(--mono); color: var(--dim); font-size: 1.1rem; line-height: 1;
  transition: transform 0.2s var(--ease);
}
.fold[open] summary::after { content: "\2212"; }
.fold summary:hover .fold__title { color: var(--accent); }
.fold__when { font-family: var(--mono); font-size: 0.8rem; color: var(--dim); }
.fold__title { font-weight: 600; letter-spacing: -0.01em; }
.fold p { padding: 0 0 1.25rem 10.5rem; color: var(--muted); font-size: 0.98rem; max-width: 60ch; }
@media (max-width: 860px) {
  .fold summary { grid-template-columns: 1fr auto; }
  .fold__when { grid-column: 1 / -1; }
  .fold p { padding-left: 0; }
}

.proj__more { margin-top: 0.9rem; }
.proj__more summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; font-weight: 560; color: var(--accent);
}
.proj__more summary::-webkit-details-marker { display: none; }
.proj__more summary::after { content: "+"; font-family: var(--mono); }
.proj__more[open] summary::after { content: "\2212"; }
.proj__more[open] summary { margin-bottom: 0.25rem; }
.proj__more p { margin-top: 0.75rem; }

/* ==========================================================================
   Start page, type-led layout
   ========================================================================== */

/* centred pill navigation on wide screens; the Contact link sits outside the pill */
.nav__cta {
  padding: 0.55rem 1.1rem; border-radius: var(--r-pill);
  background: var(--accent); color: var(--on-accent); font-weight: 560; font-size: 0.95rem; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.18s, transform 0.18s var(--ease);
}
.nav__cta:hover { background: var(--accent-strong); }
.nav__cta:active { transform: translateY(1px) scale(0.985); }
@media (min-width: 861px) {
  .nav { display: grid; grid-template-columns: 1fr auto 1fr; }
  .nav__links { justify-self: center; padding: 0.3rem; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); }
  .nav__links a { padding: 0.45rem 0.95rem; }
  .nav__links a:hover, .nav__links a[aria-current="page"] { background: var(--surface); }
  .nav__cta { justify-self: end; }
}
@media (max-width: 860px) {
  .nav { display: flex; }
  .nav__cta { margin-left: auto; margin-right: 0.25rem; padding: 0.5rem 0.9rem; font-size: 0.9rem; }
  .nav__toggle { margin-left: 0; }
}

/* intro */
.intro {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(2rem, 4vw, 3rem);
}
.display {
  display: flex; flex-direction: column;
  font-weight: 700; letter-spacing: -0.045em; line-height: 0.92;
  animation: rise 0.9s var(--ease) both;
}
.display__small {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 500; letter-spacing: -0.02em;
  color: var(--muted); margin-bottom: 0.35em; line-height: 1.1;
}
.display__accent { font-size: clamp(3rem, 7.6vw, 6.25rem); color: var(--accent); }
.display__big { font-size: clamp(3rem, 7.6vw, 6.25rem); color: var(--text); }

.intro__row {
  display: grid; grid-template-columns: 7fr 5fr; gap: 2rem 4rem; align-items: end;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.intro__copy { animation: rise 0.9s var(--ease) 0.1s both; }
.intro__role { font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 560; letter-spacing: -0.01em; }
.intro__sub { margin-top: 0.75rem; max-width: 48ch; color: var(--muted); font-size: 1.05rem; }
.intro__me {
  display: flex; align-items: center; gap: 1rem; justify-self: end;
  animation: rise 0.9s var(--ease) 0.2s both;
}
.intro__me img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.intro__me p { display: flex; flex-direction: column; line-height: 1.3; }
.intro__me span { font-size: 0.85rem; color: var(--dim); }
.intro__me b { font-weight: 600; letter-spacing: -0.01em; }

.toolstrip {
  display: flex; flex-wrap: wrap; gap: 0.6rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.5rem; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.85rem; color: var(--dim);
  animation: rise 0.9s var(--ease) 0.3s both;
}

@media (max-width: 860px) {
  .intro__row { grid-template-columns: 1fr; }
  .intro__me { justify-self: start; }
  .display { line-height: 0.95; }
}

/* what I do */
.offer { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3rem; }
.offer__item { padding: 1.5rem 0; border-top: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 0.5rem; }
.offer__item h3 { font-size: 1.2rem; }
.offer__item p { color: var(--muted); font-size: 0.98rem; max-width: 48ch; }
.offer__item a { margin-top: 0.25rem; color: var(--accent); font-weight: 560; font-size: 0.95rem; text-decoration: none; width: fit-content; }
.offer__item a:hover { text-decoration: underline; }
@media (max-width: 720px) { .offer { grid-template-columns: 1fr; } }

/* featured work */
.featured { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.case {
  grid-column: span 4;
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 1.5rem; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s;
}
a.case:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.case__year { font-family: var(--mono); font-size: 0.78rem; color: var(--dim); }
.case h3 { font-size: 1.2rem; }
.case p { color: var(--muted); font-size: 0.95rem; }
.case .tools { margin-top: auto; padding-top: 0.5rem; }
.case--sim { grid-column: span 12; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 2rem; align-items: start; align-content: start; }
.case--sim .case__year { grid-column: 1; color: var(--accent); }
.case--sim h3 { grid-column: 1; }
.case--sim .plant__frame { grid-column: 2; grid-row: 1 / 4; max-width: 380px; width: 100%; justify-self: end; align-self: center; }
.case--sim h3 { font-size: 1.5rem; margin-top: 0.25rem; }
.case--sim .plant__caption { margin-top: 0.5rem; max-width: 40ch; }
.case--sim .plant__caption { grid-column: 1; margin: 0; }
@media (max-width: 960px) {
  .case { grid-column: span 12; }
  .case--sim { grid-template-columns: 1fr; }
  .case--sim .plant__frame { grid-column: 1; grid-row: auto; justify-self: start; }
  .case--sim .case__year, .case--sim h3, .case--sim .plant__caption { grid-column: 1; }
}

/* closing call */
.closing { text-align: center; }
.closing__title { font-size: clamp(2.2rem, 6vw, 4.5rem); letter-spacing: -0.04em; line-height: 1; }
.closing__sub { margin: 1.25rem auto 0; max-width: 46ch; color: var(--muted); font-size: 1.1rem; }
.closing__actions { margin-top: 2rem; }
.closing__links { justify-content: center; }


/* ---------- theme toggle ---------- */
.theme {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text);
  transition: background-color 0.15s, border-color 0.15s;
}
.theme:hover { background: var(--surface-2); border-color: var(--text); }
.theme svg { width: 18px; height: 18px; }
.theme .theme__moon { display: none; }
:root[data-theme="dark"] .theme .theme__sun { display: none; }
:root[data-theme="dark"] .theme .theme__moon { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .theme__sun { display: none; }
  :root:not([data-theme="light"]) .theme .theme__moon { display: inline-flex; }
}
.nav__right { display: flex; align-items: center; gap: 0.6rem; }
@media (min-width: 861px) {
  .nav__right { justify-self: end; }
}
@media (max-width: 860px) {
  .nav__right { order: 2; margin-left: auto; }
  .nav__toggle { order: 3; }
  .theme { width: 36px; height: 36px; }
  .nav__cta { margin: 0; }
}

/* ---------- icons ---------- */
.icon { display: inline-flex; width: 40px; height: 40px; border-radius: 12px; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 0.25rem; }
.icon svg { width: 22px; height: 22px; }
.proj__main .icon { margin-bottom: 0.6rem; }

/* ---------- charts ---------- */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--dim); }
.chart--wide { max-width: 1000px; }
.chart__grid line { stroke: var(--line); stroke-width: 1; }
.chart__ylab, .chart__ylab text { font-family: var(--mono); font-size: 12px; fill: var(--dim); text-anchor: end; }
.chart__xlab text { font-family: var(--mono); font-size: 12px; fill: var(--dim); text-anchor: middle; }
.chart__xlab text:first-child { text-anchor: start; }
.chart__xlab text:last-child { text-anchor: end; }
.chart__area { fill: var(--accent-soft); }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart__line--fine { stroke-width: 2; }
.chart__dot { fill: var(--accent); stroke: var(--surface-2); stroke-width: 3; }
.chart__note { font-family: var(--mono); font-size: 12px; fill: var(--text); text-anchor: middle; }
.chart__note--end { text-anchor: end; }
.chart__note--muted { fill: var(--dim); text-anchor: start; }
.chart__bar { fill: var(--accent); opacity: 0.85; }
.chart__err { stroke: var(--text); stroke-width: 1.5; opacity: 0.6; }
.chart__val { font-family: var(--mono); font-size: 12px; fill: var(--text); }
.chart__desc { font-size: 12px; fill: var(--dim); }

/* larger portrait in the intro */
.intro__me img { width: 200px; height: 200px; border-width: 4px; }
.intro__me { gap: 1.25rem; }
.intro__me p { gap: 0.1rem; }


/* ---------- data figures ---------- */
.figures { display: grid; grid-template-columns: 7fr 5fr; gap: 1.5rem 2rem; align-items: start; }
.figures__stack { display: flex; flex-direction: column; gap: 1.5rem; }
.figures .chart { padding: 1.5rem; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
@media (max-width: 960px) { .figures { grid-template-columns: 1fr; } }
.chart__bar--a { fill: var(--dim); opacity: 0.5; }
.chart__bar--b { fill: var(--accent); opacity: 0.9; }
.chart__bar--c { fill: var(--line-strong); opacity: 1; }
.chart__desc--on { fill: var(--on-accent); font-weight: 500; }
.chart__legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.5rem; font-size: 0.82rem; color: var(--muted); }
.chart__legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.chart__swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.chart__swatch--a { background: var(--dim); opacity: 0.5; }
.chart__swatch--b { background: var(--accent); opacity: 0.9; }
.chart__swatch--c { background: var(--line-strong); }
.proj__more .chart { margin: 1rem 0 0; padding: 1rem 1.25rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }


/* ==========================================================================
   Round three: icon centring, project media, the simulation block, tool filter
   ========================================================================== */

.theme span { line-height: 0; }
.theme svg { display: block; }

/* project cards with a screenshot */
.proj--media { grid-template-columns: 5fr 7fr 4fr; }
.proj__media { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); align-self: start; }
.proj__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; transition: transform 0.4s var(--ease); }
.proj__media:hover img { transform: scale(1.02); }
.proj__main .icon { margin-bottom: 0.5rem; }
@media (max-width: 960px) { .proj--media { grid-template-columns: 1fr; } }

/* featured cards with a screenshot or figure */
.case--shot { padding: 0; overflow: hidden; }
.case--shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.case--shot .case__fig { margin: 0; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.case--shot .case__fig svg { width: 100%; height: auto; padding: 1rem 1.25rem; }
.case--shot .case__year, .case--shot h3, .case--shot p { margin-left: 1.5rem; margin-right: 1.5rem; }
.case--shot .case__year { margin-top: 1.25rem; }
.case--shot p { margin-bottom: 1.5rem; }

/* the simulation block */
.sim {
  display: grid; grid-template-columns: 6fr 6fr; gap: 2rem 3rem; align-items: center;
  margin-top: 1rem; padding: 2rem; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--line);
}
.sim__copy { display: flex; flex-direction: column; gap: 0.75rem; }
.sim__copy h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.sim__copy p { color: var(--muted); max-width: 46ch; }
.sim__copy .case__year { color: var(--accent); }
.sim__legend { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.25rem 0; font-size: 0.95rem; color: var(--text); }
.sim__legend li { display: flex; align-items: center; gap: 0.6rem; }
.sim__key { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; }
.sim__key--ball { background: radial-gradient(circle at 35% 30%, #fff3e8, #f4c9a6 55%, #d8875a); }
.sim__key--target { width: 12px; height: 12px; border: 2px solid var(--accent); background: transparent; }
.sim__key--meas { width: 8px; height: 8px; background: var(--dim); opacity: 0.7; margin: 0 3px; }
.sim__key--est { width: 18px; height: 3px; border-radius: 2px; background: var(--accent); }
.sim__note { font-size: 0.9rem; }
.sim__stage { display: flex; flex-direction: column; gap: 0.75rem; max-width: 460px; width: 100%; justify-self: end; }
.sim .plant__frame { aspect-ratio: 1 / 1; }
.sim .plant__hud {
  position: static; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; margin: 0;
  font-family: var(--mono); font-size: 0.72rem; color: var(--dim);
}
.sim .plant__hud div { display: flex; flex-direction: column; gap: 0.1rem; }
.sim .plant__hud dt { font-size: 0.68rem; }
.sim .plant__hud dd { margin: 0; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) {
  .sim { grid-template-columns: 1fr; padding: 1.5rem; }
  .sim__stage { justify-self: start; max-width: 100%; }
}

/* tool chips act as a filter on the projects page */
.proj-list .tools li { cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.proj-list .tools li:hover { border-color: var(--accent); }
.proj-list .tools li.is-active { background: var(--accent-soft); border-color: var(--accent); }
.toolfilter { margin: -1rem 0 1.5rem; font-size: 0.95rem; color: var(--muted); }
.toolfilter b { color: var(--text); }
.toolfilter__clear { border: 0; background: none; padding: 0; margin-left: 0.5rem; color: var(--accent); font-weight: 560; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }

/* app icon shown in place of a screenshot */
.proj__media.proj__media--tile { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: #111522; }
.proj__media.proj__media--tile img { width: 38%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 22%; box-shadow: 0 12px 32px rgba(0,0,0,0.35); }
.proj__media.proj__media--tile:hover img { transform: none; }
.case--shot .case__tile { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: #111522; border-bottom: 1px solid var(--line); }
.case--shot .case__tile img { width: 34%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 22%; border-bottom: 0; box-shadow: 0 12px 32px rgba(0,0,0,0.35); }


/* ---------- video clips on project cards ---------- */

.clip { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: cover; background: var(--surface-2); }
.clip__hint {
  position: absolute; left: 0.75rem; bottom: 0.75rem; z-index: 2;
  padding: 0.3rem 0.65rem; border-radius: var(--r-pill);
  background: rgba(12, 10, 8, 0.68); color: #fff;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.01em; line-height: 1;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 1; transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.is-playing .clip__hint { opacity: 0; }

.proj__media { min-width: 0; }
.proj__media--video { position: relative; aspect-ratio: 16 / 9; min-width: 0; overflow: hidden; }
.proj__media--video .clip { aspect-ratio: 16 / 9; transition: transform 0.4s var(--ease); }
.proj__media--video:hover .clip { transform: none; }

.case--shot .case__clip { position: relative; display: block; width: 100%; min-width: 0; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.case--shot .case__clip .clip { aspect-ratio: 16 / 9; }

/* the Swiss section reads centred, so the figure is the middle of it */
.swiss { display: flex; flex-direction: column; align-items: center; text-align: center; }
.swiss__head { margin-bottom: 2rem; }
.swiss__head p { margin-left: auto; margin-right: auto; }
.swiss__chart { width: 100%; max-width: 820px; margin: 0; }
.swiss__chart figcaption { text-align: center; margin-left: auto; margin-right: auto; max-width: 62ch; }
.swiss__note { margin-top: 2rem; max-width: 68ch; color: var(--muted); }
.swiss__note p + p { margin-top: 0.9rem; }
.swiss__note b { color: var(--text); }

.chart__seg--w { fill: var(--accent); }
.chart__seg--d { fill: var(--accent); opacity: 0.38; }
.chart__seg--l { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.chart__track { fill: var(--line); }
.chart__fill { fill: var(--accent); }

/* full screen button on every clip */
.clip__full {
  position: absolute; top: 0.7rem; right: 0.7rem; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 999px;
  background: rgba(12, 10, 8, 0.55); color: #fff; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0.72; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s;
}
.clip__full svg { width: 1rem; height: 1rem; }
.clip__full:hover, .clip__full:focus-visible { opacity: 1; transform: scale(1.08); background: rgba(12, 10, 8, 0.78); }
.clip__full:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the clip shell wraps a link, so the button sits outside it */
.case-wrap { grid-column: span 4; position: relative; display: flex; }
.case-wrap > .case { flex: 1 1 auto; }
@media (max-width: 960px) { .case-wrap { grid-column: span 12; } }
.proj__media--video .clip__link { display: block; width: 100%; height: 100%; }

/* the browser paints its own background behind a full-screen video */
.clip:fullscreen { object-fit: contain; background: #000; }
.clip:-webkit-full-screen { object-fit: contain; background: #000; }

/* touch devices play in view, so the hover wording would be wrong */
@media (hover: none) {
  .clip__hint { content: none; display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .clip__hint { opacity: 1; }
}
