/* ==========================================================================
   Dark Ride Atlas — stylesheet
   Default theme is "lights off" (dark). [data-theme="light"] is "lights on".
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0d0c0b;
  --bg-raised: #141311;
  --bg-sunken: #090908;
  --bg-hover: #1a1916;
  --line: #24221e;
  --line-strong: #3a3731;
  --rule: #5a554b;
  --text: #ece8df;
  --text-2: #b1ab9e;
  --text-3: #7b766c;
  --accent: #e3a043;
  --accent-strong: #f2b766;
  --accent-ink: #1a1205;
  --accent-wash: rgba(227, 160, 67, 0.12);
  --overlay: rgba(6, 6, 5, 0.78);
  --shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  --knob: #f3f1ea;
  --grain-opacity: 0.05;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", Georgia, serif;
  --font-latin: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --wrap: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
  --header-h: 60px;

  --r-1: 2px;
  --r-2: 3px;
  --r-3: 4px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f3efe6;
  --bg-raised: #f9f7f1;
  --bg-sunken: #e9e4d8;
  --bg-hover: #ebe6da;
  --line: #ddd7ca;
  --line-strong: #c7c0b1;
  --rule: #8f887a;
  --text: #1d1b17;
  --text-2: #4d4940;
  --text-3: #857f72;
  --accent: #9c5408;
  --accent-strong: #7f4405;
  --accent-ink: #ffffff;
  --accent-wash: rgba(156, 84, 8, 0.08);
  --overlay: rgba(30, 27, 22, 0.5);
  --shadow: 0 40px 80px -44px rgba(48, 38, 22, 0.4);
  --knob: #ffffff;
  --grain-opacity: 0.07;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  text-autospace: normal;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

/* Film grain: keeps large dark fields from looking like flat CSS colour. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: var(--grain-opacity);
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3 {
  text-wrap: balance;
}

/* Short CJK titles: break at punctuation, never inside a word, unless the line would overflow. */
.page-title,
.note-title,
.section-title {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

p,
li,
dd,
blockquote {
  text-wrap: pretty;
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

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

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

strong {
  font-weight: 600;
}

::selection {
  background: rgba(227, 160, 67, 0.32);
}

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -40px;
  z-index: 200;
  padding: 6px 12px;
  border-radius: var(--r-1);
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
}

.skip-link:focus {
  top: 12px;
}

.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

.mono {
  font-family: var(--font-mono);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  transition: color 0.2s;
}

.text-link .code {
  font-size: 0.88em;
  margin-right: 2px;
}

.text-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 17px;
  text-align: center;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.brand-name {
  font-family: var(--font-latin);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-sub {
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  font-size: 12px;
  line-height: 1;
  color: var(--text-3);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-self: stretch;
  gap: 2px;
}

.site-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-no {
  font-family: var(--font-latin);
  font-size: 12px;
  font-style: italic;
  color: var(--text-3);
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] .nav-no {
  color: var(--accent);
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: -1px;
  height: 1px;
  background: var(--accent);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 32px;
  padding: 0 7px 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-raised);
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}

.search-trigger:hover {
  border-color: var(--line-strong);
  color: var(--text-2);
}

.search-trigger kbd {
  margin-left: auto;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.ghost-btn:hover {
  color: var(--text);
  border-color: var(--line);
}

/* --------------------------------------------------------------------------
   Buttons, chips, inputs
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}

.btn:hover {
  background: var(--bg-hover);
}

.btn-solid {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.btn-solid:hover {
  background: var(--text);
  opacity: 0.88;
}

.btn-quiet {
  padding: 0 4px;
  border-color: transparent;
  color: var(--text-2);
}

.btn-quiet:hover {
  background: none;
  color: var(--text);
}

.btn .icon {
  transition: transform 0.3s var(--ease);
}

.btn:hover .icon {
  transform: translateX(2px);
}

.btn-solid:hover .icon {
  transform: translateY(2px);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.chip:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.chip[aria-pressed="true"],
.chip[aria-selected="true"] {
  background: var(--text);
  color: var(--bg);
}

.chip .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.chip[aria-pressed="true"] .count,
.chip[aria-selected="true"] .count {
  color: inherit;
  opacity: 0.55;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
}

.field > .icon {
  position: absolute;
  left: 10px;
  color: var(--text-3);
  pointer-events: none;
}

.input {
  width: 260px;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-raised);
  font-size: 13.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder {
  color: var(--text-3);
}

.input:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.select {
  -webkit-appearance: none;
  appearance: none;
  height: 34px;
  max-width: 100%;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-raised)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238a867c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E")
    no-repeat right 10px center / 14px;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select:hover,
.select:focus {
  border-color: var(--line-strong);
  outline: none;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.switch input {
  position: relative;
  width: 28px;
  height: 16px;
  margin: 0;
  border-radius: 999px;
  background: var(--line-strong);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.2s;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--knob);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s var(--ease);
}

.switch input:checked {
  background: var(--accent);
}

.switch input:checked::after {
  transform: translateX(12px);
}

.segmented {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-raised);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-3);
  transition: color 0.2s, background 0.2s;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button[aria-pressed="true"] {
  background: var(--bg-hover);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* --------------------------------------------------------------------------
   Page heads — chapter opener: title on the left, lede set against it
   -------------------------------------------------------------------------- */

.view[hidden] {
  display: none;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: end;
  gap: 24px 72px;
  padding-top: 72px;
  padding-bottom: 40px;
  margin-bottom: 48px;
  position: relative;
}

.page-head::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 0;
  height: 1px;
  background: var(--line);
}

.chapter-mark {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}

.chapter-mark .en {
  font-family: var(--font-latin);
  font-size: 14px;
  font-style: italic;
  color: var(--text-3);
}

.chapter-no {
  font-family: var(--font-latin);
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.page-title {
  margin-top: 18px;
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.005em;
}

.page-lede {
  max-width: 34em;
  padding-bottom: 6px;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Cover (home)
   -------------------------------------------------------------------------- */

.cover {
  --mx: 22%;
  --my: 90%;
  position: relative;
  overflow: hidden;
  padding: 28px 0 clamp(72px, 11vw, 168px);
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

/* A pool of warm light that the pointer carries around. */
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle 520px at var(--mx) var(--my), var(--accent-wash), transparent 70%);
  pointer-events: none;
}

.cover-track {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  max-width: none;
  fill: none;
  stroke-linecap: round;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle 380px at var(--mx) var(--my), #000 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.08) 100%);
  mask-image: radial-gradient(circle 380px at var(--mx) var(--my), #000 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.08) 100%);
}

.cover-track .rail {
  stroke: var(--text-3);
  stroke-width: 1.4;
}

.cover-track .ties {
  stroke: var(--line-strong);
  stroke-width: 22;
  stroke-linecap: butt;
  stroke-dasharray: 2 13;
}

.cover-track .car {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.dateline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-3);
}

.dateline span:last-child {
  font-family: var(--font-latin);
  font-size: 14px;
  font-style: italic;
}

.cover-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 80px;
  align-items: start;
  margin-top: 72px;
}

.display {
  font-family: var(--font-serif);
  font-size: clamp(52px, 7.6vw, 108px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.display em {
  font-style: normal;
  color: var(--accent);
  text-shadow: 0 0 48px rgba(227, 160, 67, 0.28);
}

[data-theme="light"] .display em {
  text-shadow: none;
}

.hero-lede {
  max-width: 30em;
  margin-top: 40px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.85;
  color: var(--text);
}

.hero-count {
  max-width: 34em;
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-3);
}

.hero-count b {
  font-family: var(--font-latin);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: lining-nums;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 36px;
}

/* Plate: the "did you know" figure, set like an illustration in a book. */
.plate {
  margin-top: 14px;
}

.plate-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-sunken);
}

