/* ==========================================================================
   活锁小助手 (Deadlock Companion) — 12-Column Swiss Grid & Dual Theme System
   Day: Prismatic Pearl Glass | Night: Occult Brass & Violet ("暗黑黄铜 · 阿紫")
   ========================================================================== */
:root {
  color-scheme: light;
  --cols: 12;
  --gutter: clamp(12px, 1.75vw, 24px);
  --wrap-max: 1248px;
  --nav-height: 54px;
  --display: "Noto Serif SC", "Songti SC", "STSong", serif;
  --body: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --paper: #f6f6fb;
  --paper-alt: #efeff8;
  --surface: rgba(252, 251, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-muted: #f2f1fb;
  --header-bg: rgba(249, 248, 254, 0.82);
  --ink: #1e2235;
  --ink-strong: #131625;
  --muted: #525a72;
  --accent: #5243c2;
  --accent-strong: #3f32a3;
  --accent-soft: rgba(82, 67, 194, 0.11);
  --brass: #b88728;
  --brass-soft: rgba(184, 135, 40, 0.14);
  --line: #dcdff0;
  --line-strong: #c8cde6;
  --grid-column-tint: rgba(98, 84, 214, 0.065);
  --grid-ruler-border: rgba(98, 84, 214, 0.24);
  --card-border: rgba(255, 255, 255, 0.92);
  --card-ring: rgba(114, 103, 202, 0.16);
  --card-shadow: 0 20px 50px rgba(58, 52, 114, 0.11);
  --screen-shadow: 0 24px 64px rgba(45, 47, 82, 0.24), 0 0 0 1px rgba(108, 102, 168, 0.22), 0 0 0 5px rgba(255, 255, 255, 0.72);
  --spotlight: rgba(110, 92, 232, 0.1);
  --wash: #eeecf9;
  --halo: #e2daf9;

  color: var(--ink);
  font-family: var(--body);
  background: var(--paper);
  font-feature-settings: "tnum" 1;
}

html[data-theme="night"] {
  color-scheme: dark;
  --paper: #0b0e16;
  --paper-alt: #101421;
  --surface: rgba(20, 25, 40, 0.84);
  --surface-strong: rgba(24, 30, 48, 0.95);
  --surface-muted: #161b2c;
  --header-bg: rgba(11, 14, 22, 0.84);
  --ink: #ebeaf6;
  --ink-strong: #ffffff;
  --muted: #9ca4be;
  --accent: #e8c14a;
  --accent-strong: #f3d26b;
  --accent-soft: rgba(232, 193, 74, 0.14);
  --brass: #e8c14a;
  --brass-soft: rgba(232, 193, 74, 0.18);
  --line: rgba(154, 164, 204, 0.15);
  --line-strong: rgba(232, 193, 74, 0.34);
  --grid-column-tint: rgba(232, 193, 74, 0.06);
  --grid-ruler-border: rgba(232, 193, 74, 0.28);
  --card-border: rgba(232, 193, 74, 0.18);
  --card-ring: rgba(148, 120, 255, 0.2);
  --card-shadow: 0 22px 54px rgba(3, 5, 12, 0.56);
  --screen-shadow: 0 28px 70px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(232, 193, 74, 0.32), 0 0 0 5px rgba(22, 27, 44, 0.82);
  --spotlight: rgba(232, 193, 74, 0.11);
  --wash: #111626;
  --halo: rgba(126, 98, 232, 0.2);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-height) + 12px); scroll-behavior: smooth; }
body { margin: 0; line-height: 1.65; background: var(--paper); color: var(--ink); overflow-x: clip; transition: background-color .28s ease, color .28s ease; }
h1, h2, h3, p, figure, dl, dd, ol { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: fixed; z-index: 30; left: 14px; top: 10px; padding: 8px 14px; border-radius: 8px; background: var(--surface-strong); color: var(--ink-strong); border: 1px solid var(--line-strong); transform: translateY(-200%); transition: transform .2s; }
.skip-link:focus { transform: none; }

