/* Backroom v0.1.0 · John Potts · Shared Styling
   Race-shop dark palette · race-orange accent · craftsman feel */

:root {
  --bg-deep:       #0a0d12;
  --bg-card:       #11151c;
  --bg-card-hi:    #1a1f29;
  --border:        #1f2630;
  --border-hi:     #2c3543;
  --text-primary:  #e8ecf2;
  --text-muted:    #8893a6;
  --text-dim:      #5c6878;
  --accent-orange: #ff6b1a;
  --accent-green:  #2ecc71;
  --accent-blue:   #3498db;
  --accent-purple: #9b59b6;
  --accent-red:    #e74c3c;
  --shadow-glow:   0 0 32px rgba(255, 107, 26, 0.15);
}

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

html, body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

/* ============= ANIMATED BACKGROUND (login page) ============= */
.network-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 107, 26, 0.08), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(46, 204, 113, 0.06), transparent 50%),
    var(--bg-deep);
}

.network-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(44, 53, 67, 0.3) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(44, 53, 67, 0.3) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: drift 60s linear infinite;
}

@keyframes drift {
  from { background-position: 0 0; }
  to   { background-position: 60px 60px; }
}

.network-dot {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent-orange);
  box-shadow: 0 0 12px var(--accent-orange);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.5); }
}

/* ============= LOGIN CARD ============= */
.login-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: var(--shadow-glow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-orange), #ff8c42);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #0a0d12;
}

.login-brand-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-brand-tier {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.login-greeting {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 26, 0.15);
}

.login-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  background: var(--accent-orange);
  color: #0a0d12;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}

.login-btn:hover { background: #ff8c42; }
.login-btn:active { transform: scale(0.98); }

.login-error {
  margin-top: 16px;
  padding: 12px;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px;
  color: var(--accent-red);
  font-size: 13px;
  display: none;
}

.login-error.show { display: block; animation: shake 0.4s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* ============= TUNNEL CINEMATIC ============= */
.tunnel-wrap {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.tunnel-rings {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.tunnel-ring {
  position: absolute;
  border: 2px solid var(--accent-orange);
  border-radius: 50%;
  opacity: 0;
  animation: tunnel-zoom 2.5s ease-out infinite;
}

.tunnel-ring:nth-child(1) { animation-delay: 0s; }
.tunnel-ring:nth-child(2) { animation-delay: 0.4s; }
.tunnel-ring:nth-child(3) { animation-delay: 0.8s; }
.tunnel-ring:nth-child(4) { animation-delay: 1.2s; }
.tunnel-ring:nth-child(5) { animation-delay: 1.6s; }
.tunnel-ring:nth-child(6) { animation-delay: 2.0s; }

@keyframes tunnel-zoom {
  0%   { width: 20px;  height: 20px;  opacity: 0; border-color: var(--accent-orange); }
  10%  { opacity: 1; }
  100% { width: 200vmax; height: 200vmax; opacity: 0; border-color: rgba(255, 107, 26, 0); }
}

.tunnel-text {
  position: relative;
  z-index: 10;
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 2px;
  opacity: 0;
  animation: fade-in-out 4s ease forwards;
}

.tunnel-text-sub {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 1px;
}

@keyframes fade-in-out {
  0%   { opacity: 0; transform: translateY(20px); }
  20%  { opacity: 1; transform: translateY(0); }
  80%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

/* ============= DASHBOARD LAYOUT ============= */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 56px 1fr 32px;
  height: 100vh;
}

.app-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.app-header,
.app-header * {
  user-select: none;
}

.brand-mark {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-orange), #ff8c42);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #0a0d12;
  font-size: 14px;
  cursor: default;
}

.brand-name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: default;
}

.brand-version {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 8px;
  cursor: default;
}

.search-bar {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.user-badge:hover {
  border-color: var(--accent-orange);
  background: var(--bg-card-hi);
}

.user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-purple);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.user-name { font-size: 13px; font-weight: 500; }

.app-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 0 16px;
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding: 0 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-card-hi);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(255, 107, 26, 0.1);
  color: var(--accent-orange);
}

.nav-item-icon {
  width: 16px; height: 16px;
  display: inline-block;
}

.app-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at center, rgba(255, 107, 26, 0.06), transparent 70%),
    var(--bg-deep);
  overflow: hidden;
}

