:root {
  color-scheme: light dark;

  /* Light theme. Warm-neutral stone palette, one accent */
  --bg: #f4f3ee;
  --bg-raised: #eceae3;
  --fg: 24 24 22;
  --text: #181816;
  --muted: #57564f;
  --faint: #6c6b64;
  --accent: #c2531f;
  --accent-hover: #ad4717;
  --accent-text: #b04a1a;
  --on-accent: #fff8f2;
  --accent-rgb: 194 83 31;
  --shadow-rgb: 60 40 20;
  --canvas-alpha: 0.22;

  --line: rgb(var(--fg) / 0.1);
  --line-strong: rgb(var(--fg) / 0.2);
  --surface: rgb(var(--fg) / 0.025);
  --accent-soft: rgb(var(--accent-rgb) / 0.12);
  --topbar-bg: rgb(244 243 238 / 0.75);

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

  --max-width: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layer scale */
  --z-bg: 0;
  --z-content: 1;
  --z-grain: 40;
  --z-topbar: 50;
  --z-float: 60;
  --z-skip: 100;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0b;
    --bg-raised: #141413;
    --fg: 236 235 230;
    --text: #ecebe6;
    --muted: #a3a29b;
    --faint: #85847d;
    --accent: #e2703f;
    --accent-hover: #ec8154;
    --accent-text: #e8804f;
    --on-accent: #160a04;
    --accent-rgb: 226 112 63;
    --shadow-rgb: 0 0 0;
    --canvas-alpha: 0.16;
    --line: rgb(var(--fg) / 0.09);
    --line-strong: rgb(var(--fg) / 0.18);
    --topbar-bg: rgb(12 12 11 / 0.72);
  }
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/geist.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/geist-mono.woff2") format("woff2");
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  font-family: var(--sans);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--on-accent); }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

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

.arrow { display: inline-block; transition: transform 0.3s var(--ease); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 8px;
  z-index: var(--z-skip);
  font-weight: 600;
}
.skip-link:focus { left: 1rem; }

/* Background layers */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-bg);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 65% 35%, #000 25%, transparent 80%);
  mask-image: radial-gradient(ellipse 90% 80% at 65% 35%, #000 25%, transparent 80%);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 40px; pointer-events: none; }

main, .footer { position: relative; z-index: var(--z-content); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover .arrow { transform: translate(2px, -2px); }
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 0.45rem 0.95rem; font-size: 0.875rem; }
.btn-lg { padding: 0.85rem 1.4rem; font-size: 0.975rem; }

.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / 0.4), 0 8px 30px -8px rgb(var(--accent-rgb) / 0.55), inset 0 1px 0 rgb(255 255 255 / 0.25);
}
.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / 0.55), 0 12px 40px -8px rgb(var(--accent-rgb) / 0.75), inset 0 1px 0 rgb(255 255 255 / 0.3);
  transform: translateY(-1px);
}
.btn-accent .icon { width: 1.05em; height: 1.05em; fill: currentColor; }

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgb(var(--fg) / 0.02);
}
.btn-ghost:hover { border-color: rgb(var(--fg) / 0.35); background: rgb(var(--fg) / 0.06); transform: translateY(-1px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: var(--text);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease), color 0.25s;
  padding-bottom: 2px;
}
.text-link:hover { background-size: 100% 1px; color: var(--accent-text); }
.text-link:hover .arrow { transform: translateX(3px); }

/* Top bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-topbar);
  padding: 0.9rem var(--gutter);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), padding 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: var(--topbar-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
  padding-block: 0.65rem;
}
.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: -0.04em;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.brand-name { font-weight: 500; font-size: 0.95rem; letter-spacing: -0.01em; }

.nav { display: flex; gap: 0.25rem; margin-left: auto; }
.nav a {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); background: rgb(var(--fg) / 0.07); }

.nav .nav-extra { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

/* Hero */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 8.5rem var(--gutter) 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.75fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.status strong { color: var(--text); font-weight: 500; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(var(--fg) / 0.03);
}

.hero h1 {
  font-weight: 600;
  font-size: clamp(3.4rem, 9vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
  margin-top: 1.75rem;
  margin-left: -0.05em;
}
.hero h1 .dot { color: var(--accent-text); }

.headline {
  font-family: var(--mono);
  font-size: clamp(0.8rem, 1.2vw, 0.9rem);
  color: var(--accent-text);
  margin-top: 1.5rem;
  letter-spacing: 0.02em;
}

.summary {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.4vw, 1.14rem);
  line-height: 1.7;
  margin-top: 1.1rem;
  text-wrap: pretty;
}
.summary strong { color: var(--text); font-weight: 500; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  margin-top: 2.25rem;
}
.hero-actions .btn-ghost { margin-left: -0.5rem; }

.hero-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.hero-links a { color: var(--faint); transition: color 0.2s; }
.hero-links a:hover { color: var(--text); }

