/* =====================================================================
   Section-specific styles
   ===================================================================== */

/* ============================================================
   HERO
   ============================================================ */
.hero-wrap {
  min-height: calc(100svh - 72px);
  padding: 36px 20px 48px;
  display: flex; flex-direction: column; justify-content: flex-start;
  gap: 16px;
  max-width: 1200px; margin: 0 auto;
  position: relative;
}
/* Mobile: pin the CTAs to the bottom of the viewport so the hero fills
   the fold and the About section stays cleanly below. */
@media (max-width: 640px) {
  .hero-wrap .hero-title { margin-top: 40px; }
  .hero-wrap .hero-actions { margin-top: auto; padding-top: 16px; }
}
@media (min-width: 768px) {
  .hero-wrap {
    min-height: calc(100vh - 80px);
    padding: 96px 48px 140px;
    gap: 28px;
  }
  .hero-wrap .hero-actions { margin-top: 0; padding-top: 0; }
}

.hero-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  width: 100%;
}
.hero-meta .hero-time { margin-left: auto; }
.hero-time {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 12px/1 var(--font-mono);
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Dark hero title */
.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(52px, 15vw, 200px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  color: var(--text-0);
  display: flex; flex-direction: column; gap: 0;
}
.hero-line { display: block; }
.hero-line-sub { color: var(--text-4); font-size: 0.42em; letter-spacing: -0.02em; font-weight: 500; line-height: 1.05; margin-top: 0.15em; }
.hero-word { display: inline-block; }
.hero-word-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 60%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-style: italic;
}
.hero-word-ghost { color: var(--text-4); font-weight: 500; }

/* Light hero — editorial magazine */
:root[data-theme='light'] .hero-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  text-align: center;
  border-top: 2px solid var(--text-1);
  border-bottom: 2px solid var(--text-1);
  padding: 20px 0 24px;
}
.hero-mag-kicker {
  font-family: var(--font-body) !important;
  font-size: clamp(11px, 1.4vw, 14px) !important;
  font-weight: 500 !important;
  letter-spacing: 0.4em !important;
  text-transform: uppercase;
  color: var(--accent) !important;
  margin-bottom: 12px;
}
.hero-mag-title {
  font-size: clamp(68px, 14vw, 200px) !important;
  font-weight: 800 !important;
  letter-spacing: -0.055em !important;
  line-height: 0.88 !important;
  color: var(--text-0) !important;
}
.hero-mag-sub {
  font-family: var(--font-body) !important;
  font-size: clamp(12px, 1.4vw, 15px) !important;
  font-weight: 500 !important;
  letter-spacing: 0.25em !important;
  text-transform: uppercase;
  color: var(--text-3) !important;
  margin-top: 12px;
}

.hero-sub { max-width: 560px; }
.hero-tagline {
  margin: 0;
  font: 400 clamp(16px, 2vw, 19px)/1.45 var(--font-body);
  color: var(--text-2);
  letter-spacing: -0.01em;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-scroll {
  position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero-scroll-line {
  width: 1px; height: 42px;
  background: linear-gradient(to bottom, transparent, var(--text-3));
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  50.01% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
.hero-scroll-label {
  font: 500 10px/1 var(--font-mono);
  color: var(--text-4);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* ============================================================
   SECTION HEAD
   ============================================================ */
.section-head {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 48px;
}
.section-sub {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text-0);
  max-width: 22ch;
}
:root[data-theme='light'] .section-sub {
  font-family: var(--font-display);
  font-weight: 800;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-hero {
  margin-bottom: 56px;
  display: flex; flex-direction: column; gap: 20px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}
.about-hero-text {
  margin: 0;
  font: 700 clamp(36px, 6vw, 80px)/1.0 var(--font-head);
  letter-spacing: -0.04em;
  color: var(--text-0);
  text-wrap: pretty;
}
:root[data-theme='light'] .about-hero-text {
  font-family: var(--font-display);
  font-weight: 800;
}
.about-hero-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-style: italic;
}
:root[data-theme='light'] .about-hero-accent {
  background: none; color: var(--accent); font-style: italic;
}
.about-location {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 13px/1 var(--font-mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
}
.about-location-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.about-grid {
  display: grid; grid-template-columns: 1fr; gap: 32px;
  margin-bottom: 64px;
}
@media (min-width: 900px) {
  .about-grid { grid-template-columns: 1fr 1fr; gap: 64px; }
}
.about-body { display: flex; flex-direction: column; gap: 20px; }
.about-para {
  margin: 0;
  font: 400 clamp(17px, 1.5vw, 22px)/1.65 var(--font-body);
  color: var(--text-2);
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
:root[data-theme='light'] .about-para {
  font-family: var(--font-body);
  color: var(--text-2);
  line-height: 1.75;
}
:root[data-theme='light'] .about-body:first-child .about-para:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 5.5em;
  line-height: 0.85;
  margin: 6px 12px 0 0;
  color: var(--accent);
  letter-spacing: -0.03em;
}

/* 8-cell stat grid */
.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px)  { .about-stats-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .about-stats-grid { grid-template-columns: repeat(4, 1fr); } }

.stat {
  padding: 28px 22px;
  border-radius: 18px;
  background: var(--surface-4);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), background 260ms, border-color 260ms;
  position: relative;
}
.stat::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 0% 100%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 60%);
  opacity: 0; transition: opacity 300ms;
  pointer-events: none;
  overflow: hidden;
}
.stat:hover { z-index: 4; }

