/* ============================================================
   XIAOYUN ZHANG — tech-noir portfolio
   ember gradient on near-black · Syne display · JetBrains Mono
   labels · agent-swarm hero canvas · scroll reveals
   ============================================================ */

:root {
  --bg: #08080c;
  --bg-2: #0d0d14;
  --card: rgba(255, 255, 255, 0.028);
  --card-hover: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);
  --text: #eceae6;
  --muted: #97939e;
  --faint: #625e6b;
  --ember: #ff6a3d;
  --ember-2: #ffb03a;
  --ember-grad: linear-gradient(100deg, #ff6a3d 10%, #ffb03a 55%, #ff6a3d 100%);
  --violet: #8b7cf6;
  --steel: #7da3c0;
  --red: #ff2442;
  --font-display: "Space Grotesk", "Noto Sans SC", sans-serif;
  --font-body: "Inter", "Noto Sans SC", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Noto Sans SC", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ember); color: #0a0a0c; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26242e; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--ember); }

a { color: var(--ember); text-decoration: none; transition: color 0.25s; }
a:hover { color: var(--ember-2); }

strong, b { font-weight: 500; color: var(--text); }

.container { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
}
.mono-label a { color: var(--muted); }

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

.glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(120px);
}
.glow-a {
  width: 620px; height: 620px;
  top: -220px; right: -160px;
  background: radial-gradient(circle, rgba(255, 106, 61, 0.16), transparent 65%);
}
.glow-b {
  width: 520px; height: 520px;
  bottom: -200px; left: -180px;
  background: radial-gradient(circle, rgba(139, 124, 246, 0.10), transparent 65%);
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 0 max(28px, 4vw);
  height: 72px;
  border-bottom: 1px solid transparent;
  transition: background 0.35s, border-color 0.35s, height 0.35s;
}
.nav.scrolled {
  background: rgba(8, 8, 12, 0.75);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
  height: 62px;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-right: auto;
  white-space: nowrap;
}
.nav-logo:hover { color: var(--text); }
.nav-logo-dot { color: var(--ember); }

.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 0;
  position: relative;
}
.nav-links a .idx { color: var(--ember); font-size: 0.6rem; margin-right: 6px; opacity: 0.8; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--ember);
  transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 9px 18px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  white-space: nowrap;
}
.nav-cta i { font-size: 0.6rem; transition: transform 0.3s; }
.nav-cta:hover { border-color: var(--ember); color: var(--ember); }
.nav-cta:hover i { transform: translateX(3px); }

.nav-burger { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}

#swarm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 130px 28px 90px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 70px;
  align-items: center;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 8px 18px;
  margin-bottom: 34px;
  background: rgba(8, 8, 12, 0.5);
  backdrop-filter: blur(6px);
}
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #57e389;
  box-shadow: 0 0 0 0 rgba(87, 227, 137, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(87, 227, 137, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(87, 227, 137, 0); }
  100% { box-shadow: 0 0 0 0 rgba(87, 227, 137, 0); }
}

.hero-name {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 4.8vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}
.hero-cn {
  display: inline-block;
  margin-left: 18px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.34em;
  letter-spacing: 0.42em;
  color: var(--muted);
  vertical-align: 0.55em;
  border-left: 2px solid var(--ember);
  padding-left: 16px;
}

.hero-role {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.typed-wrap {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  color: var(--text);
}
.caret {
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -0.12em;
  background: var(--ember);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-intro {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 580px;
  margin: 0 0 26px;
}
.hero-intro strong { color: var(--text); }

.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }

.xhs-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 18px;
  border-top: 1px solid var(--line-soft);
}
.stat {
  padding: 20px 18px 4px 0;
  border-right: 1px solid var(--line-soft);
}
.stat:last-child { border-right: 0; }
.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.1rem;
  color: var(--text);
  line-height: 1;
}
.stat-plus { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--ember); }
.stat-label {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  color: var(--faint);
}

