:root {
  color-scheme: light;
  --bg: #f6f5ee; --surface: #fffef9; --ink: #263a31; --muted: #647268; --line: #d8dcd0;
  --green: #38664d; --green-soft: #e9efdf; --green-mid: #c5d7b0;
  --coral: #b64d3e; --coral-soft: #fceadf; --gold: #8a641d; --gold-soft: #f9efcc;
  --purple: #6f5b89; --purple-soft: #ede8f3; --shadow: #dce0d2; --grid: rgba(71,95,63,.05); --tensor-fill: #eee8f2;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace; --font-pixel: 'Press Start 2P', monospace;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #17231f; --surface: #202e27; --ink: #e8eddd; --muted: #aab7ab; --line: #415145;
  --green: #b0d69e; --green-soft: #2e4434; --green-mid: #486845;
  --coral: #f1ac92; --coral-soft: #48352d; --gold: #e9ce85; --gold-soft: #453e29;
  --purple: #c7b4e4; --purple-soft: #383145; --shadow: #0f1b16; --grid: rgba(178,203,152,.045); --tensor-fill: #383145;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; background-color: var(--bg); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
::selection { background: var(--green-mid); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--coral); outline-offset: 5px; }
h1, h2, h3, p { margin: 0; }
svg { display: inline-block; flex-shrink: 0; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.pixel-text { font-family: var(--font-pixel); font-size: 9px; line-height: 1.8; }
.ball-icon { width: 25px; height: 25px; shape-rendering: crispEdges; }
.site-shell { width: min(1120px, calc(100% - 96px)); margin: 0 auto; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 10; padding: 12px 20px; background: var(--surface); border: 2px solid var(--ink); }
.skip-link:focus { top: 12px; }
.site-header { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 32px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-pixel); font-size: 12px; line-height: 1.8; }
.main-nav { display: flex; gap: 34px; margin-left: auto; font-size: 13px; font-weight: 500; }
.main-nav a { padding: 6px 0; border-bottom: 2px solid transparent; transition: border-color .15s; }
.main-nav a:hover { border-color: var(--green); }
.theme-toggle { display: flex; align-items: center; gap: 8px; padding: 7px 11px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-family: var(--font-mono); font-size: 11px; cursor: pointer; }
.theme-toggle:hover { border-color: var(--green); color: var(--green); }
.theme-icon { font-size: 16px; line-height: 1; }
h1 { font-size: 22px; font-weight: 500; line-height: 1.5; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 15px; padding: 11px 16px; border: 2px solid var(--green); font-size: 12px; font-weight: 600; box-shadow: 3px 3px 0 var(--shadow); transition: transform .15s,box-shadow .15s; }
.button svg { width: 14px; height: 14px; }
.button-primary { background: var(--green); color: var(--surface); }
.button-secondary { border-color: var(--line); background: var(--surface); }
.button:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--shadow); }
.button:active { transform: translate(2px,2px); box-shadow: none; }
.social-links { display: flex; flex-wrap: wrap; gap: 12px 23px; font-family: var(--font-mono); color: var(--muted); font-size: 11px; }
.social-links a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.social-links a span { font-size: 12px; margin-left: 2px; }
.profile-card { position: relative; margin: 48px 8px 0 0; border: 2px solid var(--ink); background: var(--surface); box-shadow: 8px 8px 0 var(--green-mid); }
.profile-card::before, .profile-card::after { content: ''; position: absolute; width: 8px; height: 8px; background: var(--bg); border: 2px solid var(--ink); z-index: 1; }
.profile-card::before { top: -5px; left: -5px; }
.profile-card::after { bottom: -5px; right: -5px; }
.profile-card-top { display: flex; align-items: center; justify-content: space-between; padding: 13px 28px; border-bottom: 2px solid var(--ink); background: var(--green-soft); }
.profile-card-top .pixel-text { font-size: 9px; color: var(--green); }
.profile-card-top .ball-icon { width: 20px; height: 20px; }
.profile-body { display: grid; grid-template-columns: 136px minmax(0,1fr); gap: 32px; align-items: start; padding: 32px; }
.avatar-frame { border: 2px solid var(--ink); padding: 5px; background: var(--coral-soft); box-shadow: 3px 3px 0 var(--line); }
.avatar-frame img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.profile-info h1 { font-family: var(--font-pixel); font-size: 30px; line-height: 1.5; letter-spacing: -1px; }
.profile-affiliation { margin-top: 12px; font-size: 14px; color: var(--muted); }
.profile-affiliation strong { color: var(--ink); font-weight: 600; }
.profile-fields { margin-top: 18px; font-size: 13px; color: var(--green); }
.profile-fields > span { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.profile-bio { max-width: 690px; margin-top: 13px; font-size: 14px; color: var(--muted); line-height: 1.85; }
.profile-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.profile-links { min-width: 0; padding: 22px 32px; }
.profile-contact { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 13px; margin-top: 13px; font-family: var(--font-mono); font-size: 11px; }
.profile-contact > span { font-size: 10px; color: var(--muted); }
.profile-contact > a { color: var(--green); text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.profile-contact > a:hover { color: var(--ink); }
.profile-world { align-self: stretch; flex: 0 0 235px; min-height: 106px; background: #deead5; overflow: hidden; }
.profile-world > img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
[data-theme='dark'] .profile-world { filter: brightness(.8); }
.about-section { padding-top: 52px; }
.section-heading { display: flex; align-items: center; gap: 16px; }
.section-heading h2 { font-size: 24px; font-weight: 600; letter-spacing: -.7px; }
.heading-line { flex: 1; height: 1px; margin-left: 6px; background: var(--line); }
.section-heading .ball-icon { width: 19px; height: 19px; }
.about-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 70px; margin-top: 28px; }
.about-copy > p { font-size: 14px; color: var(--muted); line-height: 1.95; }
.about-copy > p + p { margin-top: 17px; }
.about-copy strong { color: var(--ink); font-weight: 600; }
.interest-panel { align-self: start; padding: 18px 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: 4px 4px 0 var(--shadow); }
.interest-panel h3 { font-size: 14px; font-weight: 600; }
.interest-tags { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 13px 0; list-style: none; }
.interest-tags li { padding: 3px 8px; font-family: var(--font-mono); color: var(--muted); font-size: 10px; border: 1px solid var(--line); background: var(--bg); }
.research-section { padding-top: 66px; }
.section-count { font-family: var(--font-mono); color: var(--muted); font-size: 10px; white-space: nowrap; letter-spacing: 1px; }
.research-section > .section-heading { margin-bottom: 25px; }
.paper-card { display: grid; grid-template-columns: 225px minmax(0,1fr); border: 1px solid var(--line); background: var(--surface); margin-bottom: 18px; box-shadow: 4px 4px 0 var(--shadow); transition: border-color .15s,box-shadow .15s; }
.paper-card:hover { border-color: var(--green); box-shadow: 5px 5px 0 var(--shadow); }
.featured-paper { border-color: var(--green-mid); }
.paper-art { position: relative; min-height: 215px; border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 12px; overflow: hidden; }
.pgsr-art { background: #fff; }
.pgsr-art picture { display: block; width: 100%; }
.pgsr-art img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.art-caption { position: absolute; bottom: 16px; left: 8px; right: 8px; font-family: var(--font-mono); font-size: 8px; text-align: center; color: var(--muted); letter-spacing: .7px; }
.tensor-art { color: var(--purple); background: var(--purple-soft); }
.tensor-cube { width: 103px; height: 103px; transform: translateY(-5px); }
.paper-body { padding: 25px 28px 22px; }
.paper-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 13px; }
.venue-badge { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-mid); font-family: var(--font-mono); font-size: 10px; font-weight: 500; padding: 2px 8px; }
.venue-purple { background: var(--purple-soft); border-color: color-mix(in srgb,var(--purple) 30%,var(--surface)); color: var(--purple); }
.paper-topic { margin-left: auto; font-family: var(--font-mono); color: var(--muted); font-size: 8px; letter-spacing: .7px; }
.paper-body h3 { max-width: 660px; font-size: 18px; font-weight: 600; line-height: 1.5; letter-spacing: -.25px; }
.paper-authors { margin-top: 9px; font-size: 12px; color: var(--muted); }
.paper-authors strong { color: var(--ink); font-weight: 600; }
.paper-links { display: flex; gap: 22px; margin-top: 18px; font-family: var(--font-mono); font-size: 10px; }
.paper-links a { display: inline-flex; align-items: center; gap: 8px; color: var(--green); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.paper-links a:hover { border-color: var(--green); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 46px; padding: 24px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.site-footer a:hover { color: var(--green); }
.site-footer a span { margin-left: 7px; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.error-card { width: min(480px,100%); background: var(--surface); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--green-mid); padding: 45px 32px; text-align: center; }
.error-card > .ball-icon { width: 48px; height: 48px; }
.error-card h1 { font-family: var(--font-pixel); font-size: 42px; margin: 25px 0 18px; color: var(--green); }
.error-card h2 { font-size: 20px; }
.error-card p { color: var(--muted); font-size: 14px; margin: 12px 0 25px; }
@media (min-width: 1400px) {
  .site-shell { width: min(1120px,calc(100% - 120px)); }
}
@media (max-width: 1020px) {
  .site-shell { width: calc(100% - 64px); }
  .profile-body { grid-template-columns: 120px minmax(0,1fr); gap: 26px; padding: 28px; }
  .profile-links { padding: 22px 28px; }
  .profile-world { flex-basis: 200px; }
  .about-layout { gap: 40px; }
  .paper-card { grid-template-columns: 185px minmax(0,1fr); }
  .paper-topic { margin-left: 0; }
}
@media (max-width: 760px) {
  .site-shell { width: calc(100% - 40px); max-width: 570px; }
  .site-header { min-height: 85px; gap: 15px; }
  .brand { gap: 8px; font-size: 10px; }
  .brand .ball-icon { width: 21px; height: 21px; }
  .main-nav { gap: 17px; font-size: 11px; }
  .theme-toggle { padding: 6px 8px; }
  .theme-label { display: none; }
  .profile-card { margin-top: 30px; }
  .profile-body { grid-template-columns: 1fr; gap: 22px; padding: 24px; }
  .avatar-frame { width: 104px; }
  .profile-info h1 { font-size: 28px; }
  .profile-footer { flex-direction: column; align-items: stretch; }
  .profile-links { padding: 20px 24px; }
  .profile-world { flex-basis: auto; height: 90px; min-height: 0; border-top: 1px solid var(--line); }
  .profile-world > img { object-fit: contain; }
  .about-section { padding-top: 44px; }
  .section-heading { gap: 12px; }
  .section-heading h2 { font-size: 21px; }
  .about-layout { grid-template-columns: 1fr; gap: 24px; margin-top: 22px; }
  .interest-panel { padding: 18px 20px; }
  .research-section { padding-top: 48px; }
  .paper-card { grid-template-columns: 1fr; }
  .paper-art { min-height: 135px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pgsr-art picture { max-width: 250px; }
  .art-caption { bottom: 10px; }
  .tensor-cube { width: 87px; height: 87px; transform: translateY(-9px); }
  .paper-body { padding: 20px; }
  .paper-body h3 { font-size: 17px; }
  .paper-topic { margin-left: auto; font-size: 7px; }
  .paper-meta { gap: 7px 10px; }
  .site-footer { flex-wrap: wrap; gap: 10px; padding-bottom: 25px; font-size: 9px; }
}
@media (max-width: 430px) {
  .site-header { gap: 10px; }
  .main-nav { gap: 12px; font-size: 11px; }
  .main-nav a { padding: 10px 0; }
  .theme-toggle { min-height: 34px; min-width: 29px; justify-content: center; }
  .brand { font-size: 9px; }
  .brand .ball-icon { width: 19px; height: 19px; }
  .profile-card-top { padding: 12px 20px; }
  .profile-body { padding: 22px 20px; }
  .profile-affiliation, .profile-bio { font-size: 13px; }
  .profile-fields { font-size: 12px; }
  .profile-links { padding: 20px; }
  .profile-contact { font-size: 10px; }
  .button { font-size: 11px; gap: 10px; padding: 10px 13px; }
  .social-links { gap: 17px; font-size: 10px; }
  .section-heading h2 { font-size: 19px; }
  .section-count { font-size: 8px; }
  .about-copy > p { font-size: 13px; }
  .paper-topic { width: 100%; margin-left: 0; margin-top: 3px; }
}
@media (max-width: 350px) {
  .site-shell { width: calc(100% - 32px); }
  .main-nav { gap: 9px; font-size: 10px; }
  .brand { font-size: 8px; gap: 5px; }
  .brand .ball-icon { width: 16px; height: 16px; }
  .theme-toggle { padding: 5px; }
  .profile-info h1 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
