/* =========================================================
   音乐如何影响情绪 — 交互式文献综述
   Design tokens & global styles
   ========================================================= */

:root {
  --bg: #08090c;
  --bg-soft: #0c0e13;
  --panel: #101319;
  --panel-2: #151920;
  --line: rgba(242, 238, 230, 0.09);
  --line-strong: rgba(242, 238, 230, 0.18);
  --txt: #f2eee6;
  --txt-dim: #b6b0a4;
  --txt-mute: #7d786f;
  --amber: #e6a860;
  --amber-bright: #f3c07c;
  --amber-soft: rgba(230, 168, 96, 0.12);
  --teal: #7fc4b8;
  --teal-soft: rgba(127, 196, 184, 0.12);
  --violet: #b295d6;
  --violet-soft: rgba(178, 149, 214, 0.12);
  --rose: #d98a8a;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC",
    "Source Han Serif CN", "SimSun", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas,
    "Liberation Mono", monospace;
  --max: 1200px;
  --nav-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

img, svg, canvas { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(230, 168, 96, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.01em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--amber);
  opacity: 0.55;
}
.eyebrow .num {
  color: var(--txt-mute);
  letter-spacing: 0.1em;
}

.h2 {
  font-size: clamp(1.9rem, 3.6vw, 3.05rem);
  line-height: 1.22;
  margin-bottom: 22px;
}
.h2 em {
  font-style: normal;
  color: var(--amber);
}

.lede {
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  color: var(--txt-dim);
  max-width: 62ch;
  line-height: 1.9;
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-mute);
}

.small { font-size: 13px; line-height: 1.8; color: var(--txt-mute); }

strong { color: var(--txt); font-weight: 600; }
em.k { font-style: normal; color: var(--amber); }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

section {
  position: relative;
  padding: clamp(80px, 9vw, 132px) 0;
}

.section-head {
  max-width: 780px;
  margin-bottom: clamp(46px, 6vw, 76px);
}

.sec-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--txt-mute);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
}

/* ---------- Progress & nav ---------- */

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--amber), var(--amber-bright));
  z-index: 120;
  transition: width 0.1s linear;
}

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 110;
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
    backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 9, 12, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.brand-mark {
  width: 26px; height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--amber);
  font-size: 12px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  font-size: 13px;
  color: var(--txt-dim);
  padding: 8px 13px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.25s, background 0.25s;
}
.nav-links a:hover { color: var(--txt); background: rgba(255, 255, 255, 0.045); }
.nav-links a.active { color: var(--amber); background: var(--amber-soft); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--nav-h) + 40px) 0 46px;
  overflow: hidden;
}
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.9;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 62%, rgba(230, 168, 96, 0.10), transparent 70%),
    linear-gradient(180deg, rgba(8, 9, 12, 0.62) 0%, rgba(8, 9, 12, 0) 28%,
      rgba(8, 9, 12, 0.1) 55%, rgba(8, 9, 12, 0.96) 96%);
  z-index: 1;
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 8vh;
}
.hero-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--txt-mute);
  line-height: 2;
  text-transform: uppercase;
}
.hero-tag b { color: var(--txt-dim); font-weight: 400; }

.hero h1 {
  font-size: clamp(3.1rem, 9.2vw, 7.6rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin-bottom: 34px;
}
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span {
  display: block;
  transform: translateY(110%);
  animation: rise 1.15s var(--ease) forwards;
}
.hero h1 .line:nth-child(2) > span { animation-delay: 0.12s; }
.hero h1 .thin {
  color: var(--txt-mute);
  font-style: italic;
}
@keyframes rise { to { transform: translateY(0); } }

.hero-sub {
  max-width: 560px;
  font-size: clamp(0.98rem, 1.25vw, 1.1rem);
  color: var(--txt-dim);
  line-height: 1.95;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.45s forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.6s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-family: var(--sans);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--txt);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--amber);
  color: var(--amber);
  transform: translateY(-2px);
}
.btn.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #16120b;
  font-weight: 600;
}
.btn.primary:hover {
  background: var(--amber-bright);
  color: #16120b;
  box-shadow: 0 12px 34px -12px rgba(230, 168, 96, 0.7);
}
.btn.small { padding: 9px 16px; font-size: 12.5px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
}