.stage::before,
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.stage::before {
  background-image:
    radial-gradient(circle at 18% 28%, rgba(255, 107, 26, 0.5) 0, transparent 2px),
    radial-gradient(circle at 78% 32%, rgba(46, 204, 113, 0.4) 0, transparent 2px),
    radial-gradient(circle at 24% 78%, rgba(52, 152, 219, 0.4) 0, transparent 2px),
    radial-gradient(circle at 82% 72%, rgba(155, 89, 182, 0.4) 0, transparent 2px),
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.18) 0, transparent 1px),
    radial-gradient(circle at 12% 50%, rgba(255, 255, 255, 0.18) 0, transparent 1px),
    radial-gradient(circle at 88% 50%, rgba(255, 255, 255, 0.18) 0, transparent 1px),
    radial-gradient(circle at 50% 88%, rgba(255, 255, 255, 0.18) 0, transparent 1px);
  filter: blur(0.5px);
  animation: ambient-drift 16s ease-in-out infinite;
}

@keyframes ambient-drift {
  0%, 100% { opacity: 0.55; transform: translateY(0) scale(1); }
  50%      { opacity: 0.85; transform: translateY(-6px) scale(1.02); }
}

.stage > * { position: relative; z-index: 1; }

.stage-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

.stage-canvas:active { cursor: grabbing; }

.stage-status {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stage-help {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* ============= 3D-ANCHORED BUBBLE ORBITS (Path C · bubbles) ============= */
/* Each face has a ring of bubbles orbiting around it ·
   all 4 rings rotate with the pyramid · CSS2DObject anchored. */

.face-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  /* solid dark core · doesn't blend into bg · radial highlight for sphere feel */
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.14) 0%, rgba(20, 24, 32, 1) 55%, rgba(8, 10, 14, 1) 100%);
  border: 2px solid var(--face-color, rgba(255, 255, 255, 0.3));
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  user-select: none;
  font-family: inherit;
  padding: 0;
  outline: none;
  /* outer ring shadow for separation from background */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 4px 14px rgba(0, 0, 0, 0.55),
    0 0 18px var(--face-glow, rgba(255, 107, 26, 0.25));
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
}

.face-bubble:hover {
  transform: scale(1.18);
  border-color: var(--face-color, var(--accent-orange));
  box-shadow:
    0 0 24px var(--face-glow, rgba(255, 107, 26, 0.4)),
    inset 0 0 12px rgba(255, 255, 255, 0.05);
  z-index: 10;
}

.face-bubble:active {
  transform: scale(1.05);
}

.face-bubble-icon {
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

.face-bubble-label {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  background: rgba(17, 21, 28, 0.96);
  border: 1px solid var(--face-color, var(--accent-orange));
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 11;
}

.face-bubble:hover .face-bubble-label {
  opacity: 1;
  transform: translateY(-50%) translateX(4px);
}

.face-bubble.priority-red {
  border-color: var(--face-color, var(--accent-orange));
  box-shadow:
    0 0 14px var(--face-glow, rgba(255, 107, 26, 0.4)),
    inset 0 0 8px rgba(255, 255, 255, 0.04);
  background: radial-gradient(circle at 35% 35%, var(--face-color, var(--accent-orange)) -50%, rgba(17, 21, 28, 0.96) 70%);
  animation: bubble-pulse 2.4s ease-in-out infinite;
}

@keyframes bubble-pulse {
  0%, 100% {
    box-shadow:
      0 0 14px var(--face-glow, rgba(255, 107, 26, 0.4)),
      inset 0 0 8px rgba(255, 255, 255, 0.04);
  }
  50% {
    box-shadow:
      0 0 28px var(--face-glow, rgba(255, 107, 26, 0.55)),
      inset 0 0 12px rgba(255, 255, 255, 0.08);
    transform: scale(1.08);
  }
}

.face-bubble.priority-secondary {
  border-color: rgba(255, 255, 255, 0.18);
}

.face-bubble.priority-later {
  opacity: 0.7;
  border-color: rgba(255, 255, 255, 0.08);
}

.face-bubble.priority-later:hover {
  opacity: 1;
}

/* The CSS2DObject wrapper · CSS2DRenderer applies transform: translate(...)
   For that transform to position correctly, the wrapper MUST be absolutely positioned
   (otherwise it flows in normal layout and stacks at the top-left corner) */
.face-bubble-anchor {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none; /* the wrapper doesn't capture · only the inner bubble does */
}
.face-bubble-anchor .face-bubble {
  pointer-events: auto;
}

/* CSS2D layer wrapper (positioned absolute over the canvas) */
#css2d-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

#css2d-layer * {
  /* CSS2D children manage their own pointer events */
}

