:root {
  --bg: #07080b;
  --bg-elev: #0d0f14;
  --panel: #11141c;
  --panel-2: #161a24;
  --panel-glass: rgba(17, 20, 28, 0.86);
  --line: #202534;
  --line-2: #2d3448;
  --txt: #f2efe9;
  --muted: #9aa1b2;
  --dim: #646b7d;
  --accent: #f0b254;
  --accent-glow: rgba(240, 178, 84, 0.22);
  --accent-2: #38bdf8;
  --ok: #34d399;
  --rec: #ef4444;
  --r: 12px;
  --sans: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

html[dir="rtl"] body {
  font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
}

button, input, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

button {
  cursor: pointer;
}

/* ==========================================================================
   TOP STUDIO HEADER
   ========================================================================== */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 10px 24px;
  background: rgba(9, 11, 16, 0.90);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
}

.brand-mark-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(240, 178, 84, 0.45);
  box-shadow: 0 0 16px rgba(240, 178, 84, 0.18);
  flex-shrink: 0;
}

.brand-lens-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand .mark {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand b {
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 13.5px;
  color: #fff;
}

.brand .sub {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

.aaa-pill {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(240, 178, 84, 0.2), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(240, 178, 84, 0.4);
  color: var(--accent);
}

/* 6-Layer Step Navigation */
.steps {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: center;
}
.steps::-webkit-scrollbar { display: none; }

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.step:hover {
  border-color: var(--line-2);
  color: var(--txt);
  transform: translateY(-1px);
}

.step.active {
  border-color: var(--accent);
  color: var(--txt);
  background: linear-gradient(180deg, rgba(240, 178, 84, 0.16), rgba(240, 178, 84, 0.05));
  box-shadow: 0 4px 16px rgba(240, 178, 84, 0.12);
}

.step .n {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.step.active .n {
  color: var(--accent);
  background: rgba(240, 178, 84, 0.16);
}

.step .step-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.step .step-title {
  font-weight: 600;
  font-size: 11.5px;
}

.step .pick {
  color: var(--accent);
  font-size: 10px;
  max-width: 115px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono);
}

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

.ghost {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--txt);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
}

.ghost:hover {
  border-color: var(--accent);
  background: var(--panel-2);
}

.lang-btn {
  font-weight: 600;
  color: var(--accent);
  border-color: rgba(240, 178, 84, 0.32);
}

/* ==========================================================================
   CURATED DIRECTOR PRESETS / RECIPES BAR
   ========================================================================== */
.recipes-bar {
  background: linear-gradient(180deg, rgba(17, 20, 28, 0.9), rgba(11, 13, 18, 0.95));
  border-bottom: 1px solid var(--line);
  padding: 8px 24px;
}

.recipes-inner {
  max-width: 1640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.recipes-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  white-space: nowrap;
  text-transform: uppercase;
}

.rec-dot-mini {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.recipes-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.recipes-scroll::-webkit-scrollbar { display: none; }

.recipe-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(22, 26, 36, 0.75);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.recipe-chip:hover {
  border-color: var(--accent);
  color: var(--txt);
  background: rgba(240, 178, 84, 0.1);
}

.recipe-chip.active {
  border-color: var(--accent);
  background: rgba(240, 178, 84, 0.16);
  color: #fff;
}

.recipe-chip .r-badge {
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}

/* ==========================================================================
   MAIN WORKSPACE GRID
   ========================================================================== */
.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 488px;
  gap: 24px;
  padding: 20px 24px 48px;
  max-width: 1640px;
  margin: 0 auto;
  align-items: start;
}

/* ==========================================================================
   LEFT STAGE & OPTION CARDS (WITH 3 DISTINCT REAL IMAGES PER OPTION)
   ========================================================================== */
.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
  font-weight: 600;
}

.layer-count-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.stage-head h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stage-head .why {
  color: var(--muted);
  font-size: 13.5px;
}

