/* =========================================================
   Zhiyu Ni — personal site
   Concept: Neuro ⇄ Symbolic. Dark editorial, one warm accent.
   ========================================================= */

:root {
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "PingFang SC", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --wrap: 1120px;
  --radius: 18px;
}

[data-theme="dark"] {
  --bg: #0b0b0d;
  --bg-2: #111114;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #ece9e2;
  --muted: #9a978f;
  --faint: #5f5d58;
  --accent: #f3b33d;          /* Berkeley-gold, warmed */
  --accent-2: #7aa7ff;        /* cool secondary for symbols */
  --accent-ink: #1a1306;
  --glow: rgba(243, 179, 61, .14);
  --grain-op: .07;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f6f3ec;
  --bg-2: #efebe2;
  --surface: rgba(20, 18, 12, .03);
  --surface-2: rgba(20, 18, 12, .06);
  --line: rgba(20, 18, 12, .1);
  --line-2: rgba(20, 18, 12, .2);
  --text: #18160f;
  --muted: #6b675d;
  --faint: #a29d90;
  --accent: #b9770e;
  --accent-2: #2e5bd8;
  --accent-ink: #fffaf0;
  --glow: rgba(185, 119, 14, .12);
  --grain-op: .05;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .5s var(--ease), color .5s var(--ease);
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--accent-ink); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
kbd {
  font-family: var(--mono); font-size: .72em;
  padding: .1em .45em; border-radius: 6px;
  border: 1px solid var(--line-2); background: var(--surface);
  color: var(--muted);
}
.mono { font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; }
.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }

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

/* ---------- grain + progress ---------- */
.grain {
  pointer-events: none; position: fixed; inset: -50%; z-index: 100;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) }
  40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-1%) } 80% { transform: translate(3%,3%) }
}
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 50; width: min(1160px, 100% - 24px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-color: var(--line);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.nav__logo { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.nav__mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  font-family: var(--serif); font-style: italic; font-size: 16px;
  background: var(--text); color: var(--bg);
}
.nav__name { font-size: 15px; letter-spacing: -.01em; }
.nav__links { display: flex; gap: 4px; }
.nav__links a {
  position: relative; padding: 6px 12px; border-radius: 999px;
  font-size: 14px; color: var(--muted); transition: color .25s, background .25s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); background: var(--surface-2); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.kbd-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13px; color: var(--muted);
  transition: border-color .25s, color .25s;
}
.kbd-btn:hover { border-color: var(--line-2); color: var(--text); }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted); transition: color .25s, border-color .25s, transform .5s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); transform: rotate(25deg); }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px 0 90px; overflow: hidden;
}
#neuro { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 20% 45%, color-mix(in srgb, var(--bg) 85%, transparent) 0%, transparent 70%),
    linear-gradient(to bottom, transparent 70%, var(--bg));
}
.hero__inner { position: relative; z-index: 2; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 28px;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(6px);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: ping 2.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.55) } 70% { box-shadow: 0 0 0 9px rgba(61,220,132,0) } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0) } }

.hero__title {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(64px, 13vw, 184px); line-height: .9; letter-spacing: -.035em;
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: .1em .3em;
}
.hero__title .line {
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 55%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__cn {
  font-family: var(--sans); font-weight: 300; font-size: .22em; letter-spacing: .25em;
  color: var(--muted); padding-bottom: .55em;
  writing-mode: horizontal-tb;
}
.hero__lede {
  margin: 28px 0 0; max-width: 640px;
  font-size: clamp(20px, 2.3vw, 28px); line-height: 1.35; letter-spacing: -.015em; color: var(--muted);
}
.hero__lede em { font-family: var(--serif); font-size: 1.12em; color: var(--text); font-style: italic; }

.formula {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: clamp(12px, 1.4vw, 15px);
  color: var(--text); padding: 12px 18px; border-radius: 12px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px); max-width: 100%; min-height: 48px;
}
.formula__prompt { color: var(--accent); }
#typed { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
#typed .q { color: var(--accent-2); }
#typed .p { color: var(--accent); }
.caret { width: 8px; height: 1.15em; background: var(--accent); animation: blink 1s steps(1) infinite; flex: none; }
@keyframes blink { 50% { opacity: 0 } }

