/* =====================================================================
   Aditya Sidham — Portfolio
   Editorial minimal. Warm paper, ink type, one blue accent.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #F6F7F2;
  --bg-raised: #FCFCFA;
  --ink: #17212B;
  --muted: #5A6570;
  --accent: #3056D3;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(48, 86, 211, 0.08);
  --line: #D9DDD8;
  --line-strong: #C4C9C3;
  --surface: #E8EBE6;
  --shadow: 0 1px 2px rgba(23, 33, 43, 0.04), 0 12px 32px -12px rgba(23, 33, 43, 0.14);
  --shadow-lg: 0 2px 4px rgba(23, 33, 43, 0.04), 0 30px 60px -24px rgba(23, 33, 43, 0.22);

  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --text-hero: clamp(48px, 8vw, 112px);
  --text-h2: clamp(40px, 5vw, 56px);
  --text-h3: clamp(26px, 2.6vw, 34px);
  --text-body: clamp(17px, 1.05vw, 19px);
  --text-nav: 15px;
  --text-small: 14px;
  --text-mono: 12.5px;

  --container: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --section: clamp(96px, 12vw, 176px);
  --radius: 6px;
  --radius-lg: 14px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 700ms;

  --nav-h: 76px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #12171D;
  --bg-raised: #171D24;
  --ink: #EDEFEA;
  --muted: #A3ACB4;
  --accent: #8FA8FF;
  --accent-ink: #0F1A3D;
  --accent-soft: rgba(143, 168, 255, 0.12);
  --line: #2A323A;
  --line-strong: #3A434C;
  --surface: #1E252D;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 30px 60px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
  overflow-x: clip;
}
body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out);
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

.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;
}

/* ---------- Atmosphere ---------- */
.grain {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 9000;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: 0.045; }

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.display em, .serif-em {
  font-style: italic;
  color: var(--accent);
}
.h-hero { font-size: var(--text-hero); }
.h-section { font-size: var(--text-h2); line-height: 1.02; letter-spacing: -0.02em; }
.h-project { font-size: var(--text-h3); line-height: 1.12; letter-spacing: -0.015em; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.lede { font-size: clamp(19px, 1.5vw, 23px); line-height: 1.5; max-width: 34ch; }
.prose { max-width: 64ch; }
.prose p + p { margin-top: 1.2em; }
.muted { color: var(--muted); }

/* ---------- Layout ---------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.section { padding-block: var(--section); position: relative; }
.section + .section { padding-top: 0; }
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: clamp(48px, 6vw, 80px);
  align-items: end;
}
@media (min-width: 900px) {
  .section-head { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; }
}
.section-head .kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-head .kicker::before {
  content: ""; width: 28px; height: 1px; background: var(--accent);
}
.section-head .lede { color: var(--muted); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Links & buttons ---------- */
.link {
  position: relative;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--dur) var(--ease-out), color var(--dur-fast);
  padding-bottom: 2px;
}
.link:hover { color: var(--accent); background-size: 0% 1px; background-position: 100% 100%; }

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--bg);
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 22px 0 24px;
  border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: 15px; letter-spacing: 0.005em;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease-out), background-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur);
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; transition: transform var(--dur) var(--ease-out); }
.btn:hover { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); box-shadow: var(--shadow); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn:active { transform: scale(0.98); }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn--ghost:hover { --btn-bg: var(--accent-soft); --btn-fg: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn--sm { height: 42px; padding: 0 16px 0 18px; font-size: 14px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur) var(--ease-out);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--ink); color: var(--bg); box-shadow: inset 0 0 0 1px var(--ink); transform: translateY(-2px); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: transform var(--dur-slow) var(--ease-out), background-color var(--dur), box-shadow var(--dur), backdrop-filter var(--dur);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 800; font-size: 17px; letter-spacing: -0.035em;
  color: var(--ink); line-height: 1; text-transform: none;
}
.brand .mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-body); font-weight: 800; font-size: 13px; letter-spacing: -0.04em;
  transition: transform var(--dur-slow) var(--ease-out), background-color var(--dur-fast);
}
.brand:hover .mark { transform: rotate(-8deg) scale(1.06); background: var(--accent); color: var(--accent-ink); }
.brand .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: pulse 2.6s var(--ease-in-out) infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.7); opacity: 0.5; } }

.nav-links { display: none; align-items: center; gap: 4px; }
.nav-links a {
  position: relative;
  display: inline-block; padding: 10px 14px;
  font-size: var(--text-nav); font-weight: 500; color: var(--muted);
  border-radius: 999px;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}
.nav-links a:hover { color: var(--ink); background: var(--accent-soft); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); transform: translateX(-50%);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-actions .btn { display: none; }
@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-actions .btn { display: inline-flex; }
  .menu-toggle { display: none !important; }
}

