/* ==========================================================================
   KESTON — Obsidian & Swiss Minimalist Engineering Design System
   1px architectural grid · Interactive spotlight · Dark-first industrial UI
   ========================================================================== */

:root {
  --paper: #fafaf8;
  --surface: #ffffff;
  --surface-subtle: #f2f1ec;
  --ink: #0e0e0d;
  --ink-2: #383834;
  --muted: #686860;
  --faint: #94948a;
  --rule: #e2e0d8;
  --rule-strong: #1c1c19;
  --accent: #d6361f;
  --accent-soft: rgba(214, 54, 31, 0.08);
  --header-bg: rgba(250, 250, 248, 0.9);
  --btn-solid-hover: #282825;
  --readout-bg: #0e0e0d;
  --readout-fg: #fafaf8;
  --readout-muted: rgba(250, 250, 248, 0.58);
  --readout-sub: rgba(250, 250, 248, 0.85);
  --readout-rule: rgba(250, 250, 248, 0.14);
  --footer-bg: #0e0e0d;
  --footer-fg: rgba(250, 250, 248, 0.78);
  --footer-strong: #fafaf8;
  --footer-muted: rgba(250, 250, 248, 0.5);
  --footer-rule: rgba(250, 250, 248, 0.14);
  --frame-mat: #eae8e1;
  --backdrop: rgba(14, 14, 13, 0.56);
  --radius: 2px;
  --container: 1240px;
  --sans: "Inter", "Noto Sans TC", "Noto Sans JP", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 暗黑精密仪器主题（Swiss Industrial Dark Mode） */
html[data-theme="dark"] {
  --paper: #09090b;
  --surface: #111114;
  --surface-subtle: #18181d;
  --ink: #f4f4f0;
  --ink-2: #d2d2cb;
  --muted: #93938a;
  --faint: #676760;
  --rule: #232329;
  --rule-strong: #4a4a54;
  --accent: #ff4a2e;
  --accent-soft: rgba(255, 74, 46, 0.14);
  --header-bg: rgba(9, 9, 11, 0.86);
  --btn-solid-hover: #dcdcd6;
  --readout-bg: #121216;
  --readout-fg: #f4f4f0;
  --readout-muted: #8b8b83;
  --readout-sub: #c9c9c2;
  --readout-rule: #26262e;
  --footer-bg: #050507;
  --footer-fg: rgba(244, 244, 240, 0.78);
  --footer-strong: #f4f4f0;
  --footer-muted: rgba(244, 244, 240, 0.48);
  --footer-rule: rgba(244, 244, 240, 0.12);
  --frame-mat: #17171c;
  --backdrop: rgba(0, 0, 0, 0.76);
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

button,
input,
textarea {
  font-family: inherit;
}

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

::selection {
  background: var(--ink);
  color: var(--paper);
}

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

.container-narrow {
  max-width: 820px;
}

/* ==========================================================================
   Header & Language Switcher
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
  will-change: transform;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.brand-mark .bm-bg {
  fill: #0e0e0d;
  transition: fill 0.2s ease;
}

.brand-mark .bm-fg {
  stroke: #fafaf8;
  transition: stroke 0.2s ease;
}

.brand-mark .bm-dot {
  fill: var(--accent);
}

html[data-theme="dark"] .brand-mark .bm-bg {
  fill: #f4f4f0;
}

html[data-theme="dark"] .brand-mark .bm-fg {
  stroke: #09090b;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 450;
  color: var(--muted);
  transition: color 0.16s ease;
  white-space: nowrap;
  position: relative;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -24px;
  height: 1.5px;
  background: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Command Palette & Theme Controls */
.cmd-trigger,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.cmd-trigger {
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 11px;
}

.cmd-kbd {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.icon-btn {
  width: 34px;
  padding: 0;
}

.cmd-trigger:hover,
.icon-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface);
}

.cmd-trigger:hover .cmd-kbd {
  color: var(--ink);
}

.theme-btn .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-btn .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-btn .icon-sun {
  display: block;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.lang-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface);
}

.lang-chevron {
  width: 9px;
  height: 9px;
  transition: transform 0.16s ease;
}

.lang-switcher.is-open .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 176px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}

.lang-switcher.is-open .lang-menu {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink-2);
  border-radius: var(--radius);
  transition: background 0.12s ease, color 0.12s ease;
}

.lang-option:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.lang-option.is-current {
  color: var(--ink);
  font-weight: 600;
  background: var(--surface-subtle);
}