.face-panel {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 24px 22px;
  overflow-y: auto;
}

.face-panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.face-panel-name {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.face-panel-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.face-panel-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.face-panel-row {
  padding: 14px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px);
  animation: row-fade-in 0.5s ease forwards;
}

.face-panel-row:nth-child(1) { animation-delay: 0.05s; }
.face-panel-row:nth-child(2) { animation-delay: 0.10s; }
.face-panel-row:nth-child(3) { animation-delay: 0.15s; }
.face-panel-row:nth-child(4) { animation-delay: 0.20s; }
.face-panel-row:nth-child(5) { animation-delay: 0.25s; }
.face-panel-row:nth-child(6) { animation-delay: 0.30s; }

@keyframes row-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

.face-panel-row:first-of-type { border-top: none; }

.face-panel-name,
.face-panel-sub {
  transition: color 0.3s ease;
}

.face-panel-row-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.face-panel-row-value {
  font-size: 14px;
  color: var(--text-primary);
}

.face-panel-row-value.placeholder {
  color: var(--accent-orange);
  cursor: pointer;
  text-decoration: dotted underline;
  text-underline-offset: 4px;
}

.face-panel-row-value.placeholder:hover { color: #ff8c42; }

/* ============= PMG TICKER (NYSE-floor doctrine) ============= */
.pmg-ticker {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, rgba(255, 107, 26, 0.08), rgba(255, 107, 26, 0.02), rgba(255, 107, 26, 0.08));
  border-top: 1px solid var(--border-hi);
  padding: 0 16px;
  height: 32px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ticker-segment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-right: 1px solid var(--border);
  height: 32px;
}

.ticker-segment:last-child { border-right: none; }

.ticker-brand { padding-left: 0; gap: 10px; }

.ticker-mark {
  width: 18px; height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent-orange), #ff8c42);
  color: #0a0d12;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
}

.ticker-brand-name {
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
}

.ticker-status {
  color: var(--accent-orange);
  text-transform: uppercase;
  font-weight: 600;
}

.ticker-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.25); }
}

.ticker-version {
  color: var(--text-dim);
  text-transform: uppercase;
}

.ticker-time {
  font-family: "SF Mono", "Menlo", monospace;
  color: var(--text-muted);
}

.ticker-clock {
  font-size: 13px;
  filter: hue-rotate(-15deg);
}

.ticker-label {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
}

.ticker-value {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ticker-date {
  margin-left: auto;
  color: var(--text-muted);
  font-family: "SF Mono", "Menlo", monospace;
  letter-spacing: 0.5px;
}

@media (max-width: 900px) {
  .pmg-ticker {
    overflow-x: auto;
    overflow-y: hidden;
  }
  .ticker-version { display: none; }
}

/* ============= MOBILE ============= */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto 1fr 32px;
  }
  .app-sidebar {
    display: none;
  }
  .app-main {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .face-panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .login-card {
    padding: 32px 22px;
  }
}

/* ============= TOAST ============= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--accent-orange);
  border-radius: 8px;
  box-shadow: var(--shadow-glow);
  font-size: 13px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
}

.toast.show { opacity: 1; }

/* ============= PARALLAX OVERLAY (bubble click → scroll dive) ============= */
.px-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  pointer-events: none;
}

.px-overlay.open {
  transform: translateY(0);
  pointer-events: auto;
}

.px-scroll {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}

.px-scroll::-webkit-scrollbar { width: 8px; }
.px-scroll::-webkit-scrollbar-track { background: transparent; }
.px-scroll::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 4px;
}