.portrait { position: relative; justify-self: end; width: 100%; max-width: 360px; }
.portrait-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 6px;
  background: linear-gradient(160deg, rgb(var(--fg) / 0.12), rgb(var(--fg) / 0.02));
  box-shadow: 0 40px 80px -30px rgb(var(--shadow-rgb) / 0.45), inset 0 1px 0 rgb(255 255 255 / 0.08);
  transform: rotate(1.5deg);
  transition: transform 0.6s var(--ease);
}
.portrait-frame img {
  border-radius: calc(var(--radius-lg) - 6px);
}
.portrait:hover .portrait-frame { transform: rotate(0deg) scale(1.01); }

/* Entry animation */
.stagger {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
  animation: rise 1s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 100ms);
}
@keyframes rise { to { opacity: 1; transform: none; filter: blur(0); } }

/* Metrics */
.metrics {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.metric {
  padding: 1.75rem 1.5rem 1.9rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric + .metric { border-left: 1px solid var(--line); }
.metric:first-child { padding-left: 0; }
.metric strong {
  display: block;
  white-space: nowrap;
  font-weight: 500;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-top: 0.75rem;
}

/* Sections */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(5rem, 11vw, 9rem) var(--gutter) 0;
}

.section-head { margin-bottom: 3rem; max-width: 40rem; }
.section-head h2 {
  font-weight: 600;
  font-size: clamp(2.3rem, 5vw, 3.9rem);
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.section-head h2 .dim { color: var(--faint); }
.section-head > p:last-child { color: var(--muted); margin-top: 1rem; font-size: 1.02rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.sticky { position: sticky; top: 7rem; }

/* Scroll reveal */
.reveal:not(.visible) { opacity: 0; }
.reveal.visible { animation: reveal 0.9s var(--ease) var(--delay, 0ms) backwards; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

/* Research */
.pubs { list-style: none; border-top: 1px solid var(--line); }
.pubs li { border-bottom: 1px solid var(--line); }
.pub {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem 10rem minmax(0, 1fr) 2.5rem;
  gap: 1.5rem;
  padding: 2rem 1rem;
  margin: 0 -1rem;
  border-radius: var(--radius-md);
  transition: background 0.35s var(--ease);
}
.pub:hover { background: rgb(var(--fg) / 0.03); }
.pub-idx { font-family: var(--mono); font-size: 0.8rem; color: var(--faint); padding-top: 0.35rem; }
.pub-meta { display: flex; flex-direction: column; gap: 0.35rem; padding-top: 0.25rem; }
.venue {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}
.kind { font-size: 0.8rem; color: var(--faint); }
.pub-body { display: flex; flex-direction: column; gap: 0.65rem; }
.pub-title {
  font-weight: 500;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
  transition: color 0.3s;
}
.pub-desc { color: var(--muted); font-size: 0.97rem; max-width: 62ch; text-wrap: pretty; }
.pub-cta { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); transition: color 0.3s; }
.pub-arrow {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  transition: all 0.35s var(--ease);
}
.pub:hover .pub-title { color: var(--text); }
.pub:hover .pub-cta { color: var(--accent-text); }
.pub:hover .pub-arrow { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: rotate(0) scale(1.05); }

.scholar-banner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 2rem;
  margin-top: 2.5rem;
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, rgb(var(--accent-rgb) / 0.16), transparent 55%),
    var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.scholar-banner-label { font-family: var(--mono); font-size: 0.75rem; color: var(--accent-text); grid-column: 1; }
.scholar-banner-title { font-weight: 500; font-size: clamp(1.25rem, 2.3vw, 1.7rem); line-height: 1.2; letter-spacing: -0.03em; grid-column: 1; }
.scholar-banner-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.2rem;
  transition: transform 0.4s var(--ease);
}
.scholar-banner:hover .scholar-banner-arrow { transform: rotate(45deg) scale(1.06); }

/* Spotlight border, follows the cursor */
.spot { position: relative; isolation: isolate; }
.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--accent-rgb) / 0.75), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: 1;
}
.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--accent-rgb) / 0.06), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: -1;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }

/* Experience */
.timeline { display: flex; flex-direction: column; }
.job {
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
}
.job:first-child { border-top: 0; padding-top: 0.5rem; }
.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
}
.job-meta span:first-child { color: var(--accent-text); }
.job h3 {
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-top: 0.75rem;
}
.job h3 a { transition: color 0.25s; }
.job h3 a .arrow { font-weight: 400; font-size: 0.6em; color: var(--faint); vertical-align: 0.35em; }
.job h3 a:hover { color: var(--accent-text); }
.job h3 a:hover .arrow { transform: translate(2px, -2px); color: var(--accent-text); }
.role { color: var(--text); font-weight: 500; font-size: 0.95rem; margin-top: 0.35rem; }
.job ul { list-style: none; margin-top: 1.1rem; display: grid; gap: 0.6rem; }
.job li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--muted);
  font-size: 0.98rem;
  text-wrap: pretty;
}
.job li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.6rem;
  height: 1px;
  background: var(--line-strong);
}

