:root {
  color-scheme: dark;
  --ink: #141613;
  --panel: #1c1e19;
  --line: #464236;
  --paper: #eee5d3;
  --muted: #bcb4a2;
  --gold: #d9b57b;
  --serif: "Songti SC", "Noto Serif CJK SC", SimSun, Georgia, serif;
  --sans: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-family: var(--sans);
  font-size: 100%;
  background: var(--ink);
  color: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
p, h1, h2, h3, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, .joystick:focus-visible { outline: 2px solid #f1ca85; outline-offset: 4px; }
section[id], article[id] { scroll-margin-top: 5.5rem; }

.page-width { width: min(100% - 5rem, 72rem); margin-inline: auto; }
.skip-link { position: fixed; z-index: 5; inset: 0 auto auto 1rem; background: var(--gold); color: var(--ink); padding: .7rem 1rem; transform: translateY(-120%); }
.skip-link:focus { transform: none; }
.site-header { position: sticky; top: 0; z-index: 2; background: #141613f5; border-bottom: 1px solid #494235; }
.header-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: .7rem; white-space: nowrap; font-weight: 650; letter-spacing: .06em; }
.brand b { color: var(--gold); letter-spacing: .02em; }
.seal { display: grid; place-content: center; width: 2.15rem; height: 2.15rem; border: 1px solid #db977f; outline: 1px solid #8b4f40; outline-offset: 2px; color: #f0b29c; background: #5b3027; font: 700 .76rem/.96 var(--serif); text-align: center; letter-spacing: .06em; }
nav { display: flex; align-items: center; gap: clamp(1rem, 3.2vw, 2.8rem); }
nav a { padding: .65rem 0; color: var(--muted); white-space: nowrap; font-size: .9rem; }
nav a:hover, .footer-layout a:hover { color: var(--gold); }

.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(32rem, 46vw, 43rem);
  display: grid;
  background: #252d26 url("assets/three-kingdoms.webp") 58% 50% / cover no-repeat;
  border-bottom: 1px solid #887453;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #131713f5 0%, #151915d6 27%, #15191552 59%, transparent 80%), linear-gradient(0deg, #151713c9 0%, transparent 33%);
}
.hero-inner { position: relative; display: flex; align-items: center; padding-block: 5.5rem 6.25rem; }
.hero-content { max-width: 47rem; }
.eyebrow { display: flex; align-items: center; gap: .72rem; color: var(--gold); font-size: .875rem; font-weight: 650; letter-spacing: .18em; }
.diamond { display: inline-block; flex: 0 0 auto; width: .43rem; height: .43rem; transform: rotate(45deg); background: currentColor; }
.hero h1 { margin: .84rem 0 1.2rem; white-space: nowrap; font: 800 clamp(3.8rem, 8.3vw, 7.7rem)/1.07 var(--serif); letter-spacing: .055em; text-shadow: 0 3px 25px #101711b3; }
.hero h1 span { color: var(--gold); font: 500 .6em/1 Georgia, serif; letter-spacing: -.045em; }
.hero-lead { color: #eee3cd; font-size: clamp(1.08rem, 1.9vw, 1.35rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .7rem 1.23rem; border: 1px solid var(--gold); font-size: .92rem; font-weight: 680; letter-spacing: .035em; }
.button-primary { background: #dfbd87; color: #241c13; }
.button-primary:hover { background: #f0d0a1; }
.button-secondary { border-color: #ad9a7d; background: #191c16b3; color: var(--paper); }
.button-secondary:hover { background: #25271f; border-color: var(--gold); }
.hero-caption { position: absolute; right: 0; bottom: 1.4rem; color: #e1d4bd; background: #151815b8; padding: .3rem .58rem; font-size: .8rem; letter-spacing: .12em; }

.section { padding-block: clamp(3.75rem, 7.2vw, 6.55rem); }
.section h2 { margin-top: .72rem; font: 750 clamp(2.05rem, 3.9vw, 3.55rem)/1.22 var(--serif); letter-spacing: .035em; text-wrap: balance; }
.section p:not(.eyebrow, .camera-label, .preview-status) { line-height: 1.85; }
.story-section { background: #1b1e19; }
.story-layout { display: grid; grid-template-columns: .9fr 1.12fr; gap: 1.65rem clamp(2rem, 7vw, 6.2rem); align-items: start; }
.story-copy { border-left: 1px solid #8c7550; padding-left: clamp(1.15rem, 3vw, 2.2rem); color: #d2c8b5; font-size: 1.04rem; }
.story-copy p + p { margin-top: 1.05rem; }
.section-heading { margin-bottom: 1.65rem; }
.design-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.design-card { display: flex; gap: clamp(1rem, 2vw, 1.6rem); min-height: 10.5rem; align-items: flex-start; padding: clamp(1.25rem, 2.8vw, 2rem); border: 1px solid var(--line); background: linear-gradient(115deg, #2b2b21, #22241c 73%); }
.theme-mark { flex: 0 0 auto; display: grid; place-items: center; width: 3.1rem; height: 3.1rem; border: 1px solid #896c44; color: var(--gold); background: #d9b57b0d; font: 700 1.6rem/1 var(--serif); }
.design-card h3 { margin: .1rem 0 .45rem; font: 700 1.32rem/1.45 var(--serif); }
.design-card p { color: var(--muted); }

.progress-section { background: #1c1f19; }
.progress-summary { max-width: 48rem; margin-top: .7rem; color: var(--muted); }
.progress-section article + article { margin-top: 3rem; }
.character-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1rem; }
.character-heading h3 { font: 700 clamp(1.55rem, 2.5vw, 2.05rem)/1.25 var(--serif); }
.character-heading > p { max-width: 34rem; color: var(--muted); }
.showcase { border: 1px solid #514a39; }
.viewer { min-width: 0; display: flex; flex-direction: column; background: #151814; }
.stage { position: relative; flex: 1 0 auto; display: grid; justify-items: center; align-items: center; scroll-margin-top: 4.25rem; background: #151814; isolation: isolate; }
.stage video { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; object-fit: contain; }
.interactive-preview { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #353d28 url("assets/field-map.webp") center / 100% 100% no-repeat; overflow: hidden; }
.stage video, .interactive-preview { max-width: max(28rem, calc((100svh - 5.5rem) * 16 / 9)); }
.interactive-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage::before, .stage::after { content: ""; position: absolute; z-index: 1; width: 1.3rem; height: 1.3rem; border: 1px solid #a98b55; pointer-events: none; }
.stage::before { inset: .9rem auto auto .9rem; border-right: 0; border-bottom: 0; }
.stage::after { inset: auto .9rem .9rem auto; border-top: 0; border-left: 0; }
.camera-label { position: absolute; inset: 1.25rem auto auto 1.25rem; display: flex; gap: .55rem; align-items: center; padding: .32rem .58rem; background: #171913ed; color: #eed9ac; font-size: .875rem; pointer-events: none; }
.preview-status { position: absolute; inset: auto 1.5rem 1.5rem; width: fit-content; padding: .4rem .75rem; background: #24231b; color: var(--paper); pointer-events: none; }
.joystick {
  position: absolute;
  left: clamp(1rem, 4%, 2rem);
  bottom: clamp(1rem, 5%, 2rem);
  display: grid;
  place-items: center;
  width: clamp(4.75rem, 17%, 6rem);
  aspect-ratio: 1;
  border: 1px solid #e5c892b5;
  border-radius: 50%;
  background: radial-gradient(circle, #2624188a, #1a1e15e0);
  box-shadow: inset 0 0 0 4px #eed3a315, 0 2px 12px #13181080;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.joystick:active { cursor: grabbing; }
.joystick-thumb {
  width: 44%;
  aspect-ratio: 1;
  border: 1px solid #ffe1a5;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f2d7a1, #b18b55);
  box-shadow: 0 2px 7px #18160e9c;
  transform: translate(var(--thumb-x, 0), var(--thumb-y, 0));
  pointer-events: none;
}
.viewer-footer { display: flex; justify-content: space-between; align-items: center; gap: .8rem; min-height: 5.15rem; padding: .85rem 1.25rem; border-top: 1px solid #484331; background: #20221a; }
.current-motion { display: grid; gap: .25rem; }
.current-motion strong { font-size: 1rem; }
.current-motion span, .joystick-hint { color: var(--muted); font-size: .875rem; }
.playback { display: flex; align-items: center; flex-shrink: 0; gap: .45rem; }
.playback button, .motion-button { border: 1px solid #554e3b; background: #27291f; color: var(--paper); font-size: .875rem; min-height: 2.4rem; }
.playback button { padding: .28rem .65rem; }
.playback button:hover, .motion-button:hover { background: #383426; border-color: #a48755; }
.motion-panel { background: #24261e; border-top: 1px solid #514a39; padding: clamp(1rem, 2.4vw, 1.6rem); }
.motion-panel h4 { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; margin: 0 0 .85rem; font: 700 1.35rem/1.3 var(--serif); }
.motion-count { color: var(--muted); font: .875rem var(--sans); }
.motion-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem 1.3rem; }
.motion-group h5 { margin: 0 0 .35rem; font-size: .875rem; font-weight: 570; letter-spacing: .035em; color: var(--gold); }
.motion-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.motion-button { padding: .27rem .45rem; text-align: left; line-height: 1.35; }
.motion-button[aria-pressed="true"] { color: #f3dfb8; background: #4a3c29; border-color: #c1a167; }
.model-specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; border-bottom: 1px solid #514a39; }
.model-specs div { padding: .9rem .25rem; display: flex; flex-direction: column-reverse; align-items: center; gap: .25rem; }
.model-specs dt { color: var(--muted); font-size: .875rem; }
.model-specs dd { font-size: 1.04rem; color: var(--gold); font-variant-numeric: tabular-nums; text-align: center; }

.site-footer { background: #141613; border-top: 1px solid #494235; }
.footer-layout { display: grid; grid-template-columns: max-content minmax(0, 43rem); justify-content: space-between; align-items: start; gap: 1.5rem 3rem; padding-block: 2.65rem; }
.footer-layout p { font-size: .875rem; line-height: 1.8; color: var(--muted); }

@media (max-width: 54rem) {
  .story-layout { grid-template-columns: 1fr; gap: 1.45rem; }
  .motion-list { grid-template-columns: 1fr; }
  .motion-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 39rem) {
  section[id], article[id] { scroll-margin-top: 4.5rem; }
  .page-width { width: calc(100% - 2rem); }
  .header-inner { min-height: 3.75rem; gap: .55rem; }
  .site-header .brand { gap: .45rem; font-size: .83rem; letter-spacing: 0; }
  .site-header .seal { width: 1.6rem; height: 1.6rem; outline-offset: 1px; font-size: .62rem; }
  nav { gap: clamp(.4rem, 2vw, 1rem); }
  nav a { font-size: .875rem; }
  .hero { min-height: 31.25rem; background-position: 62% center; }
  .hero::before { background: linear-gradient(90deg, #151915ed, #15191536 100%), linear-gradient(0deg, #151713c9, transparent 44%); }
  .hero-inner { padding-block: 4rem 4.8rem; }
  .hero h1 { font-size: clamp(2.85rem, 11.5vw, 4.6rem); letter-spacing: .025em; }
  .hero-lead { max-width: 19rem; }
  .hero-caption { bottom: .85rem; }
  .design-grid { grid-template-columns: 1fr; gap: .75rem; }
  .design-card { min-height: auto; }
  .character-heading { display: block; }
  .character-heading > p { margin-top: .45rem; }
  .viewer-footer { padding-inline: .8rem; flex-wrap: wrap; }
  .motion-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .model-specs div:nth-child(n+3) { border-top: 1px solid #3e3b2c; }
  .footer-layout { grid-template-columns: 1fr; }
}

@media (max-width: 23rem) {
  .site-header .seal { display: none; }
}

@media (max-width: 39rem) and (min-height: 36rem) {
  .viewer { position: sticky; top: 3.75rem; z-index: 1; }
  .motion-button { scroll-margin-top: calc(56.25vw + 10rem); }
}

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