.icon { width: 15px; height: 15px; flex: none; }
.icon path, .icon rect { fill: currentColor; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: clamp(28px, 6vw, 72px);
  justify-content: start;
  margin-top: clamp(44px, 7vh, 76px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.75s forwards;
}
.hero-stats .v {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  line-height: 1;
  display: block;
  margin-bottom: 8px;
  color: var(--txt);
}
.hero-stats .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--txt-mute);
  text-transform: uppercase;
}

.scroll-cue {
  position: absolute;
  right: 32px;
  bottom: 40px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--txt-mute);
  writing-mode: vertical-rl;
}
.scroll-cue .bar {
  width: 1px; height: 54px;
  background: linear-gradient(var(--txt-mute), transparent);
  animation: pulseBar 2.4s ease-in-out infinite;
}
@keyframes pulseBar {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Concept section ---------- */

.concept-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(30px, 5vw, 76px);
  align-items: start;
}

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 30px;
  width: fit-content;
  flex-wrap: wrap;
}
.seg button {
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--txt-mute);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.seg button:hover { color: var(--txt-dim); }
.seg button[aria-selected="true"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.panel-swap {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(26px, 3.4vw, 40px);
  background: linear-gradient(160deg, var(--panel), var(--bg-soft));
  min-height: 330px;
  position: relative;
  overflow: hidden;
}
.panel-swap::before {
  content: "";
  position: absolute;
  top: -1px; left: 32px; right: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0.5;
}
.panel-swap .swap-item {
  display: none;
  animation: fadeSwap 0.55s var(--ease);
}
.panel-swap .swap-item.on { display: block; }
@keyframes fadeSwap {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.swap-q {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.1vw, 1.75rem);
  line-height: 1.4;
  margin-bottom: 18px;
  text-wrap: balance;
}
.swap-q span { color: var(--amber); }
.swap-a { color: var(--txt-dim); font-size: 15px; line-height: 1.9; }
.swap-meta {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--txt-mute);
  text-transform: uppercase;
}

.three-list { display: grid; gap: 2px; }
.three-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.three-item:last-child { border-bottom: 1px solid var(--line); }
.three-item .idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  padding-top: 4px;
}
.three-item h4 {
  font-size: 17px;
  font-family: var(--sans);
  font-weight: 600;
  margin-bottom: 5px;
}
.three-item .en {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--txt-mute);
  text-transform: uppercase;
  margin-left: 8px;
  font-weight: 400;
}
.three-item p {
  font-size: 14px;
  color: var(--txt-dim);
  line-height: 1.8;
  margin: 0;
}

/* ---------- Circumplex ---------- */

.circ-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 64px);
  align-items: center;
}

.circ-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(230, 168, 96, 0.05), transparent 68%),
    var(--bg-soft);
  padding: 22px;
  touch-action: none;
}
#circumplex { width: 100%; height: auto; cursor: crosshair; user-select: none; }
#circumplex text { font-family: var(--sans); user-select: none; }
.axis-line { stroke: var(--line-strong); stroke-width: 1; }
.grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 6; }
.quad-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  fill: var(--txt-mute);
  text-transform: uppercase;
}
.emo-word {
  font-size: 13px;
  fill: var(--txt-dim);
  transition: fill 0.3s, font-size 0.3s;
}
.emo-word.hot { fill: var(--amber); font-size: 15px; }
.handle { cursor: grab; }
.handle:active { cursor: grabbing; }

.circ-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.readout-cell {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}
.readout-cell .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--txt-mute);
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.readout-cell .v {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
}
.readout-cell .v small { font-size: 11px; color: var(--txt-mute); font-family: var(--mono); }

