/* ==========================================================================
   THE ROTUNDA — 3D Portfolio Showcase Styles (portfolio.html)
   180 Live Screens · Rolling Shaft Descent · Lone Figure in Amber Light
   ========================================================================== */

:root {
  --bg: #050506;
  --ink: #f4f1ea;
  --ink-dim: rgba(244, 241, 234, 0.78);
  --ink-muted: rgba(244, 241, 234, 0.56);
  --rule: rgba(244, 241, 234, 0.16);
  --amber: #e2b068;
  --font-serif: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body.mode-rotunda {
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

body.mode-showcase {
  overflow-x: hidden;
  overflow-y: auto;
}

body.mode-showcase .rotunda-stage {
  display: none;
}

body.mode-showcase .rotunda-only {
  display: none;
}

body.mode-rotunda .showcase-shell {
  display: none;
}

body.mode-rotunda .rotunda-stage {
  display: block;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Full-Viewport Three.js WebGL Canvas */
#rotunda-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}

#rotunda-canvas:active {
  cursor: grabbing;
}

/* Top Floating Minimal Header */
.rotunda-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 3vw, 38px);
  pointer-events: none;
}

.rotunda-header > * {
  pointer-events: auto;
}

.rotunda-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 14px;
  background: rgba(8, 8, 10, 0.72);
  border: 1px solid var(--rule);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s, background 0.25s;
}

.rotunda-back:hover {
  border-color: var(--ink);
  background: rgba(20, 20, 24, 0.9);
}

.rotunda-title-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 8px 14px;
  background: rgba(8, 8, 10, 0.65);
  border: 1px solid var(--rule);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.rotunda-title-pill strong {
  color: var(--amber);
  font-weight: 500;
}

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

.rotunda-pill-btn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  background: rgba(8, 8, 10, 0.74);
  border: 1px solid var(--rule);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  color: var(--ink-dim);
  transition: all 0.25s var(--ease);
}

.rotunda-pill-btn:hover {
  color: var(--ink);
  border-color: var(--amber);
}

.rotunda-pill-btn.primary {
  background: var(--ink);
  color: #060606;
  border-color: var(--ink);
  font-weight: 500;
}

.rotunda-pill-btn.primary:hover {
  background: var(--amber);
  border-color: var(--amber);
}

/* ==========================================================================
   SHAFT INTRO EDITORIAL CAPTIONS (Visible at top of shaft, fade on descent)
   ========================================================================== */
.shaft-overlay {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 72px);
  transition: opacity 0.45s var(--ease);
}

.shaft-caption-left,
.shaft-caption-right {
  max-width: 300px;
}

.shaft-caption-right {
  text-align: right;
}

.shaft-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}

.shaft-headline {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.7vw, 38px);
  font-weight: 400;
  line-height: 1.12;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.85);
}

.shaft-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.55;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85);
}

.shaft-drop-cta {
  position: fixed;
  left: 50%;
  bottom: clamp(24px, 4.5vh, 44px);
  transform: translateX(-50%);
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.shaft-drop-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 12px 22px;
  background: rgba(10, 10, 12, 0.78);
  border: 1px solid rgba(217, 164, 91, 0.55);
  color: var(--ink);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  transition: all 0.25s var(--ease);
}

.shaft-drop-btn:hover {
  background: var(--amber);
  color: #060606;
  border-color: var(--amber);
  transform: translateY(-2px);
}

.shaft-scroll-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ==========================================================================
   FLOATING HOVER TOOLTIP (Matching Video 2 frame 00:03)
   ========================================================================== */
.hover-pill {
  position: fixed;
  z-index: 35;
  pointer-events: none;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.86);
  border: 1px solid rgba(244, 241, 234, 0.22);
  backdrop-filter: blur(10px);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -140%) scale(0.95);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.hover-pill.visible {
  opacity: 1;
  transform: translate(-50%, -155%) scale(1);
}

.hover-pill span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--amber);
  margin-right: 7px;
}

/* ==========================================================================
   PULLED SCREEN CENTER ACTIONS ("Step inside" / "Hang it back")
   ========================================================================== */
.pulled-actions {
  position: fixed;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  z-index: 28;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.pulled-actions.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) translateY(0);
}

.action-chip {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.82);
  border: 1px solid rgba(244, 241, 234, 0.28);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  transition: transform 0.22s var(--ease), background 0.22s, color 0.22s, border-color 0.22s;
}