.px-close {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(17, 21, 28, 0.92);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.px-close:hover {
  border-color: var(--accent-orange);
  background: rgba(26, 31, 41, 0.95);
  transform: translateX(-3px);
}

.px-close-icon {
  font-size: 16px;
  line-height: 1;
}

/* HERO */
.px-hero {
  position: relative;
  min-height: 95vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 80px 8vw 40px;
}

.px-hero-blob {
  position: absolute;
  inset: -20% -20% -20% -20%;
  background: radial-gradient(
    ellipse at center,
    var(--px-color, var(--accent-orange)) -55%,
    transparent 55%
  );
  opacity: 0.45;
  filter: blur(60px);
  z-index: 0;
  /* parallax via scroll · updated by JS */
  transform: translate3d(0, 0, 0) scale(1);
  transition: transform 0.05s linear;
}

.px-hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(44, 53, 67, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(44, 53, 67, 0.18) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.4;
  /* parallax · slower */
  transform: translate3d(0, 0, 0);
}

.px-hero-content {
  position: relative;
  z-index: 1;
  max-width: 880px;
  text-align: center;
}

.px-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 107, 26, 0.1);
  border: 1px solid var(--px-color, var(--accent-orange));
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--px-color, var(--accent-orange));
  font-weight: 700;
  margin-bottom: 28px;
}

.px-title {
  font-size: clamp(38px, 7vw, 86px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin: 0 0 24px;
  background: linear-gradient(180deg, #ffffff 0%, #c8d0dd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.px-sub {
  font-size: clamp(15px, 2vw, 22px);
  color: var(--text-muted);
  margin: 0 auto 32px;
  max-width: 640px;
  letter-spacing: 0.3px;
}

.px-pulse-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.px-pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--px-color, var(--accent-orange));
  box-shadow: 0 0 12px var(--px-color, var(--accent-orange));
  animation: pulse-dot 1.4s ease-in-out infinite;
}

/* SECTIONS */
.px-section {
  position: relative;
  padding: 80px 8vw;
  max-width: 1280px;
  margin: 0 auto;
}

.px-section-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--px-color, var(--accent-orange));
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.px-section-title {
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.8px;
  margin: 0 0 36px;
  color: var(--text-primary);
}

/* STATS */
.px-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.px-stat-card {
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.px-stat-card:hover {
  border-color: var(--px-color, var(--accent-orange));
  transform: translateY(-2px);
}

.px-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--px-color, var(--accent-orange));
  opacity: 0.3;
}

.px-stat-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.px-stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.px-stat-value.placeholder {
  color: var(--px-color, var(--accent-orange));
  cursor: pointer;
  text-decoration: dotted underline;
  text-underline-offset: 4px;
}

/* SUBTASKS */
.px-subtasks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.px-subtask {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}

.px-subtask:hover {
  border-color: var(--px-color, var(--accent-orange));
  background: var(--bg-card-hi);
  transform: translateX(4px);
}

.px-subtask.priority-red {
  border-color: var(--px-color, var(--accent-orange));
  box-shadow: 0 0 18px var(--px-glow, rgba(255, 107, 26, 0.18));
  background: linear-gradient(90deg, rgba(255,107,26,0.06), var(--bg-card));
}

.px-subtask-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1px solid var(--border-hi);
}

.px-subtask-body {
  flex: 1;
}

.px-subtask-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.px-subtask-priority {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.px-subtask.priority-red .px-subtask-priority {
  color: var(--px-color, var(--accent-orange));
  font-weight: 700;
}

.px-subtask-arrow {
  color: var(--text-dim);
  font-size: 18px;
  transition: transform 0.15s, color 0.15s;
}

.px-subtask:hover .px-subtask-arrow {
  color: var(--px-color, var(--accent-orange));
  transform: translateX(4px);
}

/* TIMELINE */
.px-timeline {
  position: relative;
  padding: 32px 0;
}

.px-timeline-rail {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    var(--px-color, var(--accent-orange)) 0%,
    var(--px-color, var(--accent-orange)) 35%,
    var(--border-hi) 35%,
    var(--border-hi) 100%);
  transform: translateY(-50%);
}

.px-timeline-stop {
  position: relative;
  display: inline-block;
  width: 25%;
  text-align: center;
  vertical-align: top;
}

.px-timeline-stop:first-child { text-align: left; }
.px-timeline-stop:last-child  { text-align: right; }

.px-timeline-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--border-hi);
  margin: 0 auto 12px;
  position: relative;
  z-index: 2;
}

.px-timeline-stop:first-child .px-timeline-dot { margin: 0 auto 12px 0; }
.px-timeline-stop:last-child  .px-timeline-dot { margin: 0 0 12px auto; }