/* photo card */
.hero-right { display: flex; justify-content: flex-end; }

.photo-card {
  width: 100%;
  max-width: 360px;
  padding: 1px;
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(255, 106, 61, 0.55), rgba(255, 255, 255, 0.08) 32%, rgba(255, 255, 255, 0.05) 68%, rgba(255, 176, 58, 0.4));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), 0 0 70px rgba(255, 106, 61, 0.07);
  transition: transform 0.4s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.photo-card:hover { transform: translateY(-6px) rotate(-0.5deg); }

.photo-card-inner {
  background: #0d0d13;
  border-radius: 21px;
  padding: 12px 12px 6px;
}
.photo-card-inner img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 14px;
  filter: saturate(0.96);
}
.photo-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 6px 7px;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  letter-spacing: 0.18em;
  color: var(--faint);
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--faint);
}
.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(var(--ember), transparent);
  animation: drop 1.8s ease-in-out infinite;
  transform-origin: top;
}
@keyframes drop {
  0% { transform: scaleY(0); }
  45% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- marquee ---------- */
.marquee {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  padding: 16px 0;
  background: var(--bg-2);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 34px;
  width: max-content;
  animation: scroll-x 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  color: var(--faint);
  white-space: nowrap;
  text-transform: uppercase;
}
.marquee-track i { color: var(--ember); font-style: normal; font-size: 0.7rem; opacity: 0.7; }
@keyframes scroll-x {
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */
.section { position: relative; z-index: 1; padding: 110px 0 30px; }

.sec-label {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-bottom: 34px;
}
.sec-label .idx { color: var(--ember); }
.sec-label .rule { width: 56px; height: 1px; background: var(--ember); opacity: 0.55; }

.sec-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 26px;
}
.sec-title em {
  font-style: normal;
  background: var(--ember-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sec-sub { margin: -8px 0 44px; }

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  align-items: start;
}
.about-main p { color: var(--muted); font-size: 1.02rem; margin: 0 0 1.1rem; }

.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 9px 18px;
  transition: all 0.3s;
}
.pill-link:hover {
  color: var(--ember);
  border-color: var(--ember);
  box-shadow: 0 0 24px rgba(255, 106, 61, 0.15);
}

.about-side { display: flex; flex-direction: column; gap: 18px; }

.side-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--card);
  padding: 24px 26px;
  backdrop-filter: blur(4px);
}
.side-card-label { margin-bottom: 18px; }

.edu-item { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.edu-item:first-of-type { border-top: 0; padding-top: 0; }
.edu-time { color: var(--ember); margin-bottom: 4px; }
.edu-name { font-weight: 500; font-size: 0.96rem; }
.edu-degree { color: var(--muted); font-size: 0.85rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 11px;
  transition: all 0.3s;
}
.chip:hover { color: var(--ember); border-color: var(--ember); }

/* ---------- research ---------- */
.paper {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 24px;
  padding: 34px 26px;
  margin: 0 -26px;
  border-top: 1px solid var(--line-soft);
  border-radius: 14px;
  transition: background 0.35s, transform 0.35s;
}
.paper:hover { background: var(--card-hover); transform: translateX(6px); }
.paper:last-of-type { border-bottom: 1px solid var(--line-soft); }

.paper-idx { color: var(--faint); font-size: 0.9rem; padding-top: 6px; }

.paper-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }

.venue {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 5px 12px;
  border-radius: 5px;
}
.v-acl   { color: #ffb03a; background: rgba(255, 176, 58, 0.1);  border: 1px solid rgba(255, 176, 58, 0.35); }
.v-emnlp { color: #7da3c0; background: rgba(125, 163, 192, 0.1); border: 1px solid rgba(125, 163, 192, 0.35); }
.v-aaai  { color: #8b7cf6; background: rgba(139, 124, 246, 0.1); border: 1px solid rgba(139, 124, 246, 0.35); }

.role-chip {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  padding: 5px 12px;
  border-radius: 5px;
  color: var(--ember);
  border: 1px dashed rgba(255, 106, 61, 0.5);
}

.paper-title { margin: 0 0 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; line-height: 1.35; letter-spacing: -0.01em; }
.paper-title a { color: var(--text); }
.paper-title a:hover { color: var(--ember); }

.paper-summary { color: var(--muted); font-size: 0.94rem; margin: 0 0 10px; max-width: 760px; }

.paper-authors { font-size: 0.82rem; color: var(--faint); margin-bottom: 16px; }
.paper-authors b { color: var(--ember); font-weight: 600; }
.paper-authors sup { font-size: 0.7em; }

.paper-links { display: flex; flex-wrap: wrap; gap: 22px; }
.paper-links a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: all 0.25s;
}
.paper-links a:hover { color: var(--ember); border-color: var(--ember); }

/* reports */
.reports-head { margin: 74px 0 24px; }
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.report-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--card);
  padding: 22px 22px 20px;
  transition: all 0.35s;
  overflow: hidden;
}
.report-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at 0% 0%, rgba(255, 106, 61, 0.12), transparent 45%);
  opacity: 0;
  transition: opacity 0.35s;
}
.report-card:hover { border-color: rgba(255, 106, 61, 0.45); transform: translateY(-4px); }
.report-card:hover::before { opacity: 1; }
.report-org { font-size: 0.56rem; color: var(--ember); }
.report-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--text); }
.report-desc { font-size: 0.78rem; color: var(--muted); }
.report-arrow {
  position: absolute;
  top: 16px; right: 18px;
  color: var(--faint);
  font-size: 0.9rem;
  transition: all 0.3s;
}
.report-card:hover .report-arrow { color: var(--ember); transform: translate(2px, -2px); }

/* ---------- experience ---------- */
.xp-list { margin-top: 46px; }

.xp {
  display: grid;
  grid-template-columns: 110px 40px 1fr;
  gap: 0 24px;
}

.xp-period { padding-top: 6px; color: var(--faint); line-height: 1.9; }

.xp-node { position: relative; display: flex; flex-direction: column; align-items: center; }
.xp-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ember);
  background: var(--bg);
  margin-top: 8px;
  flex-shrink: 0;
  z-index: 1;
}
.xp-dot.live {
  background: var(--ember);
  box-shadow: 0 0 16px rgba(255, 106, 61, 0.8);
}
.xp-line { width: 1px; flex: 1; background: linear-gradient(var(--line), var(--line-soft)); }
.xp-line.last { background: linear-gradient(var(--line), transparent); }

.xp-body { padding-bottom: 56px; }

.xp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 8px; }
.xp-co { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; }
.xp-cn { font-family: var(--font-mono); font-weight: 400; font-size: 0.78rem; color: var(--faint); letter-spacing: 0.3em; margin-left: 6px; }
.xp-role { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; color: var(--ember); text-transform: uppercase; }

.xp-desc { color: var(--muted); font-size: 0.95rem; max-width: 640px; margin: 0 0 16px; }

.xp-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.xp-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 6px 14px;
  transition: all 0.3s;
}
a.xp-tag:hover { color: var(--ember); border-color: var(--ember); box-shadow: 0 0 18px rgba(255, 106, 61, 0.14); }

/* ---------- off duty / xhs ---------- */
.offduty-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 60px;
  align-items: center;
}
.offduty-intro p { color: var(--muted); font-size: 1rem; max-width: 460px; }