.plate-media::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 -80px 80px -40px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.plate-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.04);
  transition: transform 1.2s var(--ease), filter 0.5s;
}

.plate-media:hover img {
  transform: scale(1.03);
  filter: none;
}

.plate .thumb-play {
  opacity: 1;
  transform: none;
  left: auto;
  top: auto;
  right: 18px;
  bottom: 18px;
  margin: 0;
}

.plate-media:hover .thumb-play {
  background: var(--accent);
  color: var(--accent-ink);
}

.plate-caption {
  display: flex;
  gap: 14px;
  padding: 10px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.plate-no {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
}

.plate-body {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.plate-kicker {
  font-size: 12.5px;
  color: var(--accent);
}

.plate-text {
  position: relative;
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.7;
}

.plate-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  font-size: 13px;
}

.plate-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-3);
  transition: color 0.2s;
}

.plate-shuffle:hover {
  color: var(--text);
}

.plate-shuffle .icon {
  width: 13px;
  height: 13px;
  transition: transform 0.5s var(--ease);
}

.plate-shuffle:hover .icon {
  transform: rotate(180deg);
}

/* Contents strip */
.contents {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.contents a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  gap: 4px 10px;
  padding: 26px 22px 28px;
  border-left: 1px solid var(--line);
  transition: background 0.25s;
}

.contents a:first-child {
  padding-left: 0;
  border-left: 0;
}

.contents .no {
  grid-row: span 2;
  font-family: var(--font-latin);
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
  color: var(--text-3);
  transition: color 0.2s;
}

.contents .t {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  transition: color 0.2s;
}

.contents .d {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-3);
}

.contents a:hover .no,
.contents a:hover .t {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Chapter heads inside a page
   -------------------------------------------------------------------------- */

.chapter-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: baseline;
}

.chapter-head .chapter-no {
  font-size: 22px;
}

/* --------------------------------------------------------------------------
   Index (ride explorer)
   -------------------------------------------------------------------------- */

.section {
  padding-top: 80px;
  padding-bottom: 120px;
}

.section-tight {
  padding-top: 0;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
  line-height: 1.25;
}

.section-note {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-3);
}

.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  margin: 32px 0 40px;
  padding: 14px 0 12px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 12px;
}

.toolbar-row .spacer {
  flex: 1;
}

.result-count {
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-count strong {
  font-family: var(--font-latin);
  font-size: 16px;
  color: var(--text);
  font-weight: 500;
}

.ride-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 56px 32px;
}