.lang-option-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.lang-option.is-current .lang-option-code {
  color: var(--accent);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
}

/* ==========================================================================
   Buttons — Crisp Swiss Controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.btn-solid {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

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

.btn-glow {
  position: relative;
  overflow: hidden;
}

html[data-theme="dark"] .btn-glow {
  box-shadow: 0 0 0 1px rgba(244, 244, 240, 0.18), 0 10px 30px -8px rgba(255, 74, 46, 0.45);
}

.btn-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.35) 50%, transparent 75%);
  transform: translateX(-130%);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.btn-glow:hover::after {
  transform: translateX(130%);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-subtle {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--rule);
}

.btn-subtle:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease, gap 0.15s ease;
  cursor: pointer;
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  gap: 9px;
}

/* ==========================================================================
   Hero — Editorial High-Whitespace Opening
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 0;
  border-bottom: 1px solid var(--rule);
}

/* 建筑级克制聚光灯光场（黑曜石 + 瑞士朱红纵深对比，零廉价霓虹） */
.hero-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 52% 48% at 78% 36%, rgba(214, 54, 31, 0.075), transparent 68%),
    radial-gradient(ellipse 42% 38% at 22% 18%, rgba(14, 14, 13, 0.035), transparent 64%);
}

html[data-theme="dark"] .hero-ambient {
  background:
    radial-gradient(ellipse 54% 52% at 76% 36%, rgba(255, 74, 46, 0.22), transparent 66%),
    radial-gradient(ellipse 46% 42% at 24% 20%, rgba(244, 244, 240, 0.065), transparent 62%),
    radial-gradient(ellipse 70% 35% at 50% 100%, rgba(255, 74, 46, 0.08), transparent 72%);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-coords {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(214, 54, 31, 0.45);
  animation: statusPulse 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes statusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(214, 54, 31, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(214, 54, 31, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(214, 54, 31, 0);
  }
}

/* 剧场级双栏 Hero 网格：左侧强排版 + 右侧 3D 物理倾斜展示舞台 */
.hero-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(0, 1.02fr);
  gap: 44px;
  align-items: center;
  padding-bottom: 44px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-title {
  margin: 0 0 24px;
  font-size: clamp(2.35rem, 4.1vw, 3.95rem);
  font-weight: 550;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--ink);
}

:lang(zh) .hero-title,
:lang(ja) .hero-title {
  font-size: clamp(1.95rem, 3.05vw, 2.95rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.hero-title .hero-line-muted {
  color: var(--muted);
}

html[data-theme="dark"] .hero-title .hero-line-muted {
  background: linear-gradient(180deg, #cfcfc7 0%, #7d7d76 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin: 0 0 32px;
  font-size: 16px;
  line-height: 1.68;
  color: var(--ink-2);
  max-width: 520px;
}

.hero-cta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.hero-showroom-trigger {
  display: flex;
  justify-content: flex-start;
}

/* 右侧 3D 倾斜实机舞台与 AI-Agent 实时终端 HUD */
.hero-visual {
  position: relative;
}

.stage-tilt-wrap {
  position: relative;
  perspective: 1200px;
}

.stage-device {
  position: relative;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  overflow: hidden;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
  box-shadow: 0 28px 64px -16px rgba(14, 14, 13, 0.16);
  will-change: transform;
}

html[data-theme="dark"] .stage-device {
  background: #101014;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 34px 86px -14px rgba(0, 0, 0, 0.78),
    0 0 0 1px rgba(255, 74, 46, 0.16),
    0 0 72px -18px rgba(255, 74, 46, 0.3);
}

.stage-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  background: radial-gradient(
    circle 320px at var(--gx, 50%) var(--gy, 25%),
    rgba(255, 255, 255, 0.16),
    transparent 68%
  );
  transition: opacity 0.25s ease;
}

.stage-device:hover .stage-glare {
  opacity: 1;
}

.stage-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-subtle);
  font-family: var(--mono);
  font-size: 11px;
}

html[data-theme="dark"] .stage-chrome {
  background: #14141a;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.stage-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.stage-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--rule-strong);
}

.stage-dots span.is-red {
  background: var(--accent);
}

.stage-caption {
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-meta-pill {
  flex-shrink: 0;
  padding: 2px 7px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.stage-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--frame-mat);
  overflow: hidden;
}

.stage-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
  transition: opacity 0.55s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.stage-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.stage-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.stage-zoom-pill {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: var(--radius);
  background: rgba(9, 9, 11, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f4f4f0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  opacity: 0.86;
  transition: opacity 0.16s ease, border-color 0.16s ease;
}

.stage-slide:hover .stage-zoom-pill {
  opacity: 1;
  border-color: var(--accent);
}

.stage-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  background: var(--surface);
}

html[data-theme="dark"] .stage-tabs {
  background: #0d0d11;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.stage-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.stage-tab:last-child {
  border-right: 0;
}

.stage-tab:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}

