:root {
  color-scheme: dark;
  --bg: #10121e;
  --panel: #171b2a;
  --line: #303446;
  --text: #fff2db;
  --muted: #cec7c2;
  --gold: #ffbd4b;
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; color: var(--text); background: var(--bg); font: 1rem/1.65 var(--font); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }

.container { width: min(100% - 96px, 1344px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 5; top: 12px; left: 16px; padding: 10px; background: var(--bg); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.topbar { background: #0e101a; }
.topbar-inner { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.28rem; font-weight: 850; white-space: nowrap; }
.brand img { image-rendering: pixelated; }
.topbar nav { display: flex; align-items: center; align-self: stretch; gap: 30px; font-weight: 700; }
.topbar nav a { display: grid; place-items: center; min-height: 44px; text-decoration: none; padding-inline: 4px; border-block: 3px solid transparent; }
.topbar nav a:hover, .topbar nav a[aria-current] { border-bottom-color: var(--gold); }

.hero { position: relative; min-height: clamp(465px, 38vw, 560px); display: grid; align-items: center; overflow: clip; border-block: 1px solid #252b42; background: #101622; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-poster { height: 100%; width: 100%; object-fit: cover; object-position: 55% 34%; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0d1020e8 0%, #0f1222a6 25%, #0e102326 48%, transparent 66%), linear-gradient(0deg, #100e1a79 0%, transparent 26%); pointer-events: none; }
.hero-shell { display: flex; flex-direction: column; gap: 26px; padding-block: 62px; }
.hero-name { margin: 0 0 6px; color: #ffe1aa; font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 780; }
.hero h1 { margin: 0; font-size: clamp(3.25rem, 6vw, 6.45rem); font-weight: 950; line-height: 1.08; letter-spacing: -.065em; text-wrap: balance; text-shadow: 0 2px 0 #101120; }
.hero-actions { display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; width: fit-content; }
.button-primary, .button-quiet { min-height: 48px; display: inline-grid; place-items: center; font-weight: 850; cursor: pointer; }
.button-primary { min-width: 178px; padding: 12px 25px; border: 2px solid #ffe19a; border-radius: 4px; box-shadow: inset 0 -4px #a75415; background: #ffb93e; color: #241509; font-size: 1.15rem; text-decoration: none; }
.button-primary:hover { background: #ffd17c; }
.button-quiet { padding: 8px 7px; border: 0; border-radius: 4px; color: var(--text); background: #10122073; }
.button-quiet:hover { background: #222638; }

.intro-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.intro-frame { width: clamp(280px, 44vw, 680px); position: absolute; bottom: 12%; right: 6%; border: 2px solid #ffc16cab; border-radius: 4px; box-shadow: 0 0 0 5px #161a28bc, 0 24px 70px #070911ce; }
.intro-frame[data-art="ending"] { display: none; }
.intro-frame.arrive { animation: arrive .3s ease-out both; }
.intro-caption { position: absolute; right: 6%; bottom: 5%; padding: 3px 12px; background: #0f1324; font-weight: 800; color: #ffe1aa; }
.intro-ball { position: absolute; left: -30px; bottom: 3%; width: 28px; height: 28px; background: url("assets/basketball.png") center / contain; image-rendering: pixelated; animation: roll 4s linear 2s both; }
.intro-progress { position: absolute; height: 4px; inset: auto 0 0; background: var(--gold); transform-origin: left; animation: progress 8s linear both; }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes arrive { from { opacity: .35; transform: translateX(15px); } }
@keyframes roll { from { left: -30px; transform: rotate(0); } to { left: 100%; transform: rotate(1080deg); } }

.timeline { padding-block: 36px 48px; }
.timeline h2 { font-size: clamp(1.75rem, 3vw, 2.45rem); margin: 0 0 22px; line-height: 1.25; padding-left: 15px; border-left: 5px solid var(--gold); }
.era-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 0; }
.draft { --era: #6f282b; --accent: #ff9b85; }
.miami { --era: #6f202f; --accent: #ff91ad; }
.return { --era: #6a252d; --accent: #f8aa86; }
.los-angeles { --era: #492650; --accent: #e4b6fb; }
.philadelphia { --era: #243e78; --accent: #a9c6ff; }
.era-card { display: block; overflow: hidden; height: 100%; border: 1px solid #ffffff28; border-radius: 6px; background: var(--era); color: var(--text); text-decoration: none; }
.era-card:hover { border-color: var(--gold); }
.artwork { display: block; aspect-ratio: 4 / 3; background: #231b2b center / cover no-repeat; }
.artwork[data-art="draft"] { background-image: url("assets/draft-jersey.webp"); }
.artwork[data-art="miami"] { background-image: url("assets/miami-jersey.webp"); }
.artwork[data-art="return"] { background-image: url("assets/return-jersey.webp"); }
.artwork[data-art="los-angeles"] { background-image: url("assets/los-angeles-jersey.webp"); }
.artwork[data-art="philadelphia"] { background-image: url("assets/philadelphia-jersey.webp"); }
.era-label { padding: 9px 12px 11px; display: grid; text-align: center; gap: 1px; }
.era-label strong { font-size: clamp(1.01rem, 1.65vw, 1.45rem); line-height: 1.3; }
.era-label small { font-size: .875rem; color: #ffefde; }

.chapters { display: grid; gap: 24px; padding-bottom: 48px; }
.chapter { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.chapter-art { align-self: center; margin: 24px 0 24px 24px; border-radius: 5px; border: 1px solid #ffffff30; }
.chapter-body { padding: 24px; }
.period { color: var(--accent); margin: 0 0 2px; font-size: .9rem; font-weight: 800; }
.chapter h2 { font-size: clamp(1.7rem, 3vw, 2.55rem); margin: 0 0 8px; line-height: 1.25; }
.chapter-body > p:not([class]) { margin: 0 0 12px; max-width: 47em; }
.moments { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .9rem; }
.moments strong { color: var(--accent); margin-right: 2px; }
.source { display: inline-flex; min-height: 44px; align-items: center; font-size: .9rem; color: #e2d5c9; text-underline-offset: 3px; }
.updated { color: var(--muted); margin: 0 0 7px; font-size: .9rem; }
.chapter-nav { display: flex; flex-wrap: wrap; gap: 0 18px; border-top: 1px solid var(--line); }
.chapter-nav a, .footer a { display: inline-flex; min-height: 44px; align-items: center; color: #ffd58a; font-size: .9rem; text-underline-offset: 4px; }
.footer { border-top: 1px solid var(--line); padding-block: 12px 20px; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 0 16px; font-size: .9rem; color: var(--muted); }
.footer p { margin: 0; }
#timeline, .chapter h2, .era-card { scroll-margin-top: 20px; }

@media (max-width: 850px) {
  .container { width: calc(100% - 48px); }
  .hero-poster { object-position: 61% 48%; }
  .topbar-inner { min-height: 60px; }
  .topbar nav { gap: 16px; }
  .era-list { gap: 9px; }
  .era-label { padding-inline: 6px; }
}

@media (max-width: 650px) {
  html { scrollbar-gutter: auto; }
  .container { width: calc(100% - 32px); }
  .topbar-inner { min-height: 54px; gap: 10px; }
  .brand { font-size: 1.05rem; gap: 6px; }
  .brand img { width: 30px; height: 30px; }
  .topbar nav { gap: 12px; font-size: .9rem; }
  .topbar nav a { padding-inline: 3px; }
  .hero { display: block; min-height: 0; }
  .hero-shell { display: grid; grid-template-rows: auto clamp(185px, 66vw, 300px) auto; gap: 0; text-align: center; padding: 16px 0 12px; }
  .hero-copy { grid-row: 1; padding-bottom: 8px; }
  .hero h1 { font-size: clamp(2.35rem, 10vw, 3.5rem); line-height: 1.05; }
  .hero-name { margin-bottom: 5px; font-size: .9rem; }
  .hero-media { top: 99px; bottom: 96px; }
  .hero-poster { object-position: 75% 42%; }
  .hero-media::after { background: linear-gradient(180deg, #101622 0%, #10162200 27%, #10162200 83%, #101622 100%); }
  .hero-actions { grid-row: 3; display: grid; gap: 2px; margin-top: -4px; width: 100%; }
  .button-quiet { min-height: 44px; justify-self: center; background: transparent; }
  .intro-frame { width: min(72%, 350px); right: 50%; bottom: 19%; transform: translateX(50%); box-shadow: 0 0 0 4px #161a28c0; }
  .intro-frame.arrive { animation-name: arrive-mobile; }
  .intro-caption { right: 50%; bottom: 6%; transform: translateX(50%); white-space: nowrap; font-size: .875rem; }
  @keyframes arrive-mobile { from { opacity: .35; } }
  .timeline { padding-block: 22px 32px; }
  .timeline h2 { margin-bottom: 14px; padding-left: 10px; }
  .era-list { grid-template-columns: 1fr; }
  .era-card { display: grid; grid-template-columns: clamp(128px, 38vw, 168px) 1fr; min-height: 84px; }
  .era-card .artwork { width: 100%; height: 100%; }
  .era-label { align-content: center; text-align: left; padding: 5px 13px; }
  .era-label strong { font-size: 1.13rem; }
  .chapters { gap: 16px; padding-bottom: 28px; }
  .chapter { grid-template-columns: 1fr; }
  .chapter-art { margin: 0; border-radius: 0; border: 0; }
  .chapter-body { padding: 16px; }
  .chapter-nav { gap: 0 12px; }
  .moments { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-frame.arrive, .intro-progress { animation: none; }
  .intro-ball { display: none; }
}
