/* ─── TOKENS (from MotionSites Portfolio Cosmic design system) ─── */
:root {
  --bg:            #0A0A0A;
  --surface:       #141414;
  --surface2:      #1C1C1C;
  --border:        #272727;
  --text:          #F0F0F0;
  --muted:         #888;
  --muted2:        #555;

  /* Blue gradient accent — MotionSites */
  --a1: #89AACC;
  --a2: #4E85BF;
  --grad: linear-gradient(90deg, var(--a1) 0%, var(--a2) 100%);

  --green:   #4ADE80;
  --purple:  #A78BFA;

  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;
  --font-mono:  'Courier New', monospace;

  --nav-h: 64px;
  --r: 10px;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Subtle dot grid */
  background-image: radial-gradient(circle, #ffffff08 1px, transparent 1px);
  background-size: 28px 28px;
}
img { max-width: 100%; display: block; }
strong { font-weight: 600; }
a { color: inherit; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: 24px;
}

section { padding-block: 96px; }
section + section { border-top: 1px solid var(--border); }

/* Sections get a slightly lighter bg to break up the monotony */
#experience { background: color-mix(in srgb, var(--surface) 30%, transparent); }
#skills      { background: color-mix(in srgb, var(--surface) 20%, transparent); }

/* ─── LOADER ─── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 40px;
  pointer-events: none;
  transition: opacity 0.5s ease 0.3s;
}

#loader.done { opacity: 0; }

.loader-counter {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 12vw, 9rem);
  font-style: italic;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.04em;
  opacity: 0.15;
}

.loader-bar-track {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: var(--grad);
  transition: width 0.05s linear;
  box-shadow: 0 0 8px rgba(137, 170, 204, 0.4);
}

/* ─── NAV ─── */
#nav {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding-inline: 24px;
  pointer-events: none;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: all;
  transition: box-shadow 0.3s;
}

.nav-pill.scrolled {
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border-color: color-mix(in srgb, var(--a1) 20%, var(--border));
}

/* Logo ring */
.nav-logo-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s;
  flex-shrink: 0;
  padding: 2px;
}

.nav-logo-ring:hover { transform: scale(1.1); }

.nav-initials {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--text);
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin-inline: 4px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
}

.nav-link {
  display: block;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.nav-link:hover, .nav-link.active {
  background: var(--surface2);
  color: var(--text);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  transition: border-color 0.2s;
  white-space: nowrap;
  position: relative;
}

.nav-cta:hover { border-color: var(--a1); }

.cta-arrow { font-size: 0.85rem; opacity: 0.7; }

/* ─── HERO ─── */
#hero {
  padding-top: calc(var(--nav-h) + 72px);
  padding-bottom: 0;
  border-top: none !important;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: center;
  padding-bottom: 80px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 24px;
}

.hero-name em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 480px;
  margin: 0 0 36px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--text);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--a1);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 999px;
  text-decoration: none;
  background: transparent;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}

.btn-outline:hover {
  border-color: var(--a1);
  color: var(--text);
  transform: translateY(-1px);
}

/* Photo */
.hero-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-wrap {
  position: relative;
  width: 300px;
  height: 300px;
}

/* Outer glow backdrop */
.photo-wrap::before {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--a1) 18%, transparent) 0%, transparent 70%);
  z-index: -1;
}

.hero-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  display: block;
  position: relative;
  z-index: 1;
  border: 3px solid var(--surface2);
}

/* Rotating gradient ring */
.photo-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--a1) 0%, var(--a2) 35%, transparent 50%, transparent 65%, var(--a1) 100%);
  z-index: 0;
  animation: spin-ring 10s linear infinite;
  opacity: 0.7;
}

