/**
 * Native stage chrome — synced from StageWindow.swift
 * dragStripHeight=28, gapBelowDrag=8, frameMargin=12, previewCornerRadius=12
 * defaultContent=1280×720
 */
:root {
  --rt-drag-h: 28px;
  --rt-gap: 8px;
  --rt-margin: 12px;
  --rt-radius: 12px;
  --rt-preview-w: min(1120px, calc(100vw - 88px));
}

.rt-stage-window {
  width: calc(var(--rt-preview-w) + var(--rt-margin) * 2);
  box-shadow: none !important;
  filter: drop-shadow(0 22px 56px rgba(0, 0, 0, 0.62));
  background: transparent;
}

.rt-stage-root {
  background: transparent;
}

/* StageDragStripView.draw — NSColor(white:0.12, alpha:0.92) + grip pill */
.rt-stage-drag-strip {
  height: var(--rt-drag-h);
  background: rgba(31, 31, 31, 0.92);
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rt-stage-drag-strip:active { cursor: grabbing; }

.rt-stage-drag-strip::after {
  content: "";
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

/* preview NSView — cornerRadius 12, border white 14% */
.rt-stage-preview {
  margin: var(--rt-gap) var(--rt-margin) var(--rt-margin);
  border-radius: var(--rt-radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #000;
  overflow: hidden;
  aspect-ratio: 1280 / 720;
  position: relative;
}

/* reveal.js inside stage — matches present/index.work */
.rt-stage-preview .reveal {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: #000 !important;
  overflow: hidden !important;
}

.rt-stage-preview .reveal .viewport {
  width: 100% !important;
  height: 100% !important;
}

.rt-stage-preview .reveal .controls,
.rt-stage-preview .reveal .progress,
.rt-stage-preview .reveal .slide-number,
.rt-stage-preview .reveal .playback-menu,
.rt-stage-preview .reveal .pause-overlay {
  display: none !important;
}

.rt-stage-preview .reveal .slides {
  width: 100% !important;
  height: 100% !important;
  text-align: left;
}

.rt-stage-preview .reveal .slides section {
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  overflow: hidden;
  background: #000;
}

.rt-stage-preview .reveal .slides section > .slide-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Marketing deck slides — full-bleed in 720p capture rect */
.slide-inner {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: clamp(32px, 6%, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #000;
}

.slide-kicker {
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 16px;
}

.slide-title {
  font-family: "Syne", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
  max-width: 14ch;
}

.slide-body {
  font: 18px/1.55 ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: #a1a1aa;
  max-width: 38ch;
  -webkit-font-smoothing: antialiased;
}

.slide-body code {
  font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #d4d4d8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.slide-lead { max-width: 42ch; font-size: 19px; color: #b4b4bc; }
.slide-note {
  margin-top: 20px;
  font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #52525b;
}
.slide-body-tight { margin-top: 14px; font-size: 15px; }
.slide-title-sm { font-size: clamp(1.6rem, 4vw, 2.6rem); max-width: 16ch; }

/* Hero — vertically centered with breathing room */
.slide-hero { justify-content: center; padding-top: clamp(40px, 8%, 64px); }

/* Split layouts */
.slide-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4%, 40px);
  align-items: center;
  padding: clamp(28px, 5%, 48px);
}
.slide-split-reverse { direction: rtl; }
.slide-split-reverse > * { direction: ltr; }
.slide-split-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.slide-split-visual { display: flex; align-items: center; justify-content: center; min-height: 0; }

.slide-code {
  margin: 0;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #8a8a94;
  overflow: hidden;
  white-space: pre;
}
.slide-code code { background: none; border: 0; padding: 0; color: inherit; font: inherit; }

/* Use-case cards */
.slide-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.slide-card {
  padding: 18px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}
.slide-card-num {
  display: block;
  font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  color: #52525b;
  margin-bottom: 10px;
}
.slide-card h3 {
  font: 700 14px/1.2 "Syne", ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  margin-bottom: 8px;
}
.slide-card p {
  font: 13px/1.45 ui-sans-serif, system-ui, sans-serif;
  color: #71717a;
}
.slide-card code {
  font-size: 0.9em;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Pills */
.slide-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.slide-pills li {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  color: #a1a1aa;
}

.slide-list-inline { display: flex; flex-wrap: wrap; gap: 0 20px; }
.slide-list-inline li { border-bottom: 0; padding: 4px 0; }
.slide-list-inline li::before { display: none; }

/* Mock output frame */
.slide-output-wrap { justify-content: center; }
.slide-output { display: flex; flex-direction: column; gap: 16px; max-width: 100%; }
.output-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, #111 0%, #050505 100%);
  overflow: hidden;
}
.output-slide-mock {
  position: absolute;
  inset: 12% 22% 18% 8%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
}
.output-slide-mock p {
  font: 13px/1.4 ui-sans-serif, system-ui, sans-serif;
  color: #666;
  max-width: 24ch;
}
.output-tag {
  position: absolute;
  top: 10px;
  left: 12px;
  font: 500 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
}
.output-pip {
  position: absolute;
  right: 6%;
  bottom: 10%;
  width: 22%;
  aspect-ratio: 4 / 3;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 35% 30%, #3a3a3a, #1a1a1a);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.output-zoom-ring {
  position: absolute;
  left: 28%;
  top: 38%;
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

/* Stage chrome mock */
.stage-chrome-mock {
  width: 100%;
  max-width: 280px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stage-chrome-strip {
  height: 20px;
  background: rgba(31, 31, 31, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-chrome-strip::after {
  content: "";
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
}
.stage-chrome-frame {
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, #0c0c0c, #000);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Export grid */
.slide-export-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
  margin: 16px 0 0;
  max-width: 420px;
}
.export-tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  min-height: 56px;
}
.export-tile.wide { grid-column: 1; grid-row: 1 / 3; min-height: 120px; }
.export-tile.tall { grid-column: 2; grid-row: 1 / 3; min-height: 120px; }
.export-tile.sq { grid-column: 3; grid-row: 1; }
.export-tile.cap { grid-column: 3; grid-row: 2; }
.export-tile span {
  font: 800 18px/1 "Syne", ui-sans-serif, system-ui, sans-serif;
  color: #fff;
  letter-spacing: -0.02em;
}
.export-tile i {
  font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
  font-style: normal;
  margin-top: 6px;
}

@media (max-width: 720px) {
  .slide-cards { grid-template-columns: 1fr; }
  .slide-split { grid-template-columns: 1fr; }
  .slide-split-reverse { direction: ltr; }
  .slide-export-grid { max-width: 100%; }
}

.slide-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font: 15px/1.5 ui-sans-serif, system-ui, sans-serif;
  color: #71717a;
  max-width: 40ch;
}

.slide-list li {
  padding: 8px 0 8px 16px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.slide-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: #52525b;
}

.slide-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 6;
  pointer-events: none;
}

.slide-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.35);
  transition: width 0.3s linear;
}

/* Hover keycaps — bottom-right of stage preview */
.stage-keycaps {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 24;
  display: flex;
  gap: 6px;
  align-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.rt-stage-preview:hover .stage-keycaps,
.stage-keycaps:focus-within {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.keycap {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(48, 48, 48, 0.94) 0%, rgba(22, 22, 22, 0.94) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 2px 6px rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.82);
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.keycap-wide {
  min-width: 0;
  padding: 0 10px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.keycap.on {
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  background: linear-gradient(180deg, rgba(64, 64, 64, 0.96) 0%, rgba(36, 36, 36, 0.96) 100%);
}

.keycap:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.keycap:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

@media (max-width: 960px) {
  :root {
    --rt-preview-w: calc(100vw - 24px);
  }

  .stage-keycaps {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