.stage-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.mix-mode-btn {
  font-family: var(--mono);
  font-size: 11px;
}

.mix-mode-btn .mix-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
}

.mix-mode-btn.active {
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: rgba(56, 189, 248, 0.12);
}

.mix-mode-btn.active .mix-dot {
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
}

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

.search-ic {
  position: absolute;
  inset-inline-start: 11px;
  width: 15px;
  height: 15px;
  color: var(--dim);
  pointer-events: none;
}

#search {
  padding: 8px 30px 8px 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  min-width: 220px;
  font-size: 12.5px;
  transition: border-color 0.15s;
}

#search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-clear {
  position: absolute;
  inset-inline-end: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--line);
  color: var(--txt);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-nav {
  display: flex;
  gap: 6px;
}

.primary-step-btn {
  border-color: rgba(240, 178, 84, 0.45);
  color: var(--accent);
}

/* Option Cards Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  text-align: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
}

.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 30px rgba(240, 178, 84, 0.16);
}

.card.blended {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px var(--accent-2), 0 12px 28px rgba(56, 189, 248, 0.16);
}

/* Main 16:9 Card Artwork */
.pic {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050608;
  overflow: hidden;
}

.pic .main-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease, opacity 0.2s ease;
}

.card:hover .pic .main-card-img {
  transform: scale(1.03);
}

.pic::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.28) 0%, transparent 32%, transparent 65%, rgba(7,8,11,0.82) 100%);
  pointer-events: none;
}

/* Selected Badge */
.card .check {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 3;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(10, 12, 18, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: transparent;
  transition: all 0.16s ease;
}

.card.selected .check {
  background: var(--accent);
  border-color: var(--accent);
  color: #090a0f;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(240, 178, 84, 0.4);
}

.card.blended .check {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #06131c;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.4);
}

/* Top-Right Interactive 1/2/3 Frame Switcher Pills on Card */
.card-frame-pills {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 3;
  display: flex;
  gap: 3px;
  padding: 2px;
  border-radius: 6px;
  background: rgba(8, 10, 15, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.cf-pill {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--muted);
  transition: all 0.14s ease;
}

.cf-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.cf-pill.on {
  background: var(--accent);
  color: #090a0f;
}

/* Telemetry Spec Pill on Card Image Bottom-Left */
.card-spec-badge {
  position: absolute;
  bottom: 7px;
  inset-inline-start: 8px;
  z-index: 3;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(7, 9, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* 3-Thumbnail Filmstrip Row at Bottom of Card Image */
.card-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  background: #090b10;
  border-bottom: 1px solid var(--line);
}

.cthumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.62;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.cthumb:hover,
.cthumb.on {
  opacity: 1;
  border-color: var(--accent);
}

.cthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cthumb-num {
  position: absolute;
  bottom: 2px;
  inset-inline-end: 3px;
  font-family: var(--mono);
  font-size: 8.5px;
  padding: 0 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

/* Card Copy Body */
.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.card-body h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.3;
}

.card-ar-sub {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 500;
  line-height: 1.3;
}

.card-body p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.card-kw-preview {
  margin-top: auto;
  padding-top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   RIGHT DESK: AAA INTERACTIVE VIEWFINDER MONITOR (#vf)
   ========================================================================== */
.desk {
  position: sticky;
  top: 66px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vf {
  background: #0a0c12;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Top Camera Telemetry Bar */
.vf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #07090e;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.vf-rec-group {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
}

.vf-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 8px var(--rec);
  animation: recPulse 1.6s infinite ease-in-out;
}

@keyframes recPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.88); }
}

.vf-rec-txt {
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.06em;
}

.vf.previewing .vf-rec-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.vf.previewing .vf-rec-txt {
  color: var(--accent);
}

.vf-tc {
  color: var(--muted);
  padding-inline-start: 6px;
  border-inline-start: 1px solid var(--line);
}

.vf-telemetry-pills {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.vf-tel-pill {
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  white-space: nowrap;
}

.vf-tel-pill.accent {
  color: var(--accent);
  border-color: rgba(240, 178, 84, 0.3);
  background: rgba(240, 178, 84, 0.08);
}

.vf-toolbar {
  display: flex;
  gap: 4px;
  align-items: center;
}

.vf-tool-btn {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  transition: all 0.14s ease;
}

.vf-tool-btn:hover {
  color: var(--txt);
  border-color: var(--line-2);
}

.vf-tool-btn.active {
  color: #090a0f;
  background: var(--accent);
  border-color: var(--accent);
}

/* Main Optical Viewport (Forced LTR for optical coordinate stability in both EN/AR) */
.vf-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #040508;
  overflow: hidden;
  user-select: none;
  direction: ltr;
}

.vf-rig {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.3s ease;
}

.vf-layer-directed,
.vf-layer-raw {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#vfImg,
#vfRawImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.22s ease, filter 0.3s ease, transform 0.35s ease;
}

#vfFxCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.vf-color-lut {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: 0.65;
  z-index: 2;
  transition: background 0.3s ease, opacity 0.3s ease;
}

.vf-optical-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  transition: all 0.3s ease;
}

