:root {
  --ink: #101820;
  --paper: #e9f7ff;
  --paper-strong: #f8fcff;
  --night: #081018;
  --acid: #d9ff43;
  --cyan: #6ee7ee;
  --orange: #ff6b35;
  --line: rgba(16, 24, 32, 0.17);
  --muted: #52616c;
  --card-bg: rgba(255, 255, 255, 0.48);
  --interactive-accent: #b93d16;
  --section-glow: rgba(27, 174, 230, 0.28);
  --glass-bg: rgba(248, 252, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-shadow: 0 18px 60px rgba(38, 112, 146, 0.1);
  --max: 1240px;
  --radius: 24px;
  --font-sans: "Manrope", "Noto Sans SC", sans-serif;
  --font-display: "Newsreader", "Noto Serif SC", serif;
  --font-mono: "DM Mono", monospace;
  --paint-blue: rgba(62, 154, 214, 0.34);
  --paint-cyan: rgba(86, 215, 226, 0.3);
  --paint-coral: rgba(255, 125, 91, 0.25);
  --paint-violet: rgba(133, 104, 208, 0.2);
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #edf1e8;
  --paper: #0d151d;
  --paper-strong: #121f29;
  --line: rgba(255, 255, 255, 0.16);
  --muted: #9aa6ad;
  --card-bg: rgba(255, 255, 255, 0.025);
  --interactive-accent: #ff9368;
  --section-glow: rgba(61, 210, 244, 0.22);
  --glass-bg: rgba(13, 25, 34, 0.62);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  --paint-blue: rgba(61, 161, 219, 0.2);
  --paint-cyan: rgba(91, 220, 230, 0.16);
  --paint-coral: rgba(255, 117, 82, 0.14);
  --paint-violet: rgba(157, 120, 230, 0.18);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

main section[id] {
  scroll-margin-top: 92px;
}

body {
  margin: 0;
  overflow-x: hidden;
  isolation: isolate;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 20%, rgba(114, 211, 250, 0.22), transparent 28%),
    radial-gradient(circle at 88% 55%, rgba(110, 231, 238, 0.13), transparent 25%),
    var(--paper);
  background-attachment: fixed;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

main,
footer {
  position: relative;
  z-index: 1;
}

body,
.hero,
.site-header,
.hero-panel,
.project-card {
  transition:
    color 260ms ease,
    background-color 260ms ease,
    border-color 260ms ease;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--interactive-accent);
  outline-offset: 4px;
}

button {
  color: inherit;
  font: inherit;
}

[data-en][data-zh] {
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.language-fading [data-en][data-zh] {
  opacity: 0;
  transform: translateY(4px);
}

.lang-toggle:disabled {
  cursor: wait;
}

::view-transition-old(root) {
  animation: 220ms cubic-bezier(0.4, 0, 1, 1) both language-view-out;
}

::view-transition-new(root) {
  animation: 360ms cubic-bezier(0.16, 1, 0.3, 1) both language-view-in;
}

@keyframes language-view-out {
  to {
    opacity: 0;
  }
}

@keyframes language-view-in {
  from {
    opacity: 0;
  }
}

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

.watercolor-canvas {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.watercolor-wash {
  position: absolute;
  width: 52vw;
  height: 52vw;
  min-width: 520px;
  min-height: 520px;
  border-radius: 43% 57% 62% 38% / 48% 36% 64% 52%;
  filter: blur(30px);
  opacity: 0.52;
  mix-blend-mode: normal;
  animation: watercolor-drift 18s ease-in-out infinite alternate;
  will-change: transform;
}

html[data-theme="dark"] .watercolor-wash {
  opacity: 0.28;
  mix-blend-mode: normal;
}

.wash-cobalt {
  top: -18vw;
  left: -16vw;
  background:
    radial-gradient(ellipse at 56% 52%, var(--paint-blue), transparent 67%);
}

.wash-cyan {
  top: 24vh;
  right: -22vw;
  background:
    radial-gradient(ellipse at 44% 48%, var(--paint-cyan), transparent 68%);
  animation-delay: -5s;
}

.wash-coral {
  bottom: -20vw;
  left: 10vw;
  background:
    radial-gradient(ellipse at 50% 46%, var(--paint-coral), transparent 66%);
  animation-delay: -9s;
}

.wash-violet {
  right: 12vw;
  bottom: 15vh;
  width: 38vw;
  height: 38vw;
  background:
    radial-gradient(ellipse at 52% 48%, var(--paint-violet), transparent 65%);
  animation-delay: -13s;
}

.wash-coral,
.wash-violet {
  animation: none;
  will-change: auto;
}

@keyframes watercolor-drift {
  0% {
    border-radius: 43% 57% 62% 38% / 48% 36% 64% 52%;
    transform: translate3d(-2%, -1%, 0) rotate(-3deg) scale(0.98);
  }
  100% {
    border-radius: 58% 42% 39% 61% / 37% 59% 41% 63%;
    transform: translate3d(3%, 2%, 0) rotate(4deg) scale(1.06);
  }
}

.cursor-glow {
  position: fixed;
  z-index: 90;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(32, 173, 232, 0.22), rgba(32, 173, 232, 0) 68%);
  mix-blend-mode: multiply;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 220ms ease;
  will-change: transform;
}

html[data-theme="dark"] .cursor-glow {
  background: radial-gradient(circle, rgba(110, 231, 238, 0.18), rgba(110, 231, 238, 0) 68%);
  mix-blend-mode: screen;
}

body.cursor-active .cursor-glow {
  opacity: 1;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: var(--acid);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.muted {
  color: var(--muted);
}

.site-header {
  position: fixed;
  z-index: 95;
  top: 14px;
  left: 50%;
  display: flex;
  width: min(calc(100% - 48px), var(--max));
  height: 68px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  color: white;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  transform: translateX(-50%);
}

.brand,
.header-actions,
.desktop-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
}

.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  border: 0;
  filter: drop-shadow(0 6px 12px rgba(25, 105, 142, 0.18));
  transition: filter 180ms ease, transform 180ms ease;
}

.brand:hover .brand-mark {
  filter: drop-shadow(0 8px 16px rgba(25, 105, 142, 0.28));
  transform: rotate(-3deg) scale(1.04);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.desktop-nav {
  gap: 24px;
  font-size: 13px;
  font-weight: 600;
}

.desktop-nav a {
  position: relative;
  opacity: 0.7;
  transition: opacity 180ms ease;
}

.desktop-nav a::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: var(--acid);
  content: "";
  transform: scaleX(0);
  transition: transform 180ms ease;
}

html:not([data-theme="dark"]) .desktop-nav a::after {
  height: 2px;
  background: #005f87;
  box-shadow: 0 1px 6px rgba(0, 95, 135, 0.28);
}

html[data-theme="dark"] .desktop-nav a::after {
  background: var(--cyan);
  box-shadow: 0 1px 7px rgba(110, 231, 238, 0.3);
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  opacity: 1;
}

.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after {
  transform: scaleX(1);
}

.header-actions {
  gap: 22px;
}

.lang-toggle,
.theme-toggle {
  padding: 0;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  background: none;
  cursor: pointer;
}

.lang-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
}