.circ-panel h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  margin-bottom: 14px;
}
.circ-panel .near {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid var(--amber);
  border-radius: 999px;
  color: var(--amber);
  font-size: 13px;
  margin-bottom: 20px;
  background: var(--amber-soft);
}
.circ-panel .near b { font-family: var(--serif); font-size: 17px; font-weight: 500; }

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}
.chip {
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--txt-dim);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--txt); }
.chip.on {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-soft);
}

.cue-table { width: 100%; border-collapse: collapse; margin-top: 22px; }
.cue-table th, .cue-table td {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: top;
}
.cue-table th {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--txt-mute);
  text-transform: uppercase;
  font-weight: 400;
}
.cue-table td:first-child { color: var(--txt-mute); width: 34%; }
.cue-table td:last-child { color: var(--txt-dim); }

/* ---------- Mechanism map ---------- */

.mech-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.mech-map-box {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-soft);
  padding: 20px;
  position: relative;
}
#mechMap { width: 100%; height: auto; }
.mech-node { cursor: pointer; }
.mech-node circle.core {
  transition: r 0.3s var(--ease), fill 0.3s, stroke 0.3s;
}
.mech-node:hover circle.core { r: 9; }
.mech-node text {
  font-family: var(--sans);
  font-size: 13px;
  fill: var(--txt-dim);
  pointer-events: none;
  transition: fill 0.3s;
}
.mech-node.active circle.core { fill: var(--amber); stroke: var(--amber); }
.mech-node.active text { fill: var(--amber); }
.mech-node.dim { opacity: 0.28; }
.mech-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--txt-mute);
  text-transform: uppercase;
}

.mech-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(24px, 3vw, 34px);
  background: linear-gradient(170deg, var(--panel), var(--bg-soft));
  min-height: 372px;
  display: flex;
  flex-direction: column;
}
.mech-panel .tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.mech-panel h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  margin-bottom: 4px;
}
.mech-panel .en-name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--txt-mute);
  margin-bottom: 20px;
  display: block;
}
.mech-panel .def { color: var(--txt-dim); font-size: 15px; line-height: 1.9; }
.mech-facts { margin-top: auto; padding-top: 24px; }
.fact-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.fact-row .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--txt-mute);
  text-transform: uppercase;
  padding-top: 2px;
}
.fact-row .v { color: var(--txt-dim); line-height: 1.7; }

.scenario {
  margin-top: 42px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  align-items: start;
}
.scenario .prompt {
  font-size: 14px;
  color: var(--txt-dim);
  line-height: 1.8;
}
.scenario-options { display: flex; flex-wrap: wrap; gap: 8px; }
.scenario-result {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--txt-dim);
  line-height: 1.8;
  min-height: 52px;
}
.scenario-result b { color: var(--amber); font-weight: 500; }

/* ---------- Dopamine / timeline ---------- */

.dopa {
  background:
    radial-gradient(ellipse 70% 60% at 75% 20%, rgba(178, 149, 214, 0.10), transparent 65%),
    radial-gradient(ellipse 50% 50% at 15% 80%, rgba(230, 168, 96, 0.07), transparent 70%);
}
.dopa-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

.timeline-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(12, 14, 19, 0.7);
  padding: 22px;
  backdrop-filter: blur(8px);
}
#dopeChart { width: 100%; height: auto; touch-action: none; cursor: ew-resize; }
.tl-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.tl-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.tl-cell {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
}
.tl-cell .k {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  color: var(--txt-mute);
  text-transform: uppercase;
  margin-bottom: 5px;
}
.tl-cell .v { font-size: 13px; color: var(--txt-dim); }
.tl-cell.hot .v { color: var(--amber); }

.phase-legend { display: grid; gap: 14px; margin-top: 26px; }
.phase-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.phase-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
  transform: translateY(-2px);
}
.phase-row .name { font-size: 14px; }
.phase-row .name small { display: block; color: var(--txt-mute); font-size: 11.5px; }
.phase-row .val { font-family: var(--mono); font-size: 10px; color: var(--txt-mute); letter-spacing: 0.1em; }

/* ---------- Lab ---------- */

.lab {
  background:
    linear-gradient(180deg, rgba(230, 168, 96, 0.03), transparent 40%),
    var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.lab-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 54px);
  align-items: start;
}