/* 3-UP Tri-Frame Simultaneous Contact Monitor Inside Viewfinder */
.vf-tri-grid {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #05070b;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 6px;
  align-items: stretch;
}
.vf-tri-grid[hidden] { display: none; }

.vf-tri-cell {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  background: #080a0f;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.vf-tri-cell:hover,
.vf-tri-cell.active {
  border-color: var(--accent);
}

.vf-tri-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vf-tri-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(7, 9, 14, 0.84);
  color: var(--accent);
  border: 1px solid rgba(240, 178, 84, 0.35);
}

/* ==========================================================================
   MULTI-LAYER OPTICAL, LUT, MOTION & FRAMING SIMULATION IN VIEWFINDER
   ========================================================================== */
.vf[data-frame="dutch_tilt"] #vfRig {
  transform: rotate(-11deg) scale(1.18);
}
.vf[data-frame="low_hero"] #vfImg {
  transform: perspective(650px) rotateX(6deg) scale(1.08);
}
.vf[data-frame="ecu_detail"] #vfImg {
  transform: scale(1.24);
}
.vf[data-frame="birds_eye_zenith"] #vfImg {
  transform: perspective(600px) rotateX(-5deg) scale(1.06);
}

.vf.motion-sim-on[data-motion="slow_dolly_in"] #vfRig {
  animation: vfDollyIn 7s ease-in-out infinite alternate;
}
.vf.motion-sim-on[data-motion="orbit_360"] #vfRig {
  animation: vfOrbit 8s ease-in-out infinite alternate;
}
.vf.motion-sim-on[data-motion="whip_pan"] #vfRig {
  animation: vfWhipPan 3.4s cubic-bezier(0.7, 0, 0.2, 1) infinite;
}
.vf.motion-sim-on[data-motion="crane_up"] #vfRig {
  animation: vfCraneUp 6.5s ease-in-out infinite alternate;
}
.vf.motion-sim-on[data-motion="handheld_organic"] #vfRig {
  animation: vfHandheld 4.2s ease-in-out infinite;
}
.vf.motion-sim-on[data-motion="dolly_zoom_vertigo"] #vfRig {
  animation: vfVertigo 5.5s ease-in-out infinite alternate;
}
.vf.motion-sim-on[data-motion="fpv_drone_dive"] #vfRig {
  animation: vfFpvDive 4.8s ease-in-out infinite alternate;
}
.vf.motion-sim-on[data-motion="snorricam"] #vfRig {
  animation: vfSnorri 3.2s ease-in-out infinite;
}
.vf.motion-sim-on[data-motion="zero_gravity"] #vfRig {
  animation: vfZeroG 9s ease-in-out infinite alternate;
}