.stage-tab.is-active {
  background: var(--surface-subtle);
  color: var(--ink);
}

.stage-tab-idx {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
}

.stage-tab.is-active .stage-tab-idx {
  color: var(--accent);
}

.stage-tab-cat {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.stage-tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
}

.stage-tab.is-active .stage-tab-bar {
  animation: stageProgress 4.8s linear forwards;
}

@keyframes stageProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* AI-Agent 实时编译管线精密底座控制台（紧贴 3D 舞台正下方，零遮挡切换刻度） */
.agent-hud {
  position: relative;
  z-index: 4;
  width: 100%;
  margin-top: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--rule-strong);
  border-left: 2px solid var(--accent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 32px rgba(14, 14, 13, 0.1);
  overflow: hidden;
  pointer-events: none;
}

html[data-theme="dark"] .agent-hud {
  background: rgba(11, 11, 15, 0.88);
  border-color: rgba(255, 255, 255, 0.14);
  border-left-color: var(--accent);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.7);
}

.agent-hud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agent-hud-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.agent-hud-tag {
  color: var(--accent);
  font-weight: 500;
}

.agent-hud-body {
  padding: 8px 12px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10.5px;
  line-height: 1.45;
}

.hud-line {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  transition: color 0.25s ease;
}

.hud-line.is-active {
  color: var(--ink);
}

.hud-k {
  color: var(--faint);
}

.hud-line.is-active .hud-k {
  color: var(--accent);
}

.hud-ok {
  color: #22c55e;
  font-weight: 500;
}

/* ==========================================================================
   Full-Bleed Infinite 16-System Marquee Filmstrip
   ========================================================================== */

.marquee-band {
  padding: 28px 0 34px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  overflow: hidden;
}

.marquee-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.marquee-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.marquee-viewport {
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.marquee-track {
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: max-content;
  padding: 4px 0;
  animation: marqueeScroll 92s linear infinite;
}

.marquee-viewport:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.marquee-card {
  width: 304px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
  overflow: hidden;
  text-align: left;
  cursor: zoom-in;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, border-color 0.2s ease, box-shadow 0.22s ease;
}

.marquee-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.35);
}

.marquee-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--frame-mat);
  overflow: hidden;
}

.marquee-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.marquee-card:hover .marquee-thumb img {
  transform: scale(1.045);
}

.marquee-idx,
.marquee-metric {
  position: absolute;
  top: 8px;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(9, 9, 11, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f4f4f0;
  font-family: var(--mono);
  font-size: 10px;
  backdrop-filter: blur(6px);
}

.marquee-idx {
  left: 8px;
  color: #ff6a52;
}

.marquee-metric {
  right: 8px;
}

.marquee-info {
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid var(--rule);
}

.marquee-title {
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marquee-stack {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   2×2 Editorial Bento Work Gallery & Spotlight Tracking
   ========================================================================== */

[data-spotlight] {
  position: relative;
  overflow: hidden;
}

[data-spotlight]::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    360px circle at var(--mx, 50%) var(--my, 50%),
    rgba(14, 14, 13, 0.045),
    transparent 65%
  );
  transition: opacity 0.25s ease;
  z-index: 0;
}

html[data-theme="dark"] [data-spotlight]::before {
  background: radial-gradient(
    380px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 74, 46, 0.13),
    rgba(244, 244, 240, 0.04) 38%,
    transparent 68%
  );
}

[data-spotlight]:hover::before {
  opacity: 1;
}

[data-spotlight] > * {
  position: relative;
  z-index: 1;
}

.work-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.bento-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.bento-card:hover {
  border-color: var(--rule-strong);
  transform: translateY(-2px);
}

html[data-theme="dark"] .bento-card:hover {
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 0 24px 56px -22px rgba(0, 0, 0, 0.8), 0 0 42px -22px rgba(255, 74, 46, 0.35);
}