@keyframes spin-ring {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Stats bar */
.hero-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-block: 36px;
  background: color-mix(in srgb, var(--surface) 40%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stat {
  flex: 1;
  min-width: 120px;
  padding-inline: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat:first-child { padding-left: 0; }

.stat-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-prefix {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--a1);
  line-height: 1;
  letter-spacing: 0.02em;
}

.stat-unit {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--a1);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 2px;
  max-width: 130px;
  line-height: 1.4;
}

.stat-sep {
  width: 1px;
  height: 48px;
  background: var(--border);
  flex-shrink: 0;
}

/* ─── SECTION HEADERS ─── */
.section-header {
  margin-bottom: 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.eyebrow::before {
  content: '';
  display: block;
  width: 18px;
  height: 1px;
  background: var(--muted);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
  color: var(--text);
}

.section-title em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── TIMELINE ─── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tl-item {
  display: grid;
  grid-template-columns: 180px 40px 1fr;
  gap: 0;
  padding-bottom: 48px;
}

.tl-left {
  padding-right: 24px;
  padding-top: 2px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.tl-date {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.tl-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}

.tl-badge.current {
  background: color-mix(in srgb, var(--a1) 15%, transparent);
  color: var(--a1);
  border: 1px solid color-mix(in srgb, var(--a1) 30%, transparent);
}

/* Connector column */
.tl-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-top: 4px;
}

.tl-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.tl-dot.active {
  background: var(--a1);
  border-color: var(--a1);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 15%, transparent);
}

.tl-line {
  flex: 1;
  width: 1px;
  background: var(--border);
  margin-top: 6px;
}

.tl-item:hover .tl-dot { border-color: var(--a1); }

.tl-right {
  padding-left: 28px;
  padding-top: 0;
}

.tl-company {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.tl-role {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--a1);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.tl-bullets {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tl-bullets li {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
}

.tl-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--border);
  font-size: 0.8rem;
}

.tl-bullets strong { color: var(--text); font-weight: 500; }

.tl-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tl-stack span {
  padding: 3px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ─── BENTO GRID ─── */
/* ─── PROJECT EXPANDING CARDS ─── */
.projects-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  min-height: 280px;
}

.proj-card {
  flex: 1;
  min-width: 140px;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  cursor: default;
  transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.25s,
              box-shadow 0.25s;
  outline: none;
}

.proj-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--proj-color, var(--a1));
  opacity: 0.65;
  transition: opacity 0.25s;
}

.proj-card:hover::before,
.proj-card.active::before { opacity: 1; }

.proj-card--green  { --proj-color: var(--green); }
.proj-card--orange { --proj-color: #e07b39; }
.proj-card--purple { --proj-color: var(--purple); }

.proj-card:hover,
.proj-card.active {
  flex: 2.8;
  border-color: color-mix(in srgb, var(--proj-color, var(--a1)) 40%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--proj-color, var(--a1)) 10%, transparent),
              0 20px 52px -10px rgba(0,0,0,0.45);
}

.proj-summary {
  display: flex;
  flex-direction: column;
}

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

.proj-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 18px;
  line-height: 1.25;
}

.proj-title em { font-style: italic; }

.proj-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.proj-stack code {
  font-size: 0.67rem;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-mono, 'Courier New', monospace);
  white-space: nowrap;
}

.proj-hint {
  font-size: 0.62rem;
  color: var(--muted2);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-top: auto;
  padding-top: 16px;
  transition: opacity 0.2s;
}

.proj-card:hover .proj-hint,
.proj-card.active .proj-hint { opacity: 0; }

.proj-detail {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(8px);
  transition: opacity 0.28s ease 0.18s,
              max-height 0.5s ease 0.05s,
              transform 0.32s ease 0.18s;
  pointer-events: none;
}

.proj-card:hover .proj-detail,
.proj-card.active .proj-detail {
  opacity: 1;
  max-height: 600px;
  transform: translateY(0);
  pointer-events: auto;
}

.proj-desc {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.72;
  margin: 20px 0 14px;
}

.proj-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.proj-list li {
  font-size: 0.8rem;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.55;
}

.proj-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--proj-color, var(--a1));
  font-size: 0.7rem;
  top: 1px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s;
}

.bento-card:hover {
  border-color: color-mix(in srgb, var(--a1) 40%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--a1) 10%, transparent),
              0 16px 48px -8px rgba(0,0,0,0.4);
}

.bento-body {
  padding: 36px;
  flex: 1;
}

.bento-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.btag {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.btag.green {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 20%, transparent);
}