.ride-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ride-link {
  display: block;
  flex: 1;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-1);
  background: var(--bg-sunken);
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  filter: saturate(0.8) brightness(0.9) contrast(1.05);
  transition: transform 0.9s var(--ease), filter 0.5s;
}

.ride-link:hover .thumb img {
  transform: scale(1.045);
  filter: none;
}

.thumb-tags {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  gap: 4px;
}

.thumb-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-radius: var(--r-1);
  background: rgba(10, 10, 9, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 11px;
  line-height: 20px;
  color: #e9e5dc;
}

.thumb-tag.is-lit {
  color: #f2c27a;
}

.thumb-tag.is-lit::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f2b766;
  box-shadow: 0 0 6px #f2b766;
}

.thumb-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(10, 10, 9, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.25s, transform 0.3s var(--ease), background 0.2s, color 0.2s;
}

.thumb-play .icon {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.ride-link:hover .thumb-play {
  opacity: 1;
  transform: none;
}

.thumb.is-empty {
  display: grid;
  place-items: center;
  background-color: var(--bg-sunken);
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 14px 14px;
  background-position: 7px 7px;
}

.thumb-glyph {
  width: 76px;
  height: 76px;
  color: var(--text-3);
  transition: color 0.3s, transform 0.5s var(--ease);
}

.ride-link:hover .thumb-glyph {
  color: var(--accent);
  transform: translateY(-2px);
}

.thumb-empty-note {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 11.5px;
  color: var(--text-3);
}

.ride-body {
  padding-top: 16px;
}

.ride-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-3);
}

.ride-meta .park {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ride-meta .year {
  flex-shrink: 0;
  font-family: var(--font-latin);
  font-size: 14px;
  font-style: italic;
  line-height: 1.3;
}

.ride-title {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.2s;
}

.ride-link:hover .ride-title {
  color: var(--accent);
}

.ride-en {
  margin-top: 2px;
  font-family: var(--font-latin);
  font-size: 15px;
  font-style: italic;
  line-height: 1.45;
  color: var(--text-3);
}

.ride-summary {
  display: -webkit-box;
  margin-top: 12px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
}

.ride-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-3);
}

.ride-mech {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ride-mech .code {
  margin-right: 8px;
  font-size: 11.5px;
  color: var(--accent);
}

.compare-toggle {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 5px;
  padding: 2px 0 2px 4px;
  border-radius: var(--r-1);
  font-size: 12.5px;
  color: var(--text-3);
  transition: color 0.2s;
}

.compare-toggle .icon {
  width: 13px;
  height: 13px;
}

.compare-toggle:hover {
  color: var(--text);
}

.compare-toggle[aria-pressed="true"] {
  color: var(--accent);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 80px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}

.empty-state p {
  margin: 8px 0 20px;
  font-size: 14px;
  color: var(--text-3);
}

/* Tables — set like a printed book: heavy rule above and below, hairlines between. */

.table-wrap {
  overflow-x: auto;
  border-top: 1.5px solid var(--rule);
  border-bottom: 1.5px solid var(--rule);
}

.ride-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.65;
}

.ride-table th,
.data-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--bg);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  color: var(--text-3);
  white-space: nowrap;
}

.ride-table :is(th, td):first-child,
.data-table :is(th, td):first-child {
  padding-left: 2px;
}

.ride-table :is(th, td):last-child,
.data-table :is(th, td):last-child {
  padding-right: 2px;
}

.ride-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.ride-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.ride-table tbody tr:hover {
  background: var(--bg-hover);
}

.ride-table tbody tr:last-child td {
  border-bottom: 0;
}

.ride-table .t-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  white-space: nowrap;
}

.ride-table .t-title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 600;
}

.ride-table .t-en {
  display: block;
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 13.5px;
  color: var(--text-3);
}

.ride-table .t-muted {
  font-size: 13px;
  color: var(--text-2);
}

.media-marks {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.media-marks .on {
  color: var(--text);
}

.media-marks .on::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 5px 2px 0;
  border-radius: 50%;
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   Ride dialog
   -------------------------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 5vh 20px 40px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.dialog {
  position: relative;
  width: 100%;
  max-width: 1040px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--bg-raised);
  box-shadow: var(--shadow);
  transform: translateY(14px);
  transition: transform 0.4s var(--ease);
}

.backdrop.is-open .dialog {
  transform: none;
}

.dialog-close {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 10, 9, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  transition: background 0.2s;
}

.dialog-close:hover {
  background: rgba(10, 10, 9, 0.85);
}

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.86;
}

.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
}