.bento-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--frame-mat);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: zoom-in;
}

.bento-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.bento-card:hover .bento-media img {
  transform: scale(1.035);
}

html[data-theme="dark"] .bento-media img,
html[data-theme="dark"] .marquee-thumb img,
html[data-theme="dark"] .stage-slide img {
  filter: brightness(0.95) contrast(1.04);
}

.bento-overlay-top {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.bento-badge-idx,
.bento-badge-metric {
  padding: 4px 9px;
  border-radius: 2px;
  background: rgba(9, 9, 11, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f4f4f0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.bento-badge-idx {
  border-left: 2px solid var(--accent);
}

.bento-zoom-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 4px 9px;
  border-radius: 2px;
  background: rgba(9, 9, 11, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f4f4f0;
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bento-card:hover .bento-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

.bento-body {
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.bento-body h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}

.bento-body h3 a:hover {
  color: var(--accent);
}

.bento-body p {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--muted);
}

.bento-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bento-stack {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

/* 4-Column Architectural Spec Strip */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}

.spec-cell {
  padding: 24px 24px 24px 0;
  border-right: 1px solid var(--rule);
  transition: background 0.16s ease;
}

.spec-cell:hover .spec-code {
  color: var(--accent);
}

.spec-cell:not(:first-child) {
  padding-left: 24px;
}

.spec-cell:last-child {
  border-right: 0;
  padding-right: 0;
}

.spec-code {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  margin-bottom: 10px;
  transition: color 0.16s ease;
}

.spec-value {
  display: block;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 3px;
}

.spec-label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}

/* Live Engineering Telemetry Strip */
.telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}

.telemetry-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.telemetry-pulse {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #16a34a;
  display: inline-block;
}

.telemetry-stack {
  color: var(--muted);
}

.telemetry-cmd {
  border: 0;
  background: none;
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.15s ease;
}

.telemetry-cmd:hover {
  color: var(--accent);
}

/* ==========================================================================
   Sections & Editorial Headers
   ========================================================================== */

.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--rule);
}

.section-tight {
  padding: 72px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
}

.section-index {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

:lang(zh) .section-title,
:lang(ja) .section-title {
  letter-spacing: -0.015em;
  line-height: 1.24;
}

.section-sub {
  margin: 12px 0 0;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 680px;
}

/* ==========================================================================
   Selected Work — Swiss Index Ledger (Zero Fake SVG Boxes)
   ========================================================================== */

.work-ledger {
  border-top: 1px solid var(--rule-strong);
}

.work-row {
  display: grid;
  grid-template-columns: 56px 1.6fr 1.1fr 0.75fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px 16px;
  border-bottom: 1px solid var(--rule);
  transition: background 0.16s ease;
}

.work-row.has-thumb {
  grid-template-columns: 96px 1.6fr 1.05fr 0.75fr auto;
}

.work-thumb {
  display: block;
  width: 96px;
  height: 60px;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--surface);
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.15s ease;
}

.work-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.work-thumb:hover {
  border-color: var(--ink);
}

.work-thumb:hover img {
  transform: scale(1.04);
}

.work-main h3 a:hover {
  color: var(--accent);
}

.work-row:hover {
  background: var(--surface-subtle);
}

.work-idx {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.work-main h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.work-main p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 480px;
}

.work-stack {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.work-metric {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}

.work-action {
  justify-self: end;
}

/* ==========================================================================
   Capabilities — 2x2 Architectural Hairline Grid
   ========================================================================== */

.cap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.cap-cell {
  background: var(--paper);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  transition: background 0.16s ease;
}

.cap-cell:hover {
  background: var(--surface);
}

.cap-num {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  margin-bottom: 16px;
  display: block;
  transition: color 0.16s ease;
}

.cap-cell:hover .cap-num {
  color: var(--accent);
}

.cap-cell h3 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.cap-cell p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 440px;
}

.spec-directory {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.spec-directory-label {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-right: 8px;
}

.spec-directory a {
  font-size: 13.5px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.spec-directory a:hover {
  color: var(--accent);
}

.spec-directory a span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

/* ==========================================================================
   Scope Estimator — Split Architectural Workbench
   ========================================================================== */

.estimator-split {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 64px;
  align-items: start;
}

.estimator-aside {
  position: sticky;
  top: 96px;
}

.estimate-readout {
  background: var(--readout-bg);
  color: var(--readout-fg);
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--readout-bg);
  margin-bottom: 32px;
}

html[data-theme="dark"] .estimate-readout {
  border-color: var(--rule-strong);
  border-top: 2px solid var(--accent);
}

.readout-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--readout-muted);
  margin-bottom: 8px;
}