.hero__cta { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px; font-size: 15px; font-weight: 500;
  transition: transform .35s var(--ease), background .3s, border-color .3s, color .3s;
  will-change: transform;
}
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary svg { transition: transform .35s var(--ease); }
.btn--primary:hover svg { transform: translateX(4px); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--text); background: color-mix(in srgb, var(--bg) 50%, transparent); }
.btn--ghost:hover { border-color: var(--text); }
.btn--sm { padding: 9px 16px; font-size: 13.5px; margin-top: 18px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 4px; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border-radius: 999px;
  font-size: 14.5px; color: var(--muted); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 50%, transparent); backdrop-filter: blur(6px);
  transition: color .25s, border-color .25s, transform .35s var(--ease);
}
.socials a:last-child { width: 46px; padding: 0; justify-content: center; }
.socials a:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint);
}
.scroll-hint i { width: 1px; height: 42px; background: linear-gradient(var(--faint), transparent); position: relative; overflow: hidden; }
.scroll-hint i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--accent); animation: drip 2.2s var(--ease) infinite; }
@keyframes drip { to { top: 110% } }

/* ---------- marquee ---------- */
.marquee {
  border-block: 1px solid var(--line); overflow: hidden; padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; gap: 36px; width: max-content; animation: marquee 40s linear infinite; }
.marquee span { font-family: var(--serif); font-size: 26px; letter-spacing: -.01em; color: var(--muted); white-space: nowrap; }
.marquee b { color: var(--accent); font-weight: 400; align-self: center; font-size: 14px; }
@keyframes marquee { to { transform: translateX(-50%) } }

/* ---------- sections ---------- */
.section { padding: 130px 0 20px; scroll-margin-top: 40px; }
.section__head { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 20px; margin-bottom: 56px; }
.section__idx { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.section__head h2 {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 6vw, 80px); line-height: 1; letter-spacing: -.03em;
}
.section__sub { grid-column: 2; margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.section__sub em { font-family: var(--serif); font-size: 1.15em; color: var(--text); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 5fr 7fr; gap: 72px; align-items: start; }
.portrait { margin: 0; position: sticky; top: 110px; }
.portrait__frame {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
}
.portrait__frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  transition: transform 1.2s var(--ease);
}
.portrait__frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 55%, transparent), transparent 40%);
}
.portrait:hover img { transform: scale(1.03); }
.portrait figcaption { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--muted); }

.about__text p { margin: 0 0 22px; color: var(--muted); }
.about__text strong { color: var(--text); font-weight: 500; }
.about__text .big { font-size: clamp(21px, 2.1vw, 26px); line-height: 1.45; letter-spacing: -.012em; color: var(--text); }
.about__text .big em { font-family: var(--serif); font-style: italic; font-size: 1.12em; color: var(--text); }
.hl { font-family: var(--serif); font-style: italic; font-size: 1.12em; color: var(--accent); }
.link { color: var(--text); background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat, linear-gradient(var(--line-2), var(--line-2)) 0 100% / 100% 1px no-repeat; transition: background-size .45s var(--ease); padding-bottom: 1px; }
.link:hover { background-size: 100% 1px, 100% 1px; }

.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 36px 0 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); }
.facts div { background: var(--bg); padding: 16px 18px; }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.facts dd { margin: 4px 0 0; font-size: 15px; }

/* ---------- glow cards (shared) ---------- */
[data-glow] { position: relative; isolation: isolate; }
[data-glow]::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%);
  opacity: 0; transition: opacity .4s;
}
[data-glow]:hover::before { opacity: 1; }