.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle svg { position: absolute; transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur); }
.theme-toggle .sun { transform: translateY(0) rotate(0); opacity: 1; }
.theme-toggle .moon { transform: translateY(140%) rotate(-90deg); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .sun { transform: translateY(-140%) rotate(90deg); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .moon { transform: translateY(0) rotate(0); opacity: 1; }

.menu-toggle { display: inline-grid; }
.menu-toggle .bars { width: 20px; height: 12px; position: relative; }
.menu-toggle .bars i {
  position: absolute; left: 0; width: 100%; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur);
}
.menu-toggle .bars i:nth-child(1) { top: 0; }
.menu-toggle .bars i:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-toggle .bars i:nth-child(3) { bottom: 0; }
body.menu-open .menu-toggle .bars i:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
body.menu-open .menu-toggle .bars i:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.menu-open .menu-toggle .bars i:nth-child(3) { transform: translateY(-5.25px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 40px;
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--dur-slow) var(--ease-in-out);
  visibility: hidden;
}
body.menu-open .mobile-menu { clip-path: inset(0 0 0 0); visibility: visible; }
body.menu-open { overflow: hidden; }
.mobile-menu ol { display: grid; gap: 4px; counter-reset: m; }
.mobile-menu li { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
body.menu-open .mobile-menu li { opacity: 1; transform: none; }
body.menu-open .mobile-menu li:nth-child(1) { transition-delay: 160ms; }
body.menu-open .mobile-menu li:nth-child(2) { transition-delay: 220ms; }
body.menu-open .mobile-menu li:nth-child(3) { transition-delay: 280ms; }
body.menu-open .mobile-menu li:nth-child(4) { transition-delay: 340ms; }
body.menu-open .mobile-menu li:nth-child(5) { transition-delay: 400ms; }
.mobile-menu ol a {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-display); font-size: clamp(40px, 10vw, 64px); line-height: 1.1; color: var(--ink);
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.mobile-menu ol a::before { counter-increment: m; content: "0" counter(m); font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.08em; }
.mobile-menu .mm-foot { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; opacity: 0; transition: opacity var(--dur-slow) 480ms; }
body.menu-open .mobile-menu .mm-foot { opacity: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding-top: calc(var(--nav-h) + clamp(32px, 8vh, 96px));
  padding-bottom: 0;
  overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: 1fr; gap: 40px;
  flex: 1;
  align-items: center;
}
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; }
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px;
}
.hero-eyebrow .status {
  display: inline-flex; align-items: center; gap: 8px; line-height: 1.5;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.status .ping { position: relative; width: 8px; height: 8px; }
.status .ping::before, .status .ping::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: #1E9E5A;
}
.status .ping::before { animation: ping 1.8s var(--ease-out) infinite; opacity: 0.6; }
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(2.6); opacity: 0; } }