.readout-days {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--readout-fg);
  font-variant-numeric: tabular-nums;
  margin-bottom: 18px;
}

.readout-divider {
  border: 0;
  border-top: 1px solid var(--readout-rule);
  margin: 0 0 16px;
}

.readout-mode {
  display: block;
  font-size: 13px;
  color: var(--readout-sub);
}

.principles-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.principles-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.principle-num {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  padding-top: 2px;
}

.principles-list strong {
  display: block;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--ink);
  margin-bottom: 4px;
}

.principles-list p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.estimator-panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 36px;
  border-radius: var(--radius);
}

.control-group {
  margin-bottom: 28px;
}

.control-title {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

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

.choice-pill {
  position: relative;
  display: block;
  cursor: pointer;
}

.choice-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-pill span {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  transition: all 0.14s ease;
}

.choice-pill:hover span {
  border-color: var(--ink);
}

.choice-pill input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.estimator-form {
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--ink);
  background: var(--surface);
}

.form-row textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.55;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.estimator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.privacy-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--faint);
}

.form-feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  background: var(--surface-subtle);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--ink);
}

.form-feedback.is-error {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ==========================================================================
   Notes & FAQ — Compact Editorial Closing Split
   ========================================================================== */

.closing-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.notes-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}

.notes-index-item {
  border-bottom: 1px solid var(--rule);
}

.notes-index-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 20px 4px;
  transition: padding-left 0.15s ease, color 0.15s ease;
}

.notes-index-link:hover {
  padding-left: 8px;
  color: var(--accent);
}

.notes-index-title {
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.4;
}

.notes-index-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
}

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

.faq-item {
  border-bottom: 1px solid var(--rule);
}

.faq-item summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
  color: var(--ink);
}

.faq-answer {
  padding: 0 0 22px;
  font-size: 14px;
  color: var(--muted);
  max-width: 640px;
}

.faq-answer p {
  margin: 0;
}

/* ==========================================================================
   Subpages — Page Hero, Cases, Solutions, Guides, Contact
   ========================================================================== */

.page-hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--rule);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  margin-bottom: 24px;
}

.breadcrumb a:hover {
  color: var(--ink);
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 500;
}

.page-eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.page-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
  max-width: 920px;
}

:lang(zh) .page-hero h1,
:lang(ja) .page-hero h1 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-hero-lead {
  margin: 0 0 32px;
  font-size: 16.5px;
  color: var(--muted);
  max-width: 680px;
}

.page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 28px 0 32px;
}

.meta-strip > div {
  padding: 18px 20px 18px 0;
  border-right: 1px solid var(--rule);
}

.meta-strip > div:not(:first-child) {
  padding-left: 20px;
}

.meta-strip > div:last-child {
  border-right: 0;
}

.meta-strip span {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-bottom: 5px;
}

.meta-strip strong {
  font-size: 14.5px;
  font-weight: 550;
  color: var(--ink);
}

/* Detailed Cases Architecture Cards */
.case-dossier-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule-strong);
}

.case-dossier {
  display: grid;
  grid-template-columns: 0.9fr 1.35fr;
  gap: 48px;
  padding: 52px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.case-dossier-concept {
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
}

.case-concept-frame {
  margin: 0;
  border: 1px solid var(--rule);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: border-color 0.16s ease;
}

.case-concept-frame:hover {
  border-color: var(--ink);
}

.case-concept-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--frame-mat);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: zoom-in;
}

html[data-theme="dark"] .case-concept-btn img,
html[data-theme="dark"] .work-thumb img {
  filter: brightness(0.94) contrast(1.03);
}

.case-concept-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s ease;
}

.case-concept-frame:hover .case-concept-btn img {
  transform: scale(1.025);
}

.case-concept-cap {
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}

.case-private-note {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}

.case-dossier-info {
  display: flex;
  flex-direction: column;
}

.case-dossier-foot {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.case-shot {
  margin: 0;
  border: 1px solid var(--rule);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: border-color 0.16s ease;
}

.case-shot:hover {
  border-color: var(--ink);
}

.case-shot.is-wide {
  grid-column: span 2;
}

.case-shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-subtle);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: zoom-in;
}