.player-start .ring {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(10, 10, 9, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 0.3s var(--ease), background 0.2s, color 0.2s;
}

.player-start .ring .icon {
  width: 24px;
  height: 24px;
  margin-left: 3px;
}

.player-start:hover .ring {
  transform: scale(1.06);
  background: #e9a23b;
  color: #1a1205;
}

.player-caption {
  position: absolute;
  left: 18px;
  right: 70px;
  bottom: 14px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.player.is-empty {
  display: grid;
  place-items: center;
  aspect-ratio: 21 / 8;
  background-color: var(--bg-sunken);
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-3);
  text-align: center;
}

.player.is-empty .thumb-glyph {
  margin: 0 auto 10px;
}

.player.is-empty p {
  font-size: 13px;
}

.media-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.media-tabs .chip {
  height: 28px;
  font-size: 13px;
}

.media-tabs .source {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

.dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 44px;
  padding: 30px 34px 34px;
}

.dialog-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  transition: color 0.2s;
}

.dialog-kicker .code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

a.dialog-kicker:hover {
  color: var(--text);
}

.dialog-title {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.3;
}

.dialog-en {
  margin-top: 4px;
  font-family: var(--font-latin);
  font-size: 17px;
  font-style: italic;
  color: var(--text-3);
}

.dialog-summary {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-2);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.spec {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-content: start;
  gap: 12px 16px;
  padding-top: 6px;
  font-size: 13.5px;
  line-height: 1.6;
}

.spec dt {
  color: var(--text-3);
}

.spec dd {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Mechanisms
   -------------------------------------------------------------------------- */

.mech-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 72px;
  padding-bottom: 104px;
}

.side-nav {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.tree {
  margin-top: 18px;
  font-size: 13.5px;
}

.tree-cat + .tree-cat {
  margin-top: 4px;
}

.tree-cat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--r-1);
  font-weight: 600;
  text-align: left;
  color: var(--text);
  transition: background 0.15s;
}

.tree-cat-btn:hover {
  background: var(--bg-hover);
}

.tree-cat-btn .num {
  width: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
}

.tree-cat-btn .chev {
  margin-left: auto;
  color: var(--text-3);
  transition: transform 0.2s var(--ease);
}

.tree-cat-btn[aria-expanded="false"] .chev {
  transform: rotate(-90deg);
}

.tree-group {
  margin: 2px 0 8px 11px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
}

.tree-group[hidden] {
  display: none;
}

.tree-label {
  display: flex;
  gap: 8px;
  padding: 8px 8px 4px;
  font-size: 12.5px;
  color: var(--text-3);
}

.tree-leaf {
  display: flex;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--r-1);
  line-height: 1.5;
  color: var(--text-2);
  transition: color 0.15s, background 0.15s;
}

.tree-leaf:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.tree-leaf[aria-current="page"] {
  background: var(--bg-hover);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}

.tree .code {
  flex-shrink: 0;
  min-width: 46px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 20px;
  color: var(--text-3);
}

.tree-leaf[aria-current="page"] .code {
  color: var(--accent);
}

.article {
  min-width: 0;
  max-width: 820px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.crumbs span + span::before {
  content: "/";
  margin: 0 8px;
  color: var(--line-strong);
}

.article-code {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.article-title {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
  line-height: 1.32;
}

.article-en {
  margin-top: 6px;
  font-family: var(--font-latin);
  font-size: 17px;
  font-style: italic;
  color: var(--text-3);
}

.article-lede {
  margin-top: 22px;
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--text-2);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.spec-grid > div {
  padding: 16px 20px 18px;
  border-left: 1px solid var(--line);
}

.spec-grid > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.spec-grid dt {
  font-size: 12px;
  color: var(--text-3);
}

.spec-grid dd {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.7;
}

.article-section {
  margin-top: 48px;
}

.mech-lab-box {
  margin-top: 36px;
}

.mech-lab-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mech-lab-head .article-h {
  margin-bottom: 0;
}

.mech-lab-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--r-1);
  background: var(--bg-hover);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
}

.mech-inline-sheet {
  margin-top: 8px;
}

.mech-inline-controls {
  padding: 16px 0 18px;
}

.mech-dist-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--r-2);
  background: var(--bg-hover);
  border: 1px solid var(--line);
  font-size: 13px;
}

.mech-dist-links .dist-label {
  font-weight: 600;
  color: var(--text-2);
}

.mech-dist-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  transition: color 0.15s;
}

.mech-dist-links a:hover {
  color: var(--accent-strong);
}

.note-schematic-wrap {
  margin: 22px 0 28px;
}

.note-schematic-wrap .lab-sheet {
  max-width: 820px;
}

.article-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.article-h small {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-3);
}

.article-video {
  margin-top: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}

.article-video figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-3);
}

.park-rows {
  border-top: 1px solid var(--line);
}

.park-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  line-height: 1.8;
}

.park-row dt {
  padding-top: 2px;
  font-size: 13px;
  color: var(--text-3);
}

.park-row dd {
  color: var(--text-2);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px 20px;
}

.mini-grid .ride-title {
  font-size: 16px;
}

.mini-grid .ride-en {
  font-size: 13.5px;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.pager a {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  transition: border-color 0.2s, background 0.2s;
}

.pager a:hover {
  border-color: var(--line-strong);
  background: var(--bg-raised);
}

.pager small {
  display: block;
  font-size: 12px;
  color: var(--text-3);
}

.pager .code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-right: 6px;
}

.pager .next {
  text-align: right;
}

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

.lab-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 44px;
  padding-bottom: 104px;
}