.hero-title { margin-bottom: 32px; }
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: block; }
.hero-copy { max-width: 52ch; color: var(--muted); margin-bottom: 36px; font-size: clamp(17px, 1.2vw, 20px); }
.hero-copy strong { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-cta .socials { display: flex; gap: 8px; margin-left: 8px; }

.hero-figure {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 72vh;
  margin-inline: auto;
  width: 100%; max-width: 480px;
}
.hero-figure .frame {
  position: absolute; inset: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: rotate(1.5deg);
  transition: transform var(--dur-slow) var(--ease-out);
}
.hero-figure:hover .frame { transform: rotate(0deg) scale(1.01); }
.hero-figure img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transform: scale(1.04); transition: transform 1.2s var(--ease-out); }
.hero-figure:hover img { transform: scale(1); }
.hero-figure .caption {
  position: absolute; left: -10px; bottom: 28px;
  background: var(--bg-raised); color: var(--ink);
  padding: 12px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow); font-size: 14px; line-height: 1.35;
  display: grid; gap: 2px;
  max-width: 220px;
}
.hero-figure .caption .mono { font-size: 11px; }
.hero-figure .badge {
  position: absolute; top: -14px; right: -14px;
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  animation: spin 18s linear infinite;
}
.hero-figure .badge svg { width: 100%; height: 100%; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-foot {
  margin-top: clamp(40px, 8vh, 96px);
  border-top: 1px solid var(--line);
  padding-block: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.scroll-hint { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.scroll-hint svg { width: 16px; height: 16px; animation: nudge 1.8s var(--ease-in-out) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

.marquee {
  overflow: hidden; flex: 1; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex; gap: 40px; width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { display: inline-flex; align-items: center; gap: 40px; white-space: nowrap; }
.marquee-track span::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Work ---------- */
.work-grid {
  display: grid; grid-template-columns: 1fr; gap: clamp(28px, 4vw, 48px) clamp(24px, 3vw, 40px);
}
@media (min-width: 760px) {
  .work-grid { grid-template-columns: repeat(6, 1fr); }
  .work-card { grid-column: span 3; }
  .work-card.is-wide { grid-column: span 3; }
  .work-card.is-third { grid-column: span 2; }
}
.work-card { display: block; color: inherit; position: relative; }
.work-card .media {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  aspect-ratio: 4 / 3;
  isolation: isolate;
}
.work-card.is-wide .media { aspect-ratio: 16 / 11; }
.work-card .media img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.1s var(--ease-out), filter var(--dur-slow);
  will-change: transform;
}
.work-card .media.is-contain { display: grid; place-items: center; padding: clamp(24px, 5%, 48px); }
.work-card .media.is-contain img { width: auto; height: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); box-shadow: var(--shadow-lg); transform: none; }
.work-card:hover .media img { transform: scale(1.06); }
.work-card:hover .media.is-contain img { transform: translateY(-4px); }
.work-card .media::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, transparent 55%, rgba(23, 33, 43, 0.28));
  opacity: 0; transition: opacity var(--dur-slow);
}
.work-card:hover .media::after { opacity: 1; }
.work-card .cta {
  position: absolute; right: 16px; bottom: 16px; z-index: 2;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-raised); color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(0.9); opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur), background-color var(--dur-fast), color var(--dur-fast);
}
.work-card .cta svg { width: 20px; height: 20px; }
.work-card:hover .cta { transform: none; opacity: 1; }
.work-card:hover .cta:hover { background: var(--accent); color: var(--accent-ink); }
.work-card .tag {
  position: absolute; left: 16px; top: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg-raised) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
}
.work-card .tag svg { width: 14px; height: 14px; color: var(--accent); }
.work-card .body { padding-top: 20px; display: grid; gap: 8px; }
.work-card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.work-card .title { color: var(--ink); transition: color var(--dur-fast); }
.work-card:hover .title { color: var(--accent); }
.work-card .desc { color: var(--muted); max-width: 52ch; font-size: 16px; }
.work-card .stack, .showcase-stack { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.work-card .stack li, .showcase-stack li { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.work-card .stack li::before, .showcase-stack li::before { content: "#"; color: var(--accent); margin-right: 1px; }

/* ---------- About ---------- */
.about-grid {
  display: grid; grid-template-columns: 1fr; gap: 48px;
}
@media (min-width: 980px) {
  .about-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 80px; align-items: start; }
  .about-sticky { position: sticky; top: calc(var(--nav-h) + 24px); }
}
.about-photo {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); aspect-ratio: 3 / 4;
  box-shadow: var(--shadow-lg);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.about-photo .stamp {
  position: absolute; left: 16px; bottom: 16px;
  background: var(--bg-raised); color: var(--ink);
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 13px; box-shadow: var(--shadow); display: flex; gap: 8px; align-items: center;
}
.about-photo .stamp svg { width: 16px; height: 16px; color: var(--accent); }
.about-photo-2 { aspect-ratio: 4 / 3; margin-top: 20px; }
.facts {
  margin-top: 28px; display: grid; gap: 0;
  border-top: 1px solid var(--line);
}
.facts li {
  display: grid; grid-template-columns: 120px 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.facts li span:first-child { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.about-copy .h-section { margin-bottom: 32px; max-width: 16ch; }
.about-copy .prose { font-size: var(--text-body); }
.about-copy .prose p:first-child { font-size: clamp(19px, 1.4vw, 22px); color: var(--ink); }

.skills { margin-top: 56px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.skill-row {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) { .skill-row { grid-template-columns: 180px 1fr; gap: 24px; align-items: start; } }
.skill-row h4 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.skill-row h4 svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink);
  background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur-fast), color var(--dur-fast), background-color var(--dur-fast);
}
.chip:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Experience / timeline ---------- */
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line);
}
.timeline .progress {
  position: absolute; left: 7px; top: 8px; width: 1px; height: 0; background: var(--accent);
  transition: height 120ms linear;
}
.tl-item {
  position: relative; display: grid; grid-template-columns: 1fr; gap: 10px;
  padding: 28px 0 28px 40px; border-bottom: 1px solid var(--line);
}
@media (min-width: 820px) {
  .tl-item { grid-template-columns: 200px minmax(0, 1fr) 140px; gap: 32px; align-items: start; }
}
.tl-item::before {
  content: ""; position: absolute; left: 3px; top: 36px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line-strong);
  transition: background-color var(--dur), box-shadow var(--dur), transform var(--dur) var(--ease-out);
}
.tl-item.is-current::before, .tl-item:hover::before { background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 5px var(--accent-soft); transform: scale(1.15); }
.tl-item .when { padding-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tl-item .role { font-size: clamp(20px, 1.6vw, 24px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.tl-item .org { color: var(--muted); font-size: 15px; margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-item .org .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.tl-item .notes { margin-top: 12px; color: var(--muted); font-size: 16px; max-width: 60ch; display: grid; gap: 6px; }
.tl-item .notes li { position: relative; padding-left: 16px; }
.tl-item .notes li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 1px; background: var(--accent); }
.tl-item .logo {
  justify-self: start; align-self: start;
  width: 150px; height: 58px; padding: 0 14px; border-radius: 10px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  display: grid; place-items: center;
  transition: box-shadow var(--dur-fast), transform var(--dur) var(--ease-out);
}
.tl-item:hover .logo { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); transform: translateY(-2px); }
@media (min-width: 820px) { .tl-item .logo { justify-self: end; } }
/* Every mark is normalised by optical area (h = K / sqrt(aspect)) so a wide
   wordmark and a compact lockup read at the same visual weight in the box. */
.tl-item .logo img {
  display: block;
  width: auto; height: auto;
  max-width: 122px;
  max-height: var(--logo-h, 24px);
  object-fit: contain;
}
.tl-item .logo img[alt*="Southern California"] { --logo-h: 18px; }
.tl-item .logo img[alt="LTM"]                  { --logo-h: 22px; }
.tl-item .logo img[alt*="Tata"]                { --logo-h: 25px; }
.tl-item .logo img[alt*="D Y Patil"]           { --logo-h: 26px; }
.tl-item .logo img[alt*="Aces"]                { --logo-h: 19px; }
.tl-item .pill {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 4px;
  padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ---------- Highlights ---------- */
.hl-grid { display: grid; grid-template-columns: 1fr; gap: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 640px) { .hl-grid { grid-template-columns: repeat(2, 1fr); } .hl-card:nth-child(2n) { border-right: 0; } }
@media (min-width: 1000px) { .hl-grid { grid-template-columns: repeat(3, 1fr); } .hl-card:nth-child(2n) { border-right: 1px solid var(--line); } .hl-card:nth-child(3n) { border-right: 0; } }
@media (max-width: 639px) { .hl-card { border-right: 0; } }
.hl-card {
  position: relative; background: var(--bg); padding: clamp(24px, 3vw, 36px);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: grid; gap: 18px; align-content: start; min-height: 260px;
  transition: background-color var(--dur);
  overflow: hidden;
}
.hl-card::before {
  content: ""; position: absolute; inset: 0; background: var(--accent-soft);
  transform: translateY(101%); transition: transform var(--dur-slow) var(--ease-out);
}
.hl-card:hover::before { transform: translateY(0); }
.hl-card > * { position: relative; }
.hl-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hl-icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-raised); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform var(--dur-slow) var(--ease-out), background-color var(--dur), color var(--dur);
}
.hl-icon svg { width: 22px; height: 22px; }
.hl-card:hover .hl-icon { transform: rotate(-6deg) scale(1.06); background: var(--accent); color: var(--accent-ink); }
.hl-card .year { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; color: var(--muted); padding-top: 4px; }
.hl-card h3 { font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.hl-card p { color: var(--muted); font-size: 15.5px; }
.hl-card .logo-row { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 8px; }
.hl-card .logo-row img { height: 26px; width: auto; max-width: 96px; object-fit: contain; filter: grayscale(1); opacity: 0.75; transition: filter var(--dur), opacity var(--dur); }
.hl-card:hover .logo-row img { filter: none; opacity: 1; }
.hl-card .logo-row .link { font-size: 13px; }
:root[data-theme="dark"] .hl-card .logo-row img { background: #fff; padding: 3px 6px; border-radius: 4px; }
:root[data-theme="dark"] .tl-item .logo { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); }

/* ---------- Contact ---------- */
.contact { position: relative; }
.contact .h-section { max-width: 14ch; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 48px; }
@media (min-width: 980px) { .contact-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 80px; } }
.big-mail {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 28px;
  font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 44px); letter-spacing: -0.02em; color: var(--ink);
  line-height: 1.1;
  background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0% 2px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size var(--dur-slow) var(--ease-out), color var(--dur-fast);
  word-break: break-all;
}
.big-mail:hover { background-size: 100% 2px; color: var(--accent); }
.big-mail svg { width: 0.7em; height: 0.7em; flex: none; transition: transform var(--dur) var(--ease-out); }
.big-mail:hover svg { transform: translate(3px, -3px); }
.contact-meta { margin-top: 36px; display: grid; gap: 14px; }
.contact-meta li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 16px; }
.contact-meta li svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.contact-meta a { color: var(--ink); }
.contact .socials { margin-top: 28px; display: flex; gap: 8px; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.field label span { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 14px 16px; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background-color var(--dur-fast);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field .hint { font-size: 13px; color: var(--muted); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #C2372E; }
.field .error { display: none; font-size: 13px; color: #C2372E; }
.field.is-invalid .error { display: block; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-status { font-size: 14px; color: var(--muted); min-height: 1.5em; }
.form-status.ok { color: #1E7A4A; }
.form-status.err { color: #C2372E; }
.hp { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0 40px; }
.footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px; }
.footer p { font-size: 14px; color: var(--muted); }
.footer .clock { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; display: inline-flex; gap: 8px; align-items: center; color: var(--muted); }
.footer .clock::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.footer nav { display: flex; gap: 20px; }
.footer nav a { font-size: 14px; color: var(--muted); transition: color var(--dur-fast); }
.footer nav a:hover { color: var(--accent); }

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  background: var(--bg-raised); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity var(--dur), transform var(--dur) var(--ease-out), background-color var(--dur-fast), color var(--dur-fast);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Project page ---------- */
.project-hero { padding-top: calc(var(--nav-h) + clamp(40px, 8vh, 96px)); }
.crumbs { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.crumbs a { color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; transition: color var(--dur-fast); }
.crumbs a svg { width: 16px; height: 16px; transform: rotate(180deg); transition: transform var(--dur) var(--ease-out); }
.crumbs a:hover { color: var(--accent); }
.crumbs a:hover svg { transform: rotate(180deg) translateX(3px); }
.project-hero .h-hero { font-size: clamp(40px, 6.4vw, 88px); max-width: 14ch; margin-bottom: 28px; }
.project-hero .lede { color: var(--muted); max-width: 48ch; }
.meta-grid {
  margin-top: 48px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 32px;
  padding-top: 28px; border-top: 1px solid var(--line);
}
@media (min-width: 760px) { .meta-grid { grid-template-columns: repeat(4, 1fr); } }
.meta-grid dt { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.meta-grid dd { margin: 0; font-size: 15.5px; line-height: 1.45; }
.meta-grid dd .pill { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

.project-cover {
  margin-top: clamp(40px, 6vw, 72px);
  border-radius: var(--radius-lg); overflow: hidden; background: var(--surface);
  aspect-ratio: 16 / 9; box-shadow: var(--shadow-lg);
  display: grid; place-items: center;
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-cover.is-contain { padding: clamp(24px, 5%, 56px); }
.project-cover.is-contain img { object-fit: contain; width: auto; height: 100%; max-height: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); }

.project-body { display: grid; grid-template-columns: 1fr; gap: 48px; }
@media (min-width: 980px) {
  .project-body { grid-template-columns: 240px minmax(0, 1fr); gap: 80px; }
  .project-body .side { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; }
}
.project-body .side ol { display: grid; gap: 10px; }
.project-body .side a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color var(--dur-fast); display: inline-flex; gap: 10px; }
.project-body .side a::before { content: ""; width: 12px; height: 1px; background: var(--line-strong); align-self: center; transition: width var(--dur), background-color var(--dur); }
.project-body .side a:hover, .project-body .side a.is-active { color: var(--ink); }
.project-body .side a:hover::before, .project-body .side a.is-active::before { width: 24px; background: var(--accent); }
.project-body h2 { font-size: clamp(28px, 3vw, 40px); margin-bottom: 20px; }
.project-body section + section { margin-top: clamp(48px, 6vw, 80px); }
.project-body .prose { font-size: var(--text-body); color: var(--muted); }
.project-body .prose strong { color: var(--ink); font-weight: 600; }
.bullets { display: grid; gap: 12px; margin-top: 8px; }
.bullets li { position: relative; padding-left: 28px; color: var(--muted); }
.bullets li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233056D3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 9px; background-position: center; background-repeat: no-repeat;
}
.gallery { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery figure {
  border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); cursor: zoom-in;
  aspect-ratio: 4 / 3; display: grid; place-items: center; position: relative;
}
.gallery figure.is-tall { aspect-ratio: 3 / 4; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out); }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption {
  position: absolute; left: 12px; bottom: 12px; background: color-mix(in srgb, var(--bg-raised) 90%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--ink);
}
.gallery figure.is-contain { padding: 16px; }
.gallery figure.is-contain img { object-fit: contain; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 92vh; }
.lightbox::backdrop { background: rgba(10, 14, 18, 0.86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox img { max-width: min(96vw, 1400px); max-height: 88vh; width: auto; height: auto; border-radius: var(--radius); object-fit: contain; }
.lightbox .close { position: fixed; top: 20px; right: 20px; background: rgba(255,255,255,0.12); color: #fff; box-shadow: none; }
.lightbox .close:hover { background: #fff; color: #17212B; }

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
@media (min-width: 640px) { .stat-row { grid-template-columns: repeat(3, 1fr); } }
.stat { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raised); }
.stat .num { font-family: var(--font-display); font-size: clamp(36px, 4vw, 52px); line-height: 1; letter-spacing: -0.02em; color: var(--accent); }
.stat .lbl { margin-top: 8px; font-size: 14px; color: var(--muted); }

.next-project { border-top: 1px solid var(--line); }
.next-project a {
  display: grid; gap: 12px; color: var(--ink); padding-block: clamp(48px, 8vw, 96px);
}
.next-project .h-section { transition: color var(--dur-fast), transform var(--dur-slow) var(--ease-out); display: inline-flex; align-items: center; gap: 16px; }
.next-project .h-section svg { width: 0.7em; height: 0.7em; transition: transform var(--dur-slow) var(--ease-out); }
.next-project a:hover .h-section { color: var(--accent); }
.next-project a:hover .h-section svg { transform: translateX(12px); }

/* ---------- Reveal system ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--d, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }
[data-reveal="fade"] { transform: none; }
[data-reveal="scale"] { transform: scale(0.96); }

.hero-title .line > span {
  transform: translateY(110%);
  transition: transform 1.1s var(--ease-out);
}
.hero-title .line:nth-child(2) > span { transition-delay: 90ms; }
.hero-title .line:nth-child(3) > span { transition-delay: 180ms; }
body.is-ready .hero-title .line > span { transform: none; }
.hero [data-load] { opacity: 0; transform: translateY(16px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: var(--d, 0ms); }
body.is-ready .hero [data-load] { opacity: 1; transform: none; }
.hero-figure .frame { clip-path: inset(6% 8% round 14px); transition: clip-path 1.3s var(--ease-out) 200ms, transform var(--dur-slow) var(--ease-out); }
body.is-ready .hero-figure .frame { clip-path: inset(0 0 round 14px); }
.hero-figure .badge, .hero-figure .caption { opacity: 0; transition: opacity 0.8s var(--ease-out) 900ms, transform var(--dur-slow) var(--ease-out); }
body.is-ready .hero-figure .badge, body.is-ready .hero-figure .caption { opacity: 1; }

/* ---------- Cursor (fine pointers only) ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: width var(--dur) var(--ease-out), height var(--dur) var(--ease-out), opacity var(--dur), background-color var(--dur);
  opacity: 0;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .cursor { mix-blend-mode: screen; }
body.has-cursor .cursor { opacity: 0.9; }
body.has-cursor .cursor.is-link { width: 44px; height: 44px; opacity: 0.22; }
body.has-cursor .cursor.is-hidden { opacity: 0; }
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal], .hero [data-load] { opacity: 1; transform: none; }
  .hero-title .line > span { transform: none; }
  .hero-figure .frame { clip-path: none; }
  .hero-figure .badge, .hero-figure .caption { opacity: 1; }
  .marquee-track { animation: none; }
  .cursor { display: none; }
}

/* =====================================================================
   Art system: "machines that see"
   Landmark constellations, viewfinder brackets, dot grids, index numbers.
   Always ink at low opacity + one accent node. Never more than that.
   ===================================================================== */
.art { position: absolute; pointer-events: none; color: var(--ink); }
.art svg { width: 100%; height: 100%; overflow: visible; }
.art .edge { stroke: currentColor; stroke-width: 1; opacity: 0.22; fill: none; }
.art .node { fill: var(--bg); stroke: currentColor; stroke-width: 1.25; opacity: 0.6; }
.art .node.is-accent { fill: var(--accent); stroke: var(--accent); opacity: 1; }
.art .label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; fill: currentColor; opacity: 0.5; text-transform: uppercase; }
:root[data-theme="dark"] .art .edge { opacity: 0.3; }

.constellation { animation: drift 14s var(--ease-in-out) infinite alternate; transform-origin: center; }
@keyframes drift { from { transform: translate3d(0, 0, 0) rotate(0deg); } to { transform: translate3d(0, -10px, 0) rotate(1.2deg); } }
.art .node.is-accent { animation: blink 3.2s var(--ease-in-out) infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* dot grid: a subtle field behind hero + sections */
.dotfield {
  position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.2px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 70%);
  opacity: 0.7;
}
.hero { isolation: isolate; }

/* viewfinder brackets on media */
.vf { position: relative; }
.vf::before, .vf::after, .vf > .vf-b::before, .vf > .vf-b::after {
  content: ""; position: absolute; width: 18px; height: 18px; z-index: 3;
  border: 1.5px solid var(--ink); opacity: 0.9;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur);
}
.vf::before { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.vf::after { top: -8px; right: -8px; border-left: 0; border-bottom: 0; }
.vf > .vf-b::before { bottom: -8px; left: -8px; border-right: 0; border-top: 0; }
.vf > .vf-b::after { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }
.vf:hover::before { transform: translate(-4px, -4px); }
.vf:hover::after { transform: translate(4px, -4px); }
.vf:hover > .vf-b::before { transform: translate(-4px, 4px); }
.vf:hover > .vf-b::after { transform: translate(4px, 4px); }
.vf .vf-tag {
  position: absolute; z-index: 3; left: 0; top: -30px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.vf .vf-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1.6s var(--ease-in-out) infinite; }

/* editorial section index numbers */
.section-head { position: relative; }
.section-index {
  position: absolute; right: 0; top: -0.35em;
  font-family: var(--font-display); font-size: clamp(88px, 14vw, 200px); line-height: 1; letter-spacing: -0.04em;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--ink) 18%, transparent);
  pointer-events: none; user-select: none; z-index: -1;
}
@media (max-width: 899px) { .section-index { display: none; } }

/* node ruler: section divider */
.ruler { position: relative; height: 1px; background: var(--line); margin-bottom: var(--section); }
.ruler::before { content: ""; position: absolute; left: 0; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ruler::after {
  content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 1.25px var(--ink);
}
.ruler .tick { position: absolute; top: -4px; width: 1px; height: 9px; background: var(--line-strong); }

/* principles (how I work) */
.principles { display: grid; grid-template-columns: 1fr; gap: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-top: 56px; }
@media (min-width: 720px) { .principles { grid-template-columns: repeat(2, 1fr); } .principle:nth-child(odd) { border-right: 1px solid var(--line); } .principle:nth-last-child(-n+2) { border-bottom: 0; } }
.principle { background: var(--bg); padding: clamp(22px, 2.6vw, 32px); display: grid; gap: 10px; align-content: start; position: relative; border-bottom: 1px solid var(--line); }
.principle:last-child { border-bottom: 0; }
.principle .num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--accent); }
.principle h4 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.principle p { color: var(--muted); font-size: 15.5px; }
.principle::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); transition: width var(--dur-slow) var(--ease-out); }
.principle:hover::after { width: 100%; }

/* beyond the screen strip */
.beyond { margin-top: 56px; padding: 24px 0 0; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.beyond p { color: var(--muted); font-size: 16px; max-width: 60ch; }
.beyond .tags { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.beyond .tags li { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.beyond .tags li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* work: flagship card */
.work-card.is-flagship { grid-column: 1 / -1; }
.work-card.is-flagship .media { aspect-ratio: 3 / 2; }
@media (min-width: 760px) {
  .work-card.is-flagship { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: end; }
  .work-card.is-flagship .media { aspect-ratio: 3 / 2; }
  .work-card.is-flagship .body { padding-top: 0; padding-bottom: 8px; }
}
.work-card.is-flagship .h-project { font-size: clamp(32px, 3.6vw, 48px); }
.work-card .proof { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.work-card .proof li { font-size: 13.5px; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.work-card .proof li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* contact rings */
.rings { position: absolute; right: -8%; top: -10%; width: min(520px, 60vw); aspect-ratio: 1; pointer-events: none; z-index: -1; opacity: 0.9; }
.rings svg { width: 100%; height: 100%; }
.rings circle { fill: none; stroke: var(--ink); stroke-opacity: 0.12; stroke-width: 1; }
.rings circle:nth-child(2) { stroke-dasharray: 3 8; animation: spin 90s linear infinite; transform-origin: center; }
.rings circle:nth-child(4) { stroke-dasharray: 2 6; animation: spin 120s linear infinite reverse; transform-origin: center; }
.rings .n { fill: var(--accent); }

/* hero headline: tighter tracking, softer measure */
.hero-title { max-width: 14ch; }
.hero-title .line > span { padding-bottom: 0.08em; }
@media (min-width: 980px) { .hero { padding-top: calc(var(--nav-h) + clamp(24px, 5vh, 64px)); } }

@media (prefers-reduced-motion: reduce) {
  .constellation, .rings circle, .art .node.is-accent, .vf .vf-tag i { animation: none !important; }
  .hero-figure .detect, .detect-box, .detect-label { animation: none !important; opacity: 1; }
}

/* ---------- Phone screenshot cluster (FitandFine card) ---------- */
.project-cover.is-shots-unused, .work-card .media.is-shots {
  background: linear-gradient(160deg, #1B242E 0%, #12181F 100%);
  display: grid; place-items: center;
  padding: 0; overflow: hidden;
}
:root[data-theme="dark"] .project-cover.is-shots-unused, .work-card .media.is-shots {
  background: linear-gradient(160deg, #202B36 0%, #141A21 100%);
}
.work-card .media.is-shots::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000, transparent 75%);
}
.shots {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(10px, 1.6vw, 22px);
  width: 100%; height: 100%;
  padding: clamp(26px, 4%, 48px) clamp(16px, 3%, 40px) 0;
}
/* Size by width so four tall phones always fit the column; their intrinsic
   aspect ratio then sets the height. */
.is-shots .shots img {
  width: 22%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: top center;
  border-radius: 14px 14px 0 0;
  background: #fff;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.10);
  transform: translateY(var(--sy, 0)) rotate(var(--sr, 0deg));
  transition: transform var(--dur-slow) var(--ease-out);
  will-change: transform;
}
.is-shots .shots img:nth-child(1) { --sy: 16px; --sr: -3deg; }
.is-shots .shots img:nth-child(2) { --sy: 0px;  --sr: -1deg; }
.is-shots .shots img:nth-child(3) { --sy: 4px;  --sr: 1.5deg; }
.is-shots .shots img:nth-child(4) { --sy: 22px; --sr: 3.5deg; }
.work-card:hover .is-shots .shots img:nth-child(1) { --sy: 6px;  --sr: -5deg; }
.work-card:hover .is-shots .shots img:nth-child(2) { --sy: -8px; --sr: -1.5deg; }
.work-card:hover .is-shots .shots img:nth-child(3) { --sy: -4px; --sr: 2deg; }
.work-card:hover .is-shots .shots img:nth-child(4) { --sy: 12px; --sr: 5.5deg; }
/* the outer two are decorative; drop them when there is no room */
@media (max-width: 900px) {
  .is-shots .shots img:nth-child(1), .is-shots .shots img:nth-child(4) { display: none; }
  .is-shots .shots img { width: 34%; }
}
@media (max-width: 560px) {
  .is-shots .shots img:nth-child(3) { display: none; }
  .is-shots .shots img { width: 52%; }
}
.work-card .media.is-shots::after { background: none; }

/* Five-line headline: the measure must clear the longest line
   ("multi-agent AI workflows", 24 characters) or the spans wrap. */
.hero-title { max-width: 26ch; text-wrap: balance; }
.hero-title .line > span { white-space: nowrap; }
@media (min-width: 980px) {
  :root { --text-hero: clamp(38px, 4.2vw, 62px); }
  .hero-grid { align-items: center; }
}
@media (max-width: 979px) {
  :root { --text-hero: clamp(30px, 6.4vw, 50px); }
}
@media (max-width: 420px) {
  :root { --text-hero: 27px; }
}

/* ---------- Phone screenshots inside case studies ---------- */
.project-cover.is-phone {
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1B242E 0%, #12181F 100%);
  padding: clamp(20px, 3vw, 40px);
  position: relative; overflow: hidden;
}
.project-cover.is-phone::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000, transparent 75%);
}
.project-cover.is-phone img {
  position: relative;
  width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.10);
}
.gallery figure.is-phone {
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #1B242E 0%, #12181F 100%);
  padding: clamp(18px, 3%, 32px);
  display: flex; align-items: center; justify-content: center;
}
.gallery figure.is-phone img {
  width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.10);
}
.gallery figure.is-phone figcaption {
  background: rgba(18, 24, 31, 0.82); color: #EDEFEA;
}

/* four-phone cluster used as a case-study cover */
.project-cover.is-shots {
  aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, #1B242E 0%, #12181F 100%);
  padding: 0; position: relative; overflow: hidden;
  display: block;
}
.project-cover.is-shots::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000, transparent 75%);
}
.project-cover.is-shots .shots { padding-top: clamp(30px, 6%, 64px); }
.project-cover.is-shots .shots img { border-radius: 16px 16px 0 0; }

/* ---------- Face detection box on the hero portrait ---------- */
.detect {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0; transition: opacity 0.5s var(--ease-out) 1.15s;
}
body.is-ready .hero-figure .detect { opacity: 1; }

/* The hero photo is cropped to exactly 4:5 (1104x1380), so it maps 1:1 onto the
   4:5 frame: x% = sx/1104, y% = sy/1380. The figure spans sx 438-712, sy 272-1336,
   which is what a person detector would return for a full-body subject. */
.detect-box {
  position: absolute;
  left: 39.5%; top: 19%; width: 25.5%; height: 78%;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.38), 0 0 0 100vmax rgba(10, 14, 18, 0.12);
  clip-path: inset(-100vmax -100vmax -100vmax -100vmax);
  transform: scale(1.28);
  opacity: 0;
  animation: detectLock 0.75s var(--ease-out) 1.2s forwards;
}
@keyframes detectLock {
  from { transform: scale(1.28); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* four corner brackets, drawn from the box's own pseudo-elements */
.detect-box::before, .detect-box::after,
.detect-box > i::before, .detect-box > i::after {
  content: ""; position: absolute;
  width: 26%; height: 26%;
  border: 2.5px solid #fff;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.55));
}
.detect-box::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; }
.detect-box::after  { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-radius: 0 5px 0 0; }
.detect-box > i::before { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-radius: 0 0 0 5px; }
.detect-box > i::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 5px 0; }
.detect-box > i { position: absolute; inset: 0; }

.detect-label {
  position: absolute; left: 50%; top: calc(100% + 10px);
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  padding: 5px 10px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.55);
  opacity: 0;
  animation: detectLabel 0.45s var(--ease-out) 1.85s forwards;
}
.detect-label b { font-weight: 500; letter-spacing: 0.1em; }
.detect-label::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: #fff;
  animation: blink 1.5s var(--ease-in-out) infinite;
}
@keyframes detectLabel {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
:root[data-theme="dark"] .detect-label { color: #0F1A3D; }
:root[data-theme="dark"] .detect-label::before { background: #0F1A3D; }

@media (max-width: 520px) { .detect-label { font-size: 9.5px; padding: 4px 8px; } }

/* =====================================================================
   Flagship showcase — FitandFine
   Editorial style calls for "images large / impactful": one legible phone
   at a time, swapped by real buttons (not hover), on the warm paper
   surface rather than a black slab that fights the rest of the page.
   ===================================================================== */
.showcase {
  position: relative;
  margin-bottom: clamp(48px, 6vw, 80px);
  padding: clamp(28px, 3.4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  overflow: hidden;
}
.showcase::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 25%, transparent) 60%, transparent);
}

.showcase-head {
  display: grid; gap: 20px;
  padding-bottom: clamp(26px, 3vw, 38px);
  margin-bottom: clamp(26px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .showcase-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; }
}
.showcase-head .kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pill-flag {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
}
.showcase h3 {
  font-size: clamp(38px, 5vw, 62px); line-height: 1; letter-spacing: -0.025em;
  margin-bottom: 16px;
}
.showcase-lede { color: var(--muted); font-size: clamp(16px, 1.15vw, 18.5px); max-width: 56ch; }
.showcase-lede em { font-style: italic; color: var(--ink); }

.showcase-body { display: grid; gap: clamp(28px, 3.5vw, 52px); align-items: center; }
@media (min-width: 900px) {
  .showcase-body { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
}

/* ---- stage ---- */
.stage {
  position: relative;
  display: grid; place-items: center;
  padding: clamp(20px, 3vw, 32px) 0;
  min-height: 0;
}
.stage-dots {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 20%, transparent) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, #000, transparent 72%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, #000, transparent 72%);
  opacity: 0.85;
}
/* a real device frame: the screenshots already carry the status bar */
.phone {
  position: relative;
  width: min(288px, 78%);
  padding: 9px;
  border-radius: 40px;
  background: linear-gradient(160deg, #2A333D 0%, #12181F 55%, #2A333D 100%);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.16) inset,
    0 40px 70px -34px rgba(23, 33, 43, 0.55),
    0 8px 20px -12px rgba(23, 33, 43, 0.35);
}
.phone::after {
  content: ""; position: absolute; right: -1px; top: 26%; width: 2px; height: 62px;
  border-radius: 2px; background: #3A434C;
}
.phone-screen {
  position: relative;
  border-radius: 32px; overflow: hidden;
  background: #fff;
  aspect-ratio: 440 / 1022;
}
.phone-screen img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; visibility: hidden;
  transform: scale(1.015);
  transition: opacity 0.42s var(--ease-out), transform 0.6s var(--ease-out), visibility 0s linear 0.42s;
}
.phone-screen img.is-live {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.42s var(--ease-out), transform 0.6s var(--ease-out), visibility 0s;
}

/* ---- side: tabs, stats, stack ---- */
.showcase-side { display: grid; gap: clamp(22px, 2.6vw, 32px); align-content: center; }

.screen-tabs { display: grid; gap: 8px; }
@media (min-width: 620px) { .screen-tabs { grid-template-columns: repeat(2, 1fr); } }
.screen-tabs button {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 14px;
  text-align: left;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  transition: box-shadow var(--dur-fast), background-color var(--dur-fast), transform var(--dur) var(--ease-out);
}
.screen-tabs button svg {
  width: 18px; height: 18px; flex: none; color: var(--muted);
  transition: color var(--dur-fast);
}
.screen-tabs button span { display: grid; gap: 1px; min-width: 0; }
.screen-tabs button b { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.screen-tabs button span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.screen-tabs button:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); transform: translateY(-1px); }
.screen-tabs button.is-active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.screen-tabs button.is-active svg,
.screen-tabs button.is-active b { color: var(--accent); }