/* Tooltip — appears BELOW the tile in the section padding zone (clear of
   surrounding text). Card is offset to one side; an L-shaped arrow goes
   down from the tile then turns toward the card. */
.stat-tooltip {
  position: absolute;
  top: calc(100% + 0px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(.2,.8,.2,1);
  z-index: 5;
}
.stat:hover .stat-tooltip {
  opacity: 1;
  transform: translateY(0);
}
.stat-tooltip--L  { left: 50%; }
.stat-tooltip--rL { right: 50%; }

.stat-tooltip-Larrow {
  position: absolute;
  top: 0;
  display: block;
  overflow: visible;
}
.stat-tooltip--L  .stat-tooltip-Larrow { left: -4px; }
.stat-tooltip--rL .stat-tooltip-Larrow { right: -4px; }
.stat-tooltip-Larrow path {
  stroke: color-mix(in oklab, var(--accent) 75%, transparent);
}
.stat-tooltip-Larrow polygon {
  fill: color-mix(in oklab, var(--accent) 70%, transparent);
}

.stat-tooltip-card {
  position: absolute;
  top: 40px;
  background: var(--surface-2);
  color: var(--text-0);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--border));
  padding: 12px 14px;
  border-radius: 12px;
  width: max-content;
  max-width: 280px;
  font: 500 12px/1.5 var(--font-mono);
  letter-spacing: 0.01em;
  text-transform: none;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}
.stat-tooltip--L  .stat-tooltip-card { left: 52px; }
.stat-tooltip--rL .stat-tooltip-card { right: 52px; }

:root[data-theme='light'] .stat-tooltip-card {
  background: var(--surface-0);
  color: var(--text-0);
  border: 1px solid var(--text-1);
  box-shadow: 4px 4px 0 var(--text-1);
}
.stat:hover { transform: translateY(-4px); border-color: color-mix(in oklab, var(--accent) 40%, var(--border)); }
.stat:hover::before { opacity: 1; }
.stat-num {
  font: 700 clamp(26px, 3.5vw, 42px)/1 var(--font-head);
  letter-spacing: -0.03em;
  color: var(--text-0);
}
.stat-label {
  font: 500 11px/1.3 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
:root[data-theme='light'] .stat {
  background: var(--surface-4);
  border: 1px solid var(--text-1);
  box-shadow: 3px 3px 0 var(--text-1);
}
:root[data-theme='light'] .stat:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--accent);
  border-color: var(--accent);
}
:root[data-theme='light'] .stat-num { color: var(--accent); font-family: var(--font-display); }

/* ============================================================
   WORK — desktop grid
   ============================================================ */
.work-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
@media (min-width: 1000px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
  .proj-big { grid-column: span 2; grid-row: span 2; }
  .proj-wide { grid-column: span 2; }
}
@media (max-width: 640px) { .work-grid { grid-template-columns: 1fr; } }

