/* ════════════════════════════════════════════════════════
   THEMES — Star Rail / Genshin / ZZZ
   Rule: a theme only changes tokens + decoration below,
   never layout or content. Each theme has its own display
   and body face; colours keep their jobs.
═════════════════════════════════════════════════════════ */
html[data-theme="hsr"] {
  --bg: #070a16; --text: #e9ecf5; --muted: #98a3c7; --line: #283157; --shot: #0d1330;
  --accent: #e8c873; --accent-ink: #1a1405; --link: #8fd4ff;
  --display: 'Orbitron', sans-serif; --body: 'Saira', sans-serif; --radius: 0;
}
html[data-theme="genshin"] {
  /* sky sampled from the Day login screen (haze #96c1e3 → mist #d3e3ee), its deep blue as accent;
     cream / slate / gold from the in-game menus */
  --bg: #d6e7f3; --text: #3c4659; --muted: #4c5a71; --line: rgba(255,255,255,.8); --shot: #c9dff0;
  --accent: #2f5a92; --accent-ink: #ece5d8; --link: #2f5a92; --slate: #4a5366; --gold: #d3bc8e; --cream: #ece5d8;
  --display: 'M PLUS Rounded 1c', sans-serif; --body: 'M PLUS Rounded 1c', sans-serif; --radius: 999px;   /* stand-in for HYWenHei 85W */
}
html[data-theme="zzz"] {
  --bg: #0b0b0c; --text: #f2f2f2; --muted: #a3a3a3; --line: #2b2b2d; --shot: #151516;
  --accent: #d7ff1f; --accent-ink: #0b0b0c; --link: #d7ff1f;
  --display: 'Dela Gothic One', sans-serif; --body: 'Archivo', sans-serif; --radius: 999px;
}

/* ─── BASE (shared by all themes) ─────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font: 400 1.05rem/1.6 var(--body);
  min-height: 100vh; overflow-x: hidden;
}
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); transition: text-decoration-color .2s, color .2s; }
a:hover { text-decoration-color: currentColor; }
a.arrow::after { content: ' →'; display: inline-block; transition: transform .2s ease; }
a.arrow:hover::after, a.arrow:focus-visible::after { transform: translateX(3px); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px 72px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 0; }
.flavor, .theme summary, .switch button { font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.06em; }
.flavor { color: var(--muted); }
.theme { position: relative; }
.theme summary {
  list-style: none; cursor: pointer; padding: 8px 12px;
  color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s;
}
.theme summary::-webkit-details-marker { display: none; }
.theme summary::after { content: ' ▾'; color: var(--accent); }
.theme[open] summary::after { content: ' ▴'; }
.theme summary:hover, .theme[open] summary { border-color: var(--accent); }
.switch {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 100%;
  display: flex; flex-direction: column; gap: 6px; padding: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: min(var(--radius), 16px);
}
.switch button {
  padding: 8px 12px; cursor: pointer; background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: color .15s, border-color .15s, background .15s;
}
.switch button:hover { color: var(--text); border-color: var(--accent); }
.switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* hero: left-aligned and asymmetric; the name does the work */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.hero h1 { font-family: var(--display); font-size: clamp(2.4rem, 7vw, 4.6rem); line-height: .95; letter-spacing: -.01em; }
.role { margin-top: 14px; font-size: 1.15rem; color: var(--accent); }
.bio { margin-top: 10px; max-width: 34em; color: var(--muted); }
.hero nav { margin-top: 16px; display: flex; gap: 22px; font-weight: 600; }
.photo { width: 150px; height: 190px; object-fit: cover; object-position: 50% 62%; border: 1px solid var(--line); }

h2 { font-family: var(--display); font-size: 1.1rem; letter-spacing: .02em; margin: 56px 0 20px; display: flex; gap: 14px; align-items: baseline; }
h2 small { font: 400 .85rem var(--body); color: var(--muted); letter-spacing: 0; text-transform: none; }

/* featured: one big project with a real screenshot, not a card */
.feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; align-items: start; }
.shot {
  position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden;
  background: var(--shot); border: 1px solid var(--line); color: var(--muted); text-decoration: none;
  transition: border-color .25s;
}
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.shot:hover { border-color: var(--accent); color: var(--text); }
.feature h3 { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.feature p { margin-top: 12px; }
.feature ul { margin: 12px 0 0 1.1em; }
.feature li { margin: 3px 0; }
.stack { color: var(--muted); font-size: .92rem; }
.actions { display: flex; gap: 20px; font-weight: 600; align-items: baseline; flex-wrap: wrap; }
.actions span { color: var(--muted); font-weight: 400; font-size: .9rem; }

/* the rest: plain rows with hairlines, each carrying one real artefact */
.row { display: grid; grid-template-columns: 210px 1fr 300px; gap: 28px; padding: 26px 0; border-top: 1px solid var(--line); align-items: start; transition: opacity .2s ease; }
.row:last-child { border-bottom: 1px solid var(--line); }
.row h3 { font-family: var(--display); font-size: 1.05rem; line-height: 1.2; }
.row .meta { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.row .stat { color: var(--accent); font-weight: 600; }
.pix { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; image-rendering: pixelated; background: var(--shot); border: 1px solid var(--line); transition: border-color .2s; }
.thumb { aspect-ratio: 16 / 8; overflow: hidden; border: 1px solid var(--line); transition: border-color .2s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }

.timeline { display: grid; grid-template-columns: 90px 1fr; gap: 6px 28px; }
.timeline .when { color: var(--muted); font-family: var(--display); font-size: .85rem; padding-top: 3px; }

footer { margin-top: 64px; color: var(--muted); font-size: .9rem; }
footer .foot { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
footer .credit { margin-top: 10px; font-size: 0.74rem; opacity: .75; }

/* ─── micro-interactions: the cursor spotlights one thing at a time ─── */
.shot img, .thumb img { transition: filter .25s ease, transform .5s ease; }
@media (hover: hover) {
  .rows:hover .row:not(:hover) { opacity: .45; }                  /* siblings dim, the hovered row stays solid */
  .row:hover .pix, .row:hover .thumb { border-color: var(--accent); }
  .shot img, .thumb img { filter: saturate(.75) brightness(.88); }        /* muted, not see-through */
  .shot:hover img, .row:hover .thumb img { filter: none; transform: scale(1.02); }
}
.rows:focus-within .row:not(:focus-within) { opacity: .45; }       /* same spotlight for keyboard users */

/* below-the-fold sections skip rendering until scrolled near */
main > section:not(.hero) { content-visibility: auto; contain-intrinsic-size: auto 640px; }

/* per-theme flavour text: <span class="t-hsr">…</span> etc. */
html:not([data-theme="hsr"]) .t-hsr,
html:not([data-theme="genshin"]) .t-genshin,
html:not([data-theme="zzz"]) .t-zzz { display: none; }