.showcase-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
@media (min-width: 760px) { .showcase-stats { grid-template-columns: repeat(4, 1fr); } }
.showcase-stats > div { background: var(--bg-raised); padding: 14px 14px 16px; }
.showcase-stats dt {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px; line-height: 1.3;
}
.showcase-stats dd {
  margin: 0;
  font-family: var(--font-display); font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1; letter-spacing: -0.02em; color: var(--accent);
}
.showcase-stats dd span {
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  letter-spacing: 0; color: var(--muted); margin-left: 3px;
  white-space: nowrap;
}
.showcase-stack { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .phone-screen img { transition: none; }
}

/* person box sits tall, so the readout hangs off the top-left corner */
.detect-box.is-person .detect-label {
  left: 0; right: auto;
  top: auto; bottom: calc(100% + 7px);
  transform: none;
}
@keyframes detectLabelUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.detect-box.is-person .detect-label { animation-name: detectLabelUp; }

/* =====================================================================
   Training — off the clock
   Same editorial band as the FitandFine showcase so the page stays one
   system. Strava orange appears only on Strava's own marks.
   ===================================================================== */
:root { --strava: #FC4C02; }

.training .train-band {
  display: grid; gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
@media (min-width: 960px) {
  .training .train-band { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }
}
.train-copy .kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.train-copy .kicker::before { content: ""; width: 28px; height: 1px; background: var(--strava); }
.train-copy h2 {
  font-size: clamp(30px, 3.6vw, 46px); line-height: 1.04; letter-spacing: -0.022em;
  max-width: 18ch; margin-bottom: 18px;
}
.train-copy h2 em { font-style: italic; color: var(--strava); }
.train-copy > p { color: var(--muted); max-width: 58ch; font-size: clamp(16px, 1.1vw, 18px); }

.pr-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: clamp(24px, 3vw, 34px) 0 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.pr-row li { padding: 16px 0; display: grid; gap: 4px; }
.pr-row li + li { border-left: 1px solid var(--line); padding-left: 18px; }
.pr-num {
  font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1; letter-spacing: -0.025em; color: var(--ink);
}
.pr-num i { font-style: normal; font-size: 0.5em; color: var(--muted); margin-left: 1px; }
.pr-lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.train-tags { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; }
.train-tags li {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--muted);
}
.train-tags li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--strava); }