.proj-card {
  position: relative;
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  min-height: 240px;
  overflow: hidden;
  transition: transform 300ms cubic-bezier(.2,.8,.2,1), border-color 300ms;
  cursor: pointer;
}
.proj-big { min-height: 420px; padding: 32px; }
.proj-wide { min-height: 260px; padding: 32px; }
.proj-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

:root[data-theme='light'] .proj-card {
  background: var(--surface-4);
  border: 1px solid var(--text-1);
  box-shadow: 4px 4px 0 var(--text-1);
  transition: transform 300ms cubic-bezier(.2,.8,.2,1), box-shadow 300ms;
}
:root[data-theme='light'] .proj-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--accent);
  border-color: var(--accent);
}

.proj-glow {
  position: absolute; inset: 0;
  background: radial-gradient(600px circle at var(--mx,50%) var(--my,50%), color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%);
  opacity: 0; transition: opacity 300ms;
  pointer-events: none;
}
.proj-card:hover .proj-glow { opacity: 1; }

.proj-face {
  display: flex; flex-direction: column; justify-content: space-between;
  height: 100%; gap: 32px;
  position: relative; z-index: 1;
}
.proj-top {
  display: flex; align-items: center; justify-content: space-between;
}
.proj-index {
  font: 500 12px/1 var(--font-mono);
  color: var(--text-4);
  letter-spacing: 0.2em;
}
.proj-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.proj-body { display: flex; flex-direction: column; gap: 10px; }
.proj-title {
  margin: 0;
  font: 700 clamp(24px, 3vw, 34px)/1 var(--font-head);
  letter-spacing: -0.03em;
  color: var(--text-0);
  overflow-wrap: anywhere;
}
.proj-big .proj-title { font-size: clamp(34px, 4.5vw, 54px); }
:root[data-theme='light'] .proj-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.04em;
}
:root[data-theme='light'] .proj-big .proj-title {
  font-size: clamp(32px, 4vw, 48px);
}

.proj-one {
  margin: 0;
  font: 400 14px/1.45 var(--font-body);
  color: var(--text-2);
  letter-spacing: -0.005em;
}
.proj-big .proj-one { font-size: 16px; }

.proj-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.proj-secret {
  border: 1px dashed var(--accent) !important;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 12%, var(--surface-4)), var(--surface-4));
}

/* ============================================================
   WORK — mobile swipe deck
   ============================================================ */
.swipe-stage {
  position: relative;
  padding: 20px 0 40px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  min-height: 560px;
}
.swipe-deck {
  position: relative;
  width: min(340px, 84vw);
  height: 440px;
}
.swipe-card {
  position: absolute; inset: 0;
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  will-change: transform;
  user-select: none;
  touch-action: none;
}
:root[data-theme='light'] .swipe-card {
  background: var(--surface-4);
  border: 1px solid var(--text-1);
  box-shadow: 6px 6px 0 var(--text-1);
}
.swipe-card-top { cursor: grab; }
.swipe-card-top:active { cursor: grabbing; }

.swipe-badge {
  position: absolute; top: 28px;
  padding: 8px 14px; border-radius: 100px;
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.3em; text-transform: uppercase;
  pointer-events: none;
  border: 2px solid;
}
.swipe-badge-right {
  right: 24px; color: var(--accent); border-color: var(--accent);
  transform: rotate(14deg);
}
.swipe-badge-left {
  left: 24px; color: var(--text-3); border-color: var(--text-3);
  transform: rotate(-14deg);
}

.swipe-meta {
  display: flex; align-items: center; justify-content: space-between;
  width: min(340px, 84vw);
}
.swipe-counter {
  font: 500 12px/1 var(--font-mono);
  color: var(--text-3);
  letter-spacing: 0.2em;
}
.swipe-hint {
  font: 500 10px/1 var(--font-mono);
  color: var(--text-4);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.swipe-dots { display: flex; gap: 6px; }
.swipe-dot {
  width: 24px; height: 3px; border-radius: 10px;
  background: var(--border); transition: all 300ms;
}
.swipe-dot.on { background: var(--accent); width: 40px; }

.swipe-controls { display: flex; gap: 12px; }
.swipe-btn {
  all: unset; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-4); border: 1px solid var(--border);
  font-size: 18px; color: var(--text-1);
  transition: all 200ms;
}
.swipe-btn:active { transform: scale(0.9); }

