/* arks Cinema Hero Stage — Scoped, CSP-strict, Zero-Tailwind-CDN */

#arks-hero-stage {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: calc(100svh - 104px);
  height: calc(100dvh - 104px);
  min-height: 540px;
  max-height: 1080px;
  overflow: hidden;
  background: #060911;
  color: #f8fafc;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  isolation: isolate;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

#arks-hero-stage *,
#arks-hero-stage *::before,
#arks-hero-stage *::after,
#arks-qs-modal *,
#arks-qs-modal *::before,
#arks-qs-modal *::after {
  box-sizing: border-box;
}

#arks-hero-stage .arks-mono,
#arks-qs-modal .arks-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#arks-hero-stage.arks-no-webgl {
  background: radial-gradient(circle at 68% 42%, rgba(51, 180, 247, 0.22), rgba(6, 9, 17, 0.96) 62%), #060911;
}

#arks-stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}

#arks-stage-canvas.arks-free-orbit {
  touch-action: none;
  cursor: grab;
}

#arks-stage-canvas.arks-free-orbit:active {
  cursor: grabbing;
}

.arks-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background:
    linear-gradient(180deg, rgba(4, 7, 13, 0.52) 0%, rgba(4, 7, 13, 0) 24%, rgba(4, 7, 13, 0) 64%, rgba(4, 7, 13, 0.86) 100%),
    radial-gradient(ellipse at 20% 88%, rgba(4, 7, 13, 0.72) 0%, rgba(4, 7, 13, 0) 56%);
}

.arks-glass {
  background: rgba(6, 10, 19, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.arks-hidden {
  display: none !important;
}

/* Telemetry Chapter Jump Chip */
#arks-telemetry-chip {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 20;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: transform 0.2s ease;
}

#arks-telemetry-chip:hover {
  transform: scale(1.01);
}

.arks-telemetry-inner {
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s ease;
}

#arks-telemetry-chip:hover .arks-telemetry-inner {
  border-color: rgba(56, 189, 248, 0.5);
}

.arks-telemetry-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.arks-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 10px #33b4f7;
  flex-shrink: 0;
}

.arks-status-dot.is-lock {
  background: #f43f5e;
  box-shadow: 0 0 12px #f43f5e;
}

.arks-telemetry-text {
  min-width: 0;
}

#arks-telemetry-top {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fde68a;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#arks-telemetry-sub {
  font-size: 11px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arks-telemetry-arrow {
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}

/* One-Click Sound & Studio Narration Pill */
#arks-sound-cta {
  position: absolute;
  top: 158px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  border-radius: 999px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fef3c7;
  white-space: nowrap;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 24px rgba(51, 180, 247, 0.28);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#arks-sound-cta:hover {
  border-color: rgba(252, 211, 77, 0.72);
  background: rgba(15, 23, 42, 0.92);
}

.arks-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fcd34d;
  animation: arksPulse 1.8s ease-in-out infinite;
}

@keyframes arksPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* CH.04 Lock Contention Dialog (Optical Center) */
#arks-lock-toast {
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.arks-lock-card {
  border-radius: 12px;
  padding: 12px 16px;
  background: rgba(76, 5, 25, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(244, 63, 94, 0.65);
  box-shadow: 0 0 48px rgba(225, 29, 72, 0.45);
  text-align: center;
}

.arks-lock-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fb7185;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.arks-lock-msg {
  font-size: 12px;
  font-weight: 700;
  color: #ffe4e6;
  overflow-wrap: anywhere;
}

/* CH.05 Alias Flash */
#arks-alias-flash {
  position: absolute;
  inset: 0;
  z-index: 25;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.arks-alias-card {
  width: 100%;
  max-width: 460px;
  padding: 20px 24px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 60px rgba(51, 180, 247, 0.35);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arks-alias-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.25);
}

.arks-alias-cmd {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #7dd3fc;
}