.action-chip:hover {
  background: var(--ink);
  color: #060606;
  border-color: var(--ink);
  transform: translateY(-2px);
}

.action-chip.hang {
  background: rgba(10, 10, 12, 0.65);
  color: var(--ink-dim);
}

.action-chip.hang:hover {
  background: rgba(244, 241, 234, 0.16);
  color: var(--ink);
  border-color: var(--ink);
}

/* ==========================================================================
   BOTTOM EDITORIAL HUD (Active Project Info + Flip Controls)
   ========================================================================== */
.rotunda-hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 20px clamp(20px, 3.4vw, 46px) clamp(20px, 3.2vh, 34px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(to top, rgba(5, 5, 6, 0.88) 0%, rgba(5, 5, 6, 0.3) 62%, rgba(5, 5, 6, 0) 100%);
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.rotunda-hud.visible {
  opacity: 1;
  transform: translateY(0);
}

.rotunda-hud > * {
  pointer-events: auto;
}

.hud-project {
  max-width: 520px;
}

.hud-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}

.hud-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.2vw, 56px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.85);
}

.hud-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-dim);
  line-height: 1.5;
}

.hud-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.hud-flip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-flip-btn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 9px 14px;
  background: rgba(8, 8, 10, 0.78);
  border: 1px solid var(--rule);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  color: var(--ink);
  transition: all 0.2s;
}

.hud-flip-btn:hover {
  border-color: var(--amber);
  background: rgba(217, 164, 91, 0.16);
}

.hud-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Vertical Depth Gauge on Right Edge */
.depth-rail {
  position: fixed;
  right: clamp(14px, 2vw, 26px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.depth-track {
  width: 2px;
  height: 120px;
  background: rgba(244, 241, 234, 0.16);
  position: relative;
  border-radius: 2px;
}

.depth-fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: var(--amber);
  border-radius: 2px;
}

.depth-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  writing-mode: vertical-rl;
}

/* ==========================================================================
   "STEP INSIDE" CASE STUDY DRAWER OVERLAY
   ========================================================================== */
.inside-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 5, 7, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.inside-drawer.open {
  display: flex;
}

.inside-card {
  width: min(920px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #0c0c0f;
  border: 1px solid rgba(244, 241, 234, 0.22);
  border-radius: 8px;
  padding: clamp(22px, 3.2vw, 40px);
  position: relative;
}

.inside-close {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 13px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.inside-close:hover {
  background: var(--ink);
  color: #060606;
}

.inside-hero-img {
  width: 100%;
  aspect-ratio: 16 / 8.5;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--rule);
  margin: 18px 0 22px;
}

.inside-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.inside-metric {
  background: rgba(244, 241, 234, 0.03);
  border: 1px solid var(--rule);
  padding: 15px;
  border-radius: 4px;
}

.inside-metric strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 28px;
}

.inside-metric span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.inside-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.inside-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.inside-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 9px;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
}

@media (max-width: 820px) {
  .shaft-overlay { flex-direction: column; justify-content: center; gap: 28px; text-align: center; }
  .shaft-caption-right { text-align: center; }
  .rotunda-title-pill { display: none; }
  .rotunda-hud { flex-direction: column; align-items: flex-start; }
  .hud-controls { align-items: flex-start; }
  .inside-metrics, .inside-cols { grid-template-columns: 1fr; }
}

/* ==========================================================================
   VIEW MODE SWITCHER (LIVE WEBSITES <-> 3D ROTUNDA)
   ========================================================================== */
.mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(10, 10, 13, 0.78);
  border: 1px solid var(--rule);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--ink-muted);
  transition: all 0.25s var(--ease);
}

.mode-tab:hover {
  color: var(--ink);
}

.mode-tab.active {
  background: rgba(244, 241, 234, 0.12);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(226, 176, 104, 0.45);
}

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

/* ==========================================================================
   INTERACTIVE LIVE WEBSITE SHOWCASE (HOVER-TO-SCROLL BROWSER CARDS)
   ========================================================================== */
.showcase-shell {
  position: relative;
  z-index: 10;
  max-width: 1440px;
  margin: 0 auto;
  padding: 108px clamp(18px, 3.4vw, 48px) 72px;
}

.showcase-hero {
  margin-bottom: 36px;
}