.lab-sidebar {
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.lab-mode-switch {
  display: flex;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--bg-sunken);
}

.lab-mode-switch button {
  flex: 1;
  padding: 8px 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
}

.lab-mode-switch button:first-child {
  border-right: 1px solid var(--line-strong);
}

.lab-mode-switch button[aria-selected="true"] {
  background: var(--bg-raised);
  color: var(--accent);
  font-weight: 600;
}

.lab-list {
  border-top: 1px solid var(--rule);
}

.lab-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 2px 8px;
  width: 100%;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--text-2);
  transition: color 0.2s;
}

.lab-item:hover {
  color: var(--text);
}

.lab-item .num {
  grid-row: span 2;
  font-family: var(--font-latin);
  font-size: 15px;
  font-style: italic;
  line-height: 1.45;
  color: var(--text-3);
}

.lab-item .t {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.lab-item .s {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

.lab-item[aria-selected="true"] {
  color: var(--text);
}

.lab-item[aria-selected="true"] .num {
  color: var(--accent);
}

.lab-stage {
  min-width: 0;
}

/* The drawing sits on a sheet with crop marks and an engineering title block. */
.lab-sheet {
  position: relative;
  border: 1px solid var(--line-strong);
  background: var(--bg-sunken);
}

.lab-sheet::before,
.lab-sheet::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--rule);
  border-style: solid;
  pointer-events: none;
}

.lab-sheet::before {
  left: -8px;
  top: -8px;
  border-width: 1px 0 0 1px;
}

.lab-sheet::after {
  right: -8px;
  bottom: -8px;
  border-width: 0 1px 1px 0;
}

.lab-canvas {
  aspect-ratio: 840 / 400;
}

.title-block {
  display: flex;
  border-top: 1px solid var(--line-strong);
  font-size: 12px;
  color: var(--text-2);
}

.title-block span {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px;
  border-left: 1px solid var(--line-strong);
  white-space: nowrap;
}

.title-block span:first-child {
  border-left: 0;
  font-family: var(--font-mono);
}

.title-block span:last-child {
  flex: 1;
  justify-content: flex-end;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-block small {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-3);
}

.lab-canvas svg {
  width: 100%;
  height: 100%;
}

.lab-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 32px;
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
}

.range-field {
  flex: 1 1 170px;
  min-width: 150px;
}

.range-field label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}

.range-field output {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 6px 0 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: var(--line-strong);
}

input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border: 4px solid var(--bg-raised);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px var(--line-strong);
  -webkit-appearance: none;
  transition: background 0.2s;
}

input[type="range"]:hover::-webkit-slider-thumb {
  background: var(--accent);
}

input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--line-strong);
}

input[type="range"]::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 4px solid var(--bg-raised);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.lab-notes {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 56px;
  padding: 32px 0 0;
}

.lab-notes h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.45;
}

.lab-notes p {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-2);
}

.lab-notes .links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  font-size: 13.5px;
}

.video-list {
  border-top: 1px solid var(--line);
}

.video-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.video-row img {
  width: 104px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  object-fit: cover;
  filter: saturate(0.88);
  transition: filter 0.3s;
}

.video-row:hover img {
  filter: none;
}

.video-row .vt {
  font-size: 13.5px;
  line-height: 1.45;
  transition: color 0.2s;
}

.video-row:hover .vt {
  color: var(--accent);
}

.video-row .vs {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   Parks
   -------------------------------------------------------------------------- */

.park-tabs {
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.park-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 18px;
}

.park-head h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
}

.park-head p {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--text-3);
}

.data-table {
  min-width: 880px;
}

.data-table th {
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--text-2);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td:first-child {
  color: var(--text);
}

.data-table td strong {
  color: var(--text);
}

.data-table li + li {
  margin-top: 9px;
}

.data-table .row-head {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.6;
}

.code-link {
  margin: 0 1px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  border-bottom: 1px dotted currentColor;
  white-space: nowrap;
  transition: color 0.2s;
}

.code-link:hover {
  color: var(--accent-strong);
  border-bottom-style: solid;
}

.table-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   Notes (engineering distinctions)
   -------------------------------------------------------------------------- */

.notes-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 64px;
  padding-bottom: 104px;
}

.notes-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  border-top: 1px solid var(--rule);
}

.notes-toc a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-3);
  transition: color 0.2s;
}

.notes-toc a:hover {
  color: var(--text);
}

.notes-toc a .num {
  font-family: var(--font-latin);
  font-size: 14px;
  font-style: italic;
  line-height: 1.5;
}

.notes-toc a.is-active {
  color: var(--text);
}

.notes-toc a.is-active .num {
  color: var(--accent);
}

.note {
  padding-bottom: 64px;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--line);
}

.note:last-child {
  border-bottom: 0;
}

.note-num {
  font-family: var(--font-latin);
  font-size: 40px;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
}

.note-title {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  line-height: 1.4;
}

.note-sub {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-3);
}

.note-intro {
  max-width: 46em;
  margin-top: 18px;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text-2);
}

.note .table-wrap {
  margin-top: 26px;
}

.note .data-table {
  min-width: 760px;
}