.lab-controls {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  background: var(--panel);
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}
.ctrl { margin-bottom: 26px; }
.ctrl:last-of-type { margin-bottom: 20px; }
.ctrl-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.ctrl-head label {
  font-size: 13px;
  color: var(--txt-dim);
}
.ctrl-head .val {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  letter-spacing: 0.04em;
}
.ctrl-hint {
  font-size: 11px;
  color: var(--txt-mute);
  margin-top: 9px;
  line-height: 1.6;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line-strong);
  border-radius: 2px;
}
input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--line-strong);
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid #0a0b0e;
  box-shadow: 0 0 0 4px rgba(230, 168, 96, 0.14);
  transition: box-shadow 0.2s;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid #0a0b0e;
}
input[type="range"]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 7px rgba(230, 168, 96, 0.18);
}

.seg-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
}
.seg-mini button {
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 8px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--txt-mute);
  cursor: pointer;
  transition: all 0.25s;
}
.seg-mini button[aria-pressed="true"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.lab-buttons { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 4px; }

.lab-stage {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: radial-gradient(circle at 50% 0%, rgba(127, 196, 184, 0.06), transparent 70%), #0a0c10;
  padding: 24px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
#pianoRoll { width: 100%; height: clamp(190px, 24vw, 260px); border-radius: 12px; background: rgba(0, 0, 0, 0.22); }
.lab-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.lab-stage-head .t {
  font-family: var(--serif);
  font-size: 17px;
}
.lab-stage-head .s {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--txt-mute);
  text-transform: uppercase;
}

.meters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 22px;
}
.meter .m-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.meter .m-head span:first-child { font-size: 12px; color: var(--txt-dim); }
.meter .m-head span:last-child {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt-mute);
}
.meter .track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}
.meter .fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.7s var(--ease), background 0.7s;
  background: var(--amber);
}
.meter .fill.teal { background: var(--teal); }
.meter .fill.violet { background: var(--violet); }
.meter .note { font-size: 10.5px; color: var(--txt-mute); margin-top: 6px; }

.lab-io {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--txt-mute);
}
.lab-io .snap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

/* ---------- Sad music ---------- */

.sad {
  background:
    radial-gradient(ellipse 60% 55% at 20% 30%, rgba(178, 149, 214, 0.10), transparent 65%),
    var(--bg);
}
.sad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 5vw, 72px);
  align-items: start;
}

.appraisal {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(22px, 3vw, 34px);
  background: var(--panel);
}
.appraisal h4 {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt-mute);
  font-weight: 400;
  margin-bottom: 24px;
}
.appr-rows { display: grid; gap: 0; }
.appr-row {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 16px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.appr-row:last-child { border-bottom: 1px solid var(--line); }
.appr-row .lab { font-size: 14px; }
.appr-row .lab small { display: block; font-size: 11.5px; color: var(--txt-mute); margin-top: 2px; }
.appr-row .state {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: right;
  color: var(--txt-mute);
  transition: color 0.4s;
}
.appr-row .state.hi { color: var(--teal); }
.appr-row .state.lo { color: var(--rose); }
.appr-row .state.bad { color: var(--rose); }
.appr-row .state.good { color: var(--teal); }
.appr-row .state.mid { color: var(--amber); }
.appr-row .state.none { color: var(--txt-mute); }

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 8px;
  font-size: 13px;
  color: var(--txt-dim);
}
.switch {
  position: relative;
  width: 46px; height: 26px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  flex: none;
  transition: background 0.3s, border-color 0.3s;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--txt-mute);
  transition: transform 0.32s var(--ease), background 0.3s;
}
.switch[aria-checked="true"] { background: var(--amber-soft); border-color: var(--amber); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--amber); }
.switch-label { font-size: 13px; color: var(--txt-mute); min-width: 96px; transition: color 0.3s; }
.switch-label.hot { color: var(--amber); }

