/* ==========================================================================
   Zihan Yan — personal website
   Main colour: Westlake blue #00498F. Accent: Westlake orange #EF8C00, used sparingly.
   Everything else is neutral. Light theme only; desktop first.
   ========================================================================== */

/* fonts are served from this site (latin subsets of the variable fonts), so nothing waits on Google */
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/outfit-latin.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("fonts/jetbrains-mono-latin.woff2") format("woff2"); }

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #334155;
  --ink-2: #5b6576;
  --ink-3: #94a0b2;
  --line: rgba(17, 26, 43, 0.08);
  --line-2: rgba(17, 26, 43, 0.14);

  --blue: #00498f;
  --blue-2: #1a64b3;
  --blue-soft: rgba(0, 73, 143, 0.07);
  --blue-tint: #eaf1f9;
  --orange: #ef8c00;
  --orange-soft: rgba(239, 140, 0, 0.12);

  --shadow-1: 0 1px 2px rgba(17, 26, 43, 0.04), 0 8px 24px rgba(17, 26, 43, 0.06);
  --shadow-2: 0 2px 6px rgba(17, 26, 43, 0.05), 0 24px 60px rgba(17, 26, 43, 0.12);

  --radius: 22px;
  --maxw: 1200px;
  --nav-h: 76px;
  --display: "Outfit", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 10px); -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 3px; border-radius: 8px; }
.container { width: min(var(--maxw), 100% - 64px); margin-inline: auto; }
section { position: relative; }
.section { padding-block: 120px; }

/* one soft blue glow and a faint dot grid at the top of each page */
.backdrop { position: absolute; inset: 0 0 auto 0; height: 900px; z-index: -1; pointer-events: none; overflow: hidden; }
.backdrop::before { content: ""; position: absolute; width: 900px; height: 900px; right: -200px; top: -380px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 73, 143, 0.12), transparent 65%);
  animation: drift 18s ease-in-out infinite alternate; }
.backdrop::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(0, 73, 143, 0.13) 1px, transparent 1.3px); background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(#000, transparent 85%); mask-image: linear-gradient(#000, transparent 85%); opacity: 0.6; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translate(-80px, 60px) scale(1.06); } }

.progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 200; transform-origin: 0 50%; transform: scaleX(0); background: var(--blue); }

/* ---------------------------------------------------------------- type */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--orange); }
.h2 { font-family: var(--display); font-size: 48px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 16px 0 0; text-wrap: balance; color: var(--ink); }
.h2 .hl { color: var(--blue); }
.lead { font-size: 18px; color: var(--ink-2); line-height: 1.7; margin: 16px 0 0; max-width: 640px; }
.lead.wide { max-width: 900px; }
/* highlighter-style emphasis, shared by the bio and project descriptions */
.marker { color: var(--ink); font-weight: 600; background: linear-gradient(transparent 58%, rgba(239, 140, 0, 0.28) 58%, rgba(239, 140, 0, 0.28) 92%, transparent 92%); padding: 0 2px; }
.sec-head { margin-bottom: 52px; }
.sec-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 50px; padding: 0 24px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.25s, color 0.25s, border-color 0.25s; }
.btn svg { width: 18px; height: 18px; flex: none; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { color: #fff; background: var(--blue); box-shadow: 0 10px 24px -10px rgba(0, 73, 143, 0.6); }
.btn-primary:hover { background: var(--blue-2); transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(0, 73, 143, 0.6); }
.btn-ghost { color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }
.btn-white { color: var(--blue); background: #fff; }
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.35); }
.btn-line-w { color: #fff; border: 1px solid rgba(255, 255, 255, 0.45); }
.btn-line-w:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: all 0.25s var(--ease); }
button.chip:hover { color: var(--blue); border-color: var(--blue); }
.chip.active, button.chip.active:hover { color: #fff; background: var(--blue); border-color: var(--blue); }
.chip .n { font-size: 11.5px; opacity: 0.65; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; font: 600 12px var(--font); border: 1px solid var(--line-2); color: var(--ink-3); background: #fff; }

/* ---------------------------------------------------------------- navigation: Westlake logo at top left */
.nav { position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 100; transition: background-color 0.3s, box-shadow 0.3s; }
.nav.scrolled { background: rgba(255, 255, 255, 0.85); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); box-shadow: 0 1px 0 var(--line); }
.nav .container { height: 100%; display: flex; align-items: center; gap: 24px; }
.nav-logo { flex: none; }
.nav-logo img { height: 40px; width: auto; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-links a { position: relative; padding: 8px 14px; font-size: 15px; font-weight: 600; color: var(--ink-2); transition: color 0.2s; }
.nav-links a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--orange); transform: scaleX(0); transition: transform 0.35s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--blue); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav .btn { height: 42px; padding: 0 18px; font-size: 14px; }
.menu-btn { display: none; }

/* ---------------------------------------------------------------- cover */
.cover { position: relative; min-height: 100vh; display: flex; align-items: center; padding: calc(var(--nav-h) + 40px) 0 110px; overflow: hidden;
  background: radial-gradient(70% 80% at 80% 40%, rgba(0, 73, 143, 0.07), transparent 70%), linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%); }