.lang-toggle .lang-active {
  color: white;
}

.theme-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  transition: border-color 180ms ease, background 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--acid);
  background: rgba(217, 255, 67, 0.1);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.theme-toggle .sun-icon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}

html[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}

.header-cta {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  font-size: 12px;
  transition: color 180ms ease, background 180ms ease;
}

.header-cta:hover {
  color: var(--night);
  background: var(--acid);
}

.hero {
  position: relative;
  display: grid;
  min-height: 820px;
  padding: 180px max(24px, calc((100vw - var(--max)) / 2)) 100px;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.65fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
  overflow: hidden;
  color: white;
  background: var(--night);
}

.hero-watercolor {
  --hero-paint-x: 0px;
  --hero-paint-y: 0px;
  position: absolute;
  z-index: 0;
  inset: -7%;
  overflow: hidden;
  pointer-events: none;
  transform: translate3d(var(--hero-paint-x), var(--hero-paint-y), 0) scale(1.04);
  transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-watercolor::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--night) 0%, rgba(8, 16, 24, 0.91) 24%, transparent 62%),
    linear-gradient(180deg, rgba(8, 16, 24, 0.25), transparent 45%, rgba(8, 16, 24, 0.18));
  content: "";
}

.hero-watercolor svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-paint {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.hero.watercolor-paused .hero-paint {
  animation-play-state: paused;
}

.hero-paint-mountain {
  fill: url("#mountain-wash");
  opacity: 0.2;
  animation: hero-watercolor-mountain 42s ease-in-out -12s infinite alternate;
}

.hero-mountain-echo {
  opacity: 0.28;
}

.hero-paint-river,
.hero-paint-horizon,
.hero-contours {
  fill: none;
  stroke-linecap: round;
}

.hero-paint-river {
  animation: hero-watercolor-river 34s ease-in-out -9s infinite alternate;
}

.hero-river-outer,
.hero-river-middle,
.hero-river-core {
  stroke: url("#river-wash");
}

.hero-river-outer {
  stroke-width: 330;
  opacity: 0.08;
}

.hero-river-middle {
  stroke-width: 240;
  opacity: 0.11;
}

.hero-river-core {
  stroke-width: 145;
  opacity: 0.1;
}

.hero-paint-horizon {
  animation: hero-watercolor-horizon 46s ease-in-out -21s infinite alternate;
}

.hero-horizon-outer,
.hero-horizon-inner {
  stroke: url("#violet-wash");
}

.hero-horizon-outer {
  stroke-width: 260;
  opacity: 0.09;
}

.hero-horizon-inner {
  stroke-width: 150;
  opacity: 0.11;
}

.hero-paint-sun {
  fill: url("#sun-wash");
  opacity: 0.52;
  animation: hero-watercolor-sun 38s ease-in-out -15s infinite alternate;
}

.hero-sun-core {
  fill: #ff8263;
  opacity: 0.46;
}

.hero-contours {
  stroke: rgba(192, 240, 245, 0.16);
  stroke-width: 1.5;
  opacity: 0.55;
}

@keyframes hero-watercolor-mountain {
  from { transform: translate3d(0, -1%, 0) scale(1.01); }
  to { transform: translate3d(-1.5%, 1%, 0) scale(1.035); }
}

@keyframes hero-watercolor-river {
  from { transform: translate3d(-1%, 1%, 0) rotate(-0.7deg); }
  to { transform: translate3d(1.5%, -1%, 0) rotate(0.8deg); }
}

@keyframes hero-watercolor-horizon {
  from { transform: translate3d(-1.2%, 0, 0) scale(0.99); }
  to { transform: translate3d(1.2%, -0.8%, 0) scale(1.025); }
}

@keyframes hero-watercolor-sun {
  from { transform: translate3d(-4px, 3px, 0) scale(0.96); }
  to { transform: translate3d(5px, -4px, 0) scale(1.04); }
}

.hero-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0.09;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.hero::after {
  position: absolute;
  right: -180px;
  bottom: -350px;
  width: 720px;
  height: 720px;
  border: 1px solid rgba(217, 255, 67, 0.22);
  border-radius: 50%;
  box-shadow:
    0 0 0 90px rgba(217, 255, 67, 0.025),
    0 0 0 180px rgba(217, 255, 67, 0.018);
  content: "";
}

html:not([data-theme="dark"]) .site-header {
  color: var(--ink);
  border-bottom-color: rgba(16, 24, 32, 0.17);
}

html:not([data-theme="dark"]) .brand-mark,
html:not([data-theme="dark"]) .header-cta {
  border-color: rgba(16, 24, 32, 0.35);
}

html:not([data-theme="dark"]) .desktop-nav a,
html:not([data-theme="dark"]) .lang-toggle,
html:not([data-theme="dark"]) .theme-toggle {
  color: rgba(16, 24, 32, 0.58);
}

html:not([data-theme="dark"]) .lang-toggle .lang-active {
  color: var(--ink);
}

html:not([data-theme="dark"]) .theme-toggle {
  border-color: rgba(16, 24, 32, 0.24);
}

html:not([data-theme="dark"]) .header-cta:hover {
  color: var(--paper-strong);
  background: var(--ink);
}

html:not([data-theme="dark"]) .hero {
  color: var(--ink);
  background: #dff3ff;
}

html:not([data-theme="dark"]) .hero-watercolor::after {
  background:
    linear-gradient(90deg, #dff3ff 0%, rgba(223, 243, 255, 0.91) 27%, transparent 66%),
    linear-gradient(180deg, rgba(223, 243, 255, 0.18), transparent 48%, rgba(223, 243, 255, 0.22));
}

html:not([data-theme="dark"]) .hero-paint-mountain {
  opacity: 0.22;
}

html:not([data-theme="dark"]) .hero-river-outer {
  opacity: 0.1;
}

html:not([data-theme="dark"]) .hero-river-middle,
html:not([data-theme="dark"]) .hero-river-core {
  opacity: 0.14;
}

html:not([data-theme="dark"]) .hero-horizon-outer {
  opacity: 0.11;
}

html:not([data-theme="dark"]) .hero-horizon-inner {
  opacity: 0.13;
}

html:not([data-theme="dark"]) .hero-paint-sun {
  opacity: 0.68;
}

html:not([data-theme="dark"]) .hero-contours {
  stroke: rgba(22, 112, 151, 0.18);
}

html:not([data-theme="dark"]) .hero-grid {
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(16, 24, 32, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 32, 0.35) 1px, transparent 1px);
}

html:not([data-theme="dark"]) .hero::after {
  border-color: rgba(0, 137, 148, 0.28);
  box-shadow:
    0 0 0 90px rgba(0, 137, 148, 0.035),
    0 0 0 180px rgba(0, 137, 148, 0.025);
}

html:not([data-theme="dark"]) .eyebrow,
html:not([data-theme="dark"]) .hero-intro {
  color: rgba(16, 24, 32, 0.66);
}

html:not([data-theme="dark"]) .status-dot {
  background: var(--orange);
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.7);
}