.note .data-table td:first-child {
  width: 150px;
  font-size: 13px;
  color: var(--text-3);
}

.note-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 18px;
  font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   Glossary
   -------------------------------------------------------------------------- */

.glossary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px;
  padding-bottom: 104px;
}

.gloss-col > h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1.5px solid var(--rule);
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}

.gloss-col > h2 small {
  font-family: var(--font-latin);
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  color: var(--text-3);
}

.gloss-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 10px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.gloss-item .num {
  grid-row: span 3;
  font-family: var(--font-latin);
  font-size: 16px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-3);
}

.gloss-item h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
}

.gloss-item p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
}

.gloss-item .ex {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   Compare tray + dialog
   -------------------------------------------------------------------------- */

.compare-tray {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 7px 7px 7px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.55);
  font-size: 13px;
  transform: translate(-50%, 160%);
  transition: transform 0.4s var(--ease);
}

.compare-tray.is-visible {
  transform: translate(-50%, 0);
}

.tray-label {
  white-space: nowrap;
  opacity: 0.7;
}

.tray-items {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tray-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 3px 2px 10px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 999px;
  white-space: nowrap;
}

.tray-item button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  opacity: 0.6;
}

.tray-item button:hover {
  opacity: 1;
}

.tray-item .icon {
  width: 12px;
  height: 12px;
}

.tray-go {
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  white-space: nowrap;
}

.compare-dialog {
  max-width: 1120px;
}

.compare-dialog .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.compare-dialog .dialog-head h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.compare-dialog .dialog-close {
  position: static;
  background: var(--bg-hover);
  color: var(--text);
}

.compare-body {
  padding: 22px 24px 28px;
}

.compare-body .data-table {
  min-width: 720px;
}

.compare-body .data-table td:first-child {
  width: 110px;
  font-size: 13px;
  color: var(--text-3);
}

.dialog .data-table th {
  background: var(--bg-raised);
}

.compare-body .data-table th {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: normal;
}

.compare-body th img {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
  border-radius: 4px;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Search palette
   -------------------------------------------------------------------------- */

.palette-backdrop {
  padding-top: 12vh;
}

.palette {
  width: 100%;
  max-width: 640px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  background: var(--bg-raised);
  box-shadow: var(--shadow);
  transform: translateY(-8px);
  transition: transform 0.3s var(--ease);
}

.backdrop.is-open .palette {
  transform: none;
}

.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
}

.palette-input input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--text);
  outline: none;
}

.palette-input input::placeholder {
  color: var(--text-3);
}

.palette-results {
  max-height: min(56vh, 520px);
  overflow-y: auto;
  padding: 6px;
}

.palette-group {
  padding: 12px 10px 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-2);
  font-size: 14px;
  text-align: left;
}

.palette-item[aria-selected="true"] {
  background: var(--bg-hover);
}

.palette-item .code {
  min-width: 60px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
}

.palette-item .label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-item .sub {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}

.palette-empty {
  padding: 36px 16px;
  font-size: 14px;
  text-align: center;
  color: var(--text-3);
}

.palette-foot {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
}

.palette-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  position: relative;
  overflow: hidden;
  padding: 72px 0 36px;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--text-3);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.5fr)) minmax(0, 0.9fr);
  gap: 48px;
}

.colophon {
  line-height: 1.85;
}