.px-timeline-stop.is-done .px-timeline-dot {
  background: var(--px-color, var(--accent-orange));
  border-color: var(--px-color, var(--accent-orange));
}

.px-timeline-stop.is-current .px-timeline-dot {
  background: var(--bg-deep);
  border-color: var(--px-color, var(--accent-orange));
  box-shadow: 0 0 0 4px var(--px-glow, rgba(255, 107, 26, 0.25));
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.px-timeline-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.px-timeline-stop.is-current .px-timeline-label {
  color: var(--px-color, var(--accent-orange));
  font-weight: 600;
}

/* CTA */
.px-cta-section {
  text-align: center;
  padding-bottom: 120px;
}

.px-cta-sub {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 28px;
}

.px-cta-btn {
  padding: 16px 32px;
  background: var(--px-color, var(--accent-orange));
  color: #0a0d12;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 4px 16px var(--px-glow, rgba(255, 107, 26, 0.35));
}

.px-cta-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--px-glow, rgba(255, 107, 26, 0.5));
}

.px-cta-btn:active {
  transform: translateY(0);
}

/* FOOT */
.px-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 8vw;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.px-foot-mark {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent-orange), #ff8c42);
  color: #0a0d12;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}

.px-foot-text {
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .px-hero { padding: 80px 24px 40px; }
  .px-section { padding: 60px 24px; }
  .px-timeline-stop { width: 50%; margin-bottom: 24px; }
  .px-timeline-rail { display: none; }
}

/* ============================================================
   BUBBLE STATE SYSTEM · v0.1.1 · added 2026-05-02
   Per S-89 Bubbles and Gauges + S-283 Catch the Red One.
   States derive from subtask priority (status-aware in v0.2):
     priority="red"       → 🎯 if master · gold pulse halo
                          → otherwise red border
     priority="secondary" → 🟡 yellow building halo
     priority="later"     → ◇ ghost · low opacity · no halo (S-71)
   ============================================================ */

.face-bubble.is-master-red {
  box-shadow:
    0 0 0 2px rgba(232, 201, 118, 0.92),
    0 0 14px rgba(232, 201, 118, 0.65),
    0 0 32px rgba(232, 201, 118, 0.28);
  animation: bubblePulse 2.4s ease-in-out infinite;
  z-index: 5;
}
@keyframes bubblePulse {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(232, 201, 118, 0.78),
      0 0 10px rgba(232, 201, 118, 0.45),
      0 0 22px rgba(232, 201, 118, 0.18);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 0 2.5px rgba(232, 201, 118, 1),
      0 0 18px rgba(232, 201, 118, 0.8),
      0 0 42px rgba(232, 201, 118, 0.34);
    transform: scale(1.06);
  }
}

.face-bubble.priority-red:not(.is-master-red) {
  box-shadow: 0 0 0 1.5px rgba(255, 90, 30, 0.55);
}

.face-bubble.priority-secondary {
  box-shadow: 0 0 0 1.2px rgba(232, 201, 118, 0.30);
}

.face-bubble.priority-later {
  opacity: 0.32;
}
.face-bubble.priority-later:hover {
  opacity: 0.85;
}

/* ============================================================
   NARRATOR STRIP · S-284 The Narrator · 2026-05-02
   One sentence · 3 paths · red one called · never paternalistic
   ============================================================ */

.app.has-narrator {
  grid-template-rows: 56px 38px 1fr 32px;
}