@keyframes vfDollyIn {
  0% { transform: scale(1.0); }
  100% { transform: scale(1.13); }
}
@keyframes vfOrbit {
  0% { transform: scale(1.1) translateX(-3%) rotate(-1.2deg); }
  100% { transform: scale(1.1) translateX(3%) rotate(1.2deg); }
}
@keyframes vfWhipPan {
  0%, 35% { transform: scale(1.08) translateX(0); filter: blur(0px); }
  45% { transform: scale(1.12) translateX(-8%); filter: blur(3px); }
  55% { transform: scale(1.12) translateX(8%); filter: blur(3px); }
  65%, 100% { transform: scale(1.08) translateX(0); filter: blur(0px); }
}
@keyframes vfCraneUp {
  0% { transform: scale(1.12) translateY(5%); }
  100% { transform: scale(1.04) translateY(-4%); }
}
@keyframes vfHandheld {
  0% { transform: scale(1.06) translate(0px, 0px) rotate(0deg); }
  25% { transform: scale(1.06) translate(-4px, 3px) rotate(-0.7deg); }
  50% { transform: scale(1.06) translate(3px, -4px) rotate(0.6deg); }
  75% { transform: scale(1.06) translate(-3px, -2px) rotate(-0.4deg); }
  100% { transform: scale(1.06) translate(0px, 0px) rotate(0deg); }
}
@keyframes vfVertigo {
  0% { transform: perspective(400px) translateZ(0px) scale(1.0); }
  100% { transform: perspective(400px) translateZ(-45px) scale(1.22); }
}
@keyframes vfFpvDive {
  0% { transform: scale(1.05) rotate(-4deg) translateY(-3%); }
  100% { transform: scale(1.18) rotate(5deg) translateY(4%); }
}
@keyframes vfSnorri {
  0%, 100% { transform: scale(1.08) translate(0, 0); }
  33% { transform: scale(1.09) translate(5px, -3px) rotate(1deg); }
  66% { transform: scale(1.09) translate(-5px, 3px) rotate(-1deg); }
}
@keyframes vfZeroG {
  0% { transform: scale(1.08) translate(-2%, 2%) rotate(-2.5deg); }
  100% { transform: scale(1.10) translate(2%, -2%) rotate(2.5deg); }
}

/* Aspect Ratio Mattes */
.vf-matte {
  position: absolute;
  background: #020305;
  z-index: 6;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.vf-matte-top { top: 0; left: 0; right: 0; height: 0%; border-bottom: 1px solid rgba(255,255,255,0.07); }
.vf-matte-bottom { bottom: 0; left: 0; right: 0; height: 0%; border-top: 1px solid rgba(255,255,255,0.07); }
.vf-matte-left { top: 0; bottom: 0; left: 0; width: 0%; border-right: 1px solid rgba(255,255,255,0.07); }
.vf-matte-right { top: 0; bottom: 0; right: 0; width: 0%; border-left: 1px solid rgba(255,255,255,0.07); }

/* Interactive A/B Split Wipe Comparison */
.vf-layer-raw {
  z-index: 5;
  width: 50%;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
}

.vf-ab-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 32px;
  margin-left: -16px;
  z-index: 9;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vf-ab-slider[hidden] { display: none; }

.vf-ab-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
}

.vf-ab-handle {
  position: relative;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0a0c12;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75);
}