/* ---------- research cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px 26px;
  background: var(--surface); transition: border-color .4s, transform .5s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-4px); }
.card__sym {
  font-family: var(--serif); font-size: 64px; line-height: 1; letter-spacing: .02em; margin-bottom: 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card h3 { margin: 0 0 12px; font-size: 20px; font-weight: 500; letter-spacing: -.015em; line-height: 1.3; }
.card p { margin: 0 0 22px; color: var(--muted); font-size: 15.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tags li { font-family: var(--mono); font-size: 11.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

/* ---------- publications ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--muted);
  transition: all .3s var(--ease);
}
.chip span { font-family: var(--mono); font-size: 11px; opacity: .7; margin-left: 4px; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

.pubs { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.pub { border-bottom: 1px solid var(--line); transition: opacity .4s var(--ease); }
.pub.is-hidden { display: none; }
.pub__row {
  width: 100%; text-align: left; display: grid; grid-template-columns: 80px 1fr 28px; gap: 24px; align-items: start;
  padding: 26px 4px; transition: padding .4s var(--ease);
}
.pub__row:hover { padding-left: 14px; }
.pub__year { font-family: var(--mono); font-size: 13px; color: var(--faint); padding-top: 6px; }
.pub__main { display: flex; flex-direction: column; gap: 6px; }
.pub__title { font-size: clamp(18px, 1.9vw, 22px); line-height: 1.32; letter-spacing: -.015em; font-weight: 450; transition: color .3s; }
.pub__row:hover .pub__title { color: var(--accent); }
.pub__authors { font-size: 14px; color: var(--muted); }
.pub__authors b { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.pub__venue { font-family: var(--mono); font-size: 12.5px; color: var(--accent); letter-spacing: .02em; }
.badge { font-style: normal; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; }
.pub__plus { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); margin-top: 2px; transition: transform .45s var(--ease), border-color .3s; }
.pub__plus::before, .pub__plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.4px; background: currentColor; transform: translate(-50%, -50%); }
.pub__plus::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .45s var(--ease); }
.pub.is-open .pub__plus { transform: rotate(180deg); border-color: var(--accent); color: var(--accent); }
.pub.is-open .pub__plus::after { transform: translate(-50%, -50%) rotate(0); }
.pub__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.pub.is-open .pub__more { grid-template-rows: 1fr; }
.pub__more > div { overflow: hidden; padding-left: 108px; padding-right: 52px; }
.pub__more p { margin: 0 0 16px; color: var(--muted); font-size: 15.5px; max-width: 70ch; }
.pub.is-open .pub__more > div { padding-bottom: 26px; }
.metrics { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.metrics li { font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 10px; background: var(--surface-2); }
.metrics b { font-family: var(--mono); color: var(--text); font-weight: 500; }
.pub__links { display: flex; gap: 16px; }
.pub__links a { font-family: var(--mono); font-size: 13px; color: var(--text); border-bottom: 1px solid var(--line-2); transition: color .25s, border-color .25s; }
.pub__links a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 190px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--line-2), var(--line) 80%, transparent); }
.tl { display: grid; grid-template-columns: 190px 1fr; gap: 0 48px; padding: 22px 24px 22px 0; border-radius: 16px; }
.tl__when { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 4px; text-align: right; padding-right: 0; position: relative; }
.tl__when::after {
  content: ""; position: absolute; right: -53px; top: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--faint); transition: all .35s var(--ease);
}
.tl:hover .tl__when::after, .tl:first-child .tl__when::after { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--glow); }
.tl h3 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.015em; }
.tl h3 span { color: var(--muted); font-weight: 400; }
.tl__where { margin: 4px 0 8px !important; font-size: 14px; color: var(--faint) !important; }
.tl p { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 64ch; }

/* ---------- news ---------- */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.news time { font-family: var(--mono); font-size: 13px; color: var(--accent); padding-top: 3px; }
.news p { margin: 0; color: var(--muted); }
.news b { color: var(--text); font-weight: 500; }
.news__old { display: none !important; }
.news.is-expanded .news__old { display: grid !important; animation: fadeUp .6s var(--ease) both; }