.narrator-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  background:
    linear-gradient(90deg,
      rgba(232, 201, 118, 0.14) 0%,
      rgba(232, 201, 118, 0.04) 32%,
      rgba(232, 201, 118, 0.10) 100%);
  border-bottom: 1px solid rgba(232, 201, 118, 0.28);
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  font-style: italic;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.narrator-pin {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(232, 201, 118, 1);
  font-weight: 700;
  font-style: normal;
  padding: 4px 10px;
  border: 1px solid rgba(232, 201, 118, 0.55);
  border-radius: 3px;
  background: rgba(232, 201, 118, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}
.narrator-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.narrator-text strong {
  color: rgba(232, 201, 118, 1);
  font-style: normal;
  font-weight: 700;
}
.narrator-alts {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  flex-shrink: 0;
}
.narrator-alts a {
  color: rgba(232, 201, 118, 0.85);
  text-decoration: none;
  border-bottom: 1px dotted rgba(232, 201, 118, 0.45);
  cursor: pointer;
  margin: 0 6px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.narrator-alts a:hover {
  color: rgba(232, 201, 118, 1);
  border-color: rgba(232, 201, 118, 0.9);
}

/* ============================================================
   SIDEBAR PRESSURE PINS · 2026-05-02
   Each face nav item carries its pressure state at a glance
   ============================================================ */
.nav-item-pin {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-style: italic;
}
.nav-item-pin .pin-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}
.nav-item-pin.red .pin-dot {
  background: rgba(255, 90, 30, 0.95);
  box-shadow: 0 0 6px rgba(255, 90, 30, 0.6);
}
.nav-item-pin.yellow .pin-dot {
  background: rgba(232, 201, 118, 0.92);
}
.nav-item-pin.green .pin-dot {
  background: rgba(46, 204, 113, 0.92);
}

.nav-item.is-master-red {
  background: linear-gradient(90deg,
    rgba(232, 201, 118, 0.12),
    rgba(232, 201, 118, 0.02));
  border-left: 2px solid rgba(232, 201, 118, 0.95);
  padding-left: 10px;
}
.nav-item.is-master-red .nav-item-pin {
  color: rgba(232, 201, 118, 1);
  font-weight: 700;
  letter-spacing: 1.5px;
}
/* (🎯 marker now lives inside the pressure pin label · cleaner alignment) */

.nav-section.today-section {
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(232, 201, 118, 0.22);
  margin-bottom: 4px;
}
.nav-section.today-section .nav-section-title {
  color: rgba(232, 201, 118, 0.85);
  letter-spacing: 2px;
}

@media (max-width: 768px) {
  .narrator-strip { font-size: 12px; gap: 10px; padding: 0 14px; }
  .narrator-alts { display: none; }
}

/* ============================================================
   SIDEBAR FACE DROPDOWNS · 2026-05-03
   Per Chris: clicking a face in the sidebar should expand to show
   its subtasks · same bubbles that orbit on the pyramid.
   The sidebar mirrors the pyramid · clicking a subtask = clicking
   that bubble (fires the same `subtask-click` event).
   ============================================================ */

/* Make the face nav-items relative so the chevron can position */
.nav-item[data-face-id] {
  position: relative;
}

/* Chevron · slot it into the existing pin · rotates when expanded */
.nav-item-chevron {
  display: inline-block;
  width: 10px;
  margin-right: 6px;
  font-size: 9px;
  color: var(--text-dim);
  transition: transform 0.22s ease, color 0.22s ease;
  user-select: none;
  flex-shrink: 0;
}
.nav-item.is-expanded .nav-item-chevron {
  transform: rotate(90deg);
  color: rgba(232, 201, 118, 0.95);
}

/* Dropdown container · HARD HIDE via display:none · animates in on open */
.nav-dropdown {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;                /* bulletproof hide — gone from layout */
}
.nav-dropdown.open {
  display: block;
  margin: 4px 0 10px;
  animation: ddOpen 0.32s ease-out forwards;
}
@keyframes ddOpen {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   FONT HIERARCHY · per Chris 2026-05-03
   Face rows (PROJECT etc.) read like SECTION TITLES — small caps.
   Dropdown items (Proposal Breakdown etc.) read like ACTION ITEMS —
   bigger + bolder. The dropdown is what John clicks · it should win
   the visual weight.
   ================================================================ */

/* Face nav-items — small, uppercase, letter-spaced (category title look) */
.nav-item[data-face-id] {
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
}
/* Keep the icon at a readable size — don't shrink the symbol */
.nav-item[data-face-id] .nav-item-icon {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
/* Pin label keeps its own small-caps treatment */
.nav-item[data-face-id] .nav-item-pin {
  letter-spacing: 1px;
}

/* Dropdown items — bigger, bolder, primary color (the actual click target) */
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 30px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 4px;
  margin: 0 8px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
  position: relative;
}
.nav-dropdown-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--accent-orange, #ff6b1a);
  transform: translateX(3px);
}

/* Priority pip on each subtask · matches bubble priority colors */
.nav-dropdown-pip {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,0.25);
}
.nav-dropdown-pip.red {
  background: rgba(255, 90, 30, 0.95);
  box-shadow: 0 0 6px rgba(255, 90, 30, 0.55);
}
.nav-dropdown-pip.secondary {
  background: rgba(232, 201, 118, 0.85);
}
.nav-dropdown-pip.later {
  background: rgba(255,255,255,0.28);
}