/* ============================================================
   EXPERIENCE
   ============================================================ */
.exp-list {
  display: flex; flex-direction: column; gap: 0;
  border-top: 1px solid var(--border);
}
.exp-item {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  transition: background 300ms;
}
@media (min-width: 800px) {
  .exp-item { grid-template-columns: 220px 1fr; gap: 32px; padding: 36px 0; }
}
.exp-item:hover { background: color-mix(in oklab, var(--surface-4) 40%, transparent); }

.exp-period {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
}
.exp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.exp-role {
  margin: 0 0 6px 0;
  font: 700 clamp(20px, 2vw, 26px)/1.1 var(--font-head);
  letter-spacing: -0.02em;
  color: var(--text-0);
}
:root[data-theme='light'] .exp-role { font-family: var(--font-display); }
.exp-company {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
  font: 500 14px/1 var(--font-body);
  color: var(--text-2);
}
.exp-place { color: var(--text-4); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.exp-bullets {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 6px;
}
.exp-bullets li {
  position: relative; padding-left: 18px;
  font: 400 14px/1.55 var(--font-body);
  color: var(--text-2);
}
.exp-bullets li::before {
  content: '—';
  position: absolute; left: 0; top: 0;
  color: var(--text-4);
}

.exp-meta {
  display: grid; grid-template-columns: 1fr; gap: 20px;
  margin-top: 48px;
}
@media (min-width: 800px) { .exp-meta { grid-template-columns: 1fr 1fr; gap: 24px; } }

/* Certifications link rows */
.cert-link {
  display: flex; flex-direction: column; gap: 4px;
  text-decoration: none;
  padding: 10px; margin: -10px; border-radius: 10px;
  transition: background 200ms;
}
.cert-link:hover { background: var(--surface-5); }
.cert-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cert-top .panel-line-a { color: var(--text-0); }
.cert-icon {
  font-size: 14px; color: var(--accent);
  flex-shrink: 0; margin-top: 1px;
  opacity: 0; transition: opacity 200ms;
}
.cert-link:hover .cert-icon { opacity: 1; }

/* Papers section */
.exp-meta-stack {
  display: flex; flex-direction: column; gap: 48px;
  margin-top: 64px;
}
.papers-row {
  display: grid; grid-template-columns: 1fr; gap: 20px;
}
@media (min-width: 700px) { .papers-row { grid-template-columns: 1fr 1fr; } }

.panel {
  position: relative;
  padding: 24px;
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1), border-color 280ms, box-shadow 280ms;
  overflow: hidden;
}
.panel-link-card { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.proj-card { text-decoration: none; }
.proj-card *, .panel-link-card *, .panel-row * { text-decoration: none; }
.panel-link-card:hover,
.panel-row:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
:root[data-theme='light'] .panel { box-shadow: 3px 3px 0 var(--text-1); border-color: var(--text-1); }
:root[data-theme='light'] .panel-link-card:hover,
:root[data-theme='light'] .panel-row:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--accent);
  border-color: var(--accent);
}
.panel-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  padding: 14px;
  margin: -4px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none; color: inherit;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1), border-color 280ms, background 280ms;
}
.panel-row-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.panel-row-arrow {
  flex-shrink: 0;
  font-size: 18px; color: var(--text-4);
  transition: transform 300ms, color 280ms;
  padding-top: 6px;
}
.panel-row-arrow-tr {
  position: absolute; top: 24px; right: 24px;
  padding-top: 0;
}
.panel-row:hover .panel-row-arrow,
.panel-link-card:hover .panel-row-arrow { transform: translate(4px, -4px); color: var(--accent); }
:root[data-theme='light'] .panel-row:hover { background: color-mix(in oklab, var(--accent) 6%, transparent); }
.panel-title {
  font: 500 11px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-3);
  margin-bottom: 16px;
}
.panel-list {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 28px;
}
.panel-list li { display: flex; flex-direction: column; gap: 8px; }
.panel-line-a {
  font: 700 clamp(22px, 2.6vw, 32px)/1.15 var(--font-head);
  letter-spacing: -0.025em;
  color: var(--text-0);
}
:root[data-theme='light'] .panel-line-a { font-family: var(--font-display); }
.panel-line-b {
  font: 400 15px/1.5 var(--font-body);
  color: var(--text-3);
  letter-spacing: -0.005em;
}
.panel-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  transition: border-color 200ms;
}
.panel-link:hover { border-color: var(--accent); }
.panel-link-arrow { display: inline-block; transition: transform 200ms; }
.panel-link:hover .panel-link-arrow { transform: translate(2px, -2px); }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
@media (min-width: 700px) { .skills-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }

.skill-block {
  padding: 24px;
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 16px;
}
:root[data-theme='light'] .skill-block { box-shadow: 3px 3px 0 var(--text-1); border-color: var(--text-1); }
.skill-head {
  font: 700 13px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 16px;
}
.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip { font-size: 12px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-hero {
  margin-bottom: 48px;
  display: flex; flex-direction: column; gap: 20px;
}
.contact-big {
  margin: 0;
  font: 700 clamp(44px, 9vw, 110px)/0.9 var(--font-head);
  letter-spacing: -0.045em;
  color: var(--text-0);
}
:root[data-theme='light'] .contact-big { font-family: var(--font-display); font-weight: 800; }
.contact-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}
:root[data-theme='light'] .contact-accent {
  background: none; color: var(--accent); font-style: normal;
  text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 8px;
}
.contact-sub {
  margin: 0;
  font: 400 clamp(15px, 1.4vw, 18px)/1.55 var(--font-body);
  color: var(--text-2);
  max-width: 600px;
  letter-spacing: -0.005em;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 900px)  { .contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }

/* Icon tiles */
.contact-card-icon { position: relative; }
.ccard-top {
  display: flex; align-items: flex-start; justify-content: space-between;
}
.ccard-logo {
  width: clamp(26px, 3.4vw, 36px);
  height: clamp(26px, 3.4vw, 36px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: color 320ms, transform 320ms cubic-bezier(.2,.8,.2,1);
  flex-shrink: 0;
}
.ccard-logo svg {
  width: clamp(26px, 3.6vw, 38px);
  height: clamp(26px, 3.6vw, 38px);
  display: block;
}
.contact-card:hover .ccard-logo {
  color: var(--accent);
  transform: rotate(-10deg) scale(1.25);
}
/* Primary (resume) icon stays white */
.contact-card-primary .ccard-logo { color: var(--body-bg); }
.contact-card-primary:hover .ccard-logo { color: var(--body-bg); }

.contact-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: clamp(14px, 3.6vw, 24px);
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: clamp(12px, 2.2vw, 16px);
  text-decoration: none;
  position: relative;
  transition: all 300ms cubic-bezier(.2,.8,.2,1);
  min-height: clamp(120px, 26vw, 200px);
  justify-content: space-between;
  min-width: 0;
}
.contact-card:hover { transform: translateY(-4px); border-color: var(--accent); }
:root[data-theme='light'] .contact-card {
  box-shadow: 3px 3px 0 var(--text-1); border-color: var(--text-1);
}
:root[data-theme='light'] .contact-card:hover {
  transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); border-color: var(--accent);
}
.contact-card-label {
  font: 500 clamp(9.5px, 1.2vw, 11px)/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-3);
}
.contact-card-value {
  font: 600 clamp(14px, 3.2vw, 28px)/1.2 var(--font-body);
  letter-spacing: -0.01em;
  color: var(--text-0);
  padding: clamp(4px, 1vw, 10px) 0 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.contact-card-arrow {
  position: absolute;
  top: clamp(12px, 2vw, 20px);
  right: clamp(12px, 2vw, 20px);
  font-size: clamp(14px, 1.6vw, 18px);
  color: var(--text-3);
  transition: transform 300ms;
}
.contact-card:hover .contact-card-arrow { transform: translate(4px, -4px); color: var(--accent); }

.contact-card-primary {
  background: var(--text-0); color: var(--body-bg);
  border-color: var(--text-0);
}
.contact-card-primary .contact-card-label,
.contact-card-primary .contact-card-value,
.contact-card-primary .contact-card-arrow { color: var(--body-bg); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 40px 0 40px;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.footer-left { display: flex; align-items: center; gap: 16px; }
.footer-sig {
  font: 700 18px/1 var(--font-head);
  letter-spacing: -0.02em;
  color: var(--text-0);
}
.footer-meta {
  font: 400 12px/1 var(--font-body);
  color: var(--text-4);
  letter-spacing: -0.005em;
}
.footer-right { display: flex; gap: 20px; }
.footer-link {
  font: 500 13px/1 var(--font-body);
  color: var(--text-2);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 200ms;
}
.footer-link:hover { color: var(--accent); }

/* ============================================================
   KONAMI TOAST
   ============================================================ */
.konami-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 14px 22px; border-radius: 100px;
  background: var(--accent); color: #000;
  font: 700 13px/1 var(--font-mono);
  letter-spacing: 0.15em; text-transform: uppercase;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 300ms, transform 300ms cubic-bezier(.2,.8,.2,1);
  z-index: 1000;
  pointer-events: none;
}
.konami-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Long-press hint toast */
.lp-toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%) translateY(-20px);
  padding: 10px 16px; border-radius: 100px;
  background: var(--surface-5); color: var(--text-0);
  border: 1px solid var(--border);
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.15em; text-transform: uppercase;
  opacity: 0; transition: all 280ms;
  z-index: 1000; pointer-events: none;
}
.lp-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   LIGHT MODE TEXTURE / EXTRAS
   ============================================================ */