.lattice-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lattice-bg .grid { opacity: 0.55; }
.lattice-bg pattern path { fill: none; stroke: rgba(0, 73, 143, 0.16); stroke-width: 1; }
.lattice-bg pattern circle { fill: rgba(0, 73, 143, 0.3); }
.lattice-bg .site { transform-box: fill-box; transform-origin: center; animation: site 4.5s ease-in-out infinite; animation-delay: var(--delay, 0s); opacity: 0; }
.lattice-bg .site.o { fill: var(--orange); } .lattice-bg .site.b { fill: var(--blue); }
.lattice-bg .halo { fill: none; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: halo 4.5s ease-out infinite; animation-delay: var(--delay, 0s); opacity: 0; }
.lattice-bg .halo.o { stroke: var(--orange); } .lattice-bg .halo.b { stroke: var(--blue); }
@keyframes site { 0%, 100% { opacity: 0; transform: scale(0.6); } 25%, 70% { opacity: 1; transform: scale(1); } }
@keyframes halo { 0% { opacity: 0.6; transform: scale(1); } 60%, 100% { opacity: 0; transform: scale(3.2); } }
.cover-inner { position: relative; z-index: 1; }
.crystal { position: absolute; z-index: 1; right: max(3vw, calc((100vw - var(--maxw)) / 2)); top: 50%; width: min(40vw, 520px); aspect-ratio: 1; transform: translateY(-48%); }
.crystal::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.7) 45%, transparent 70%); }
.crystal canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crystal .cap { position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%); white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.crystal .cap i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 5px 0 12px; vertical-align: 0; }
.crystal .cap .a { background: var(--blue); } .crystal .cap .b { background: var(--orange); } 
.cover-title { margin: 22px 0 0; font-family: var(--display); font-size: clamp(44px, 4.4vw, 64px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; color: var(--ink); }
.cover-inner > * { max-width: 680px; }
.cover-title .to { font-weight: 500; color: var(--ink-3); }
.cover-title .hl { color: var(--blue); background: linear-gradient(transparent 72%, rgba(239, 140, 0, 0.35) 72%, rgba(239, 140, 0, 0.35) 90%, transparent 90%); }
.cover-sub { margin: 24px 0 0; max-width: 540px; font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.cover-sub b { color: var(--blue); font-weight: 700; }
.cover .hero-cta { margin-top: 38px; }
.scroll-cue { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); width: 26px; height: 42px; border-radius: 14px; border: 2px solid var(--line-2); }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--blue); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 60% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- about: profile card on the left, about text on the right */
.about { padding-top: 110px; }
.hero-about { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 80px; align-items: center; }
.hero-about > * { min-width: 0; }
.profile { text-align: center; padding: 40px 32px 34px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.profile .portrait { width: 220px; margin: 0 auto; }
.profile .name { margin: 26px 0 0; font-family: var(--display); font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.profile .name span { color: var(--blue); }
.profile .role-title { margin: 10px 0 0; font-size: 15px; font-weight: 700; color: var(--orange); letter-spacing: 0.04em; }
.profile .affil { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-3); line-height: 1.5; }
.profile .socials { justify-content: center; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.intro .h2 { margin-bottom: 24px; }
.intro .edu { margin-top: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.socials { display: flex; gap: 10px; }
.social { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); transition: all 0.3s var(--ease); }
.social svg { width: 18px; height: 18px; }
.social:hover { color: #fff; background: var(--blue); border-color: var(--blue); transform: translateY(-3px); }

/* ---------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.stat { padding: 30px 32px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .num { font-family: var(--display); font-size: 52px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--blue); font-variant-numeric: tabular-nums; }
.stat .num sup { font-size: 0.5em; color: var(--orange); top: -0.8em; margin-left: 2px; }
.stat .lbl { margin-top: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink-3); }

/* ---------------------------------------------------------------- cards */
.card { position: relative; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.3s; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); border-color: rgba(0, 73, 143, 0.18); }
.card[data-tilt]:hover { transform: none; }

/* ---------------------------------------------------------------- portrait, bio and education (inside the hero) */
.portrait { position: relative; width: 100%; aspect-ratio: 1; }
.portrait .ring { position: absolute; inset: 0; border-radius: 50%; padding: 5px; background: conic-gradient(from var(--ang, 0deg), var(--blue) 0deg, var(--blue) 250deg, var(--orange) 300deg, var(--blue) 360deg);
  animation: spin-ang 10s linear infinite; box-shadow: var(--shadow-2); }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin-ang { to { --ang: 360deg; } }
.portrait .ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 6px solid #fff; }
.bio { font-size: 18px; line-height: 1.85; color: var(--ink-2); margin: 0; text-align: justify; }
.bio b { color: var(--ink); font-weight: 700; }
.bio b { color: var(--blue); }
.bio .num-hl { color: var(--orange); }
.bio i { font-style: italic; color: var(--ink); }
.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 34px; }
.edu-card { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; padding: 22px; }
.edu-card .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.edu-card.now .ic { color: #fff; background: var(--blue); }
.edu-card .ic svg { width: 21px; height: 21px; }
.edu-card .yr { font-size: 12.5px; font-weight: 700; color: var(--orange); letter-spacing: 0.04em; }
.edu-card b { display: block; margin-top: 4px; font-family: var(--display); font-size: 18px; font-weight: 600; line-height: 1.3; }
.edu-card small { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-3); }

/* ---------------------------------------------------------------- research */
.research { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.r-card { padding: 30px; display: flex; flex-direction: column; overflow: hidden; }
.r-card .top { display: flex; align-items: center; justify-content: space-between; }
.r-card .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); transition: all 0.4s var(--ease); }
.r-card .ic svg { width: 25px; height: 25px; }
.r-card:hover .ic { background: var(--blue); color: #fff; }
.r-card .no { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--ink-3); }
.r-card h3 { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 26px 0 0; color: var(--ink); }
.r-card p { margin: 10px 0 0; color: var(--ink-2); line-height: 1.7; font-size: 15.5px; }
.r-card .viz { margin-top: 26px; height: 170px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.r-card .viz svg { width: 100%; height: 100%; }
.r-card .kws { margin-top: 18px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.v-orb ellipse { fill: none; stroke: rgba(0, 73, 143, 0.22); stroke-width: 1.5; }
.v-orb .nuc { fill: var(--orange); }
.v-orb .e { fill: var(--blue); }
.v-orb .rot { transform-origin: 150px 85px; animation: spin 28s linear infinite; }
.v-nn line { stroke: rgba(0, 73, 143, 0.18); stroke-width: 1.3; }
.v-nn line.f { stroke: var(--blue); stroke-width: 2; stroke-dasharray: 8 60; animation: flow 2.4s linear infinite; }
.v-nn circle { fill: #fff; stroke: var(--blue); stroke-width: 2; }
.v-nn circle.out { fill: var(--orange); stroke: var(--orange); }
.viz text { font: 600 11.5px var(--font); fill: var(--ink-3); }
@keyframes flow { to { stroke-dashoffset: -68; } }
.v-neb .axis { stroke: var(--line-2); stroke-width: 1.5; fill: none; }
.v-neb .curve { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; }
.v-neb .area { fill: var(--blue-soft); }
.v-neb .ion { fill: var(--orange); }
.v-neb .ea { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 3 4; }

/* ---------------------------------------------------------------- publications (home) */
.pub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.pub { display: flex; flex-direction: column; overflow: hidden; }
.pub .im { position: relative; height: 210px; background: #fff; display: grid; place-items: center; padding: 18px; border-bottom: 1px solid var(--line); overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.pub .im img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.7s var(--ease); }
.pub:hover .im img { transform: scale(1.05); }
.pub .im .role { position: absolute; top: 14px; left: 14px; }
.pub .body { padding: 22px 24px; display: flex; flex-direction: column; flex: 1; }
.pub h3 { margin: 0; font-family: var(--display); font-size: 19px; line-height: 1.38; font-weight: 600; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.25s; }
.pub:hover h3 { color: var(--blue); }
.pub .au { margin: 10px 0 18px; font-size: 13.5px; color: var(--ink-3); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.au strong { color: var(--ink); font-weight: 700; }
.pc-foot { margin-top: auto; display: flex; align-items: center; gap: 12px; }
.jr { min-width: 0; font-size: 13.5px; font-weight: 600; font-style: italic; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go { flex: none; margin-left: auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--blue); border: 1px solid var(--line-2); transition: all 0.35s var(--ease); }
.go svg { width: 16px; height: 16px; }
.pub:hover .go { background: var(--blue); border-color: var(--blue); color: #fff; transform: rotate(-45deg); }
.role { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--ink-2); background: #eef1f5; }
.role.first { color: #fff; background: var(--blue); }
.role.co-first { color: #a35f00; background: #fdf0dc; }

/* ---------------------------------------------------------------- gallery strip */
.strip { overflow: hidden; padding-block: 12px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.strip-track { display: flex; gap: 20px; width: max-content; animation: marquee 90s linear infinite; }
.strip:hover .strip-track { animation-play-state: paused; }
.strip .ph { flex: none; height: 300px; border-radius: 20px; overflow: hidden; background: var(--blue-tint); cursor: zoom-in; box-shadow: var(--shadow-1); transition: transform 0.45s var(--ease), box-shadow 0.45s; }
.strip .ph:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); }
.strip .ph img { height: 100%; width: auto; max-width: none; object-fit: cover; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- projects: GPUMDkit (light terminal) and ServerIsland */
.project { padding: 48px; display: grid; gap: 56px; align-items: center; }
.project + .project { margin-top: 28px; }
.project:hover { transform: none; }
.project > * { min-width: 0; }
.gk { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
.si { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.p-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.gk-wordmark { height: 46px; width: auto; }
.stars { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px; background: var(--orange-soft); color: #a35f00; font-size: 13px; font-weight: 700; white-space: nowrap; transition: transform 0.25s var(--ease); }
.stars[hidden] { display: none; }
.stars svg { width: 14px; height: 14px; color: var(--orange); }
.stars:hover { transform: translateY(-2px); }
.project p { color: var(--ink-2); margin: 20px 0 0; line-height: 1.8; font-size: 16px; }
.project p b { color: var(--ink); font-weight: 700; }
.tag-b, .tag-o { display: inline-block; padding: 0 8px; border-radius: 6px; font-weight: 700; line-height: 1.6; }
.tag-b { color: var(--blue); background: var(--blue-soft); }
.tag-o { color: #a35f00; background: var(--orange-soft); }
.gk-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.gk-feats a { display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); font-size: 14.5px; font-weight: 600;
  transition: all 0.25s var(--ease); }
.gk-feats a svg { width: 19px; height: 19px; color: var(--blue); flex: none; }
.gk-feats a:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.gk-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.si-shot { display: block; padding: 14px; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-2); background: linear-gradient(160deg, #1b2236, #05070c); }
.si-shot img { border-radius: 14px; }
.si-shot img { width: 100%; height: auto; transition: transform 0.8s var(--ease); }
.si-shot:hover img { transform: scale(1.03); }
.si-name { display: flex; align-items: center; gap: 14px; }
.si-name img { width: 56px; height: 56px; border-radius: 14px; }
.si-name b { display: block; font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.si-name small { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.si-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 9px; }
.si-list li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); }
.si-list svg { width: 18px; height: 18px; padding: 3px; border-radius: 50%; color: #fff; background: var(--blue); flex: none; }
.si-list code { font-family: var(--mono); font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.project .si-meta { margin-top: 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.term { border-radius: 18px; background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow-2); overflow: hidden; }
.term-bar { position: relative; height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #f3f5f8; border-bottom: 1px solid var(--line); }
.term-bar i { width: 12px; height: 12px; border-radius: 50%; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar .t { position: absolute; left: 0; right: 0; text-align: center; font: 500 12px/1 var(--mono); color: var(--ink-3); pointer-events: none; }
.term-body { height: 390px; padding: 18px 20px; font: 12.5px/1.6 var(--mono); color: #24292f; white-space: pre; overflow: hidden; }
.term-body .d { color: #8c959f; } .term-body .b { color: var(--blue); font-weight: 600; } .term-body .o { color: #c46f00; font-weight: 600; } .term-body .g { color: #1a7f37; font-weight: 600; }
.term-body .cur { display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.2em; background: var(--blue); animation: blink 1s steps(1) infinite; }
.install { display: flex; align-items: center; gap: 12px; margin: 0 14px 14px; padding: 10px 10px 10px 16px; border-radius: 12px; background: #f6f8fa; border: 1px solid var(--line); font: 500 12.5px/1.5 var(--mono); }
.install .ps { color: var(--orange); user-select: none; }
.install code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.install code::-webkit-scrollbar { display: none; }
.copy-btn { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); transition: all 0.2s; }
.copy-btn:hover { color: var(--blue); background: var(--blue-soft); }
.copy-btn svg { width: 16px; height: 16px; }
.copy-btn .ok { display: none; color: #1a7f37; }
.copy-btn.done .ok { display: block; }
.copy-btn.done .cp { display: none; }

/* ---------------------------------------------------------------- contact */
.contact { position: relative; overflow: hidden; isolation: isolate; border-radius: 32px; padding: 80px 64px; text-align: center; color: #fff; background: var(--blue); }
.contact::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.3px); background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 15%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 50%, #000 15%, transparent 70%); }
.contact::after { content: ""; position: absolute; z-index: -1; width: 380px; height: 380px; right: -120px; bottom: -200px; border-radius: 50%; border: 40px solid rgba(239, 140, 0, 0.5); animation: drift 14s ease-in-out infinite alternate; }
.contact .eyebrow { color: #fff; }
.contact h2 { font-family: var(--display); font-size: 56px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; margin: 18px 0 0; }
.contact p { margin: 16px auto 0; max-width: 560px; color: rgba(255, 255, 255, 0.8); font-size: 18px; }
.contact .hero-cta { justify-content: center; }

/* ---------------------------------------------------------------- footer */
.footer { margin-top: 110px; padding: 56px 0 28px; background: #fff; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer .wl { height: 48px; width: auto; }
.footer p { font-size: 14.5px; line-height: 1.75; color: var(--ink-3); margin: 18px 0 0; }
.footer h5 { margin: 0 0 16px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.footer ul a { font-size: 14.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 10px; transition: color 0.2s; }
.footer ul a svg { width: 16px; height: 16px; color: var(--ink-3); transition: color 0.2s; }
.footer ul a:hover, .footer ul a:hover svg { color: var(--blue); }
.footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-3); }
.footer-bottom .visits { display: flex; gap: 18px; }
.footer-bottom .visits b { color: var(--ink-2); font-weight: 700; }
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 90; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--blue);
  box-shadow: var(--shadow-2); opacity: 0; transform: translateY(16px); pointer-events: none; transition: all 0.4s var(--ease); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--blue-2); transform: translateY(-3px); }
.to-top svg { width: 19px; height: 19px; }

/* ---------------------------------------------------------------- reveal */
.reveal { transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal:not(.in) { opacity: 0; transform: translateY(28px); }
.card.reveal.in { transition: opacity 0.9s var(--ease), transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.3s; }

/* ---------------------------------------------------------------- toast + lightbox */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-2); transition: all 0.4s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; color: var(--orange); }
.lightbox { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 40px 90px; background: rgba(10, 18, 32, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 14px; background: #fff; transform: scale(0.96); transition: transform 0.45s var(--ease), opacity 0.25s; }
.lightbox.open img { transform: none; }
.lightbox img.swap { opacity: 0; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); transition: background-color 0.2s; }
.lb-btn:hover { background: var(--blue); border-color: var(--blue); }
.lb-btn svg { width: 19px; height: 19px; }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; margin-top: -24px; }
.lb-next { right: 20px; top: 50%; margin-top: -24px; }
.lb-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.75); }

/* ---------------------------------------------------------------- sub-pages */
.page-hero { padding-top: calc(var(--nav-h) + 90px); padding-bottom: 40px; }
.page-title { font-family: var(--display); font-weight: 800; font-size: 88px; line-height: 1; letter-spacing: -0.045em; margin: 18px 0 0; color: var(--ink); }
.page-title .dot { color: var(--orange); }
.page-hero .stats { margin-top: 44px; }
.toolbar { position: sticky; top: var(--nav-h); z-index: 50; padding: 14px 0; background: rgba(246, 248, 251, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.toolbar .container { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 320px; }
.search svg { position: absolute; left: 15px; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; color: var(--ink-3); }
.search input { width: 100%; height: 42px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; padding: 0 42px; font: 500 14.5px var(--font); color: var(--ink); outline: 0; transition: border-color 0.2s, box-shadow 0.2s; }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.search kbd { position: absolute; right: 12px; top: 50%; margin-top: -11px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters + .filters { padding-left: 12px; border-left: 1px solid var(--line-2); }
.filters .chip { height: 34px; padding: 0 13px; }
.result-count { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.year-block { padding-block: 40px 16px; }
.yb-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.yb-head b { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1; letter-spacing: -0.03em; color: var(--ink); }
.yb-head span { height: 28px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 700; }
.yb-head i { flex: 1; height: 1px; background: var(--line-2); }
.pcard .im { cursor: zoom-in; }
.pcard .meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pcard .meta .date, .abs-body .meta .date { white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pcard h3 a { transition: color 0.2s; }
.pcard h3 a:hover { color: var(--blue); }
.pub .jr { display: block; margin: -6px 0 18px; white-space: normal; }
.pub .pc-foot { gap: 10px; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--line); }
.pub .more { font-size: 13.5px; font-weight: 700; color: var(--blue); }
.abs-btn { flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--line-2); transition: all 0.25s var(--ease); }
.abs-btn:hover { color: var(--blue); border-color: var(--blue); }
.pub .go { margin-left: 0; }
.pcard:hover .go { background: var(--blue); border-color: var(--blue); color: #fff; transform: rotate(-45deg); }
.abs-modal { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 40px; background: rgba(10, 18, 32, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.abs-modal.open { opacity: 1; pointer-events: auto; }
.abs-box { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); width: min(980px, 100%); max-height: calc(100vh - 80px); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-2); overflow: hidden;
  transform: translateY(16px) scale(0.98); transition: transform 0.4s var(--ease); }
.abs-modal.open .abs-box { transform: none; }
.abs-im { background: #fff; display: grid; place-items: start center; padding: 34px 24px; border-right: 1px solid var(--line); }
.abs-im img { max-height: 360px; width: 100%; object-fit: contain; }
.abs-body { padding: 34px 36px; overflow-y: auto; }
.abs-body .meta { display: flex; align-items: center; gap: 10px; }
.abs-body h3 { margin: 14px 40px 0 0; font-family: var(--display); font-size: 25px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
.abs-body .au { margin: 12px 0 0; font-size: 14.5px; color: var(--ink-3); line-height: 1.6; }
.abs-body .jr { display: block; margin-top: 8px; white-space: normal; }
.abs-body h4 { margin: 24px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.abs-text { margin: 10px 0 26px; font-size: 15.5px; line-height: 1.8; color: var(--ink-2); }
.abs-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); background: var(--bg); transition: all 0.2s; z-index: 1; }
.abs-close:hover { color: #fff; background: var(--blue); }
.abs-close svg { width: 18px; height: 18px; }
mark.hit { background: var(--orange-soft); color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 rgba(239, 140, 0, 0.6); }
.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); font-weight: 600; }

.masonry { columns: 3 300px; column-gap: 20px; }
.m-item { display: block; width: 100%; break-inside: avoid; margin: 0 0 20px; border-radius: 18px; overflow: hidden; background: var(--blue-tint); cursor: zoom-in; position: relative;
  box-shadow: var(--shadow-1); transition: transform 0.45s var(--ease), box-shadow 0.45s; }
.m-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
.m-item img { width: 100%; height: auto; transition: transform 0.9s var(--ease), opacity 0.6s; }
.m-item img[data-loading] { opacity: 0; }
.m-item:hover img { transform: scale(1.04); }

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 1100px) {
  .crystal { width: 38vw; }
  .hero-about { grid-template-columns: 300px minmax(0, 1fr); gap: 48px; }
  .project { padding: 36px; gap: 36px; }
}

/* tablets and large phones: menu button, single-column sections, crystal below the cover text */
@media (max-width: 960px) {
  .nav { background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); box-shadow: 0 1px 0 var(--line); }
  .menu-btn { display: grid; margin-left: auto; width: 44px; height: 44px; border-radius: 12px; place-items: center; color: var(--blue); }
  .menu-btn:hover, .nav.menu-open .menu-btn { background: var(--blue-soft); }
  .menu-btn svg { width: 22px; height: 22px; }
  .nav-links { position: fixed; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px 24px 20px;
    background: #fff; box-shadow: 0 18px 40px rgba(17, 26, 43, 0.12); border-top: 1px solid var(--line);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.25s, transform 0.3s var(--ease); }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 15px 4px; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a::after { display: none; }
  .nav-links a.active { color: var(--blue); }

  .section { padding-block: 88px; }
  .h2 { font-size: 38px; }
  .sec-head { margin-bottom: 36px; }
  .sec-head.row { flex-wrap: wrap; align-items: flex-start; }

  .cover { min-height: auto; flex-direction: column; align-items: stretch; padding: calc(var(--nav-h) + 56px) 0 56px; }
  .cover-inner { order: 1; }
  .crystal { order: 2; position: relative; right: auto; top: auto; transform: none; width: min(78vw, 440px); margin: 28px auto 0; opacity: 1; }
  .scroll-cue { display: none; }

  .about { padding-top: 88px; }
  .hero-about { grid-template-columns: 1fr; gap: 40px; }
  .profile { max-width: 440px; width: 100%; margin: 0 auto; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .research { grid-template-columns: 1fr; }
  .pub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project, .gk, .si { grid-template-columns: 1fr; }
  .si-shot { max-width: 520px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: span 2; }

  .page-hero { padding-top: calc(var(--nav-h) + 64px); }
  .page-title { font-size: 64px; }
  .filters + .filters { padding-left: 0; border-left: 0; }
  .result-count { margin-left: 0; width: 100%; }
  .abs-box { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .abs-im { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px; }
  .abs-im img { max-height: 220px; }
}

/* phones */
@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .container { width: calc(100% - 32px); }
  .nav-logo img { height: 32px; }
  .nav-links { padding: 4px 16px 16px; }
  .section { padding-block: 64px; }
  .h2 { font-size: 30px; }
  .lead { font-size: 16px; }
  .eyebrow { font-size: 12px; }
  .btn { height: 46px; padding: 0 20px; font-size: 14.5px; }

  .cover { padding: calc(var(--nav-h) + 36px) 0 40px; }
  .cover-title { font-size: clamp(32px, 9.4vw, 44px); margin-top: 16px; }
  .cover-sub { font-size: 16px; margin-top: 18px; }
  .cover .hero-cta { margin-top: 28px; }
  .cover .hero-cta .btn { flex: 1; }
  .crystal { width: min(88vw, 380px); margin-top: 20px; }
  .crystal .cap { font-size: 12px; }

  .about { padding-top: 64px; }
  .profile { padding: 30px 20px 26px; }
  .profile .portrait { width: 180px; }
  .profile .name { font-size: 30px; }
  .bio { font-size: 16px; line-height: 1.8; text-align: left; }
  .edu { grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
  .edu-card { padding: 18px; }

  .stat { padding: 20px; }
  .stat .num { font-size: 36px; }
  .stat .lbl { font-size: 13px; }

  .r-card { padding: 24px; }
  .r-card h3 { font-size: 23px; margin-top: 20px; }
  .r-card .viz { height: 150px; }
  .pub-grid { grid-template-columns: 1fr; gap: 18px; }
  .pub .im { height: 190px; }
  .strip .ph { height: 210px; border-radius: 16px; }
  .strip-track { gap: 14px; }

  .project { padding: 22px; gap: 26px; border-radius: 22px; }
  .project + .project { margin-top: 20px; }
  .gk-wordmark { height: 34px; }
  .project p { font-size: 15px; }
  .gk-feats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gk-feats a { padding: 11px 12px; font-size: 13.5px; gap: 8px; }
  .gk-cta .btn { flex: 1; }
  .term-body { font-size: 8.4px; height: 280px; padding: 14px 12px; }
  .install { font-size: 11px; margin: 0 10px 10px; padding: 8px 8px 8px 12px; }
  .si-name img { width: 46px; height: 46px; }
  .si-name b { font-size: 24px; }
  .si-list li { font-size: 14px; align-items: flex-start; }
  .si-list svg { margin-top: 2px; }

  .contact { padding: 52px 22px; border-radius: 24px; }
  .contact h2 { font-size: 32px; }
  .contact p { font-size: 16px; }
  .contact .btn { width: 100%; }
  .footer { margin-top: 72px; padding-top: 44px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-grid > :first-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }

  .page-hero { padding-top: calc(var(--nav-h) + 40px); padding-bottom: 24px; }
  .page-title { font-size: 46px; }
  .toolbar { position: relative; top: auto; padding: 10px 0; }
  .toolbar .container { gap: 8px; }
  .search { max-width: none; flex-basis: 100%; }
  .search kbd { display: none; }
  .filters { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; padding-bottom: 2px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .chip { flex: none; height: 32px; font-size: 13px; }
  .year-block { padding-block: 28px 8px; }
  .yb-head { margin-bottom: 18px; }
  .yb-head b { font-size: 28px; }
  .abs-modal { padding: 0; align-items: end; }
  .abs-box { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .abs-body { padding: 22px 20px 28px; }
  .abs-body h3 { font-size: 20px; }
  .masonry { columns: 2; column-gap: 10px; }
  .m-item { margin-bottom: 10px; border-radius: 12px; }
  .lightbox { padding: 60px 10px 80px; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js .reveal:not(.in) { opacity: 1; transform: none; }
}