.nav-dropdown-item.is-master-red {
  color: rgba(232, 201, 118, 1);
  font-weight: 600;
  background: linear-gradient(90deg,
    rgba(232, 201, 118, 0.10),
    rgba(232, 201, 118, 0.02));
  border-left: 2px solid rgba(232, 201, 118, 0.95);
  padding-left: 28px;            /* compensate for 2px border */
}
/* (🎯 removed from dropdown text per Chris 2026-05-03 · pin already carries it) */

.nav-dropdown-item .nav-dropdown-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The 🎯 master-red marker for face items now lives inside the pin */
.nav-item-pin .pin-master {
  margin-right: 4px;
  font-size: 10px;
  filter: saturate(1.2);
}

/* ============================================================
   MOBILE CTA STRIP · 2026-05-03
   Phone-only · big tap targets above the 3D stage so John
   immediately sees how to reach the proposal + progress report.
   Hidden on desktop · the sidebar dropdown handles desktop nav.
   ============================================================ */

.mobile-cta-strip {
  display: none;        /* hidden on desktop */
}

@media (max-width: 900px) {
  /* Adjust the app grid to make room for the CTA strip · sits between
     the narrator and the stage · auto-height row inserted */
  .app.has-narrator {
    grid-template-rows: 56px 38px auto 1fr 32px;
  }

  .mobile-cta-strip {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px 8px;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
  }

  .mob-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hi) 100%);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.15s ease, border-color 0.18s ease, background 0.18s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mob-cta:active {
    transform: scale(0.985);
    background: var(--bg-card-hi);
  }

  .mob-cta.mob-cta-primary {
    border-color: rgba(232, 201, 118, 0.55);
    background: linear-gradient(135deg, rgba(232,201,118,0.12) 0%, rgba(232,201,118,0.04) 100%);
    box-shadow: 0 0 0 1px rgba(232,201,118,0.18), 0 6px 18px rgba(232,201,118,0.10);
  }

  .mob-cta-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--bg-deep);
    border-radius: 10px;
    flex-shrink: 0;
  }

  .mob-cta.mob-cta-primary .mob-cta-icon {
    background: rgba(232,201,118,0.10);
  }

  .mob-cta-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
  }

  .mob-cta-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.2px;
    line-height: 1.3;
    margin-bottom: 2px;
  }

  .mob-cta.mob-cta-primary .mob-cta-title {
    color: rgba(232, 201, 118, 1);
  }

  .mob-cta-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    letter-spacing: 0.2px;
  }

  .mob-cta-arrow {
    font-size: 22px;
    color: var(--text-dim);
    flex-shrink: 0;
    margin-left: 4px;
  }

  .mob-cta.mob-cta-primary .mob-cta-arrow {
    color: rgba(232, 201, 118, 0.85);
  }

  /* Tighten the rest of the mobile layout to keep CTA above the fold */
  .narrator-strip {
    font-size: 11px;
    gap: 8px;
    padding: 0 12px;
    overflow: hidden;
  }
  .narrator-pin {
    font-size: 9px;
    padding: 3px 7px;
    letter-spacing: 1.4px;
  }
  .narrator-alts {
    display: none;       /* simplify · sidebar drop-downs not visible on mobile anyway */
  }
  .narrator-text {
    font-size: 11px;
    text-overflow: ellipsis;
  }

  /* Face panel collapses below the stage on mobile · keep but make it scroll-into rather than dominant */
  .face-panel {
    max-height: 50vh;
    overflow-y: auto;
  }

  /* Stage min-height keeps the pyramid visible without dominating */
  .stage {
    min-height: 320px;
  }

  /* Help text on stage less prominent on phone */
  .stage-status,
  .stage-help {
    font-size: 10px;
  }
}

@media (max-width: 540px) {
  .mobile-cta-strip { padding: 12px 12px 6px; gap: 8px; }
  .mob-cta { padding: 12px 14px; gap: 12px; }
  .mob-cta-icon { width: 40px; height: 40px; font-size: 22px; }
  .mob-cta-title { font-size: 14px; }
  .mob-cta-sub { font-size: 10.5px; }
  .stage { min-height: 280px; }
}