.vf-ab-badge {
  position: absolute;
  top: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(7, 9, 14, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  z-index: 8;
}

.raw-badge { left: 12px; color: #cbd5e1; }
.dir-badge { left: 22px; color: var(--accent); border-color: rgba(240, 178, 84, 0.45); }

/* Viewfinder Framing Guides */
.vf-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.vf-guides .c {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(255, 255, 255, 0.55);
}
.vf-guides .tl { top: 12px; left: 12px; border-top: 1.5px solid; border-left: 1.5px solid; }
.vf-guides .tr { top: 12px; right: 12px; border-top: 1.5px solid; border-right: 1.5px solid; }
.vf-guides .bl { bottom: 12px; left: 12px; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.vf-guides .br { bottom: 12px; right: 12px; border-bottom: 1.5px solid; border-right: 1.5px solid; }

.vf-guides .thirds-h,
.vf-guides .thirds-v {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.vf-guides .thirds-h {
  border-top: 1px dashed rgba(255, 255, 255, 0.16);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.16);
  top: 33.33%;
  bottom: 33.33%;
}
.vf-guides .thirds-v {
  border-left: 1px dashed rgba(255, 255, 255, 0.16);
  border-right: 1px dashed rgba(255, 255, 255, 0.16);
  left: 33.33%;
  right: 33.33%;
}

.vf-guides[data-guide="thirds"] .thirds-h,
.vf-guides[data-guide="thirds"] .thirds-v {
  opacity: 1;
}

.vf-guides .center-cross-h,
.vf-guides .center-cross-v {
  position: absolute;
  background: rgba(240, 178, 84, 0.42);
  opacity: 0;
  transition: opacity 0.2s;
}
.vf-guides .center-cross-h { top: 50%; left: 15%; right: 15%; height: 1px; }
.vf-guides .center-cross-v { left: 50%; top: 15%; bottom: 15%; width: 1px; }

.vf-guides[data-guide="crosshair"] .center-cross-h,
.vf-guides[data-guide="crosshair"] .center-cross-v,
.vf[data-frame="symmetrical_center"] .vf-guides .center-cross-h,
.vf[data-frame="symmetrical_center"] .vf-guides .center-cross-v {
  opacity: 1;
}

.vf-guides[data-guide="off"] .c,
.vf-guides[data-guide="off"] .focus-bracket {
  opacity: 0;
}

.focus-bracket {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.roll-horizon {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(7, 9, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

/* Bottom HUD Overlay Inside Viewport */
.vf-hud-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 8;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.vf-hud-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(7, 9, 14, 0.78);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 70%;
}

.vf-inspect-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.vf-inspect-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vf-inspect-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vf-hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(7, 9, 14, 0.78);
  backdrop-filter: blur(8px);
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.vf-pal-swatches {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vf-pal-dot {
  width: 10px;
  height: 8px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

#vfHistCanvas {
  display: block;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   3-FRAME FILMSTRIP & FRAME SWITCHER BAR INSIDE VIEWFINDER
   ========================================================================== */
.vf-filmstrip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #0c0f17;
  border-top: 1px solid var(--line);
}

.vf-frame-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.vf-frame-nav {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.vf-frame-nav:hover {
  border-color: var(--accent);
  color: #fff;
}

.vf-frame-pills {
  display: flex;
  gap: 4px;
}

.vf-fpill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  transition: all 0.14s ease;
}

.vf-fpill:hover {
  color: #fff;
  border-color: var(--line-2);
}

.vf-fpill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #090a0f;
}

.vf-reel-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}

.vf-reel-btn .reel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim);
}

.vf-reel-btn.active {
  border-color: var(--ok);
  color: var(--ok);
  background: rgba(52, 211, 153, 0.1);
}

.vf-reel-btn.active .reel-dot {
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
}

/* 3 Mini Thumbnail Strip Inside Viewfinder */
.vf-mini-strip {
  display: flex;
  gap: 5px;
}

.vf-mini-thumb {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 4px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  opacity: 0.65;
  transition: all 0.15s ease;
  cursor: pointer;
}

.vf-mini-thumb:hover,
.vf-mini-thumb.active {
  opacity: 1;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.vf-mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 6-Layer Chips Dock Inside Viewfinder */
.vf-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 12px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.chip {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--txt);
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: start;
  cursor: pointer;
  transition: all 0.14s ease;
}

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

.chip.active-layer {
  border-color: var(--accent);
  background: rgba(240, 178, 84, 0.12);
}

.chip b {
  color: var(--dim);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.chip span {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   SCENE INPUT, SHOT PARAMETERS & PROMPT COMPILER BOXES
   ========================================================================== */
.scene-box,
.prompt-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px;
}

.scene-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.aspect-pills {
  display: flex;
  gap: 4px;
}

.asp-pill {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
}

.asp-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240, 178, 84, 0.12);
}

#scene {
  width: 100%;
  resize: vertical;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  font-size: 12.5px;
}