.arks-alias-sub {
  font-size: 11px;
  color: #fde68a;
  margin-top: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* CH.06 3-Layer Architecture Legend (Desktop xl+) */
#arks-arch-stack {
  position: absolute;
  right: 40px;
  top: 42%;
  transform: translateY(-50%);
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 288px;
  transition: opacity 0.45s ease;
}

.arks-arch-card {
  border-radius: 12px;
  padding: 10px 14px;
}

.arks-arch-l3 { border-left: 2px solid #38bdf8; }
.arks-arch-l2 { border-left: 2px solid #67e8f9; }
.arks-arch-l1 { border-left: 2px solid #fcd34d; }

.arks-arch-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.arks-arch-l3 .arks-arch-title { color: #7dd3fc; }
.arks-arch-l2 .arks-arch-title { color: #67e8f9; }
.arks-arch-l1 .arks-arch-title { color: #fde68a; }

.arks-arch-desc {
  font-size: 12px;
  color: #e2e8f0;
  margin-top: 2px;
  line-height: 1.4;
}

/* Cinema Subtitles */
#arks-subtitle-box {
  position: absolute;
  top: 68px;
  left: 16px;
  right: 16px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#arks-subtitle-box.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.arks-sub-card {
  border-radius: 12px;
  padding: 8px 14px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
}

.arks-sub-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.arks-sub-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.arks-sub-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
  opacity: 0.6;
  flex-shrink: 0;
}

.arks-sub-eq span:nth-child(1) { width: 2px; height: 6px; background: #38bdf8; border-radius: 99px; }
.arks-sub-eq span:nth-child(2) { width: 2px; height: 10px; background: #fcd34d; border-radius: 99px; }
.arks-sub-eq span:nth-child(3) { width: 2px; height: 4px; background: #7dd3fc; border-radius: 99px; }

#arks-sub-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(125, 211, 252, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arks-sub-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.arks-studio-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.32);
}

#arks-sub-cue-idx {
  font-size: 10px;
  color: #94a3b8;
}

#arks-sub-text {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.38;
  color: rgba(255, 251, 235, 0.95);
}

#arks-sub-text code {
  background: transparent;
  padding: 0;
  color: #7dd3fc;
  font-size: 0.95em;
}

#arks-sub-text .arks-em-amber { color: #fde68a; font-weight: 600; }
#arks-sub-text .arks-em-sky { color: #7dd3fc; font-weight: 600; }
#arks-sub-text .arks-em-rose { color: #fda4af; }

.arks-sub-track {
  margin-top: 6px;
  height: 2px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

#arks-sub-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #38bdf8, #fcd34d);
}

/* Bottom-Left Hero Typography & CTAs */
#arks-hero-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 74px;
  z-index: 20;
  pointer-events: none;
}

.arks-hero-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-bottom: 6px;
}

#arks-hero-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: #fffbeb;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.78);
}

#arks-hero-desc {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(203, 213, 225, 0.95);
  max-width: 500px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

#arks-hero-desc code {
  background: transparent;
  padding: 0;
  color: #7dd3fc;
  font-size: 0.95em;
}

#arks-hero-desc .arks-em-amber { color: #fde68a; }
#arks-hero-desc .arks-em-rose { color: #fda4af; }

.arks-hero-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

#arks-copy-alias {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #fffbeb;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

#arks-copy-alias:hover {
  border-color: rgba(56, 189, 248, 0.65);
}

.arks-cmd-prompt { font-size: 12px; color: #38bdf8; }
.arks-cmd-text { font-size: 12px; font-weight: 600; }

#arks-copy-label {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

#arks-btn-start {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.28);
  transition: filter 0.2s ease;
}

#arks-btn-start:hover {
  filter: brightness(1.1);
  color: #ffffff;
}

.arks-scroll-cue {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(6, 10, 19, 0.55);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.arks-scroll-cue:hover {
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.5);
}

/* Bottom-Right Director Dock */
#arks-director-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 20;
  border-radius: 999px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
}

.arks-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.arks-pill-btn:hover {
  color: #ffffff;
  background: rgba(51, 180, 247, 0.2);
}

.arks-pill-btn:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