/* 12-Line Swiss Grid Container & Blueprint Overlay */
.wrap { width: min(100% - clamp(28px, 5vw, 64px), var(--wrap-max)); margin-inline: auto; }
main { position: relative; isolation: isolate; }
.swiss-grid { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.swiss-grid-inner {
  height: 100%; display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}
.swiss-grid-inner > span {
  position: relative; height: 100%;
  border-inline: 1px solid transparent;
  transition: background-color .24s ease, border-color .24s ease;
}
.swiss-grid-inner > span > i {
  position: sticky; top: calc(var(--nav-height) + 70px); display: inline-block;
  margin: 6px 0 0 6px; padding: 1px 5px; border-radius: 4px;
  font: 600 .66rem/1.3 var(--mono); font-style: normal; letter-spacing: .04em;
  color: var(--accent); background: var(--surface-strong); border: 1px solid var(--grid-ruler-border);
  opacity: 0; transform: translateY(-4px); transition: opacity .22s ease, transform .22s ease;
}
html[data-grid="on"] .swiss-grid-inner > span {
  background: var(--grid-column-tint);
  border-inline-color: var(--grid-ruler-border);
}
html[data-grid="on"] .swiss-grid-inner > span > i { opacity: .92; transform: none; }

.feature {
  --image-away: calc(1 - var(--image-progress, 1));
  --controls-away: calc(1 - var(--controls-progress, 1));
  --intro-away: calc(1 - var(--intro-progress, 1));
  --exit: var(--out-progress, 0);
  --handoff-lift: calc(var(--image-progress, 1) * var(--intro-away));
  --motion-depth: 1;
  --image-direction: -1;
  --intro-direction: 1;
  --image-rise: clamp(120px, 21svh, 215px);
  --intro-rise: clamp(185px, 32svh, 320px);
  --exit-rise: clamp(146px, 25svh, 245px);
}
.motion-enabled .feature .feature-head {
  transform: translateY(calc(var(--motion-depth) * (var(--image-away) * 54px - var(--handoff-lift) * 60px - var(--exit) * 100px)));
  opacity: max(.025, calc(1 - var(--image-away) * .78 - var(--exit) * 1.13));
}
.motion-enabled .feature .screen-link {
  transform: translate(
    calc(var(--image-away) * var(--image-direction) * clamp(34px, 5vw, 74px)),
    calc(var(--motion-depth) * (var(--image-away) * var(--image-rise) - var(--handoff-lift) * 105px - var(--exit) * var(--exit-rise)))
  ) scale(calc(1 - var(--image-away) * .18 - var(--exit) * .105));
  opacity: max(.02, calc(1 - var(--image-away) - var(--exit) * 1.16));
}
.motion-enabled .feature :is(.shot-choices, figcaption) {
  transform: translateY(calc(var(--motion-depth) * (var(--controls-away) * 118px - var(--handoff-lift) * 105px - var(--exit) * 152px)));
  opacity: max(.02, calc(1 - var(--controls-away) - var(--exit) * 1.18));
}
.motion-enabled .feature :is(.feature-grid > .details, .chapter-notes) {
  transform: translate(
    calc(var(--intro-away) * var(--intro-direction) * clamp(45px, 7vw, 106px)),
    calc(var(--motion-depth) * (var(--intro-away) * var(--intro-rise) - var(--exit) * 158px))
  );
  opacity: max(.02, calc(1 - var(--intro-away) - var(--exit) * 1.25));
}
.motion-enabled .feature::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: min(100%, 78svh);
  pointer-events: none;
  background: radial-gradient(ellipse at var(--halo-x, 72%) 40%,
    color-mix(in srgb, var(--violet) 23%, transparent), transparent 68%);
  opacity: calc(3.6 * var(--image-progress, 1) * var(--image-away));
}
.motion-enabled .feature :is(.screen-link, .shot-choices, .details, .chapter-notes):is(:focus-visible, :has(:focus-visible)) {
  transform: none; opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
  .motion-enabled .hero .glints i:nth-child(odd) { animation: glint 7s ease-in-out infinite alternate; }
}
@keyframes glint { from { opacity: .58; transform: scale(.83); } to { opacity: .97; transform: scale(1.12); } }