.btag.blue {
  background: color-mix(in srgb, var(--a1) 12%, transparent);
  color: var(--a1);
  border: 1px solid color-mix(in srgb, var(--a1) 20%, transparent);
}

.btag.purple {
  background: color-mix(in srgb, var(--purple) 12%, transparent);
  color: var(--purple);
  border: 1px solid color-mix(in srgb, var(--purple) 20%, transparent);
}

.btag.orange {
  background: color-mix(in srgb, var(--orange, #e07b39) 12%, transparent);
  color: var(--orange, #e07b39);
  border: 1px solid color-mix(in srgb, var(--orange, #e07b39) 20%, transparent);
}

.bento-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.2;
}

.bento-title em { font-style: italic; }

.bento-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 18px;
}

.bento-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bento-list li {
  font-size: 0.82rem;
  color: var(--muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.bento-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--a1);
  font-size: 1.2rem;
  line-height: 0.9;
  top: 3px;
}

.bento-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 20px;
}

.bento-stack code {
  padding: 3px 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--muted);
}

.bento-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--a1);
  text-decoration: none;
  transition: gap 0.15s;
}

.bento-link:hover { gap: 8px; }

/* Bento visuals */
.bento-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.bento-wide .bento-body {
  border-right: 1px solid var(--border);
}

.bento-wide .bento-visual {
  border-top: none;
  border-left: none;
}

/* Tekton architecture diagram */
.arch-diagram {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arch-scenario {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.arch-scenario-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.arch-scenario-label.bad { color: #e07b39; }
.arch-scenario-label.good { color: var(--green); }

.arch-flow {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.arch-node {
  font-size: 0.62rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.4;
}

.arch-node.users   { background: color-mix(in srgb, var(--a1) 12%, transparent); color: var(--a1); border: 1px solid color-mix(in srgb, var(--a1) 25%, transparent); }
.arch-node.service { background: color-mix(in srgb, var(--purple) 12%, transparent); color: var(--purple); border: 1px solid color-mix(in srgb, var(--purple) 25%, transparent); }
.arch-node.danger  { background: color-mix(in srgb, #e07b39 12%, transparent); color: #e07b39; border: 1px solid color-mix(in srgb, #e07b39 25%, transparent); }
.arch-node.safe    { background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); }
.arch-node.neutral { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }

.arch-arrow {
  font-size: 0.7rem;
  color: var(--muted2);
  padding: 0 1px;
}

.arch-arrow.overload { color: #e07b39; }

.bento-visual {
  background: var(--surface2);
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.erp-visual {}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 100%;
}

.mod {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

.visual-note {
  font-size: 0.68rem;
  color: var(--muted2);
  margin: 0;
  text-align: center;
}

.chart-visual {
  min-height: 180px;
  justify-content: center;
}

#stockChart {
  width: 100%;
  max-width: 300px;
  height: 160px;
}

/* ─── SKILLS ─── */
.skills-wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}

.skill-group:hover {
  border-color: color-mix(in srgb, var(--a1) 25%, transparent);
}

.sg-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted2);
  margin: 0 0 14px;
}

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

.sg-tag {
  padding: 5px 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}

.sg-tag:hover {
  border-color: color-mix(in srgb, var(--a1) 35%, transparent);
  color: var(--text);
}

.sg-tag.hi {
  border-color: color-mix(in srgb, var(--a1) 25%, transparent);
  color: var(--a1);
  background: color-mix(in srgb, var(--a1) 8%, transparent);
}

/* ─── EDUCATION ─── */
.edu-card {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 40px;
  max-width: 720px;
  transition: border-color 0.2s;
}

.edu-card:hover {
  border-color: color-mix(in srgb, var(--a1) 25%, transparent);
}

.edu-left {
  flex-shrink: 0;
}

.edu-mono {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 2rem;
  font-weight: 400;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.edu-school {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.edu-degree {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.edu-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.edu-pill {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted2);
}

.edu-pill.highlight {
  color: var(--green);
  font-weight: 600;
}

/* ─── CONTACT ─── */
#contact {
  padding-bottom: 0;
}

.contact-inner {
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.contact-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-eyebrow::before {
  content: '';
  display: block;
  width: 18px;
  height: 1px;
  background: var(--muted);
}

.contact-heading {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 40px;
}

.contact-heading em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Big email button */
.contact-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 16px 28px;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 28px;
}

.contact-email-btn:hover {
  border-color: var(--a1);
  background: color-mix(in srgb, var(--a1) 6%, transparent);
}

.arrow-box {
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  width: 32px;
  height: 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.contact-links a {
  text-decoration: none;
  transition: color 0.15s;
}

.contact-links a:hover { color: var(--a1); }

.dot-sep { color: var(--muted2); }

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding-block: 28px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--muted2);
}

/* ─── OPEN SOURCE ─── */
#opensource { background: color-mix(in srgb, var(--surface) 15%, transparent); }

.os-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.os-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.os-card:hover {
  border-color: color-mix(in srgb, var(--green) 35%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 8%, transparent),
              0 16px 48px -8px rgba(0,0,0,0.4);
}

.os-card-inner {
  display: grid;
  grid-template-columns: 1fr 340px;
}

.os-body {
  padding: 36px;
  border-right: 1px solid var(--border);
}

.os-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.os-repo-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-mono);
}

.os-gh-icon { color: var(--muted); flex-shrink: 0; }

.os-repo-name {
  letter-spacing: 0.01em;
}

.os-pr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: color-mix(in srgb, var(--green) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.15s;
}

.os-pr-badge:hover {
  background: color-mix(in srgb, var(--green) 18%, transparent);
}

.os-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.25;
}