#scene:focus {
  outline: none;
  border-color: var(--accent);
}

/* Shot Duration, FPS & Negative Prompt Bar */
.shot-params-row {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.param-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg);
  padding: 2px 5px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.param-lbl {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
  padding-inline-end: 4px;
}

.param-pill {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.14s ease;
}

.param-pill:hover {
  color: var(--txt);
}

.param-pill.active {
  background: rgba(240, 178, 84, 0.15);
  border-color: rgba(240, 178, 84, 0.45);
  color: var(--accent);
  font-weight: 600;
}

.neg-pill {
  background: var(--bg);
  border-color: var(--line);
  padding: 4px 8px;
}

.neg-pill.active {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.prompt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.prompt-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ready-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(52, 211, 153, 0.14);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.hint {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
}

/* AI Video Engine Syntax Tabs */
.engine-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.engine-tabs::-webkit-scrollbar { display: none; }

.eng-tab {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.14s ease;
}

.eng-tab:hover {
  color: var(--txt);
}

.eng-tab.active {
  background: rgba(240, 178, 84, 0.14);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.prompt-out {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--txt);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  max-height: 145px;
  overflow-y: auto;
  margin-bottom: 10px;
  user-select: all;
}

.prompt-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
}

.cta {
  padding: 10px 14px;
  background: var(--accent);
  color: #0b0c10;
  font-weight: 700;
  border-radius: 8px;
  font-size: 13px;
  transition: filter 0.15s, transform 0.1s;
}
.cta:hover { filter: brightness(1.08); }
.cta:active { transform: translateY(1px); }
.cta.copied { background: var(--ok); color: #062118; }

.save-shot-btn,
.export-btn {
  font-family: var(--mono);
  font-size: 11px;
}

/* Saved Shotboard Drawer */
.shotboard-wrap {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.shotboard-wrap[hidden] { display: none; }

.shotboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.shotboard-clear {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}
.shotboard-clear:hover { color: var(--rec); }

.shotboard-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.shot-card {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 4px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--line);
  min-width: 155px;
  max-width: 190px;
  cursor: pointer;
  transition: border-color 0.14s ease;
}
.shot-card:hover {
  border-color: var(--accent);
}

.shot-card img {
  width: 38px;
  height: 24px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.shot-card-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.2;
}

.shot-card-meta b {
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shot-card-meta span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
}

.kbd-hints {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10.5px;
  color: var(--dim);
}

.kbd-hints kbd {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}

.kbd-hints em {
  font-style: normal;
}

/* ==========================================================================
   FULLSCREEN CINEMA LIGHTBOX
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 7, 0.92);
  backdrop-filter: blur(16px);
}

.lightbox-content {
  position: relative;
  z-index: 2;
  width: min(1180px, 96vw);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lightbox-head h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-frame-tabs {
  display: flex;
  gap: 5px;
}

.lightbox-stage {
  aspect-ratio: 16 / 9;
  max-height: 70vh;
  background: #030406;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.lightbox-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.lb-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--line);
  opacity: 0.65;
  cursor: pointer;
  transition: all 0.16s ease;
}

.lb-thumb:hover,
.lb-thumb.active {
  opacity: 1;
  border-color: var(--accent);
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1180px) {
  .work {
    grid-template-columns: 1fr;
  }
  .desk {
    position: static;
    order: -1;
  }
  .top {
    grid-template-columns: 1fr auto;
  }
  .steps {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .top, .recipes-bar, .work {
    padding-left: 14px;
    padding-right: 14px;
  }
  .vf-chips {
    grid-template-columns: repeat(2, 1fr);
  }
}