.showcase-hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.showcase-headline {
  margin: 0 0 12px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: clamp(34px, 4.8vw, 64px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 820px;
}

.showcase-sub {
  margin: 0;
  max-width: 680px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-dim);
}

.showcase-sub strong {
  color: var(--amber);
  font-weight: 600;
}

.rotunda-launch-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 14px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(226, 176, 104, 0.16), rgba(226, 176, 104, 0.04));
  border: 1px solid rgba(226, 176, 104, 0.48);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink);
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.rotunda-launch-btn .launch-sub {
  font-size: 9.5px;
  color: var(--amber);
  letter-spacing: 0.12em;
}

.rotunda-launch-btn:hover {
  transform: translateY(-2px);
  border-color: var(--amber);
  background: linear-gradient(135deg, rgba(226, 176, 104, 0.28), rgba(226, 176, 104, 0.08));
  box-shadow: 0 12px 32px rgba(226, 176, 104, 0.16);
}

.showcase-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(244, 241, 234, 0.03);
  color: var(--ink-dim);
  transition: all 0.22s var(--ease);
}

.filter-pill span {
  opacity: 0.55;
  margin-left: 4px;
}

.filter-pill:hover {
  border-color: rgba(244, 241, 234, 0.42);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--ink);
  color: #060606;
  border-color: var(--ink);
  font-weight: 500;
}

.filter-pill.active span {
  opacity: 0.72;
}

.showcase-legend {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--ink-muted);
}

.legend-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4fd1a5;
  box-shadow: 0 0 10px #4fd1a5;
  animation: pulseDot 2.1s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Grid of Interactive Website Browser Cards */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 1160px) {
  .showcase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }
  .mode-switcher {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .rotunda-header {
    flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(to bottom, rgba(5, 5, 6, 0.92), rgba(5, 5, 6, 0));
  }
  .showcase-shell {
    padding-top: 138px;
  }
}

.site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(18, 18, 22, 0.95), rgba(10, 10, 13, 0.98));
  border: 1px solid rgba(244, 241, 234, 0.14);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.32s var(--ease), border-color 0.32s var(--ease), box-shadow 0.32s var(--ease);
}

.site-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent, var(--amber));
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(226, 176, 104, 0.16);
}

/* Browser Window Chrome */
.site-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(14, 14, 18, 0.96);
  border-bottom: 1px solid rgba(244, 241, 234, 0.09);
}

.site-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.22);
  transition: background 0.25s;
}

.site-card:hover .site-dots i:nth-child(1) { background: #ff5f56; }
.site-card:hover .site-dots i:nth-child(2) { background: #ffbd2e; }
.site-card:hover .site-dots i:nth-child(3) { background: #27c93f; }

.site-url-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(244, 241, 234, 0.05);
  border: 1px solid rgba(244, 241, 234, 0.07);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s, color 0.2s;
}

.site-url-pill:hover {
  color: var(--ink);
  border-color: rgba(244, 241, 234, 0.25);
}

.site-live-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.site-live-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.28);
  transition: background 0.25s, box-shadow 0.25s;
}

.site-card.is-scrolling .site-live-status {
  color: var(--card-accent, var(--amber));
}

.site-card.is-scrolling .site-live-status::before {
  background: var(--card-accent, var(--amber));
  box-shadow: 0 0 8px var(--card-accent, var(--amber));
}

/* Interactive Hover-Scroll Website Viewport */
.site-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  background: #08080b;
  cursor: ns-resize;
}

.site-scroll-img {
  display: block;
  width: 100%;
  height: auto;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  pointer-events: none;
  user-select: none;
}

/* Simulated Browser Scrollbar on Right Edge */
.site-scrollbar-track {
  position: absolute;
  top: 8px;
  right: 6px;
  bottom: 8px;
  width: 4px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.site-card.is-scrolling .site-scrollbar-track,
.site-viewport:hover .site-scrollbar-track {
  opacity: 1;
}

.site-scrollbar-thumb {
  width: 100%;
  height: 24%;
  border-radius: 99px;
  background: var(--card-accent, var(--amber));
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
}

/* Bottom Progress Bar + Floating Navigation Pill */
.site-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.site-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--card-accent, var(--amber));
}

.site-scroll-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 11, 0.84);
  border: 1px solid rgba(244, 241, 234, 0.2);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  pointer-events: none;
  opacity: 0.92;
  transition: opacity 0.22s, transform 0.22s, border-color 0.22s;
}