.case-shot.is-wide .case-shot-btn {
  aspect-ratio: 16 / 9.4;
}

.case-shot-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
}

.case-shot:hover .case-shot-btn img {
  transform: scale(1.025);
}

.case-shot figcaption {
  padding: 9px 12px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-dossier-head {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.case-dossier-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 12px;
}

.case-dossier h2 {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.metric-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.metric-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-2);
}

.stack-inline {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.case-spec-table {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

.case-spec-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}

.case-spec-row dt {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  padding-top: 2px;
}

.case-spec-row dd {
  margin: 0;
  color: var(--ink-2);
}

/* Solution Contrast Table & Deliverables */
.contrast-list {
  border-top: 1px solid var(--rule-strong);
}

.contrast-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}

.contrast-col-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

.contrast-col-label.is-fix {
  color: var(--accent);
}

.contrast-row p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.deliverables-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.deliverable-item {
  background: var(--paper);
  padding: 32px;
}

.deliverable-item h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 550;
}

.deliverable-item p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.stack-strip {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.stack-strip code {
  padding: 4px 10px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
}

/* Guides List & Article Detail */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.filter-chip {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.filter-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.guides-ledger {
  border-top: 1px solid var(--rule-strong);
}

.guide-row {
  display: grid;
  grid-template-columns: 120px 1.4fr 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 26px 8px;
  border-bottom: 1px solid var(--rule);
  transition: background 0.14s ease;
}

.guide-row:hover {
  background: var(--surface-subtle);
}

.guide-row-cat {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.guide-row h2 {
  margin: 0;
  font-size: 17.5px;
  font-weight: 500;
  line-height: 1.35;
}

.guide-row h2 a:hover {
  color: var(--accent);
}

.guide-row p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.guide-row-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 64px;
  align-items: start;
}

.article-main {
  max-width: 68ch;
}

.article-sec {
  margin-bottom: 44px;
}

.article-sec h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.article-sec p {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.75;
}

.article-list {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--ink-2);
}

.article-list li {
  margin-bottom: 10px;
  line-height: 1.65;
}

.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.data-table th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom-color: var(--rule-strong);
  background: var(--surface-subtle);
}

.article-cta-box {
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--ink);
  background: var(--surface);
}

.article-cta-box h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 550;
}

.article-cta-box p {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--muted);
}

.article-sidebar {
  position: sticky;
  top: 96px;
  border-top: 1px solid var(--rule-strong);
  padding-top: 20px;
}

.sidebar-title {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  margin-bottom: 12px;
}

.sidebar-toc {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  border-left: 1px solid var(--rule);
}

.sidebar-toc a {
  display: block;
  padding: 5px 0 5px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.sidebar-toc a:hover {
  color: var(--ink);
}

.sidebar-toc a.is-current {
  color: var(--ink);
  font-weight: 550;
  border-left-color: var(--accent);
}

.sidebar-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

/* Contact Channel Grid */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: 36px;
}

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

.channel-cell {
  background: var(--paper);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.channel-cell h3 {
  margin: 8px 0;
  font-size: 18px;
  font-weight: 550;
}

.channel-cell p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* ==========================================================================
   Footer — High-Contrast Charcoal Architectural Anchor
   ========================================================================== */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 76px 0 36px;
  border-top: 1px solid var(--rule);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--footer-rule);
}

.footer-brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--footer-strong);
  margin-bottom: 14px;
}

.footer-desc {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--footer-muted);
  max-width: 340px;
}

.footer-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
}

.footer-langs a {
  color: var(--footer-muted);
}

.footer-langs a:hover,
.footer-langs a.is-current {
  color: var(--footer-strong);
}

.footer-heading {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--footer-muted);
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
}

.footer-links a,
.footer-links button {
  color: var(--footer-fg);
  transition: color 0.14s ease;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.footer-links a:hover,
.footer-links button:hover {
  color: var(--footer-strong);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--footer-muted);
}

.footer-bottom a:hover {
  color: var(--footer-strong);
}

/* ==========================================================================
   Modal — Clean Swiss Dialog
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--ink);
}

.modal-badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.modal-dialog h3 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.modal-lead {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--muted);
}

/* Image Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(14, 14, 13, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(250, 250, 248, 0.32);
  border-radius: var(--radius);
  background: transparent;
  color: #fafaf8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  border-color: #fafaf8;
}

.lightbox-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: calc(90vh - 48px);
  object-fit: contain;
  border: 1px solid rgba(250, 250, 248, 0.16);
  background: #0e0e0d;
}

.lightbox-figure figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(250, 250, 248, 0.74);
  text-align: center;
}

/* ==========================================================================
   Command Palette (⌘K), Toast & Scroll Reveal
   ========================================================================== */