.why-list { display: grid; gap: 2px; margin-top: 8px; }
.why-item {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: padding-left 0.35s var(--ease);
}
.why-item:hover { padding-left: 6px; }
.why-item .why-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.why-item .why-head h4 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}
.why-item .why-head .pct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt-mute);
}
.why-item .why-body {
  font-size: 13px;
  color: var(--txt-mute);
  line-height: 1.75;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease), margin 0.45s;
}
.why-item.open .why-body { max-height: 160px; margin-top: 10px; }
.why-item.open .why-head h4 { color: var(--amber); }
.why-bar {
  height: 2px;
  background: var(--line);
  margin-top: 12px;
  position: relative;
}
.why-bar i {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--amber);
  width: 0;
  transition: width 0.9s var(--ease);
}

/* ---------- Self test ---------- */

.test { background: var(--bg-soft); border-top: 1px solid var(--line); }
.test-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

.test-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  padding: clamp(22px, 3vw, 32px);
}
.step {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.step:first-of-type { border-top: 0; padding-top: 0; }
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt-mute);
  flex: none;
  transition: all 0.3s;
}
.step.done .step-num { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.step.on .step-num { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.step-body { flex: 1; min-width: 0; }
.step-body h4 {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 4px;
}
.step-body p { font-size: 12.5px; color: var(--txt-mute); margin: 0; line-height: 1.7; }

.slider-block { margin: 16px 0 4px; }
.slider-block .sb-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--txt-dim);
  margin-bottom: 4px;
}
.slider-block .sb-head b {
  font-family: var(--mono);
  color: var(--amber);
  font-weight: 400;
}
.slider-block .ends {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--txt-mute);
  margin-top: -2px;
}

.file-drop {
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 4px;
}
.file-drop:hover, .file-drop.hover { border-color: var(--amber); background: var(--amber-soft); }
.file-drop .t { font-size: 13px; color: var(--txt-dim); }
.file-drop .s { font-size: 11px; color: var(--txt-mute); margin-top: 4px; }

.result-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.02);
  margin-top: 20px;
}
.result-box.hidden { display: none; }
.delta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.delta {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.delta .k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--txt-mute); text-transform: uppercase; }
.delta .v { font-family: var(--serif); font-size: 30px; line-height: 1.1; margin-top: 4px; }
.delta .v.pos { color: var(--teal); }
.delta .v.neg { color: var(--rose); }
.delta .v.zero { color: var(--txt-dim); }
.delta .s { font-size: 10.5px; color: var(--txt-mute); }

.trials { margin-top: 22px; }
.trials table { width: 100%; border-collapse: collapse; font-size: 12px; }
.trials th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--txt-mute);
  text-transform: uppercase;
  font-weight: 400;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}
.trials td { padding: 9px 6px; border-bottom: 1px solid var(--line); color: var(--txt-dim); }
.trials .empty { color: var(--txt-mute); font-size: 12px; padding: 14px 0; }

/* ---------- Evidence library ---------- */

.lib { border-top: 1px solid var(--line); }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.ref-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  transition: border-color 0.35s, transform 0.35s var(--ease), background 0.35s;
  position: relative;
}
.ref-card:hover {
  border-color: rgba(230, 168, 96, 0.4);
  transform: translateY(-3px);
  background: var(--panel-2);
}
.ref-card.hide { display: none; }
.ref-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
}
.ref-id {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 0.1em;
}
.badge {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid rgba(127, 196, 184, 0.35);
  color: var(--teal);
  white-space: nowrap;
}
.badge.warn { border-color: rgba(217, 138, 138, 0.4); color: var(--rose); }
.ref-card h4 {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 6px;
}
.ref-card .cite {
  font-size: 11px;
  color: var(--txt-mute);
  line-height: 1.6;
  margin-bottom: 12px;
  font-family: var(--mono);
  letter-spacing: 0.01em;
}
.ref-card .finding {
  font-size: 13px;
  color: var(--txt-dim);
  line-height: 1.75;
  margin-bottom: 14px;
}
.ref-card .limit {
  font-size: 11.5px;
  color: var(--txt-mute);
  line-height: 1.7;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.ref-card .limit b { color: var(--txt-mute); font-weight: 400; }
.ref-links {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ref-links a { color: var(--txt-mute); border-bottom: 1px solid transparent; }
.ref-links a:hover { color: var(--amber); border-bottom-color: var(--amber); }

/* ---------- Notes / limits ---------- */

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.note {
  background: var(--bg-soft);
  padding: 26px;
}
.note .n {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--rose);
  letter-spacing: 0.14em;
  margin-bottom: 12px;
  display: block;
}
.note h4 { font-size: 15px; font-family: var(--sans); font-weight: 600; margin-bottom: 8px; }
.note p { font-size: 12.5px; color: var(--txt-mute); line-height: 1.8; margin: 0; }

.check-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}
.check-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-mute);
  font-weight: 400;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line-strong);
}
.check-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--txt-dim);
  vertical-align: top;
  line-height: 1.7;
}
.check-table td:first-child { color: var(--txt); width: 34%; }
.ok { color: var(--teal); }
.fix { color: var(--rose); }
.check-table .pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 8.5px;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid currentColor;
  opacity: 0.9;
  white-space: nowrap;
}