.xhs-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 11px 22px 11px 12px;
  transition: all 0.3s;
}
.xhs-logo {
  background: var(--red);
  color: #fff;
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  border-radius: 100px;
  padding: 5px 12px;
}
.xhs-cta i { font-size: 0.62rem; transition: transform 0.3s; }
.xhs-cta:hover { border-color: var(--red); color: #ff8095; box-shadow: 0 0 26px rgba(255, 36, 66, 0.18); }
.xhs-cta:hover i { transform: translateX(3px); }

.xhs-card {
  position: relative;
  border: 1px solid rgba(255, 36, 66, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(500px circle at 100% 0%, rgba(255, 36, 66, 0.10), transparent 55%),
    var(--card);
  padding: 26px 28px;
  backdrop-filter: blur(4px);
}

.xhs-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.xhs-avatar {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff2442, #ff6a3d);
  color: #fff;
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.xhs-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }
.xhs-bio { font-size: 0.56rem; margin-top: 3px; }
.xhs-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--red);
  border: 1px solid rgba(255, 36, 66, 0.45);
  border-radius: 5px;
  padding: 4px 9px;
}

.xhs-notes { display: flex; flex-direction: column; }
.xhs-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line-soft);
  transition: all 0.25s;
}
.xhs-note span { color: var(--faint); font-size: 0.75rem; transition: all 0.25s; }
.xhs-note:hover { color: var(--text); padding-left: 8px; }
.xhs-note:hover span { color: var(--red); }

.xhs-quote {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  margin-top: 110px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-2);
  padding: 90px 0 36px;
}

.footer-big { display: flex; flex-direction: column; gap: 18px; margin-bottom: 80px; }
.footer-mail {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 6rem);
  letter-spacing: -0.02em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 28px;
  width: fit-content;
  line-height: 1;
}
.footer-mail i {
  font-size: 0.42em;
  color: var(--ember);
  transition: transform 0.35s;
}
.footer-mail:hover { color: var(--ember); }
.footer-mail:hover i { transform: translateX(14px) rotate(-45deg); }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--faint);
}
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ember); }

/* ---------- cite modal ---------- */
.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 8, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-dialog {
  background: #101018;
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 660px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-close {
  background: none; border: 0;
  font-size: 1.5rem; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--ember); }
.modal-body { padding: 18px 22px; max-height: 50vh; overflow: auto; }
.modal-body pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
}
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--line-soft); text-align: right; }

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }
.r1 { transition-delay: 0.05s; }
.r2 { transition-delay: 0.15s; }
.r3 { transition-delay: 0.3s; }
.r4 { transition-delay: 0.4s; }
.r5 { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  .hero-name .line em { animation: none; }
  html { scroll-behavior: auto; }
}

@media (max-height: 780px) {
  .hero-scroll { display: none; }
}

/* screenshot/debug mode: ?flat=1 collapses 100svh hero and forces reveals in */
.flat .hero { min-height: 0; }
.flat .reveal { opacity: 1; transform: none; transition: none; }
.flat .hero-scroll { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav { gap: 20px; }
  .nav-links {
    position: fixed;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(8, 8, 12, 0.97);
    border-bottom: 1px solid var(--line-soft);
    padding: 10px 28px 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
  .nav-links a:last-child { border-bottom: 0; }

  .nav-burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
  }
  .nav-burger span { width: 20px; height: 2px; background: var(--text); transition: transform 0.3s; }
  .nav-burger.open span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

  .nav-cta { display: none; }

  .about-grid, .offduty-grid { grid-template-columns: 1fr; gap: 40px; }

  .paper { grid-template-columns: 1fr; gap: 8px; padding: 28px 18px; margin: 0 -18px; }
  .paper:hover { transform: none; }
  .paper-idx { display: none; }

  .xp { grid-template-columns: 28px 1fr; }
  .xp-period { grid-column: 2; order: -1; padding: 0 0 6px; }
  .xp-node { grid-row: 2; }
  .xp-body { grid-column: 2; }

  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-right { justify-content: center; order: -1; }
  .photo-card { max-width: 270px; }
  .hero-inner { padding-top: 110px; }
}

@media (max-width: 560px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2n) { border-right: 0; }
  .footer-mail { font-size: 2.4rem; gap: 16px; }
  .hero-inner { padding-top: 100px; }
}