.cmd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(14vh, 110px) 20px 24px;
}

.cmd-backdrop[hidden] {
  display: none;
}

.cmd-dialog {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .cmd-dialog {
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}

.cmd-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}

.cmd-search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.4;
}

.cmd-input::placeholder {
  color: var(--faint);
}

.cmd-esc-btn {
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.cmd-esc-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.cmd-list {
  max-height: min(56vh, 420px);
  overflow-y: auto;
  padding: 8px 0;
}

.cmd-group-label {
  padding: 10px 16px 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.cmd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.cmd-item.is-selected,
.cmd-item:hover {
  background: var(--surface-subtle);
  color: var(--ink);
  border-left-color: var(--accent);
}

.cmd-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.cmd-item-kbd {
  padding: 1px 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 10.5px;
  color: var(--muted);
}

.cmd-empty {
  padding: 28px 16px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.cmd-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.cmd-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 4px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  padding: 11px 16px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

.toast[hidden] {
  display: none;
}

/* Progressive Scroll Reveal (Zero flash & SEO-safe) */
html.js-anim [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

html.js-anim [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html.js-anim [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .status-dot,
  .stage-tab.is-active .stage-tab-bar,
  .marquee-track {
    animation: none;
  }

  .marquee-viewport {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .stage-device {
    transform: none !important;
  }
}

/* Mobile Sticky Bottom Bar */
.mobile-sticky-bar {
  display: none;
}

/* Not Found */
.not-found-box {
  padding: 96px 0;
  text-align: left;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1080px) {
  .hero-stage-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 40px;
  }

  .stage-tilt-wrap {
    padding-bottom: 0;
  }

  .agent-hud {
    position: relative;
    left: 0;
    bottom: auto;
    width: 100%;
    margin-top: 12px;
  }

  .work-row {
    grid-template-columns: 42px 1.4fr 1fr auto;
  }

  .work-metric {
    display: none;
  }

  .estimator-split,
  .closing-split,
  .case-dossier,
  .article-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .estimator-aside,
  .article-sidebar {
    position: static;
  }

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

@media (max-width: 820px) {
  .container {
    padding: 0 20px;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--ink);
    padding: 8px 20px 16px;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }

  .nav-link.is-active::after {
    display: none;
  }

  .header-cta,
  .cmd-kbd,
  .hero-coords,
  .telemetry-stack {
    display: none;
  }

  .cmd-trigger {
    width: 34px;
    padding: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero {
    padding-top: 36px;
  }

  .hero-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 24px;
  }

  .hero-title {
    margin-bottom: 18px;
  }

  .hero-lead {
    margin-bottom: 24px;
  }

  .stage-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-tab {
    border-bottom: 1px solid var(--rule);
  }

  .marquee-card {
    width: 256px;
  }

  .work-bento {
    grid-template-columns: 1fr;
  }

  .spec-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec-cell {
    padding: 18px 16px;
    border-bottom: 1px solid var(--rule);
  }

  .spec-cell:nth-child(odd) {
    padding-left: 0;
  }

  .spec-cell:nth-child(even) {
    border-right: 0;
    padding-right: 0;
  }

  .section {
    padding: 64px 0;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 28px;
  }

  .work-row,
  .work-row.has-thumb {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 22px 0;
  }

  .work-thumb {
    width: 140px;
    height: 88px;
  }

  .case-gallery {
    grid-template-columns: 1fr;
  }

  .case-shot.is-wide {
    grid-column: span 1;
  }

  .work-action {
    justify-self: start;
    margin-top: 4px;
  }

  .cap-grid,
  .deliverables-grid,
  .channels-grid,
  .contrast-row,
  .choice-grid,
  .choice-grid-3,
  .form-grid-2,
  .meta-strip {
    grid-template-columns: 1fr;
  }

  .meta-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 14px 0 !important;
  }

  .meta-strip > div:last-child {
    border-bottom: 0;
  }

  .cap-cell,
  .estimator-panel {
    padding: 24px 20px;
  }

  .guide-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  body {
    padding-bottom: 64px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 76px;
    text-align: center;
  }

  .mobile-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--rule-strong);
  }
}