/* ---------- References footer ---------- */

.refs {
  border-top: 1px solid var(--line);
  background: #06070a;
}
.refs ol {
  list-style: none;
  counter-reset: r;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}
.refs li {
  counter-increment: r;
  position: relative;
  padding-left: 40px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--txt-mute);
}
.refs li::before {
  content: "[" counter(r) "]";
  position: absolute;
  left: 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  opacity: 0.7;
}
.refs li a { color: var(--txt-dim); }
.refs li a:hover { color: var(--amber); }

footer.foot {
  padding: 44px 0 54px;
  border-top: 1px solid var(--line);
  background: #06070a;
}
.foot-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.foot-inner p { font-size: 11.5px; color: var(--txt-mute); margin: 0; line-height: 1.9; }
.foot-inner .brand { font-size: 14px; }

/* ---------- Utility ---------- */

.divider {
  height: 1px;
  background: var(--line);
  margin: clamp(60px, 8vw, 100px) 0;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 60px); }

.hr-fade {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.kbd-note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--txt-mute);
  letter-spacing: 0.06em;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .concept-grid, .circ-grid, .mech-layout, .dopa-grid,
  .sad-grid, .test-grid, .two-col {
    grid-template-columns: 1fr;
  }
  .lab-grid { grid-template-columns: 1fr; }
  .lab-controls { position: static; }
  .scenario { grid-template-columns: 1fr; gap: 18px; }
  .notes-grid { grid-template-columns: 1fr; }
  .mech-panel { min-height: 0; }
  .circ-panel { padding-top: 8px; }
  .lab-stage { min-height: 0; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .nav-inner { padding: 0 20px; }
  .brand > span:last-child { display: none; }
  .nav-links {
    display: flex;
    flex: 1;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0;
    margin-left: 4px;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .nav-links a { padding: 8px 9px; font-size: 12px; }
  .sec-num span:last-child { display: none; }
  .hero { padding-bottom: 30px; }
  .hero-top { margin-bottom: 6vh; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .hero-stats .v { font-size: 1.35rem; }
  .scroll-cue { display: none; }
  .lib-grid { grid-template-columns: 1fr; }
  .meters { grid-template-columns: 1fr; gap: 12px; }
  .tl-readout { grid-template-columns: 1fr; }
  .delta-grid { grid-template-columns: 1fr; }
  .three-item { grid-template-columns: 30px 1fr; }
  .ref-links { flex-wrap: wrap; }
  .check-table { font-size: 12px; }
  .check-table td:first-child { width: 42%; }
}

@media (max-width: 620px) {
  .hero-top { flex-direction: column; gap: 16px; }
  .hero-top .hero-tag:last-child { display: none; }
  .hero-stats { gap: 10px; }
  .hero-stats .k { font-size: 9px; letter-spacing: 0.06em; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 9px 10px; font-size: 12px; }
  .lab-buttons { grid-template-columns: 1fr; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero h1 .line > span { transform: none; }
}

/* ---------- Print ---------- */

@media print {
  body { background: #fff; color: #111; }
  .nav, .progress, .scroll-cue, .hero-cta, #heroCanvas, .lab, .test { display: none; }
  section { padding: 24px 0; }
  .ref-card { break-inside: avoid; }
}


/* =========================================================
   English edition — typographic overrides
   ========================================================= */

html[lang="en"] {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

html[lang="en"] body {
  font-size: 16.5px;
  line-height: 1.72;
  letter-spacing: 0;
  font-feature-settings: "kern" 1, "liga" 1;
}

html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] h4 {
  letter-spacing: -0.018em;
}

html[lang="en"] .hero h1 {
  font-size: clamp(3.2rem, 9.2vw, 7.9rem);
  line-height: 1;
  letter-spacing: -0.032em;
}

html[lang="en"] .h2 {
  font-size: clamp(1.95rem, 3.5vw, 3rem);
  line-height: 1.16;
  letter-spacing: -0.022em;
}

html[lang="en"] .lede {
  line-height: 1.78;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
}

html[lang="en"] p { margin-bottom: 1.05em; }

html[lang="en"] .swap-q {
  font-size: clamp(1.28rem, 1.95vw, 1.62rem);
  line-height: 1.34;
  letter-spacing: -0.014em;
}

html[lang="en"] .three-item h4 { font-size: 16px; }
html[lang="en"] .three-item p { font-size: 13.8px; line-height: 1.7; }

html[lang="en"] .mech-panel .def { font-size: 14.5px; line-height: 1.78; }
html[lang="en"] .fact-row .v { font-size: 12.5px; line-height: 1.65; }

html[lang="en"] .ref-card h4 {
  font-size: 15.5px;
  line-height: 1.38;
  letter-spacing: -0.01em;
}
html[lang="en"] .ref-card .cite {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0;
  line-height: 1.55;
}
html[lang="en"] .ref-card .finding { font-size: 13px; line-height: 1.68; }
html[lang="en"] .ref-card .limit { font-size: 11.5px; line-height: 1.62; }

html[lang="en"] .check-table { font-size: 12.5px; }
html[lang="en"] .check-table td { line-height: 1.65; }
html[lang="en"] .note p { font-size: 12.5px; line-height: 1.7; }

html[lang="en"] .refs li {
  font-size: 12.5px;
  line-height: 1.7;
}
html[lang="en"] .refs li a { overflow-wrap: anywhere; }

html[lang="en"] .lib-grid {
  grid-template-columns: repeat(auto-fill, minmax(335px, 1fr));
}

html[lang="en"] .hero-stats .k { letter-spacing: 0.12em; }
html[lang="en"] .phase-row .val { white-space: nowrap; }
html[lang="en"] .tl-cell .v { font-size: 12.5px; }

html[lang="en"] .btn { font-size: 13.5px; }
html[lang="en"] .chip { font-size: 12.5px; }

@media (max-width: 760px) {
  html[lang="en"] .hero h1 { font-size: clamp(2.9rem, 12vw, 4.2rem); }
  html[lang="en"] .lib-grid { grid-template-columns: 1fr; }
}


/* English hero: avoid clipping tall Latin glyphs inside the masked lines */
html[lang="en"] .hero h1 .line { overflow: visible; }

html[lang="en"] .hero h1 .line > span {
  transform: translateY(26px);
  opacity: 0;
  animation: riseEn 1.1s var(--ease) forwards;
}

html[lang="en"] .hero h1 .line:nth-child(2) > span {
  animation-delay: 0.12s;
}

@keyframes riseEn {
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html[lang="en"] .hero h1 .line > span { opacity: 1; transform: none; }
}


html[lang="en"] .trials table { table-layout: fixed; }
html[lang="en"] .trials th {
  font-size: 8px;
  letter-spacing: 0.04em;
  padding: 8px 4px;
}
html[lang="en"] .trials td { font-size: 11.5px; padding: 9px 4px; }
html[lang="en"] .trials th:first-child,
html[lang="en"] .trials td:first-child { width: 26px; }