html:not([data-theme="dark"]) .hero-outline {
  -webkit-text-stroke-color: rgba(16, 24, 32, 0.65);
}

html:not([data-theme="dark"]) .hero .text-link {
  border-bottom-color: rgba(16, 24, 32, 0.4);
}

html:not([data-theme="dark"]) .hero-panel {
  border-color: rgba(16, 24, 32, 0.2);
  background: var(--glass-bg);
}

html:not([data-theme="dark"]) .avatar {
  border-color: rgba(16, 24, 32, 0.22);
}

html:not([data-theme="dark"]) .profile-id {
  color: rgba(16, 24, 32, 0.52);
}

html:not([data-theme="dark"]) .profile-id .mono {
  color: var(--ink);
}

html:not([data-theme="dark"]) .signal,
html:not([data-theme="dark"]) .profile-stats,
html:not([data-theme="dark"]) .profile-stats div + div {
  border-color: rgba(16, 24, 32, 0.14);
}

html:not([data-theme="dark"]) .signal span {
  background: #008996;
}

html:not([data-theme="dark"]) .profile-stats dd {
  color: rgba(16, 24, 32, 0.48);
}

.hero-copy,
.hero-panel {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.68);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 16px var(--acid);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

html[lang="zh-CN"] .hero h1 {
  letter-spacing: -0.045em;
  line-height: 1.04;
}

html[lang="zh-CN"] .section h2,
html[lang="zh-CN"] .contact-section h2 {
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.hero h1 {
  max-width: 880px;
  margin-bottom: 32px;
  font-size: clamp(58px, 7.3vw, 108px);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.92;
}

.hero h1 span {
  display: block;
}

.hero-outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.62);
}

.hero-intro {
  max-width: 690px;
  margin-bottom: 38px;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.7;
}

.hero-actions,
.contact-actions {
  display: flex;
  gap: 28px;
  align-items: center;
}

.button {
  display: inline-flex;
  gap: 26px;
  align-items: center;
  justify-content: center;
  padding: 16px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--night);
  background: var(--acid);
}

.button-primary:hover {
  box-shadow: 0 12px 36px rgba(217, 255, 67, 0.2);
}

.text-link {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 13px;
  font-weight: 600;
}