.os-title em { font-style: italic; }

.os-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 20px;
}

.os-desc code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--a1);
}

.os-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.os-chip {
  padding: 4px 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-mono);
}

.os-cta { font-size: 0.85rem; }

.os-visual {
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 28px;
  gap: 16px;
}

.diff-block {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.diff-filename {
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted2);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  letter-spacing: 0.01em;
}

.diff-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  line-height: 1.5;
}

.diff-line + .diff-line {
  border-top: 1px solid var(--border);
}

.diff-line.removed {
  background: color-mix(in srgb, #f87171 6%, transparent);
}

.diff-line.added {
  background: color-mix(in srgb, var(--green) 6%, transparent);
}

.diff-sign {
  flex-shrink: 0;
  width: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
}

.diff-line.removed .diff-sign { color: #f87171; }
.diff-line.added  .diff-sign  { color: var(--green); }

.diff-code {
  color: var(--muted);
  word-break: break-all;
}

.diff-hl-red   { color: #f87171; font-weight: 600; }
.diff-hl-green { color: var(--green); font-weight: 600; }

/* ─── RESEARCH ─── */
.research-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.research-card:hover {
  border-color: color-mix(in srgb, var(--purple) 35%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--purple) 8%, transparent),
              0 16px 48px -8px rgba(0,0,0,0.4);
}

.research-card-inner {
  display: grid;
  grid-template-columns: 1fr 320px;
}

.research-body {
  padding: 36px;
  border-right: 1px solid var(--border);
}

.research-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.research-venue-badge {
  display: inline-block;
  padding: 3px 11px;
  background: color-mix(in srgb, var(--purple) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--purple) 22%, transparent);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.research-domain-badge {
  display: inline-block;
  padding: 3px 11px;
  background: color-mix(in srgb, var(--a1) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--a1) 22%, transparent);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--a1);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.research-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.3;
}

.research-title em { font-style: italic; }

.research-abstract {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 20px;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.rtag {
  padding: 4px 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-mono);
}

.research-cta { font-size: 0.85rem; color: var(--purple); }
.research-cta:hover { color: color-mix(in srgb, var(--purple) 70%, var(--text)); }

.research-visual {
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 28px;
  gap: 16px;
}

.hmm-diagram {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hmm-title-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 4px;
}

.hmm-states-row {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  justify-content: space-between;
}

.hmm-state {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.hmm-state.bull {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 28%, transparent);
  color: var(--green);
}

.hmm-state.bear {
  background: color-mix(in srgb, #f87171 12%, transparent);
  border: 1px solid color-mix(in srgb, #f87171 28%, transparent);
  color: #f87171;
}

.hmm-state.sideways {
  background: color-mix(in srgb, var(--a1) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--a1) 28%, transparent);
  color: var(--a1);
}

.hmm-arrows {
  flex: 1;
  height: 40px;
}

.hmm-arrows-svg {
  width: 100%;
  height: 100%;
}

.hmm-sideways-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.hmm-obs-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 2px;
}