.arks-pill-btn.active {
  color: #ffffff;
  background: #0c4a6e;
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(51, 180, 247, 0.25);
}

.arks-pill-btn.recording {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.78);
  color: #fecaca;
}

#arks-time-readout {
  font-size: 11px;
  color: #7dd3fc;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

#arks-timeline {
  padding: 8px 0;
  cursor: pointer;
  flex: 1;
  min-width: 48px;
}

#arks-timeline-rail {
  position: relative;
  height: 4px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

#arks-timeline-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #33b4f7, #f2d08b);
}

.arks-tick {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 8px;
  border-radius: 99px;
  pointer-events: none;
}

.arks-tick-lock { left: 35%; background: rgba(251, 113, 133, 0.85); }
.arks-tick-alias { left: 51.7%; background: rgba(125, 211, 252, 0.92); }
.arks-tick-arch { left: 61.7%; height: 6px; background: rgba(252, 211, 77, 0.78); }

.arks-dock-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
  flex-shrink: 0;
}

.arks-sm-only { display: none; }

/* Quickstart Conversion Modal */
#arks-qs-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.arks-qs-dialog {
  position: relative;
  width: 100%;
  max-width: 512px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  padding: 24px;
  color: #f1f5f9;
}

#arks-qs-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#arks-qs-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.arks-qs-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-bottom: 4px;
}

.arks-qs-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: #fffbeb;
}

.arks-qs-sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #cbd5e1;
}

.arks-qs-cmds {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arks-qs-cmd-row {
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.arks-qs-cmd-row code {
  background: transparent;
  padding: 0;
  color: #fef3c7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arks-qs-cmd-row code.is-sky {
  color: #7dd3fc;
}

.arks-qs-copy {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 6px;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.arks-qs-copy:hover {
  background: rgba(14, 165, 233, 0.32);
}

.arks-qs-badges {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: #cbd5e1;
}

.arks-qs-badges span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.arks-qs-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.arks-qs-link-sec {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.arks-qs-link-sec:hover {
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.5);
}

.arks-qs-link-pri {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
}

/* Landing Doc Section Wrapper Below Hero */
#arks-doc-content {
  padding-top: 2.5rem;
}

/* Responsive Breakpoints */
@media (min-width: 640px) {
  .arks-sm-only { display: inline-flex; }
  .arks-scroll-cue { display: inline-flex; }
  #arks-hero-title { font-size: 32px; }
  #arks-hero-desc { font-size: 14px; }
  #arks-sub-text { font-size: 13.5px; }
}

@media (min-width: 1280px) {
  #arks-telemetry-chip {
    top: 24px;
    left: auto;
    right: 40px;
    width: auto;
  }
  .arks-telemetry-inner { padding: 10px 16px; gap: 14px; }
  #arks-telemetry-top { font-size: 11px; }
  #arks-telemetry-sub { font-size: 12px; }

  #arks-sound-cta {
    top: 24px;
  }

  #arks-lock-toast {
    top: 38%;
  }
  .arks-lock-msg { font-size: 15px; }

  #arks-arch-stack {
    display: flex;
  }

  #arks-subtitle-box {
    top: auto;
    left: auto;
    bottom: 84px;
    right: 40px;
    max-width: 448px;
  }
  #arks-sub-text { font-size: 14.5px; }

  #arks-hero-copy {
    left: 40px;
    right: auto;
    bottom: 32px;
    max-width: 440px;
  }
  #arks-hero-title { font-size: 46px; }
  #arks-hero-desc { font-size: 15px; margin-top: 12px; }
  .arks-hero-actions { margin-top: 18px; }
  .arks-cmd-text { font-size: 13px; }
  #arks-btn-start { padding: 10px 20px; font-size: 13px; }

  #arks-director-dock {
    left: auto;
    right: 40px;
    bottom: 32px;
    padding: 8px 14px;
    gap: 8px;
  }
  #arks-timeline { flex: none; width: 108px; }
}

@media (min-width: 1536px) {
  #arks-hero-copy { max-width: 560px; }
  #arks-timeline { width: 148px; }
}