.strava-link {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: clamp(22px, 2.6vw, 30px);
  padding: 11px 18px 11px 16px; border-radius: 999px;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink); font-size: 14.5px; font-weight: 600;
  transition: box-shadow var(--dur-fast), background-color var(--dur-fast), transform var(--dur) var(--ease-out);
}
.strava-link img { height: 15px; width: auto; }
.strava-link svg { width: 16px; height: 16px; color: var(--muted); transition: transform var(--dur) var(--ease-out), color var(--dur-fast); }
.strava-link:hover {
  background: color-mix(in srgb, var(--strava) 8%, var(--bg-raised));
  box-shadow: inset 0 0 0 1px var(--strava);
  transform: translateY(-2px);
}
.strava-link:hover svg { transform: translate(2px, -2px); color: var(--strava); }
.strava-link:focus-visible { outline-color: var(--strava); }

.train-embed { display: grid; gap: 10px; }
.train-embed figcaption { color: var(--muted); }
.embed-shell {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--bg-raised);
  padding: 10px;
  min-height: 200px;
  overflow: hidden;
}
/* Strava injects its own iframe; keep it inside the rounded shell */
.embed-shell iframe { display: block; width: 100% !important; border: 0; border-radius: 8px; }
.embed-fallback { font-size: 14px; color: var(--muted); padding: 20px; }
.embed-shell:empty::after,
.embed-shell .strava-embed-placeholder:empty::after {
  content: "Loading activity…";
  display: grid; place-items: center; min-height: 180px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