/* Shared axes */
main { isolation: auto; }
img, video { max-width: 100%; }
.site-bar, .hero-content, .feature-bar, .feature-head, .feature-grid, .footer-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}
:is(.site-bar, .hero-content, .feature-bar, .feature-head, .feature-grid, .footer-row) > * { min-width: 0; }
html:not(.motion-enabled) { scroll-behavior: auto; }
:root {
  --on-accent: #fff;
  --violet: #5243c2;
  --teal: #256766;
  --section-gap: clamp(18px, 2.8vw, 36px);
  --panel-radius: 12px;
  --glint: #a293f2;
}
html[data-theme="night"] { --on-accent: #1d1708; --violet: #9478ff; --teal: #39d5c4; --glint: #9478ff; }

/* Header and controls */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--line); }
.site-bar { min-height: 68px; align-items: center; padding-block: 8px; }
.brand { grid-column: 1 / 4; display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; }
.brand-mark {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 8px; color: var(--accent);
  background: linear-gradient(145deg, var(--surface-strong), var(--accent-soft));
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: grid; line-height: 1.25; }
.brand-text strong { color: var(--ink-strong); font-size: .98rem; }
.brand-text small { margin-top: 4px; color: var(--muted); font: 600 .61rem/1.2 var(--mono); letter-spacing: .06em; }
.site-bar nav { grid-column: 4 / 9; display: flex; justify-content: center; gap: clamp(8px, 2vw, 30px); }
.site-bar nav a, .footer a { color: var(--muted); font-size: .84rem; }
.site-bar nav a { white-space: nowrap; }
.site-bar nav a:hover, .footer a:hover { color: var(--accent-strong); }
.header-actions { grid-column: 9 / 13; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.button, .theme-toggle, .rail-controls button {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  min-height: 42px; padding: 8px 16px; border: 1px solid transparent; border-radius: 999px;
  font-size: .86rem; font-weight: 650; line-height: 1.25; white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.button.small, .theme-toggle { min-height: 36px; padding: 6px 12px; font-size: .78rem; }
.button.dark, .button.primary { color: var(--on-accent); background: var(--accent); }
.button.dark:hover, .button.primary:hover { background: var(--accent-strong); }
.button.primary { box-shadow: 0 6px 20px var(--accent-soft); }
.button.secondary, .theme-toggle, .rail-controls button { color: var(--ink); background: var(--surface-strong); border-color: var(--line); }
.button.secondary:hover, .theme-toggle:hover, .rail-controls button:hover { color: var(--accent-strong); border-color: var(--line-strong); }
.theme-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.play-glyph { color: var(--accent-strong); font-size: .74em; }

/* Optical hero and real client windows */
.hero {
  position: relative; isolation: isolate; text-align: center;
  padding-block: clamp(34px, 5vw, 78px) clamp(22px, 4vw, 60px);
  background: var(--paper-alt);
}
.hero-backdrop { position: absolute; z-index: -3; inset: 0; overflow: hidden; background: url("assets/glass-poster.webp") center / cover no-repeat; }
.hero-backdrop video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 48%; }
html[data-theme="night"] .hero-backdrop { filter: invert(.92) hue-rotate(184deg) saturate(1.32) brightness(.58) contrast(1.14); }
.hero::after {
  content: ""; position: absolute; z-index: -2; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, #f6f6fbcb, #f8f6ffd0 18%, #faf9ff2c 57%, var(--paper) 100%);
}
html[data-theme="night"] .hero::after {
  background: radial-gradient(ellipse at 20% 45%, #6e45b63a, transparent 52%),
    radial-gradient(ellipse at 88% 62%, #c18c2326, transparent 46%),
    linear-gradient(180deg, #0b0e168f, #0b0e169c 25%, #0b0e161a 66%, var(--paper) 100%);
}
.hero-content { row-gap: var(--section-gap); }
.hero-lead, .hero-gallery { grid-column: 2 / 12; }
.platform {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 4px 11px;
  border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink);
  background: var(--surface-strong); font-size: .76rem; font-weight: 650; text-wrap: balance;
}
.platform span { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
h1, .feature-head h2 { color: var(--ink-strong); font-family: var(--display); letter-spacing: -.02em; text-wrap: balance; }
.hero h1 { margin: 14px 0 10px; font-size: clamp(2.45rem, 5.1vw, 4.7rem); font-weight: 700; line-height: 1.16; }
.hero h1 em { color: var(--accent-strong); font-style: normal; white-space: nowrap; }
.hero-copy { max-width: 46rem; margin-inline: auto; color: var(--ink); text-wrap: pretty; }
.hero-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hero-pillars { grid-column: 1 / -1; }
.hero-pillars {
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 10px var(--gutter); text-align: left;
}
.hero-pillar {
  grid-column: span 3; display: grid; align-content: start; grid-template-columns: auto 1fr;
  gap: 2px 9px; padding: clamp(9px, 1.2vw, 16px); border: 1px solid var(--line-strong);
  border-radius: var(--panel-radius); background-color: var(--surface-strong); box-shadow: var(--card-shadow);
}
.hero-pillar span { align-self: center; color: var(--accent-strong); font: 600 .69rem var(--mono); }
.hero-pillar strong { color: var(--ink-strong); font-size: .86rem; }
.hero-pillar small { grid-column: 2; color: var(--muted); font-size: .75rem; }
.hero-pillar:hover { border-color: var(--accent); }

.gallery { min-width: 0; position: relative; text-align: left; }
.screen-link {
  position: relative; display: block; overflow: hidden; aspect-ratio: 61 / 39;
  background: #141a27; border-radius: clamp(6px, 1vw, 14px); box-shadow: var(--screen-shadow);
}
.screen-link::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px #ffffff45;
}
.screen-link img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.zoom-hint {
  position: absolute; inset: auto 9px 9px auto; padding: 4px 9px; border-radius: 999px;
  border: 1px solid #ffffff8c; background: #121924ef; color: #fff; font-size: .72rem;
  transition: background-color .2s ease;
}
.screen-link:hover .zoom-hint, .screen-link:focus-visible .zoom-hint { background: #484087; }
.shot-choices {
  position: relative; z-index: 1; width: fit-content; max-width: 100%; margin: 14px 0 0 auto;
  display: flex; gap: 4px; flex-wrap: wrap; padding: 4px;
  border: 1px solid var(--line-strong); border-radius: 22px;
  background: var(--surface); box-shadow: var(--card-shadow); backdrop-filter: blur(14px);
}
.shot-choices button {
  min-height: 30px; padding: 5px 10px; border-radius: 999px; border: 0;
  color: var(--ink); font-size: .76rem;
  transition: background-color .18s ease, color .18s ease;
}
.shot-choices button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.shot-choices button:not([aria-pressed="true"]):hover { background: var(--accent-soft); color: var(--accent-strong); }
.gallery figcaption { margin-top: 9px; color: var(--muted); }
.shot-caption { color: var(--ink); font-size: .82rem; font-weight: 720; }
.shot-note { font-size: .76rem; }

/* Sticky reading rail */
.feature-navigation {
  position: sticky; top: 0; z-index: 6;
  border-block: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(14px);
}
.feature-bar { min-height: calc(var(--nav-height) - 2px); align-items: center; }
.feature-nav {
  grid-column: 1 / 10; display: flex; gap: 4px; padding: 6px 3px;
  overflow-x: auto; scrollbar-width: none;
}
.feature-nav::-webkit-scrollbar { display: none; }
.feature-nav a {
  flex: none; padding: 5px 9px; border: 1px solid transparent; border-radius: 999px;
  color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.feature-nav a:hover, .feature-nav a[aria-current] { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--line-strong); }
.feature-nav a:focus-visible { outline-offset: -2px; }
.rail-controls { grid-column: 10 / 13; display: flex; justify-content: flex-end; gap: 5px; }
.rail-controls button { min-height: 32px; padding: 4px 9px; font-size: .74rem; }
.rail-controls button[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--line-strong); }
.motion-toggle::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.motion-toggle[aria-pressed="true"]::before { opacity: 1; box-shadow: 0 0 7px var(--accent); }
.motion-toggle:disabled { cursor: default; }
.reading-progress { position: absolute; inset: auto 0 -1px; height: 2px; pointer-events: none; }
.reading-progress-bar {
  display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--accent));
  transform: scaleX(var(--scroll-progress, 0)); transform-origin: left center;
}

/* Chapter axes and depth */
.feature {
  position: relative; isolation: isolate; display: grid; align-items: center;
  min-height: calc(100svh - var(--nav-height)); padding-block: clamp(42px, 6vw, 94px);
}
.feature::before {
  content: ""; position: absolute; z-index: -2; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at var(--halo-x, 72%) 55%, var(--chapter-halo, var(--halo)), transparent 68%),
    linear-gradient(180deg, transparent, var(--chapter-wash, var(--wash)) 23% 76%, transparent);
  mask-image: linear-gradient(transparent, #000 17% 82%, transparent);
}
.feature.alternate { --halo-x: 23%; }
.glints { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.glints i {
  position: absolute; width: var(--size, 20px); aspect-ratio: 1; opacity: .88;
  filter: drop-shadow(0 0 5px var(--spark, var(--glint))) drop-shadow(0 0 18px var(--spark, var(--glint)));
}
.glints i::after {
  content: ""; display: block; width: 100%; height: 100%;
  background: linear-gradient(145deg, #fff 25%, var(--spark, var(--glint)) 64%, #fff);
  clip-path: polygon(50% 0, 59% 39%, 100% 50%, 59% 60%, 50% 100%, 40% 60%, 0 50%, 39% 40%);
}
.glints i:nth-child(1) { left: 4.6%; top: 29%; --size: 30px; }
.glints i:nth-child(2) { right: 7%; top: 13%; --size: 21px; --spark: #929ff4; }
.glints i:nth-child(3) { right: 3.8%; top: 53%; --size: 35px; --spark: #c280bf; }
.glints i:nth-child(4) { left: 12%; bottom: 10%; --size: 17px; --spark: #d7a56f; }
.feature.alternate .glints { transform: scaleX(-1); }
.feature:nth-of-type(3n) .glints i:nth-child(3) { top: 73%; }
.hero .glints i:nth-child(1) { top: 44%; left: 8%; }
.hero .glints i:nth-child(3) { top: 38%; right: 8%; }

.feature-head { align-items: start; row-gap: 7px; margin-bottom: var(--section-gap); }
.chapter-eyebrow {
  grid-column: 1 / 4; display: flex; gap: 8px; align-items: center;
  color: var(--accent-strong); font-size: .8rem; font-weight: 680;
}
.chapter-index {
  display: grid; place-items: center; width: 34px; min-height: 30px;
  border-block: 1px solid var(--line-strong); background: var(--accent-soft);
  font: 700 .81rem var(--mono); font-variant-numeric: tabular-nums;
}
.feature-head h2 { grid-column: 4 / 9; font-size: clamp(1.75rem, 3vw, 2.62rem); line-height: 1.24; font-weight: 700; }
.feature-head > p:last-child { grid-column: 9 / 13; color: var(--muted); font-size: .92rem; text-wrap: pretty; }
.feature-grid { align-items: start; row-gap: var(--section-gap); }
.feature-grid > .gallery { grid-column: var(--image-columns, 1 / 9); grid-row: 1; }
.feature-grid > :is(.details, .chapter-notes) { grid-column: var(--notes-columns, 9 / 13); grid-row: var(--notes-row, 1); }
.feature--theater { --image-columns: 2 / 12; --notes-columns: 1 / 13; --notes-row: 2; }
.feature--workflow { --image-columns: 5 / 13; --notes-columns: 1 / 5; --image-direction: 1; --intro-direction: -1; }
.feature--mods { --image-columns: 7 / 13; --notes-columns: 1 / 7; --image-direction: 1; --intro-direction: -1; }
.feature--map { --image-columns: 1 / 10; --notes-columns: 10 / 13; }
.feature--compare { --image-columns: 3 / 11; --notes-columns: 1 / 13; --notes-row: 2; }
.feature--chat { --image-columns: 5 / 13; --notes-columns: 1 / 5; --image-direction: 1; --intro-direction: -1; }
.feature--data { --image-columns: 6 / 13; --notes-columns: 1 / 6; --image-direction: 1; --intro-direction: -1; }
.feature--matrix { --image-columns: 3 / 11; --notes-columns: 1 / 13; --notes-row: 2; }
.feature--theater, .feature--matrix { --chapter-halo: color-mix(in srgb, var(--violet) 16%, var(--paper)); }
.feature--mods { --chapter-halo: color-mix(in srgb, #d48fa5 21%, var(--paper)); }
.feature--map, .feature--compare { --chapter-halo: color-mix(in srgb, #6f9fdd 24%, var(--paper)); }
.feature--chat { --chapter-halo: color-mix(in srgb, var(--teal) 16%, var(--paper)); }


/* Distinct chapter structures */
.details, .chapter-notes { min-width: 0; }
.feature-grid > :is(.details, .chapter-notes) { margin-top: clamp(30px, 7svh, 86px); }
.details {
  display: grid; padding: 2px clamp(11px, 1.5vw, 19px);
  border: 1px solid var(--card-border); border-radius: var(--panel-radius);
  background-color: var(--surface); box-shadow: 0 0 0 1px var(--card-ring), var(--card-shadow);
  backdrop-filter: blur(12px);
}
.details > div { padding-block: 12px; }
.details > div + div { border-top: 1px solid var(--line); }
.details dt, .steps h3 { margin-bottom: 3px; color: var(--accent-strong); font-size: .91rem; font-weight: 720; }
.details dd, .steps p { color: var(--muted); font-size: .85rem; line-height: 1.65; }
.feature-grid > .steps { padding-block: 4px; }
.steps { list-style: none; counter-reset: step; }
.steps li { position: relative; padding: 13px 0 13px 34px; counter-increment: step; }
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; top: 13px; left: 0;
  width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--accent-soft); color: var(--accent-strong);
  font: 700 .7rem var(--mono); font-variant-numeric: tabular-nums;
}

.feature:is(.feature--theater, .feature--mods, .feature--compare, .feature--matrix) .details {
  grid-template-columns: subgrid; row-gap: 12px; padding: 0; border: 0;
  background: none; box-shadow: none; backdrop-filter: none;
}
.feature:is(.feature--theater, .feature--compare, .feature--matrix) .details { margin-top: 0; }
.feature:is(.feature--theater, .feature--mods, .feature--compare, .feature--matrix, .feature--data) .details > div {
  min-width: 0; padding: clamp(11px, 1.4vw, 18px);
  border: 1px solid var(--line-strong); border-radius: var(--panel-radius);
  background-color: var(--surface-strong); box-shadow: var(--card-shadow);
}
.feature:is(.feature--theater, .feature--mods, .feature--matrix) .details > div { grid-column: span 3; }
.feature--compare .details > div { grid-column: span 4; border-top: 2px solid var(--accent); }
.feature--compare .details > div:nth-child(2) { border-top-color: var(--violet); }
.feature--compare .details > div:nth-child(3) { border-top-color: var(--teal); }
.feature--matrix .details > div:nth-child(odd) { background-color: var(--surface-muted); }
.feature--map .feature-grid > .details { margin-top: clamp(44px, 11svh, 118px); }
.feature--map .details { border-block-start: 2px solid var(--teal); }
.feature--map .details dt, .feature--chat .details dt { color: var(--teal); }

.shortcut-example {
  width: fit-content; max-width: 100%; display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface-muted); color: var(--ink); font-size: .8rem;
}
.shortcut-example span:last-child { margin-left: 4px; }
.chapter-notes .details { margin-top: 12px; }
kbd {
  padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: 5px;
  background: var(--surface-strong); box-shadow: 0 2px 0 var(--line-strong); color: var(--ink);
  font-family: var(--mono); font-size: .75em; white-space: nowrap;
}
.chat-example { display: grid; gap: 7px; }
.chat-example p {
  width: fit-content; max-width: 94%; padding: 7px 11px; border: 1px solid var(--line);
  border-radius: 11px 11px 11px 2px; background: var(--surface-strong); color: var(--ink);
  font-size: .84rem;
}
.chat-example p + p {
  justify-self: end; border-radius: 11px 11px 2px 11px;
  background: color-mix(in srgb, var(--teal) 13%, var(--surface-strong)); color: var(--teal);
}
.feature--data .details { gap: 9px; padding: 0; border: 0; background: none; box-shadow: none; }
.feature--data .details > div:nth-child(2) { background-color: var(--surface-muted); }
.tri-dots { display: inline-flex; align-items: center; gap: 3px; margin-right: 7px; vertical-align: .12em; }
.tri-dots i { width: 7px; height: 7px; border-radius: 50%; }
.dot-weapon { background: #e08c3c; }
.dot-vitality { background: #58b667; }
.dot-spirit { background: #9b6dff; }
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .motion-enabled :is(.hero-pillar, .details > div, .steps li):hover {
    background-image: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--spotlight), transparent 70%);
  }
}

/* Footer, floating return and native lightboxes */
.footer { background: var(--paper-alt); border-top: 1px solid var(--line); padding-block: clamp(26px, 4vw, 56px) 16px; }
.footer-row { align-items: start; row-gap: 22px; }
.footer-brand { grid-column: 1 / 5; }
.footer-contact { grid-column: 5 / 9; }
.footer-project { grid-column: 9 / 13; }
.footer h2 { color: var(--ink-strong); font-size: .98rem; font-weight: 720; }
.footer p { margin-top: 7px; color: var(--muted); font-size: .82rem; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; margin-top: 9px; }
.footer-link { padding: 0; border: 0; color: var(--muted); font-size: .84rem; }
.footer-link:hover { color: var(--accent-strong); }
.footer-contacts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin-top: 7px; font-size: .84rem; }
.footer-contacts dt { color: var(--muted); }
.footer-contacts dd { color: var(--ink); font-weight: 650; }
.footer-qq { font-family: var(--mono); }
.footer-support { margin-top: 11px; color: var(--accent-strong); }
.footer-end { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.back-to-top {
  position: fixed; z-index: 8; right: max(12px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-strong);
  color: var(--accent-strong); box-shadow: var(--card-shadow); font-size: 1.15rem;
}
.back-to-top:hover { border-color: var(--accent); }
dialog {
  max-width: calc(100% - 24px); max-height: calc(100% - 24px); padding: 0;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-strong);
  color: var(--ink); box-shadow: 0 24px 86px #090e235e;
}
.capture-dialog { width: min(1244px, 100% - 40px); }
.demo-dialog { width: min(760px, 100% - 40px); }
.dialog-surface { padding: clamp(8px, 1.3vw, 16px); }
.info-dialog { width: min(660px, 100% - 28px); }
.info-dialog .dialog-surface, .donate-dialog .dialog-surface { padding: clamp(12px, 2.6vw, 26px); }
:is(.info-dialog, .donate-dialog) .dialog-head h2 { font-size: 1.05rem; }
.policy-version { color: var(--muted); font: .78rem/1.6 var(--body); }
.policy-version time { font-family: var(--mono); }
.policy-content section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.policy-content h3, .credits-list dt { color: var(--ink-strong); font-size: .93rem; font-weight: 700; }
.policy-content p, .credits-list dd { margin-top: 5px; color: var(--muted); font-size: .88rem; }
.credits-dialog { width: min(460px, 100% - 28px); }
.credits-list > div { padding-block: 10px; border-top: 1px solid var(--line); }
.donate-dialog { width: min(420px, 100% - 28px); }
.donate-qr { display: block; width: auto; height: auto; max-height: min(62svh, 495px); margin: 12px auto; border-radius: 8px; }
.donate-link { width: 100%; }

.dialog-head, .dialog-foot, .dialog-title-group, .dialog-actions, .dialog-nav { display: flex; gap: 8px; align-items: center; }
.dialog-head, .dialog-foot { justify-content: space-between; flex-wrap: wrap; }
.dialog-head { margin-bottom: 8px; }
.dialog-title-group { flex-wrap: wrap; min-width: 0; }
.dialog-head h2 { color: var(--ink-strong); font-size: .96rem; }
.dialog-counter {
  border-radius: 999px; padding: 3px 7px; background: var(--accent-soft);
  color: var(--accent-strong); font: 650 .74rem var(--mono);
}
.dialog-actions { margin-left: auto; }
.dialog-nav .icon-btn { min-width: 36px; padding-inline: 6px; }
.dialog-stage { display: grid; place-items: center; border-radius: 7px; overflow: hidden; background: #141a27; }
.capture-dialog img { display: block; width: 100%; height: auto; max-height: 72svh; object-fit: contain; }
.dialog-foot { margin-top: 8px; }
.dialog-foot p, .demo-dialog p { color: var(--muted); font-size: .81rem; }
.dialog-foot a { color: var(--accent-strong); font-size: .81rem; text-decoration: underline; text-underline-offset: 3px; }
.demo-dialog video { width: 100%; display: block; max-height: 67svh; border-radius: 7px; background: #141a27; }
.demo-dialog p { margin-top: 8px; }
dialog::backdrop { background: #101427ab; backdrop-filter: blur(5px); }
html:has(dialog[open]) { overflow-y: hidden; scrollbar-gutter: stable; }
.motion-enabled dialog {
  opacity: 0; transform: scale(.975); transition: opacity .25s ease, transform .3s var(--ease-out-expo);
  transition: opacity .25s ease, transform .3s var(--ease-out-expo), display .3s allow-discrete, overlay .3s allow-discrete;
}
.motion-enabled dialog[open] { opacity: 1; transform: none; }
.motion-enabled dialog::backdrop { opacity: 0; transition: opacity .25s ease, display .25s allow-discrete, overlay .25s allow-discrete; }
.motion-enabled dialog[open]::backdrop { opacity: 1; }
@starting-style {
  .motion-enabled dialog[open] { opacity: 0; transform: scale(.975); }
  .motion-enabled dialog[open]::backdrop { opacity: 0; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

@media (max-width: 960px) {
  :root { --cols: 6; --nav-height: 48px; }
  .swiss-grid-inner > span:nth-child(n+7) { display: none; }
  .site-bar { min-height: 58px; }
  .brand { grid-column: 1 / 3; }
  .site-bar nav { grid-column: 3 / 5; gap: clamp(5px, 1vw, 10px); }
  .site-bar nav a { font-size: .76rem; }
  .header-actions { grid-column: 5 / 7; }
  .hero-lead, .hero-gallery { grid-column: 1 / 7; }
  .feature-nav { grid-column: 1 / 5; }
  .rail-controls { grid-column: 5 / 7; }
  .feature { min-height: 0; --motion-depth: .62; --image-direction: 0; --intro-direction: 0; }
  .feature :is(.feature-head > *, .feature-grid > .gallery, .feature-grid > .details, .feature-grid > .chapter-notes) { grid-column: 1 / 7; }
  .feature .feature-grid > :is(.details, .chapter-notes) { grid-row: 2; margin-top: 0; }
  .feature--compare .details > div { grid-column: span 3; }
  .feature--compare .details > div:last-child { grid-column: 1 / -1; }
  .footer-brand { grid-column: 1 / 3; }
  .footer-contact { grid-column: 3 / 5; }
  .footer-project { grid-column: 5 / 7; }
}
@media (max-width: 600px) {
  :root { --cols: 4; --nav-height: 46px; }
  .swiss-grid-inner > span:nth-child(n+5) { display: none; }
  .swiss-grid-inner > span > i { top: calc(var(--nav-height) + 12px); margin-left: 2px; }
  .site-bar nav { display: none; }
  .header-actions { grid-column: 3 / 5; gap: 4px; }
  .brand { gap: 6px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-mark svg { width: 17px; height: 17px; }
  .brand-text strong { font-size: .88rem; }
  .brand-text small { font-size: .51rem; letter-spacing: .035em; }
  .header-actions :is(.theme-toggle, .button) { min-height: 34px; padding-inline: 7px; gap: 4px; font-size: .7rem; }
  .theme-dot { width: 6px; height: 6px; box-shadow: none; }
  .hero h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .hero h1 em { display: block; }
  .hero-copy { font-size: .91rem; }
  .hero-lead, .hero-gallery, .feature :is(.feature-head > *, .feature-grid > .gallery, .feature-grid > .details, .feature-grid > .chapter-notes) { grid-column: 1 / 5; }
  .hero-pillar, .feature:is(.feature--theater, .feature--mods, .feature--matrix, .feature--compare) .details > div { grid-column: span 2; }
  .feature.feature--compare .details > div:last-child { grid-column: 1 / -1; }
  .hero-pillar { gap: 3px 6px; }
  .hero-pillar strong { font-size: .8rem; }
  .hero-pillar small { grid-column: 1 / -1; font-size: .72rem; }
  .hero-actions .button { min-height: 38px; padding-inline: 12px; font-size: .79rem; }
  .shot-choices { margin-top: 10px; }
  .shot-choices button { font-size: .72rem; }
  .zoom-hint { inset: auto 5px 5px auto; padding: 2px 6px; font-size: .66rem; }

  .feature-nav { grid-column: 1 / 3; }
  .rail-controls { grid-column: 3 / 5; }
  .rail-controls button { min-height: 30px; padding-inline: 7px; gap: 4px; font-size: .7rem; }
  .feature-nav a { padding-inline: 7px; font-size: .76rem; }
  .feature { --motion-depth: .48; }
  .feature-head > p:last-child { font-size: .9rem; }
  .glints i:nth-child(1) { --size: 17px; }
  .glints i:nth-child(3) { --size: 23px; }
  .footer-brand { grid-column: 1 / 5; }
  .footer-contact { grid-column: 1 / 3; }
  .footer-project { grid-column: 3 / 5; }
}
@media (max-width: 360px) {
  .platform { font-size: .68rem; }
  .feature:is(.feature--theater, .feature--mods, .feature--matrix, .feature--compare) .details > div { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-backdrop video { display: none; }
  *, *::before, *::after { transition-duration: 0s !important; }
}