.hmm-obs-label {
  font-size: 0.62rem;
  color: var(--muted2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hmm-obs-prices {
  display: flex;
  gap: 8px;
}

.hmm-p {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.hmm-p.up   { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.hmm-p.dn   { background: color-mix(in srgb, #f87171 15%, transparent); color: #f87171; }
.hmm-p.flat { background: color-mix(in srgb, var(--a1) 12%, transparent); color: var(--a1); }

/* ─── FADE-UP ANIMATIONS ─── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
  .photo-ring { animation: none; }
  .status-dot { animation: none; }
  #loader { display: none; }
}

/* ─── MOBILE MENU ─── */
.nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.nav-menu-btn:hover { color: var(--text); border-color: var(--a1); }
.nav-menu-btn.open  { color: var(--text); border-color: var(--a1); }

.nav-menu-btn .icon-hamburger { display: block; }
.nav-menu-btn .icon-close     { display: none; }
.nav-menu-btn.open .icon-hamburger { display: none; }
.nav-menu-btn.open .icon-close     { display: block; }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-image: radial-gradient(circle, #ffffff05 1px, transparent 1px);
  background-size: 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 24px;
}

.mobile-nav-link {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.15s;
  text-align: center;
  padding: 4px 0;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus { color: var(--text); outline: none; }

.mobile-email-link {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--a1);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--a1) 25%, transparent);
  border-radius: 999px;
  padding: 10px 20px;
  transition: border-color 0.15s, background 0.15s;
}

.mobile-email-link:hover {
  background: color-mix(in srgb, var(--a1) 8%, transparent);
  border-color: var(--a1);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-wide {
    grid-template-columns: 1fr;
  }

  .bento-wide .bento-body {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .bento-wide .bento-visual {
    border-top: 1px solid var(--border);
  }

  .os-card-inner,
  .research-card-inner {
    grid-template-columns: 1fr;
  }

  .os-body,
  .research-body {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .os-visual,
  .research-visual {
    padding: 28px 24px;
  }

  .skills-wrap {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  section { padding-block: 64px; }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 48px;
  }

  .hero-right { order: -1; }

  .photo-wrap {
    width: 160px;
    height: 160px;
  }

  /* Nav: hide links, show hamburger */
  .nav-links      { display: none; }
  .nav-divider    { display: none; }
  .nav-cta        { display: none; }
  .nav-menu-btn   { display: flex; }

  /* Timeline: 2-column (connector + content), no date column */
  .tl-item {
    grid-template-columns: 28px 1fr;
  }

  .tl-left { display: none; }

  .tl-right { padding-left: 16px; }

  /* Card body padding */
  .bento-body,
  .os-body,
  .research-body {
    padding: 24px;
  }

  /* Stats */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding-block: 28px;
  }

  .stat { padding-inline: 0; }

  .stat-sep { display: none; }

  /* Education */
  .edu-card {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }

  /* Contact */
  .contact-email-btn {
    font-size: 1rem;
    padding: 14px 20px;
    word-break: break-all;
    width: 100%;
    justify-content: space-between;
  }

  .contact-heading {
    font-size: clamp(1.8rem, 8vw, 2.8rem);
  }
}

@media (max-width: 520px) {
  section { padding-block: 48px; }

  .container { padding-inline: 16px; }

  .skills-wrap { grid-template-columns: 1fr; }

  .hero-name {
    font-size: clamp(2.2rem, 10vw, 3rem);
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .bento-body,
  .os-body,
  .research-body {
    padding: 20px;
  }

  .os-visual,
  .research-visual {
    padding: 20px 16px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }

  .section-header {
    margin-bottom: 36px;
  }

  .diff-filename,
  .diff-line {
    font-size: 0.62rem;
  }

  .tl-bullets li {
    font-size: 0.83rem;
  }

  .edu-card { padding: 20px; }

  .contact-inner { padding-bottom: 64px; }
}