.education {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.75rem 1.75rem;
  margin-top: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.education h3 { font-weight: 600; font-size: 1.5rem; line-height: 1.1; letter-spacing: -0.035em; margin-top: 0.6rem; }
.education p:not(.job-meta) { color: var(--muted); font-size: 0.93rem; margin-top: 0.3rem; }
.edu-result { text-align: right; }
.edu-result strong { font-weight: 500; font-size: 2rem; line-height: 1; letter-spacing: -0.04em; display: block; font-variant-numeric: tabular-nums; }
.edu-result span { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

/* Projects bento */
.bento {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}
.project {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgb(var(--fg) / 0.035), rgb(var(--fg) / 0.012));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
  transition: transform 0.5s var(--ease), border-color 0.4s;
}
.project.wide { grid-column: span 3; }
.project:hover { transform: translateY(-3px); }
.tag { font-family: var(--mono); font-size: 0.75rem; color: var(--accent-text); }
.project h3 {
  font-weight: 600;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.project-desc { color: var(--muted); font-size: 0.96rem; flex: 1; text-wrap: pretty; }
.stack { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.stack li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.project .text-link { align-self: flex-start; margin-top: 0.4rem; font-size: 0.93rem; }

/* Skills */
.skills { border-top: 1px solid var(--line); }
.skills > div {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.4s var(--ease);
}
.skills > div:hover { padding-left: 0.75rem; }
.skills dt { font-weight: 500; font-size: 0.98rem; }
.skills > div:hover dt { color: var(--accent-text); }
.skills dd { color: var(--muted); font-size: 0.96rem; }

/* Contact */
.contact { padding-bottom: clamp(5rem, 10vw, 8rem); }
.contact .section-head { max-width: none; }
.section-head .contact-title { font-size: clamp(3.75rem, 12vw, 9rem); line-height: 0.9; letter-spacing: -0.06em; }
.email {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
  font-size: clamp(1.4rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  padding-bottom: 0.4rem;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease), color 0.3s;
}
.email .arrow { color: var(--accent-text); }
.email:hover { background-size: 100% 2px; }
.email:hover .arrow { transform: translateX(8px); }

.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  margin-top: 3.5rem;
  border-top: 1px solid var(--line);
}
.contact-list a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.35rem 2.5rem 1.35rem 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.25s;
}
.contact-list span { font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }
.contact-list strong { font-weight: 500; font-size: 0.98rem; }
.contact-list i {
  position: absolute;
  right: 1rem;
  top: 50%;
  translate: 0 -50%;
  font-style: normal;
  color: var(--faint);
  transition: transform 0.3s var(--ease), color 0.25s;
}
.contact-list a:hover strong, .contact-list a:hover i { color: var(--accent-text); }
.contact-list a:hover i { transform: translate(2px, -2px); }

.footer {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--max-width) - 2 * var(--gutter));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 1.75rem 0 2.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
}

.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: var(--z-float);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.3s var(--ease), color 0.25s;
}
.to-top:hover { border-color: var(--accent); color: var(--accent-text); transform: translateY(-2px); }

/* Responsive */
@media (max-width: 1024px) {
  .nav { gap: 0; }
  .nav a { padding: 0.4rem 0.55rem; }
  .brand-name { display: none; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 7.5rem;
  }
  .portrait { justify-self: start; max-width: 200px; order: -1; }
  .portrait-frame { padding: 4px; border-radius: 16px; }
  .portrait-frame img { border-radius: 12px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3) { border-left: 0; padding-left: 0; }
  .metric:nth-child(n + 3) { border-top: 0; }
  .split { grid-template-columns: 1fr; gap: 0; }
  .sticky { position: static; }
  .bento { grid-template-columns: 1fr; }
  .project, .project.wide { grid-column: auto; }
  .pub { grid-template-columns: minmax(0, 1fr) 2.5rem; gap: 0.9rem 1rem; }
  .pub-idx { display: none; }
  .pub-meta { grid-column: 1; flex-direction: row; align-items: center; gap: 0.75rem; padding: 0; }
  .pub-body { grid-column: 1; }
  .pub-arrow { grid-column: 2; grid-row: 1; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter) 1rem;
    background: var(--bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 0.85rem 0; font-size: 1.05rem; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav .nav-extra { display: block; }
  .nav a.active { background: none; color: var(--accent-text); }
  .topbar-actions { margin-left: auto; }
}

@media (max-width: 520px) {
  .hide-sm { display: none; }
  .topbar-actions .btn-ghost { display: none; }
  .skills > div { grid-template-columns: 1fr; }
  .metric strong { font-size: 2.1rem; }
  .metric { padding-inline: 1rem; }
  .skills > div:hover { padding-left: 0; }
  .education { flex-direction: column; align-items: flex-start; }
  .edu-result { text-align: left; }
  .scholar-banner { padding: 1.4rem; }
  .hero-actions .btn-ghost { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .stagger, .reveal:not(.visible) { opacity: 1; transform: none; filter: none; }
}