:root[data-theme='light'] .container {
  position: relative;
}
:root[data-theme='light'] section[data-section]::before {
  content: attr(data-section);
  position: absolute; top: 40px; right: 24px;
  font: 700 11px/1 var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.3em;
  color: var(--text-5);
  pointer-events: none;
}

/* Section row letters in light mode — magazine folios */
:root[data-theme='light'] body {
  cursor: auto;
}

/* ============================================================
   Tech Reel (marquee under Skills)
   ============================================================ */
.tech-reel {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 48px;
  padding: 28px 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
}
:root[data-theme='light'] .tech-reel {
  background: var(--surface-3);
}

.tech-reel-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: tech-reel-scroll 95s linear infinite;
  will-change: transform;
}

/* Cursor-following tooltip shown on desktop hover over the reel.
   Rendered via React portal into document.body so it escapes the
   reel's overflow:hidden and mask-image clipping. Sizes to content
   (no max-width) so the full sentence always fits on one line. */
.tech-reel-tip {
  position: fixed;
  left: 0; top: 0;
  transform: translate(-50%, 0) translateY(8px) scale(0.96);
  transform-origin: top center;
  pointer-events: none;
  z-index: 9970;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px 14px 18px;
  border-radius: 100px;
  width: max-content;
  white-space: nowrap;
  background: rgba(16, 16, 17, 0.92);
  border: 1px solid var(--border);
  color: var(--text-1);
  font: 500 15px/1.2 var(--font-head);
  letter-spacing: -0.005em;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 52px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
}
.tech-reel-tip.on {
  opacity: 1;
  transform: translate(-50%, 0) translateY(0) scale(1);
}
.tech-reel-tip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}
:root[data-theme='light'] .tech-reel-tip {
  background: rgba(255, 255, 255, 0.97);
  border-color: var(--text-1);
  color: var(--text-0);
  font-family: var(--font-body);
  font-weight: 600;
  box-shadow: 5px 5px 0 var(--text-1), 0 12px 32px rgba(0,0,0,0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@media (max-width: 720px) {
  .tech-reel-tip { display: none; }
}

.tech-reel-item {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
}
.tech-reel-entry {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.tech-reel-name {
  font: 600 clamp(16px, 2.1vw, 24px)/1 var(--font-head);
  letter-spacing: -0.01em;
  color: var(--text-3);
  transition: color 220ms;
}
:root[data-theme='light'] .tech-reel-name {
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text-2);
}
/* When no logo is available, bump the name to match the visual weight of logo-bearing entries */
.tech-reel-entry.no-logo .tech-reel-name {
  font-size: clamp(18px, 2.4vw, 28px);
}
.tech-reel-item:hover .tech-reel-name { color: var(--accent); }

.tech-reel-logo {
  height: clamp(24px, 2.4vw, 34px);
  width: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0.82;
  /* Dark mode: force logos to white silhouette */
  filter: brightness(0) invert(1);
  transition: opacity 220ms, filter 220ms, transform 220ms;
}
:root[data-theme='light'] .tech-reel-logo {
  /* Light mode: pure-black silhouette on cream */
  filter: brightness(0);
  opacity: 0.75;
}
.tech-reel-item:hover .tech-reel-logo {
  opacity: 1;
  transform: scale(1.05);
}

.tech-reel-sep {
  color: var(--accent);
  opacity: 0.55;
  font-size: clamp(10px, 1.1vw, 13px);
  transform: translateY(-1px);
}
:root[data-theme='light'] .tech-reel-sep { opacity: 0.7; }

@keyframes tech-reel-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .tech-reel-track { animation: none; }
}

/* ============================================================
   MOBILE TUNING (<=640px) — alignment, spacing, typography
   ============================================================ */
@media (max-width: 640px) {
  /* Hero */
  .hero-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .hero-meta .hero-time { margin-left: 0; }
  .hero-meta .eyebrow { font-size: 10px; letter-spacing: 0.22em; gap: 8px; }
  .hero-meta .eyebrow::before { width: 14px; }
  .hero-time { font-size: 11px; letter-spacing: 0.05em; }
  .hero-title { font-size: clamp(58px, 16vw, 200px); }
  .hero-line-sub { font-size: 0.48em; margin-top: 0.3em; }
  .hero-tagline { font-size: clamp(17px, 4.8vw, 22px); line-height: 1.45; }
  .hero-sub { max-width: 40ch; }
  .hero-actions { gap: 10px; width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; padding: 15px 18px; font-size: 14px; }
  .hero-scroll { display: none; }

  /* Light hero — editorial */
  :root[data-theme='light'] .hero-title { padding: 16px 0 18px; }
  .hero-mag-kicker { letter-spacing: 0.3em !important; }
  .hero-mag-title { letter-spacing: -0.045em !important; }
  .hero-mag-sub { letter-spacing: 0.22em !important; }

  /* Section scaffolding */
  section[data-section] { padding: 64px 0; }
  .section-head { margin-bottom: 36px; gap: 12px; }

  /* About */
  .about-hero { margin-bottom: 40px; padding-bottom: 36px; gap: 16px; }
  .about-location { font-size: 11px; letter-spacing: 0.1em; }
  .about-grid { gap: 22px; margin-bottom: 44px; }
  .about-para { padding-left: 18px; font-size: 18px; line-height: 1.7; }
  :root[data-theme='light'] .about-body:first-child .about-para:first-of-type::first-letter {
    font-size: 4.4em; margin: 4px 8px 0 0;
  }
  .about-stats-grid { gap: 10px; }
  .stat { padding: 20px 16px; border-radius: 14px; gap: 6px; }
  .stat-num { font-size: 24px; }
  .stat-label { font-size: 10px; letter-spacing: 0.1em; }

  /* Work — swipe deck */
  .swipe-stage { min-height: 520px; gap: 18px; padding: 12px 0 28px; }
  .swipe-deck { width: min(320px, 86vw); height: 420px; }
  .swipe-card { padding: 24px; border-radius: 20px; }
  .swipe-badge { top: 22px; padding: 6px 12px; font-size: 10px; letter-spacing: 0.25em; }
  .swipe-badge-right { right: 18px; }
  .swipe-badge-left  { left: 18px; }
  .proj-title { font-size: 26px; }
  .proj-big .proj-title, .proj-wide .proj-title { font-size: 28px; }

  /* Experience */
  .exp-list { border-top-color: var(--border); }
  .exp-item { padding: 22px 0; gap: 8px; }
  .exp-role { font-size: 20px; margin-bottom: 4px; }
  .exp-company { margin-bottom: 12px; font-size: 13px; gap: 8px; }
  .exp-place { font-size: 11px; }
  .exp-bullets li { font-size: 13.5px; line-height: 1.55; padding-left: 14px; }

  .exp-meta-stack { gap: 28px; margin-top: 44px; }
  .panel { padding: 20px; border-radius: 14px; }
  .panel-title { margin-bottom: 12px; font-size: 10px; letter-spacing: 0.18em; }
  .panel-list { gap: 20px; }
  .panel-row { padding: 10px; margin: -2px; gap: 10px; }
  .panel-line-a { font-size: 19px; line-height: 1.2; }
  .panel-line-b { font-size: 13px; line-height: 1.45; }
  .panel-row-arrow { font-size: 16px; padding-top: 2px; }
  .panel-row-arrow-tr { top: 18px; right: 18px; }

  /* Skills */
  .skills-grid { gap: 12px; }
  .skill-block { padding: 20px; border-radius: 14px; }
  .skill-head { margin-bottom: 14px; font-size: 12px; letter-spacing: 0.16em; }

  /* Tech reel */
  .tech-reel { padding: 20px 0; margin-top: 32px; }
  .tech-reel-item { gap: 18px; padding-right: 18px; }
  .tech-reel-entry { gap: 8px; }
  .tech-reel-name { font-size: 14px; }
  .tech-reel-entry.no-logo .tech-reel-name { font-size: 15px; }
  .tech-reel-logo { height: 20px; }

  /* Contact (grid/typography driven by fluid clamps on the base rules) */
  .contact-hero { margin-bottom: 32px; gap: 14px; }
  .contact-big { font-size: clamp(40px, 12vw, 64px); line-height: 0.95; letter-spacing: -0.035em; }
  .contact-sub { font-size: 14.5px; line-height: 1.55; }
  .contact-card { gap: 8px; }

  /* Footer */
  .footer { padding: 28px 0; }
  .footer-inner { gap: 14px; }
  .footer-left { gap: 10px; flex-wrap: wrap; }
  .footer-sig { font-size: 16px; }
  .footer-meta { font-size: 11px; }
  .footer-right { gap: 14px; }
  .footer-link { font-size: 12px; }

  /* Light-mode magazine folio label — move out of the way */
  :root[data-theme='light'] section[data-section]::before {
    top: 16px; right: 16px; font-size: 9px; letter-spacing: 0.22em;
  }
}

/* Extra tightening on very narrow phones (<=380px) */
@media (max-width: 380px) {
  .container { padding: 0 16px; }
  .hero-wrap { padding: 32px 16px 40px; }
  .hero-meta { gap: 8px; }
  .hero-meta .eyebrow { font-size: 9.5px; letter-spacing: 0.18em; }
  .hero-time { font-size: 10.5px; }
  .hero-title { font-size: clamp(50px, 15vw, 58px); }
  .hero-tagline { font-size: 16px; }
  .about-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Easter-egg hover hints — chip follows the cursor inside an egg region
   ============================================================ */
.egg-hint {
  position: fixed;
  /* left/top set inline from JS to cursor coords (clientX/clientY) */
  z-index: 9960;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border-radius: 100px;
  width: max-content;
  max-width: min(420px, 80vw);
  white-space: nowrap;
  background: rgba(16, 16, 17, 0.94);
  border: 1px solid var(--border);
  color: var(--text-2);
  font: 500 12px/1.2 var(--font-mono);
  letter-spacing: 0.02em;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  /* Default: chip sits 28px below the cursor, horizontally centered on it */
  transform: translate(-50%, 28px);
  opacity: 0;
  transition: opacity 150ms ease;
}
.egg-hint.on { opacity: 1; }
.egg-hint.egg-hint-up {
  /* Flipped: chip sits 28px above the cursor */
  transform: translate(-50%, calc(-100% - 28px));
}
.egg-hint-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}
:root[data-theme='light'] .egg-hint {
  background: rgba(255, 255, 255, 0.97);
  border-color: var(--text-1);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-weight: 600;
  box-shadow: 3px 3px 0 var(--text-1), 0 8px 20px rgba(0,0,0,0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@media (hover: none) {
  .egg-hint { display: none; }
}