.hero-panel {
  align-self: end;
  margin-bottom: 10px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.profile-top {
  display: flex;
  gap: 20px;
  align-items: center;
}

.avatar {
  width: 84px;
  height: 84px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  object-fit: cover;
}

.profile-id {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
}

.profile-id .mono {
  color: white;
  font-size: 14px;
}

.signal {
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.signal span {
  width: 3px;
  background: var(--cyan);
  animation: signal 2.3s ease-in-out infinite alternate;
}

.signal span:nth-child(1) { height: 8px; }
.signal span:nth-child(2) { height: 15px; animation-delay: -0.4s; }
.signal span:nth-child(3) { height: 25px; animation-delay: -1s; }
.signal span:nth-child(4) { height: 12px; animation-delay: -1.6s; }
.signal span:nth-child(5) { height: 31px; animation-delay: -0.8s; }
.signal span:nth-child(6) { height: 19px; animation-delay: -1.9s; }

@keyframes signal {
  to { transform: scaleY(0.35); opacity: 0.5; }
}

.profile-stats {
  display: grid;
  margin: 0;
  padding: 24px 0;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.profile-stats div + div {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
}

.profile-stats dt {
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 19px;
}

.profile-stats dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
  line-height: 1.4;
  text-transform: uppercase;
}

.profile-focus {
  padding-top: 22px;
}

.profile-focus .mono {
  font-size: 9px;
}

.profile-focus p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.marquee {
  overflow: hidden;
  padding: 15px 0;
  color: var(--night);
  background: var(--acid);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 28px;
  align-items: center;
  animation: marquee 34s linear infinite;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.marquee-track i {
  font-size: 6px;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.section {
  position: relative;
  isolation: isolate;
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px 24px;
}

.section::before,
.contact-section::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  content: "";
  transition: opacity 260ms ease;
}

.section::before,
.contact-section::before {
  background:
    radial-gradient(
      circle 100px at var(--section-pointer-x, 50%) var(--section-pointer-y, 50%),
      rgba(255, 255, 255, 0.6),
      transparent 72%
    ),
    radial-gradient(
      circle 520px at var(--section-pointer-x, 50%) var(--section-pointer-y, 50%),
      var(--section-glow),
      transparent 70%
    );
}

html[data-theme="dark"] .section::before,
html[data-theme="dark"] .contact-section::before {
  background:
    radial-gradient(
      circle 100px at var(--section-pointer-x, 50%) var(--section-pointer-y, 50%),
      rgba(110, 231, 238, 0.2),
      transparent 72%
    ),
    radial-gradient(
      circle 520px at var(--section-pointer-x, 50%) var(--section-pointer-y, 50%),
      var(--section-glow),
      transparent 70%
    );
}

.section.pointer-lit::before,
.contact-section.pointer-lit::before {
  opacity: 1;
}

.section > *,
.contact-section > * {
  position: relative;
  z-index: 1;
}

.section-heading {
  display: flex;
  margin-bottom: 64px;
  align-items: end;
  justify-content: space-between;
  gap: 50px;
}

.section-index {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 10px;
}

.section h2,
.contact-section h2 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(42px, 5vw, 70px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
}

.project-filters {
  display: flex;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.filter {
  padding: 9px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 9px;
  transition: color 150ms ease, background 150ms ease;
}

.filter.active {
  color: white;
  background: var(--ink);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.project-card {
  position: relative;
  display: flex;
  min-height: 440px;
  padding: 28px;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  transition: border-color 200ms ease, transform 200ms ease, background 200ms ease;
}

.project-card:hover {
  border-color: rgba(16, 24, 32, 0.5);
  background: var(--paper-strong);
  transform: translateY(-4px);
}

.project-featured {
  display: grid;
  min-height: 520px;
  grid-column: 1 / -1;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  color: white;
  background: var(--night);
}

.project-featured:hover {
  border-color: var(--night);
  background: var(--night);
}

html[data-theme="dark"] .filter.active {
  color: var(--night);
  background: var(--acid);
}

html[data-theme="dark"] .project-card:not(.project-featured):hover {
  border-color: rgba(217, 255, 67, 0.5);
}

.project-number {
  position: absolute;
  z-index: 2;
  top: 26px;
  left: 28px;
  color: var(--muted);
  font-size: 9px;
}

.project-featured .project-number {
  color: rgba(255, 255, 255, 0.45);
}

.project-body {
  display: flex;
  height: 100%;
  padding-top: 76px;
  flex-direction: column;
}

.project-featured .project-body {
  padding: 80px 24px 24px 0;
}

.project-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.project-meta span,
.tag-list li {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.project-featured .project-meta span {
  border-color: rgba(255, 255, 255, 0.2);
}

.project-card h3 {
  margin: auto 0 17px;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -0.045em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.project-card p {
  max-width: 540px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.project-featured p {
  color: rgba(255, 255, 255, 0.58);
}

.project-card a {
  display: flex;
  padding-top: 18px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.project-featured a {
  border-color: rgba(255, 255, 255, 0.17);
}

.project-visual {
  position: relative;
  overflow: hidden;
  margin: 54px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(rgba(110, 231, 238, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 238, 0.08) 1px, transparent 1px),
    #0b1721;
  background-size: 28px 28px;
}

.chip {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 170px;
  height: 170px;
  place-items: center;
  border: 1px solid var(--cyan);
  box-shadow:
    inset 0 0 40px rgba(110, 231, 238, 0.08),
    0 0 60px rgba(110, 231, 238, 0.08);
  transform: translate(-50%, -50%) rotate(45deg);
}

.chip::before,
.chip::after {
  position: absolute;
  inset: 15px;
  border: 1px dashed rgba(217, 255, 67, 0.4);
  content: "";
}

.chip::after {
  inset: 35px;
  border-style: solid;
  border-color: rgba(110, 231, 238, 0.3);
}

.chip span,
.chip small {
  position: absolute;
  z-index: 2;
  transform: rotate(-45deg);
}

.chip span {
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.08em;
}

.chip small {
  margin-top: 48px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 9px;
}

.trace {
  position: absolute;
  height: 1px;
  background: var(--cyan);
  opacity: 0.6;
}

.trace::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 10px var(--acid);
  content: "";
}

.trace-a { top: 24%; left: 0; width: 35%; }
.trace-b { right: 0; bottom: 23%; width: 31%; }
.trace-c { top: 69%; left: 6%; width: 24%; transform: rotate(90deg); }

.project-card.is-hidden {
  display: none;
}

.ecosystem-section .section-lead {
  color: var(--muted);
}

.org-strip {
  display: grid;
  margin-bottom: 18px;
  padding: 22px 24px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  transition: border-color 180ms ease, transform 180ms ease;
}

.org-strip:hover {
  border-color: var(--orange);
  transform: translateY(-3px);
}

.org-strip img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.org-strip-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.org-strip-copy .mono,
.org-strip-meta {
  color: var(--muted);
  font-size: 8px;
}

.org-strip-copy strong {
  font-size: 22px;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.org-strip-copy > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.org-strip-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.org-strip-actions a {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.org-strip-actions a:hover {
  color: var(--interactive-accent);
  border-color: var(--interactive-accent);
  background: var(--card-bg);
}

.repo-logo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.repo-logo-card {
  display: flex;
  min-width: 0;
  min-height: 310px;
  padding: 24px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.repo-logo-card:hover {
  z-index: 1;
  color: var(--interactive-accent);
  background: var(--paper-strong);
  box-shadow: 0 16px 46px rgba(16, 24, 32, 0.08);
  transform: translateY(-5px);
}

.repo-logo {
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 38px;
  place-items: center;
  border-radius: 19px;
  color: white;
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.05em;
}

.logo-argus {
  color: var(--night);
  background: var(--acid);
}

.logo-microsoft {
  background: #2076d2;
}

.logo-fla {
  color: var(--night);
  background: var(--cyan);
  font-size: 13px;
}

.logo-h3 {
  background: #7a4ce0;
}

.logo-mac {
  color: var(--night);
  background: #d5d9dd;
}

.logo-hilbert {
  background: #1d7d63;
  font-size: 13px;
}

.logo-comfy {
  background: #bf4b78;
}

.logo-ace {
  background: var(--orange);
}

.repo-owner {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.repo-logo-card > strong {
  margin-bottom: 12px;
  font-size: 21px;
  letter-spacing: -0.035em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.repo-summary {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.repo-card-footer {
  display: flex;
  margin-top: auto;
  padding-top: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 7px;
}

.repo-card-footer > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.repo-card-footer i {
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
}

.research-section {
  max-width: none;
  padding-right: max(24px, calc((100vw - var(--max)) / 2));
  padding-left: max(24px, calc((100vw - var(--max)) / 2));
  color: white;
  background: var(--night);
}

.research-section .section-index {
  color: var(--cyan);
}

.section-lead {
  max-width: 390px;
  margin: 0;
  color: rgba(255, 255, 255, 0.53);
  font-size: 14px;
  line-height: 1.7;
}

.publication {
  display: grid;
  padding: 32px 0;
  grid-template-columns: 80px minmax(0, 1fr) 230px 30px;
  gap: 20px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.17);
}

.publication:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.17);
}

.publication:hover {
  color: var(--acid);
}

.publication-year,
.publication-type {
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
}

.publication-main {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.publication-main strong {
  font-size: 21px;
}

.publication-main span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

.publication-arrow {
  font-size: 19px;
  text-align: right;
  transition:
    color 220ms ease,
    transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.research-links {
  display: flex;
  margin-top: 34px;
  justify-content: flex-end;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.about-section {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(60px, 10vw, 150px);
}

.about-content {
  padding-top: 45px;
}

.about-intro {
  margin-bottom: 70px;
  font-size: clamp(20px, 2.2vw, 29px);
  letter-spacing: -0.025em;
  line-height: 1.55;
}

.about-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 50px;
}

.about-columns h3 {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 9px;
}

.about-columns p {
  font-size: 13px;
  line-height: 1.7;
}

.social-section {
  max-width: none;
  padding-right: max(24px, calc((100vw - var(--max)) / 2));
  padding-left: max(24px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 82%, var(--cyan));
}

.social-section .section-lead {
  color: var(--muted);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.social-card {
  display: flex;
  min-height: 260px;
  padding: 25px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.social-card:hover {
  z-index: 1;
  color: #006b96;
  background: var(--paper-strong);
  box-shadow: 0 18px 48px rgba(8, 122, 168, 0.1);
  transform: translateY(-5px);
}

.social-symbol {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: auto;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: #161d24;
}

.social-symbol svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.social-symbol .stroke-logo {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.social-symbol .logo-dot {
  fill: currentColor;
  stroke: none;
}

.social-symbol .youtube-play {
  fill: #ef2b2d;
}

.social-symbol-instagram {
  background: linear-gradient(135deg, #7a46c5, #e14a79 58%, #f49b45);
}

.social-symbol-youtube {
  background: #ef2b2d;
}

.social-symbol-linktree {
  color: #102319;
  background: #43e660;
}

.social-symbol-mail {
  color: var(--night);
  background: var(--cyan);
  font-size: 20px;
}

.social-name {
  margin: 34px 0 5px;
  color: var(--muted);
  font-size: 10px;
}

.social-card strong {
  margin-bottom: 18px;
  font-size: 20px;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.social-action {
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  overflow-wrap: anywhere;
}

.tag-list {
  display: flex;
  margin: 0;
  padding: 0;
  gap: 7px;
  flex-wrap: wrap;
  list-style: none;
}

.contact-section {
  position: relative;
  isolation: isolate;
  padding: 110px max(24px, calc((100vw - var(--max)) / 2));
  color: white;
  background: var(--orange);
}

.contact-section > .mono {
  margin-bottom: 38px;
  font-size: 10px;
}

.contact-section h2 {
  max-width: 900px;
  font-size: clamp(52px, 7.3vw, 100px);
}

.contact-section h2 span {
  display: block;
}

.contact-section .hero-outline {
  -webkit-text-stroke-color: rgba(255, 255, 255, 0.7);
}

.contact-actions {
  margin-top: 54px;
}

.button-light {
  color: var(--orange);
  background: white;
}

.text-link.light {
  border-color: rgba(255, 255, 255, 0.65);
}

footer {
  display: flex;
  padding: 28px max(24px, calc((100vw - var(--max)) / 2));
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.45);
  background: var(--night);
  font-size: 10px;
}

footer a {
  color: white;
}

/* Light mode uses bright surfaces throughout, not only in the hero. */
html:not([data-theme="dark"]) .project-featured,
html:not([data-theme="dark"]) .project-featured:hover {
  color: var(--ink);
  border-color: rgba(16, 24, 32, 0.18);
  background: #d9effa;
}

html:not([data-theme="dark"]) .project-featured .project-number,
html:not([data-theme="dark"]) .project-featured p {
  color: rgba(16, 24, 32, 0.62);
}

html:not([data-theme="dark"]) .project-featured .project-meta span,
html:not([data-theme="dark"]) .project-featured a {
  border-color: rgba(16, 24, 32, 0.2);
}

html:not([data-theme="dark"]) .research-section {
  color: var(--ink);
  background: #d8eef9;
}

html:not([data-theme="dark"]) .research-section .section-index {
  color: #005f69;
}

html:not([data-theme="dark"]) .research-section .section-lead,
html:not([data-theme="dark"]) .publication-main span,
html:not([data-theme="dark"]) .publication-year,
html:not([data-theme="dark"]) .publication-type {
  color: rgba(16, 24, 32, 0.58);
}

html:not([data-theme="dark"]) .publication,
html:not([data-theme="dark"]) .publication:last-child {
  border-color: rgba(16, 24, 32, 0.17);
}

html:not([data-theme="dark"]) .publication:hover {
  color: #005f69;
}

html:not([data-theme="dark"]) .contact-section {
  color: var(--ink);
  background: #bfe6f7;
}

html:not([data-theme="dark"]) .contact-section .hero-outline {
  -webkit-text-stroke-color: rgba(16, 24, 32, 0.62);
}

html:not([data-theme="dark"]) .button-light {
  color: white;
  background: var(--ink);
}

html:not([data-theme="dark"]) .contact-section .text-link {
  border-color: rgba(16, 24, 32, 0.45);
}

html:not([data-theme="dark"]) footer {
  color: rgba(16, 24, 32, 0.58);
  background: #cce6f2;
}

html:not([data-theme="dark"]) footer a {
  color: var(--ink);
}

html:not([data-theme="dark"]) .marquee {
  color: #082f43;
  background: #72d3fa;
}

html:not([data-theme="dark"]) .button-primary {
  color: #082f43;
  background: #72d3fa;
}

/* Dark mode maps every bright accent surface to a deeper counterpart. */
html[data-theme="dark"] .marquee {
  color: var(--cyan);
  background: #17262e;
}

html[data-theme="dark"] .contact-section {
  background: #351b19;
}

html[data-theme="dark"] .button-light {
  color: var(--night);
  background: var(--orange);
}

html[data-theme="dark"] .social-card:hover {
  color: var(--cyan);
}

.project-card,
.repo-logo-card,
.social-card {
  transform-style: preserve-3d;
}

@media (hover: hover) and (pointer: fine) {
  .project-card,
  .repo-logo-card,
  .social-card {
    will-change: transform;
  }
}

.project-card.pointer-card-active,
.repo-logo-card.pointer-card-active,
.social-card.pointer-card-active {
  z-index: 2;
  background-image:
    radial-gradient(
      circle 190px at var(--card-pointer-x, 50%) var(--card-pointer-y, 50%),
      rgba(255, 255, 255, 0.5),
      transparent 72%
    );
  box-shadow: 0 24px 64px rgba(16, 91, 125, 0.16);
  transform:
    perspective(900px)
    rotateX(var(--card-rotate-x, 0deg))
    rotateY(var(--card-rotate-y, 0deg))
    translateY(-5px);
}

html[data-theme="dark"] .project-card.pointer-card-active,
html[data-theme="dark"] .repo-logo-card.pointer-card-active,
html[data-theme="dark"] .social-card.pointer-card-active {
  background-image:
    radial-gradient(
      circle 190px at var(--card-pointer-x, 50%) var(--card-pointer-y, 50%),
      rgba(110, 231, 238, 0.13),
      transparent 72%
    );
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
}

/* Watercolor editorial art direction */
.hero h1,
.section h2,
.contact-section h2,
.project-card h3,
.publication-main strong,
.about-intro,
.repo-logo-card > strong,
.social-card strong {
  font-family: var(--font-display);
}

.hero {
  background:
    radial-gradient(ellipse at 78% 30%, var(--paint-cyan), transparent 36%),
    radial-gradient(ellipse at 12% 82%, var(--paint-coral), transparent 38%),
    color-mix(in srgb, var(--paper) 78%, transparent);
}

html[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse at 78% 30%, var(--paint-cyan), transparent 36%),
    radial-gradient(ellipse at 12% 82%, var(--paint-violet), transparent 38%),
    color-mix(in srgb, var(--night) 82%, transparent);
}

.hero-grid {
  opacity: 0.055;
  background-size: 86px 86px;
}

.hero h1 {
  font-weight: 600;
  letter-spacing: -0.052em;
  line-height: 0.88;
}

.hero h1 .hero-outline {
  color: #237da7;
  font-style: italic;
  -webkit-text-stroke: 0;
  text-shadow: 0 10px 35px rgba(35, 125, 167, 0.13);
}

html[data-theme="dark"] .hero h1 .hero-outline {
  color: var(--cyan);
  text-shadow: 0 10px 38px rgba(110, 231, 238, 0.14);
}

.hero::after {
  border-color: rgba(40, 141, 184, 0.2);
  border-radius: 48% 52% 41% 59% / 60% 38% 62% 40%;
  box-shadow:
    0 0 0 90px rgba(62, 154, 214, 0.025),
    0 0 0 180px rgba(86, 215, 226, 0.018);
  transform: rotate(-7deg);
}

.site-header,
.hero-panel,
.org-strip {
  border-radius: 24px 14px 26px 16px;
}

.hero-panel {
  border-color: var(--glass-border);
  border-radius: 44px 18px 36px 20px;
}

.section-heading h2 {
  position: relative;
  z-index: 1;
}

.section-heading h2::after {
  position: absolute;
  z-index: -1;
  right: 4%;
  bottom: 3px;
  left: 18%;
  height: 18px;
  border-radius: 58% 42% 51% 49% / 65% 42% 58% 35%;
  opacity: 0.5;
  background: linear-gradient(90deg, var(--paint-cyan), var(--paint-blue), transparent);
  filter: blur(2px);
  content: "";
  transform: rotate(-1.3deg);
}

.section h2,
.contact-section h2 {
  font-weight: 600;
  letter-spacing: -0.045em;
}

.project-grid {
  gap: 26px;
}

.project-card,
.repo-logo-card,
.social-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: var(--glass-border);
  box-shadow:
    0 18px 50px rgba(35, 104, 136, 0.08),
    inset 0 0 50px rgba(255, 255, 255, 0.14);
}

.project-card {
  border-radius: 38px 13px 32px 17px;
}

.project-card:nth-child(even) {
  border-radius: 15px 38px 18px 34px;
}

.project-card::before,
.repo-logo-card::before,
.social-card::before,
.org-strip::before,
.publication::before {
  position: absolute;
  z-index: 0;
  inset: -25%;
  pointer-events: none;
  opacity: 0.36;
  background:
    radial-gradient(ellipse at 18% 22%, var(--card-paint, var(--paint-cyan)), transparent 34%),
    radial-gradient(ellipse at 86% 78%, var(--paint-blue), transparent 31%);
  filter: blur(20px);
  content: "";
  transform: rotate(-4deg);
  transition:
    opacity 360ms ease,
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:nth-child(2n),
.repo-logo-card:nth-child(3n),
.social-card:nth-child(2n) {
  --card-paint: var(--paint-coral);
}

.project-card:nth-child(3n),
.repo-logo-card:nth-child(4n),
.social-card:nth-child(3n) {
  --card-paint: var(--paint-violet);
}

.project-card > *,
.repo-logo-card > *,
.social-card > *,
.org-strip > *,
.publication > * {
  position: relative;
  z-index: 1;
}

.project-card > .project-number {
  position: absolute;
  z-index: 2;
}

.project-card h3 {
  font-weight: 600;
}

.project-card:hover,
.repo-logo-card:hover,
.social-card:hover {
  border-color: color-mix(in srgb, var(--interactive-accent) 55%, transparent);
}

.org-strip {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 27px 30px;
  border-radius: 34px 15px 30px 18px;
}

.repo-logo-grid,
.social-grid {
  gap: 16px;
  border: 0;
}

.repo-logo-card {
  border: 1px solid var(--glass-border);
  border-radius: 30px 12px 26px 15px;
}

.repo-logo-card:nth-child(even) {
  border-radius: 13px 28px 14px 30px;
}

.repo-logo {
  border-radius: 50% 44% 55% 42% / 44% 57% 43% 56%;
  box-shadow: 0 10px 28px rgba(24, 79, 104, 0.12);
}

.research-section {
  background:
    radial-gradient(ellipse at 15% 25%, var(--paint-blue), transparent 38%),
    radial-gradient(ellipse at 88% 72%, var(--paint-violet), transparent 40%),
    color-mix(in srgb, var(--paper) 78%, transparent);
}

html[data-theme="dark"] .research-section {
  background:
    radial-gradient(ellipse at 15% 25%, var(--paint-blue), transparent 38%),
    radial-gradient(ellipse at 88% 72%, var(--paint-violet), transparent 40%),
    color-mix(in srgb, var(--night) 82%, transparent);
}

.publication-list {
  display: grid;
  gap: 14px;
}

.publication,
.publication:last-child {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--glass-border);
  border-radius: 30px 12px 26px 15px;
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.publication:nth-child(even) {
  border-radius: 13px 28px 14px 30px;
  --card-paint: var(--paint-coral);
}

.publication:hover {
  border-color: color-mix(in srgb, var(--interactive-accent) 54%, transparent);
  background-color: color-mix(in srgb, var(--glass-bg) 88%, var(--paint-cyan));
  box-shadow:
    0 22px 58px rgba(35, 104, 136, 0.13),
    inset 0 0 54px rgba(255, 255, 255, 0.18);
}

.publication:hover::before {
  opacity: 0.58;
  transform: rotate(-1deg) scale(1.06);
}

.publication:hover .publication-arrow {
  transform: translate3d(3px, -3px, 0);
}

.publication-main strong {
  font-size: 26px;
  font-weight: 600;
}

.about-section {
  align-items: start;
}

.about-title {
  position: sticky;
  top: 125px;
}

.about-intro {
  position: relative;
  padding: 28px 30px;
  border: 1px solid var(--glass-border);
  border-radius: 42px 16px 38px 18px;
  background:
    radial-gradient(ellipse at 20% 20%, var(--paint-coral), transparent 44%),
    var(--glass-bg);
  box-shadow: var(--glass-shadow);
  font-weight: 500;
}

.social-section {
  background:
    radial-gradient(ellipse at 18% 22%, var(--paint-cyan), transparent 38%),
    radial-gradient(ellipse at 84% 80%, var(--paint-coral), transparent 42%),
    color-mix(in srgb, var(--paper) 76%, transparent);
}

html[data-theme="dark"] .social-section {
  background:
    radial-gradient(ellipse at 18% 22%, var(--paint-cyan), transparent 38%),
    radial-gradient(ellipse at 84% 80%, var(--paint-violet), transparent 42%),
    color-mix(in srgb, var(--night) 82%, transparent);
}

.social-card {
  border: 1px solid var(--glass-border);
  border-radius: 32px 13px 28px 16px;
}

.social-card:nth-child(even) {
  border-radius: 14px 30px 16px 32px;
}

.social-symbol {
  border-radius: 50% 43% 56% 45% / 45% 58% 42% 55%;
  box-shadow: 0 10px 26px rgba(20, 76, 101, 0.13);
}

.contact-section {
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 14% 25%, rgba(255, 255, 255, 0.62), transparent 32%),
    radial-gradient(ellipse at 85% 74%, var(--paint-violet), transparent 38%),
    linear-gradient(135deg, #9ddff3, #b9d7f4 55%, #e7c9e9);
}

html[data-theme="dark"] .contact-section {
  color: white;
  background:
    radial-gradient(ellipse at 14% 25%, rgba(110, 231, 238, 0.16), transparent 32%),
    radial-gradient(ellipse at 85% 74%, var(--paint-violet), transparent 38%),
    linear-gradient(135deg, #102d3a, #17263d 55%, #2b1d39);
}

.contact-section .hero-outline {
  color: #426f9d;
  font-style: italic;
  -webkit-text-stroke: 0;
}

html[data-theme="dark"] .contact-section .hero-outline {
  color: #b6c9ff;
  -webkit-text-stroke: 0;
}

.marquee {
  position: relative;
  z-index: 2;
  box-shadow: 0 8px 30px rgba(24, 104, 140, 0.12);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition-delay: var(--reveal-delay, 0ms);
}

.publication.reveal {
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1),
    color 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    box-shadow 320ms ease;
}

.publication.reveal.visible {
  transition-delay:
    var(--reveal-delay, 0ms),
    var(--reveal-delay, 0ms),
    0ms,
    0ms,
    0ms,
    0ms;
}

@media (max-width: 900px) {
  .site-header {
    width: calc(100% - 36px);
  }

  .desktop-nav,
  .header-cta {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 150px 24px 80px;
    grid-template-columns: 1fr;
  }

  .hero-panel {
    max-width: 500px;
    margin-top: 20px;
    justify-self: end;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .project-featured {
    grid-template-columns: 1fr;
  }

  .project-featured .project-body {
    padding: 0 0 20px;
  }

  .project-visual {
    min-height: 320px;
  }

  .about-section {
    grid-template-columns: 1fr;
  }

  .about-content {
    padding-top: 0;
  }

  .about-title {
    position: static;
  }

  .repo-logo-grid,
  .social-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  body {
    background-attachment: scroll;
  }

  .watercolor-wash {
    animation: none;
    filter: blur(42px);
  }

  .site-header {
    top: 10px;
    width: calc(100% - 20px);
    height: 60px;
    padding: 0 12px;
    border-radius: 16px;
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
    transform: translateX(-50%) translateZ(0);
  }

  .header-actions {
    gap: 12px;
  }

  .brand-text {
    display: none;
  }

  .hero {
    padding: 112px 18px 64px;
    gap: 34px;
  }

  .hero-watercolor {
    inset: -3% -38% -3% -18%;
    transform: scale(1.02);
    transition: none;
  }

  .hero-watercolor::after {
    background:
      linear-gradient(180deg, rgba(8, 16, 24, 0.76) 0%, rgba(8, 16, 24, 0.38) 43%, transparent 78%),
      linear-gradient(90deg, rgba(8, 16, 24, 0.58), transparent 78%);
  }

  html:not([data-theme="dark"]) .hero-watercolor::after {
    background:
      linear-gradient(180deg, rgba(223, 243, 255, 0.76) 0%, rgba(223, 243, 255, 0.36) 44%, transparent 80%),
      linear-gradient(90deg, rgba(223, 243, 255, 0.58), transparent 80%);
  }

  .hero-paint-mountain,
  .hero-paint-sun {
    animation: none;
    will-change: auto;
  }

  .hero-contours {
    display: none;
  }

  .hero-paint-river {
    animation: hero-watercolor-mobile 42s ease-in-out infinite alternate;
  }

  .hero-paint-horizon {
    animation: hero-watercolor-mobile 48s ease-in-out -21s infinite alternate-reverse;
  }

  .hero h1 {
    margin-bottom: 25px;
    font-size: clamp(46px, 14vw, 64px);
  }

  html[lang="zh-CN"] .hero h1 {
    font-size: clamp(40px, 10.8vw, 48px);
  }

  html[lang="zh-CN"] .hero h1 .hero-outline {
    font-size: 0.88em;
    line-height: 1.08;
  }

  .hero-intro {
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.65;
  }

  .hero-actions {
    gap: 18px;
    flex-wrap: wrap;
  }

  .hero-panel {
    width: 100%;
    margin-top: 0;
    padding: 20px;
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
  }

  .section {
    padding: 68px 18px;
  }

  .section-heading {
    margin-bottom: 40px;
    gap: 22px;
  }

  .section h2 {
    font-size: 38px;
    line-height: 1.06;
  }

  .section-lead {
    font-size: 13px;
  }

  .project-filters {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter {
    white-space: nowrap;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .org-strip {
    padding: 16px;
    grid-template-columns: auto 1fr;
    gap: 12px;
  }

  .org-strip-meta {
    display: none;
  }

  .org-strip img {
    width: 50px;
    height: 50px;
    border-radius: 13px;
  }

  .org-strip-copy strong {
    font-size: 18px;
  }

  .org-strip-copy > span:last-child {
    font-size: 9px;
  }

  .org-strip-actions {
    grid-column: 1 / -1;
  }

  .org-strip-actions a {
    flex: 1;
    justify-content: center;
  }

  .repo-logo-grid {
    display: flex;
    margin-right: -18px;
    padding-right: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
    scroll-padding-left: 0;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .repo-logo-grid::-webkit-scrollbar,
  .project-filters::-webkit-scrollbar {
    display: none;
  }

  .repo-logo-card {
    min-width: min(82vw, 310px);
    min-height: 280px;
    padding: 21px;
    contain: layout paint;
    scroll-snap-align: start;
  }

  .repo-logo-grid .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .repo-logo {
    width: 58px;
    height: 58px;
    margin-bottom: 28px;
    border-radius: 16px;
  }

  .project-featured {
    grid-column: auto;
  }

  .project-card {
    min-height: 360px;
    padding: 22px;
    backdrop-filter: blur(9px) saturate(115%);
    -webkit-backdrop-filter: blur(9px) saturate(115%);
  }

  .project-number {
    top: 22px;
    left: 22px;
  }

  .project-body {
    padding-top: 64px;
  }

  .project-card h3 {
    font-size: 32px;
  }

  .publication,
  .publication:last-child,
  .publication:hover {
    height: 220px;
    padding: 22px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 16px 12px;
    align-items: start;
  }

  .publication {
    transition:
      opacity 480ms ease,
      transform 480ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .publication-year {
    grid-row: 1;
    grid-column: 1;
  }

  .publication-main {
    grid-row: 2;
    grid-column: 1 / -1;
    gap: 8px;
  }

  .publication-main strong {
    font-size: 28px;
  }

  .publication-main span {
    font-size: 12px;
    line-height: 1.55;
  }

  .publication-arrow {
    grid-row: 1;
    grid-column: 2;
    align-self: start;
  }

  .publication-type {
    display: none;
  }

  .about-columns {
    grid-template-columns: 1fr;
  }

  .about-intro {
    margin-bottom: 48px;
    font-size: 20px;
    line-height: 1.55;
  }

  .social-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .social-card {
    min-height: 225px;
    padding: 18px;
    backdrop-filter: blur(9px) saturate(115%);
    -webkit-backdrop-filter: blur(9px) saturate(115%);
  }

  .social-symbol {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .social-name {
    margin-top: 26px;
  }

  .social-card strong {
    font-size: 16px;
  }

  .contact-actions {
    align-items: start;
    flex-direction: column;
  }

  .button-light {
    max-width: 100%;
    gap: 12px;
    font-size: 11px;
  }

  .contact-section {
    padding: 72px 18px;
  }

  .contact-section h2 {
    font-size: 46px;
  }

  footer {
    gap: 20px;
    align-items: start;
    flex-direction: column;
  }

  footer .mono {
    display: none;
  }

  .reveal {
    transform: translateY(10px);
    transition-duration: 480ms;
  }

  .signal span {
    animation: none;
  }
}

@keyframes hero-watercolor-mobile {
  from { transform: translate3d(-1%, 0, 0) scale(0.99); }
  to { transform: translate3d(1%, -1%, 0) scale(1.025); }
}

@media (hover: none) {
  .project-card:hover,
  .repo-logo-card:hover,
  .social-card:hover,
  .org-strip:hover,
  .publication:hover {
    color: inherit;
    border-color: var(--glass-border);
    background: var(--glass-bg);
    box-shadow:
      0 18px 50px rgba(35, 104, 136, 0.08),
      inset 0 0 50px rgba(255, 255, 255, 0.14);
    transform: none;
  }

  .publication:hover::before {
    opacity: 0.36;
    transform: rotate(-4deg);
  }

  .publication:hover .publication-arrow {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .cursor-glow {
    display: none;
  }

  .hero-paint {
    animation: none;
  }
}

@media (pointer: coarse) {
  .cursor-glow {
    display: none;
  }

  .section::before,
  .contact-section::before {
    display: none;
  }
}