/* ---------- bento ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: var(--surface); transition: border-color .4s; }
.tile:hover { border-color: var(--line-2); }
.tile--wide { grid-column: 1 / -1; }
.tile__k { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.tile h3 { margin: 14px 0 6px; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.08; letter-spacing: -.02em; }
.tile p { margin: 0; color: var(--muted); font-size: 14.5px; }
.venues { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 16px 0 0; }
.venues li { font-family: var(--serif); font-size: 26px; padding: 2px 18px; border-radius: 999px; border: 1px solid var(--line); }

/* ---------- visitor globe ---------- */
.globe-wrap { display: grid; grid-template-columns: 7fr 5fr; gap: 56px; align-items: center; }
.globe { position: relative; aspect-ratio: 1; width: 100%; max-width: 620px; margin-inline: auto; }
.globe::before {
  content: ""; position: absolute; inset: 8%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, var(--glow), transparent 75%); filter: blur(30px);
}
.globe canvas { position: relative; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; opacity: 0; transition: opacity 1.2s var(--ease); }
.globe canvas.is-ready { opacity: 1; }
.globe canvas:active { cursor: grabbing; }
.globe__hint { position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%); color: var(--faint); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.gstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 0 32px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); }
.gstats div { background: var(--bg); padding: 18px 16px; }
.gstats dt { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.gstats dd { margin: 6px 0 0; font-family: var(--serif); font-size: clamp(34px, 3.4vw, 46px); line-height: 1; letter-spacing: -.02em; }
.gtop__title { margin: 0 0 10px; font-size: 11px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.gtop { list-style: none; padding: 0; margin: 0; }
.gtop li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px dashed var(--line); font-size: 15px; }
.gtop li span:first-child { color: var(--text); }
.gtop li small { color: var(--faint); margin-left: 6px; font-size: 12.5px; }
.gtop li b { font-family: var(--mono); font-weight: 400; font-size: 13px; color: var(--accent); }
.gtop li i { position: absolute; left: 0; bottom: -1px; height: 1px; background: var(--accent); opacity: .7; transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.2s var(--ease); }
.globe-stats.is-in .gtop li i { transform: scaleX(var(--w, 0)); }
.gtop__empty { color: var(--muted); font-size: 14.5px !important; }
.gnote { margin: 18px 0 0; color: var(--faint); font-size: 11.5px; }

/* ---------- contact ---------- */
.contact { margin-top: 140px; padding: 140px 0 0; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.contact::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 900px; height: 500px; transform: translate(-50%, -55%);
  background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none;
}
.contact__title {
  margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 9vw, 132px); line-height: .95; letter-spacing: -.035em;
}
.contact__title em { color: var(--accent); }
.contact__row { margin-top: 48px; }
.email {
  display: inline-flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  font-size: clamp(22px, 3vw, 36px); letter-spacing: -.02em;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-2); transition: border-color .3s;
}
.email:hover { border-color: var(--accent); }
.email__hint { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.contact__links { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 32px; }
.contact__links a { font-size: 15px; color: var(--muted); transition: color .25s; }
.contact__links a:hover { color: var(--accent); }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 90px 0 36px; color: var(--faint); font-size: 13px; }

/* ---------- palette ---------- */
.palette { position: fixed; inset: 0; z-index: 80; display: grid; place-items: start center; padding-top: 14vh; }
.palette[hidden] { display: none; }
.palette__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); animation: fade .25s both; }
.palette__box {
  position: relative; width: min(580px, 100% - 32px); border-radius: 16px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); animation: pop .3s var(--ease) both;
}
.palette input {
  width: 100%; padding: 20px 22px; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 17px var(--sans); border-bottom: 1px solid var(--line);
}
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 340px; overflow-y: auto; }
.palette li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; cursor: pointer; font-size: 15px; color: var(--muted);
}
.palette li small { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.palette li.is-sel { background: var(--surface-2); color: var(--text); }
.palette li.is-sel small { color: var(--accent); }
.palette__foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.palette__foot kbd { margin-right: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .4s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98) } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .nav__links { display: none; }
  .about { grid-template-columns: 1fr; gap: 48px; }
  .portrait { position: relative; top: 0; max-width: 420px; }
  .cards, .bento { grid-template-columns: 1fr; }
  .globe-wrap { grid-template-columns: 1fr; gap: 32px; }
  .timeline::before { left: 7px; }
  .tl { grid-template-columns: 1fr; padding: 18px 0 18px 36px; }
  .tl__when { text-align: left; margin-bottom: 6px; }
  .tl__when::after { right: auto; left: -33px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .kbd-btn span { display: none; }
  .nav__name { display: none; }
  .section { padding-top: 96px; }
  .section__head { grid-template-columns: 1fr; }
  .section__sub { grid-column: 1; }
  .pub__row { grid-template-columns: 1fr 28px; gap: 14px; }
  .pub__year { display: none; }
  .pub__more > div { padding-left: 4px; padding-right: 4px; }
  .news li { grid-template-columns: 1fr; gap: 4px; }
  .facts { grid-template-columns: 1fr; }
  .socials { margin-left: 0; }
}

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