.site-card.is-scrolling .site-scroll-badge {
  border-color: var(--card-accent, var(--amber));
  opacity: 1;
}

.site-scroll-badge .badge-pct {
  color: var(--card-accent, var(--amber));
  font-weight: 600;
}

/* Card Body & Actions */
.site-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 18px 16px;
}

.site-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.site-meta-cat {
  color: var(--card-accent, var(--amber));
}

.site-meta-metric {
  color: var(--ink-dim);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(244, 241, 234, 0.05);
  border: 1px solid rgba(244, 241, 234, 0.1);
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58%;
}

.site-title {
  margin: 0 0 6px;
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
}

.site-subtitle {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.52;
  color: var(--ink-dim);
  flex: 1;
}

.site-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.site-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(244, 241, 234, 0.04);
  border: 1px solid rgba(244, 241, 234, 0.1);
  color: var(--ink-muted);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(244, 241, 234, 0.09);
}

.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
  transition: all 0.2s var(--ease);
}

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

.site-btn.primary {
  background: var(--ink);
  color: #060606;
  border-color: var(--ink);
  font-weight: 500;
}

.site-btn.primary:hover {
  background: var(--card-accent, var(--amber));
  border-color: var(--card-accent, var(--amber));
  color: #060606;
}

.site-btn.ghost-3d {
  margin-left: auto;
  border-color: rgba(226, 176, 104, 0.35);
  color: var(--amber);
}

.site-btn.ghost-3d:hover {
  background: rgba(226, 176, 104, 0.14);
  border-color: var(--amber);
}

.showcase-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

.showcase-footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-link-btn,
.showcase-footer-links a {
  color: var(--ink-dim);
  transition: color 0.2s;
}

.footer-link-btn:hover,
.showcase-footer-links a:hover {
  color: var(--amber);
}

/* ==========================================================================
   INTERACTIVE BROWSER PREVIEW INSIDE "STEP INSIDE" DRAWER
   ========================================================================== */
.inside-browser {
  margin: 18px 0 22px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 234, 0.2);
  background: #08080b;
}

.inside-browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #121216;
  border-bottom: 1px solid rgba(244, 241, 234, 0.1);
}

.inside-browser-url {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  background: rgba(244, 241, 234, 0.05);
  padding: 5px 12px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inside-tour-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(226, 176, 104, 0.45);
  color: var(--amber);
  background: rgba(226, 176, 104, 0.08);
  transition: all 0.2s;
}

.inside-tour-btn.playing {
  background: var(--amber);
  color: #060606;
  border-color: var(--amber);
}

.inside-browser-viewport {
  position: relative;
  width: 100%;
  height: clamp(280px, 46vh, 440px);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: auto;
  background: #08080b;
}

.inside-browser-viewport::-webkit-scrollbar {
  width: 7px;
}

.inside-browser-viewport::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.inside-browser-viewport::-webkit-scrollbar-thumb {
  background: rgba(226, 176, 104, 0.5);
  border-radius: 99px;
}

.inside-browser-img {
  display: block;
  width: 100%;
  height: auto;
}

.inside-browser-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #101014;
  border-top: 1px solid rgba(244, 241, 234, 0.08);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

/* Mobile-only touch legend swap */
.showcase-legend .legend-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .showcase-legend .legend-desktop { display: none; }
  .showcase-legend .legend-touch { display: inline; }
  .site-viewport { cursor: pointer; }
}

/* ==========================================================================
   COMPREHENSIVE MOBILE & TABLET RESPONSIVE OPTIMIZATION (<= 768px & <= 480px)
   ========================================================================== */