.footer-wordmark {
  margin: 72px 0 0;
  font-family: var(--font-latin);
  font-size: clamp(56px, 13.2vw, 184px);
  font-weight: 400;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  user-select: none;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.footer-note {
  max-width: 36em;
  margin-top: 14px;
  line-height: 1.85;
}

.footer-h {
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text);
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  color: var(--text-2);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   Blueprint drawings (lab + glyphs)
   -------------------------------------------------------------------------- */

.bp text {
  font-family: var(--font-mono);
}

.bp-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.bp-frame {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
}

.bp-ink {
  fill: none;
  stroke: var(--text-2);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bp-body {
  fill: var(--bg-raised);
  stroke: var(--text-2);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.bp-faint {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
}

.bp-dash {
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.bp-move {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bp-move-body {
  fill: var(--accent-wash);
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.bp-dot {
  fill: var(--text-2);
}

.bp-dot-accent {
  fill: var(--accent);
}

.bp-joint {
  fill: var(--bg-sunken);
  stroke: var(--text-2);
  stroke-width: 1.4;
}

.bp-hatch {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.bp-water {
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1;
}

.bp-screen {
  fill: none;
  stroke: var(--text);
  stroke-width: 3;
  stroke-linecap: round;
}

.bp-beam {
  fill: var(--accent-wash);
  stroke: none;
}

.bp-leader {
  fill: none;
  stroke: var(--text-3);
  stroke-width: 0.8;
}

.bp-label {
  fill: var(--text-3);
  font-size: 10.5px;
}

.bp-label-strong {
  fill: var(--text-2);
  font-size: 11px;
}

.bp-title {
  fill: var(--text);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.bp-tag {
  fill: var(--accent);
  font-size: 10.5px;
}

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

html:lang(en) .brand-sub,
html:lang(es) .brand-sub,
html:lang(fr) .brand-sub,
html:lang(de) .brand-sub,
html:lang(ru) .brand-sub {
  display: none;
}

@media (max-width: 1320px) {
  .brand-sub {
    display: none;
  }
}

@media (max-width: 1240px) {
  .nav-no {
    display: none;
  }
}

@media (max-width: 1120px) {
  .brand-sub {
    display: none;
  }

  .contents {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contents a:nth-child(4) {
    padding-left: 0;
    border-left: 0;
  }

  .contents a:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .search-trigger {
    min-width: 0;
  }

  .search-trigger .label,
  .search-trigger kbd {
    display: none;
  }
}

@media (max-width: 1024px) {
  .cover-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    margin-top: 48px;
  }

  .plate {
    max-width: 640px;
  }

  .page-head {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 56px;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .mech-layout,
  .notes-layout,
  .lab-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .side-nav,
  .notes-toc,
  .lab-list {
    position: static;
    max-height: none;
  }

  .side-nav {
    padding: 16px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--line);
  }

  .lab-list {
    display: flex;
    gap: 0;
    overflow-x: auto;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .lab-item {
    flex: 0 0 auto;
    width: auto;
    max-width: 220px;
    border-bottom: 0;
    padding: 10px 16px 12px 0;
  }

  .notes-toc {
    display: none;
  }

  .lab-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  :root {
    --header-h: 100px;
  }

  .site-header {
    height: auto;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0 16px;
    height: auto;
    padding-top: 10px;
  }

  .site-nav {
    order: 3;
    width: calc(100% + 2 * var(--gutter));
    margin: 6px calc(-1 * var(--gutter)) 0;
    padding: 0 calc(var(--gutter) - 11px);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    height: 42px;
  }

  .header-tools .ghost-btn .label {
    display: none;
  }

  .dialog-body {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 24px 22px 26px;
  }

  .dialog-title {
    font-size: 25px;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .spec-grid > div {
    padding: 14px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .spec-grid > div:first-child {
    border-top: 0;
  }

  .park-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .glossary {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .dateline-mid {
    display: none;
  }

  .contents {
    grid-template-columns: minmax(0, 1fr);
  }

  .contents a,
  .contents a:nth-child(4) {
    padding: 18px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .contents a:first-child {
    border-top: 0;
  }

  .title-block span:nth-child(2) {
    display: none;
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .toolbar {
    position: static;
  }

  .input {
    width: 100%;
  }

  .toolbar-row .field {
    flex: 1 1 100%;
  }
}

@media (max-width: 560px) {
  .cover {
    padding-bottom: 56px;
  }

  .hero-lede {
    margin-top: 28px;
    font-size: 16.5px;
  }

  .plate-text {
    font-size: 18px;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .chapter-head {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .ride-grid {
    grid-template-columns: 1fr;
  }

  .compare-tray .tray-label {
    display: none;
  }

  .backdrop {
    padding: 0;
  }

  .dialog {
    border-radius: 0;
    min-height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Small additions
   -------------------------------------------------------------------------- */

.btn .icon,
.text-link .icon {
  width: 14px;
  height: 14px;
}

.lab-buttons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.video-row .vt,
.video-row .vs {
  display: block;
}

.tray-go:disabled {
  opacity: 0.55;
  cursor: default;
}

.video-dialog {
  max-width: 1000px;
}

.video-title {
  overflow: hidden;
  padding-right: 12px;
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-tabs a.source {
  color: var(--text-3);
  white-space: nowrap;
}

.media-tabs a.source:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Language switcher & multi-language / RTL typography
   -------------------------------------------------------------------------- */

.lang-picker {
  position: relative;
}

.lang-btn {
  padding: 0 9px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  min-width: 156px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--bg-raised);
  box-shadow: var(--shadow);
}

.lang-menu[hidden] {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--r-1);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.lang-option:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.lang-option[aria-selected="true"] {
  background: var(--bg-hover);
  color: var(--accent);
  font-weight: 500;
}

.lang-option .lang-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--text-3);
}

.lang-option[aria-selected="true"] .lang-code {
  color: var(--accent);
}

/* Language-specific typography adjustments */
:root:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) {
  --font-serif: "Newsreader", Georgia, "Times New Roman", "Noto Serif SC", serif;
}

:root:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru)) .display {
  font-size: clamp(42px, 5.2vw, 76px);
  line-height: 1.06;
  font-weight: 500;
}

:root:is(:lang(en), :lang(es), :lang(fr), :lang(de), :lang(ru), :lang(ar)) :is(.page-title, .note-title, .section-title) {
  word-break: normal;
  overflow-wrap: break-word;
}

:root:lang(en) .chapter-mark .en {
  display: none;
}

:root:lang(ja) {
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Noto Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

:root:lang(ko) {
  --font-serif: "AppleMyungjo", "Nanum Myeongjo", "Batang", "Noto Serif KR", "Noto Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

:root:is(:lang(ja), :lang(ko)) .display {
  font-size: clamp(44px, 6.2vw, 88px);
  line-height: 1.12;
}

:root:lang(ar) {
  --font-serif: "Geeza Pro", "Amiri", "Traditional Arabic", "Noto Naskh Arabic", Georgia, serif;
  --font-sans: "Geeza Pro", "SF Arabic", -apple-system, "Segoe UI", "Tahoma", sans-serif;
}

:root:lang(ar) .display {
  font-size: clamp(42px, 5.6vw, 80px);
  line-height: 1.22;
  letter-spacing: 0;
}

:root:lang(ar) :is(.page-title, .section-title, .article-title, .note-title, .dialog-title) {
  letter-spacing: 0;
  line-height: 1.35;
}

/* Right-to-Left (RTL) layout rules for Arabic */
[dir="rtl"] .header-tools {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .brand-sub {
  padding-left: 0;
  padding-right: 10px;
  border-left: 0;
  border-right: 1px solid var(--line-strong);
}

[dir="rtl"] .search-trigger kbd,
[dir="rtl"] .palette-item .sub,
[dir="rtl"] .media-tabs .source,
[dir="rtl"] .lab-buttons,
[dir="rtl"] .tree-cat-btn .chev {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}

[dir="rtl"] .lang-option,
[dir="rtl"] .ride-table th,
[dir="rtl"] .data-table th,
[dir="rtl"] .tree-cat-btn,
[dir="rtl"] .lab-item,
[dir="rtl"] .video-row,
[dir="rtl"] .palette-item {
  text-align: right;
}

[dir="rtl"] .field > .icon {
  left: auto;
  right: 10px;
}

[dir="rtl"] .input {
  padding: 0 32px 0 12px;
}

[dir="rtl"] .select {
  padding: 0 12px 0 34px;
  background-position: left 10px center;
}

[dir="rtl"] .contents a {
  border-left: 0;
  border-right: 1px solid var(--line);
}

[dir="rtl"] .contents a:first-child {
  padding-right: 0;
  border-right: 0;
}

[dir="rtl"] .ride-mech .code,
[dir="rtl"] .pager .code {
  margin-right: 0;
  margin-left: 8px;
}

[dir="rtl"] .pager .next {
  text-align: left;
}

[dir="rtl"] .tree-group {
  margin: 2px 11px 8px 0;
  padding-left: 0;
  padding-right: 9px;
  border-left: 0;
  border-right: 1px solid var(--line);
}

[dir="rtl"] .tree-leaf[aria-current="page"] {
  box-shadow: inset -2px 0 0 var(--accent);
}

[dir="rtl"] .spec-grid > div {
  border-left: 0;
  border-right: 1px solid var(--line);
}

[dir="rtl"] .spec-grid > div:first-child {
  padding-right: 0;
  border-right: 0;
}

[dir="rtl"] .title-block span {
  border-left: 0;
  border-right: 1px solid var(--line-strong);
}

[dir="rtl"] .title-block span:first-child {
  border-right: 0;
}

[dir="rtl"] .dialog-close {
  right: auto;
  left: 14px;
}

[dir="rtl"] .lab-canvas {
  direction: ltr;
}


span.code-link {
  border-bottom: 0;
}

.footer-links .icon {
  width: 14px;
  height: 14px;
  color: var(--text-3);
}

.player-start {
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Merged Lab & Distinctions + Park Gallery & Inline Ride Video Links
   -------------------------------------------------------------------------- */

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.lab-distinction {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.lab-distinction-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 30px;
}

.lab-distinction-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.lab-distinction-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lab-distinction-card .note-title {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 600;
  line-height: 1.3;
}

.lab-distinction-card .note-sub {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
}

.lab-distinction-card .note-intro {
  margin: 14px 0 22px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-2);
}

.lab-distinction-card .pager {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Park Row Photo Gallery */
.park-head-text {
  line-height: 1.55;
}

.park-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.park-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-sunken);
  padding: 0;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}

.park-photo:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.park-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92) contrast(1.03);
  transition: transform 0.45s var(--ease), filter 0.3s;
}

.park-photo:hover img {
  transform: scale(1.05);
  filter: none;
}

.park-photo-play {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(14, 14, 13, 0.76);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, color 0.2s;
}

.park-photo-play .icon {
  width: 10px;
  height: 10px;
}

.park-photo:hover .park-photo-play {
  background: var(--accent);
  color: var(--accent-ink);
}

.park-photo-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 6px 4px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0) 100%);
  color: #f4f2ec;
  font-size: 10.5px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Direct Ride Video Link Pill inside Park Table */
.park-ride-title {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed var(--line-strong);
  transition: color 0.18s, border-color 0.18s;
}

.park-ride-title:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.park-vid-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--accent);
  background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  text-decoration: none;
  vertical-align: baseline;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.park-vid-link .icon {
  width: 9px;
  height: 9px;
}

.park-vid-link:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.park-vid-link.is-search {
  color: var(--text-2);
  background: var(--bg-raised);
  border-color: var(--line-strong);
}

.park-vid-link.is-search:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-wash);
}

.player.is-photo {
  background: #090909;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player.is-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 760px) {
  .lab-distinction-card {
    padding: 18px 16px;
  }
  .park-gallery {
    max-width: 260px;
  }
}