@media (max-width: 768px) {
  .tab-extra {
    display: none;
  }

  .rotunda-header {
    width: 100%;
    max-width: 100vw;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    gap: 8px;
    background: rgba(5, 5, 6, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(244, 241, 234, 0.08);
  }

  .rotunda-back {
    font-size: 9.5px;
    letter-spacing: 0.1em;
    padding: 7px 11px;
    min-height: 34px;
  }

  .rotunda-pill-btn {
    font-size: 9.5px;
    letter-spacing: 0.1em;
    padding: 7px 11px;
    min-height: 34px;
  }

  .mode-switcher {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding: 3px;
  }

  .mode-tab {
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    font-size: 9.5px;
    letter-spacing: 0.1em;
    padding: 8px 10px;
    min-height: 34px;
  }

  .showcase-shell {
    padding: 132px 14px calc(52px + env(safe-area-inset-bottom));
  }

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

  .showcase-hero-top {
    gap: 16px;
    margin-bottom: 20px;
  }

  .showcase-headline {
    font-size: clamp(28px, 8.2vw, 40px);
    line-height: 1.06;
  }

  .showcase-sub {
    font-size: 13.5px;
    line-height: 1.55;
  }

  .showcase-hero-cta {
    width: 100%;
  }

  .rotunda-launch-btn {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
  }

  .showcase-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 14px;
  }

  /* Horizontal single-row scrollable filter chip rail on mobile */
  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin: 0 -14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex: 0 0 auto;
    padding: 9px 14px;
    min-height: 36px;
  }

  .showcase-legend {
    display: flex;
    flex-wrap: wrap;
    font-size: 9.5px;
    letter-spacing: 0.08em;
    line-height: 1.45;
  }

  .showcase-grid {
    gap: 18px;
  }

  .site-card:hover {
    transform: none;
  }

  .site-chrome {
    padding: 9px 12px;
    gap: 8px;
  }

  .site-viewport {
    aspect-ratio: 16 / 11;
  }

  .site-body {
    padding: 15px 14px 14px;
  }

  .site-meta-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .site-meta-metric {
    max-width: 100%;
  }

  .site-title {
    font-size: 21px;
  }

  .site-subtitle {
    font-size: 12.5px;
    margin-bottom: 12px;
  }

  .site-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .site-btn {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 10px;
  }

  .site-btn.primary {
    flex: 1 1 auto;
  }

  /* Native-feel bottom sheet drawer on mobile */
  .inside-drawer {
    padding: 0;
    align-items: flex-end;
  }

  .inside-card {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding: 52px 16px calc(28px + env(safe-area-inset-bottom));
  }

  .inside-close {
    top: 12px;
    right: 14px;
    min-height: 32px;
    padding: 5px 12px;
    background: rgba(12, 12, 15, 0.94);
    z-index: 5;
  }

  .inside-browser-bar {
    padding: 8px 10px;
    gap: 8px;
  }

  .inside-browser-bar .site-dots {
    display: none;
  }

  .inside-browser-viewport {
    height: 40dvh;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .inside-browser-hint {
    font-size: 9px;
    padding: 7px 10px;
  }

  .inside-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .inside-metric {
    padding: 11px 10px;
  }

  .inside-metric strong {
    font-size: 19px;
  }

  .inside-metric span {
    font-size: 8.5px;
  }

  /* 3D Rotunda mobile HUD & overlays */
  .shaft-overlay {
    padding: 0 18px;
    gap: 20px;
  }

  .shaft-headline {
    font-size: clamp(22px, 6.2vw, 30px);
  }

  .shaft-sub {
    font-size: 12px;
  }

  .shaft-drop-cta {
    bottom: calc(20px + env(safe-area-inset-bottom));
    width: calc(100% - 28px);
  }

  .shaft-scroll-note {
    font-size: 9px;
    text-align: center;
  }

  .depth-rail {
    right: 8px;
  }

  .pulled-actions {
    top: auto;
    bottom: calc(156px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
  }

  .pulled-actions.visible {
    transform: translateX(-50%);
  }

  .action-chip {
    min-height: 40px;
    padding: 9px 16px;
    font-size: 12px;
  }

  .rotunda-hud {
    padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
    gap: 12px;
  }

  .hud-title {
    font-size: clamp(22px, 6.5vw, 30px);
  }

  .hud-sub {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hud-controls {
    width: 100%;
    align-items: stretch;
  }

  .hud-flip-row {
    width: 100%;
    justify-content: space-between;
  }

  .hud-flip-btn {
    flex: 1;
    text-align: center;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 9.5px;
  }

  .hud-hint {
    display: none;
  }

  .showcase-footer {
    margin-top: 40px;
    font-size: 9.5px;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .rotunda-back {
    font-size: 9px;
    padding: 7px 10px;
  }
  .rotunda-pill-btn.primary {
    font-size: 9px;
    padding: 7px 10px;
  }
  .inside-metrics {
    grid-template-columns: 1fr;
  }
}
