/* ==========================================================================
   Dimension Style Reference — Exact Dusk Colors & Canvas Scroll System
   ========================================================================== */

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

:root {
  /* Dimension Color Palette — Matched to Screenshot */
  --color-void-canvas: #080b12;
  --color-dusk-backdrop: #0d121f;
  --color-graphite: #111827;
  --color-graphite-card: #161e2e;
  --color-frosted-rail: rgba(15, 22, 36, 0.82);
  --color-snow-white: #ffffff;
  --color-bone: #f1f5f9;
  --color-ash: #94a3b8;
  --color-slate: #64748b;
  --color-smoke: #78889b;
  --color-hairline: rgba(255, 255, 255, 0.08);
  --color-hairline-strong: rgba(255, 255, 255, 0.16);
  --color-accent-blue: #38bdf8;
  --color-dusk-violet: #60a5fa;

  /* Semantic surfaces & overlays */
  --color-app-shell-bg: rgba(13, 18, 30, 0.6);
  --color-rail-bg: var(--color-frosted-rail);
  --color-canvas-bg: var(--color-void-canvas);
  --color-mockup-header-bg: rgba(15, 22, 36, 0.9);
  --color-mockup-body-bg: var(--color-graphite-card);
  --color-card-inner-bg: rgba(11, 15, 25, 0.7);
  --color-card-inner-alt-bg: rgba(11, 15, 25, 0.85);
  --color-announcement-bg: rgba(17, 24, 39, 0.7);
  --color-workflow-card-bg: rgba(17, 24, 39, 0.6);
  --color-example-box-bg: rgba(0, 0, 0, 0.35);
  --color-decomp-bg: rgba(0, 0, 0, 0.3);
  --color-table-bg: rgba(8, 12, 20, 0.4);
  --color-table-header-bg: rgba(15, 22, 36, 0.9);
  --color-code-box-bg: #080c14;
  --color-prompt-box-bg: #090d16;
  --color-quiz-card-bg: rgba(56, 189, 248, 0.06);
  --color-quiz-card-border: rgba(56, 189, 248, 0.2);
  --color-modal-overlay-bg: rgba(6, 9, 17, 0.85);
  --color-modal-bg: var(--color-graphite-card);
  --color-copy-btn-bg: rgba(15, 22, 36, 0.95);
  
  /* Interactive overlays (white-based in dark, black-based in light) */
  --color-hover-overlay: rgba(255, 255, 255, 0.05);
  --color-hover-overlay-medium: rgba(255, 255, 255, 0.08);
  --color-hover-overlay-strong: rgba(255, 255, 255, 0.12);
  --color-hover-overlay-heavy: rgba(255, 255, 255, 0.15);
  --color-subtle-overlay: rgba(255, 255, 255, 0.03);
  --color-subtle-overlay-light: rgba(255, 255, 255, 0.04);
  --color-icon-bg: rgba(255, 255, 255, 0.06);
  --color-dot-bg: rgba(255, 255, 255, 0.15);
  --color-dot-inactive-bg: rgba(255, 255, 255, 0.2);
  --color-tab-dark-bg: rgba(0, 0, 0, 0.4);
  --color-selection-bg: rgba(56, 189, 248, 0.3);
  --color-tag-bg: rgba(56, 189, 248, 0.12);
  --color-step-badge-bg: rgba(96, 165, 250, 0.15);
  --color-step-badge-border: rgba(96, 165, 250, 0.3);
  --color-table-even-row: rgba(255, 255, 255, 0.015);
  --color-table-row-hover: rgba(56, 189, 248, 0.04);
  --color-table-row-border: rgba(255, 255, 255, 0.05);
  --color-scrollbar-track: rgba(0, 0, 0, 0.2);
  --color-scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --color-scrollbar-thumb-hover: rgba(255, 255, 255, 0.3);
  --color-scrollbar-rail-thumb: rgba(255, 255, 255, 0.1);
  --color-scrollbar-table-track: rgba(0, 0, 0, 0.3);
  --color-scrollbar-table-thumb: rgba(56, 189, 248, 0.35);
  
  /* Hover border overrides */
  --color-hover-border: rgba(255, 255, 255, 0.2);
  --color-card-hover-border: rgba(255, 255, 255, 0.22);
  --color-active-nav-border: rgba(255, 255, 255, 0.15);
  
  /* Shadows */
  --shadow-card-hover: 0 16px 32px rgba(0, 0, 0, 0.4);
  --shadow-mockup: 0 25px 60px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 30px 60px rgba(0, 0, 0, 0.8);
  --shadow-pill-primary: 0 4px 16px rgba(255, 255, 255, 0.15);
  
  /* Primary button (inverts in light) */
  --color-pill-primary-bg: var(--color-snow-white);
  --color-pill-primary-text: #000000;
  --color-pill-primary-hover-bg: #f1f5f9;
  --color-quiz-btn-bg: var(--color-snow-white);
  --color-quiz-btn-text: #000000;
  --color-quiz-btn-hover-bg: #f1f5f9;

  /* Status colors (same in both themes, but tinted overlays change) */
  --color-status-green: #22c55e;
  --color-status-red: #f85149;
  --color-status-purple: #a855f7;
  --color-correct-bg: rgba(34, 197, 94, 0.12);
  --color-correct-border: rgba(34, 197, 94, 0.4);
  --color-incorrect-bg: rgba(248, 81, 73, 0.12);
  --color-incorrect-border: rgba(248, 81, 73, 0.4);

  /* Gradients */
  --gradient-outer-dusk: radial-gradient(ellipse at 85% 10%, #1e293b 0%, #0d121f 50%, #060911 100%);
  --gradient-canvas-dusk: radial-gradient(circle at 85% 15%, rgba(59, 130, 246, 0.22) 0%, rgba(30, 41, 59, 0.5) 35%, rgba(13, 18, 30, 0.95) 100%);
  --gradient-dusk-violet: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(56, 189, 248, 0.4) 50%, rgba(0, 0, 0, 0) 100%);

  /* Typography */
  --font-dm-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-geist: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  --font-mono: 'Geist', monospace;

  /* Border Radii */
  --radius-ui: 10px;
  --radius-cards: 22px;
  --radius-panels: 32px;
  --radius-buttons: 9999px;

  /* Shadows */
  --shadow-panel: 0 35px 70px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--color-hairline);
}

/* ==========================================================================
   LIGHT THEME — System-adaptive via prefers-color-scheme
   Color theory: complementary temperature inversion of the dark theme.
   Cool-tinted whites replace deep navies. Accent deepens for WCAG AA.
   ========================================================================== */

@media (prefers-color-scheme: light) {
  :root {
    /* Core palette — cool slate whites */
    --color-void-canvas: #f8fafc;
    --color-dusk-backdrop: #f1f5f9;
    --color-graphite: #e2e8f0;
    --color-graphite-card: #ffffff;
    --color-frosted-rail: rgba(241, 245, 249, 0.88);
    --color-snow-white: #0f172a;
    --color-bone: #1e293b;
    --color-ash: #475569;
    --color-slate: #64748b;
    --color-smoke: #64748b;
    --color-hairline: rgba(0, 0, 0, 0.08);
    --color-hairline-strong: rgba(0, 0, 0, 0.14);
    --color-accent-blue: #0284c7;
    --color-dusk-violet: #3b82f6;

    /* Gradients — subtle cool tints */
    --gradient-outer-dusk: radial-gradient(ellipse at 85% 10%, #e2e8f0 0%, #f1f5f9 50%, #f8fafc 100%);
    --gradient-canvas-dusk: radial-gradient(circle at 85% 15%, rgba(14, 165, 233, 0.06) 0%, rgba(226, 232, 240, 0.3) 35%, rgba(248, 250, 252, 0.95) 100%);
    --gradient-dusk-violet: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(2, 132, 199, 0.12) 50%, rgba(255, 255, 255, 0) 100%);

    /* Shadows — slate-tinted, lighter */
    --shadow-panel: 0 20px 50px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--color-hairline);

    /* Semantic surfaces */
    --color-app-shell-bg: rgba(255, 255, 255, 0.75);
    --color-rail-bg: rgba(241, 245, 249, 0.88);
    --color-canvas-bg: var(--color-void-canvas);
    --color-mockup-header-bg: rgba(241, 245, 249, 0.95);
    --color-mockup-body-bg: #ffffff;
    --color-card-inner-bg: rgba(241, 245, 249, 0.7);
    --color-card-inner-alt-bg: rgba(241, 245, 249, 0.85);
    --color-announcement-bg: rgba(255, 255, 255, 0.8);
    --color-workflow-card-bg: rgba(241, 245, 249, 0.6);
    --color-example-box-bg: rgba(241, 245, 249, 0.6);
    --color-decomp-bg: rgba(241, 245, 249, 0.5);
    --color-table-bg: rgba(248, 250, 252, 0.6);
    --color-table-header-bg: rgba(241, 245, 249, 0.95);
    --color-code-box-bg: #f1f5f9;
    --color-prompt-box-bg: #f1f5f9;
    --color-quiz-card-bg: rgba(2, 132, 199, 0.04);
    --color-quiz-card-border: rgba(2, 132, 199, 0.18);
    --color-modal-overlay-bg: rgba(248, 250, 252, 0.85);
    --color-modal-bg: #ffffff;
    --color-copy-btn-bg: rgba(241, 245, 249, 0.95);

    /* Interactive overlays — black-based for light backgrounds */
    --color-hover-overlay: rgba(0, 0, 0, 0.03);
    --color-hover-overlay-medium: rgba(0, 0, 0, 0.05);
    --color-hover-overlay-strong: rgba(0, 0, 0, 0.06);
    --color-hover-overlay-heavy: rgba(0, 0, 0, 0.08);
    --color-subtle-overlay: rgba(0, 0, 0, 0.02);
    --color-subtle-overlay-light: rgba(0, 0, 0, 0.02);
    --color-icon-bg: rgba(0, 0, 0, 0.04);
    --color-dot-bg: rgba(0, 0, 0, 0.1);
    --color-dot-inactive-bg: rgba(0, 0, 0, 0.12);
    --color-tab-dark-bg: rgba(0, 0, 0, 0.04);
    --color-selection-bg: rgba(2, 132, 199, 0.15);
    --color-tag-bg: rgba(2, 132, 199, 0.08);
    --color-step-badge-bg: rgba(59, 130, 246, 0.08);
    --color-step-badge-border: rgba(59, 130, 246, 0.2);
    --color-table-even-row: rgba(0, 0, 0, 0.02);
    --color-table-row-hover: rgba(2, 132, 199, 0.04);
    --color-table-row-border: rgba(0, 0, 0, 0.06);
    --color-scrollbar-track: rgba(0, 0, 0, 0.04);
    --color-scrollbar-thumb: rgba(0, 0, 0, 0.12);
    --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.22);
    --color-scrollbar-rail-thumb: rgba(0, 0, 0, 0.08);
    --color-scrollbar-table-track: rgba(0, 0, 0, 0.04);
    --color-scrollbar-table-thumb: rgba(2, 132, 199, 0.25);

    /* Hover borders */
    --color-hover-border: rgba(0, 0, 0, 0.12);
    --color-card-hover-border: rgba(0, 0, 0, 0.14);
    --color-active-nav-border: rgba(0, 0, 0, 0.1);

    /* Shadows — lighter, slate-tinted */
    --shadow-card-hover: 0 12px 24px rgba(15, 23, 42, 0.06);
    --shadow-mockup: 0 20px 40px rgba(15, 23, 42, 0.08);
    --shadow-modal: 0 24px 48px rgba(15, 23, 42, 0.12);
    --shadow-pill-primary: 0 4px 12px rgba(15, 23, 42, 0.08);

    /* Primary button — inverted */
    --color-pill-primary-bg: #0f172a;
    --color-pill-primary-text: #ffffff;
    --color-pill-primary-hover-bg: #1e293b;
    --color-quiz-btn-bg: #0f172a;
    --color-quiz-btn-text: #ffffff;
    --color-quiz-btn-hover-bg: #1e293b;

    /* Status tints on light */
    --color-correct-bg: rgba(34, 197, 94, 0.08);
    --color-correct-border: rgba(34, 197, 94, 0.3);
    --color-incorrect-bg: rgba(248, 81, 73, 0.08);
    --color-incorrect-border: rgba(248, 81, 73, 0.3);
  }
}

/* Page lock — Page does NOT scroll, canvas scrolls */
html, body {
  height: 100vh;
  overflow: hidden;
  background: var(--color-void-canvas);
  background-image: var(--gradient-outer-dusk);
  color: var(--color-bone);
  font-family: var(--font-dm-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px) {
  body { padding: 0.5rem; overflow: auto; height: auto; }
  html { overflow: auto; height: auto; }
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
code, .mono { font-family: var(--font-geist); }

::selection { background: var(--color-selection-bg); color: var(--color-snow-white); }

/* ==========================================================================
   DIMENSION TWO-PANE APP SHELL (LOCKED CONTAINER)
   ========================================================================== */

.dim-app-shell {
  width: 100%;
  max-width: 1540px;
  height: calc(100vh - 2rem);
  background: var(--color-app-shell-bg);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-panels);
  box-shadow: var(--shadow-panel);
  display: grid;
  grid-template-columns: 380px 1fr;
  position: relative;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .dim-app-shell {
    grid-template-columns: 1fr;
    height: auto;
    border-radius: 20px;
  }
}

/* ==========================================================================
   LEFT RAIL NAVIGATION (FIXED SIDEBAR)
   ========================================================================== */

.dim-rail {
  border-right: 1px solid var(--color-hairline);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  overflow-y: auto;
  background: var(--color-rail-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 10;
}

/* Custom Scrollbar for Left Rail */
.dim-rail::-webkit-scrollbar {
  width: 4px;
}
.dim-rail::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-rail-thumb);
  border-radius: 4px;
}

.rail-brand {
  margin-bottom: 2rem;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-buttons);
  border: 1px solid var(--color-hairline);
  background: var(--color-subtle-overlay-light);
  font-size: 13px;
  color: var(--color-ash);
  font-weight: 500;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent-blue);
  box-shadow: 0 0 8px var(--color-accent-blue);
}

.rail-hero-content {
  margin-bottom: 2rem;
}

.rail-eyebrow {
  font-size: 13px;
  color: var(--color-smoke);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.rail-title {
  font-family: var(--font-dm-sans);
  font-size: 38px;
  font-weight: 500;
  line-height: 1.12;
  color: var(--color-snow-white);
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.rail-bullets {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.rail-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 14px;
  color: var(--color-ash);
  line-height: 1.45;
}

.bullet-icon {
  font-size: 14px;
  line-height: 1;
  opacity: 0.9;
  margin-top: 2px;
}

.dim-pill-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-pill-primary-bg);
  color: var(--color-pill-primary-text);
  border-radius: var(--radius-buttons);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s;
  box-shadow: var(--shadow-pill-primary);
}

.dim-pill-primary:hover {
  transform: translateY(-2px);
  background: var(--color-pill-primary-hover-bg);
}

/* Nav Menu Index (01 - 07) */
.rail-menu-container {
  margin-top: auto;
}

.rail-menu-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-smoke);
  margin-bottom: 0.85rem;
  font-weight: 600;
}

.rail-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-ui);
  font-size: 14px;
  color: var(--color-ash);
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  border: 1px solid transparent;
  position: relative;
}

.rail-item:hover {
  background: var(--color-hover-overlay);
  color: var(--color-snow-white);
}

/* Active Nav Pill matching Screenshot */
.rail-item.active {
  background: var(--color-hover-overlay-strong);
  color: var(--color-snow-white);
  border-color: var(--color-active-nav-border);
}

.rail-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  border-radius: 4px;
  background: var(--color-accent-blue);
  box-shadow: 0 0 10px var(--color-accent-blue);
}

.rail-item .num {
  font-family: var(--font-geist);
  font-size: 12px;
  color: var(--color-smoke);
  opacity: 0.8;
}

.rail-item.active .num {
  color: var(--color-snow-white);
  opacity: 1;
}

/* ==========================================================================
   RIGHT CONTENT CANVAS (PRIMARY SCROLL CONTAINER)
   ========================================================================== */

.dim-canvas {
  height: 100%;
  overflow-y: auto;
  padding: 2.5rem 3rem;
  background: var(--color-void-canvas);
  background-image: var(--gradient-canvas-dusk);
  position: relative;
}

/* Sleek Webkit Scrollbar for Canvas */
.dim-canvas::-webkit-scrollbar {
  width: 8px;
}
.dim-canvas::-webkit-scrollbar-track {
  background: var(--color-scrollbar-track);
}
.dim-canvas::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-thumb);
  border-radius: 8px;
}
.dim-canvas::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-thumb-hover);
}

@media (max-width: 1024px) {
  .dim-canvas { padding: 1.5rem; height: auto; overflow-y: visible; }
}

/* Top Announcement Bar */
.announcement-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.1rem;
  background: var(--color-announcement-bg);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-buttons);
  font-size: 13px;
  color: var(--color-ash);
  margin-bottom: 2.5rem;
  backdrop-filter: blur(16px);
  transition: all 0.2s ease;
  text-decoration: none;
}

.announcement-bar:hover {
  background: var(--color-hover-overlay-medium);
  border-color: var(--color-hover-border);
  color: var(--color-snow-white);
}

.announcement-bar strong {
  color: var(--color-snow-white);
  font-weight: 500;
}

/* ── HERO ENGINE SIMULATOR WINDOW (PRODUCT MOCKUP CARD) ── */
.hero-mockup-section {
  margin-bottom: 4rem;
}

.mockup-window {
  background: var(--color-graphite);
  border: 1px solid var(--color-hairline-strong);
  border-radius: var(--radius-cards);
  overflow: hidden;
  box-shadow: var(--shadow-mockup);
  position: relative;
}

.mockup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--color-mockup-header-bg);
  border-bottom: 1px solid var(--color-hairline);
}

.mockup-dots {
  display: flex;
  gap: 6px;
}

.mockup-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-dot-bg);
}

.mockup-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--color-tab-dark-bg);
  padding: 3px;
  border-radius: var(--radius-buttons);
  border: 1px solid var(--color-hairline);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mockup-tabs::-webkit-scrollbar {
  display: none;
}

.mockup-tab {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-buttons);
  font-size: 12px;
  font-family: var(--font-geist);
  color: var(--color-smoke);
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.mockup-tab.active {
  background: var(--color-hover-overlay-heavy);
  color: var(--color-snow-white);
}

.mockup-body {
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--color-mockup-body-bg);
}

@media (max-width: 768px) {
  .mockup-body { grid-template-columns: 1fr; }
  .mockup-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

.mockup-card-left {
  background: var(--color-card-inner-bg);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-ui);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-tag {
  font-family: var(--font-geist);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent-blue);
  background: var(--color-tag-bg);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}

.mockup-card-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-snow-white);
}

.mockup-prompt-box {
  background: var(--color-prompt-box-bg);
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  padding: 0.9rem;
  font-family: var(--font-geist);
  font-size: 13px;
  color: var(--color-bone);
  line-height: 1.5;
}

.mockup-card-right {
  background: var(--color-card-inner-alt-bg);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-ui);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.trace-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 13px;
  font-family: var(--font-geist);
  color: var(--color-ash);
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  background: var(--color-subtle-overlay);
  border: 1px solid var(--color-hairline);
}

.trace-status {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-status-green);
  box-shadow: 0 0 6px var(--color-status-green);
}

/* Embedded Interactive Quiz Options */
.quiz-option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 13px;
  font-family: var(--font-geist);
  color: var(--color-ash);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--color-subtle-overlay);
  border: 1px solid var(--color-hairline);
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-option-card:hover {
  background: var(--color-hover-overlay-medium);
  color: var(--color-snow-white);
  border-color: var(--color-hover-border);
}

.quiz-option-card.correct {
  background: var(--color-correct-bg);
  border-color: var(--color-correct-border);
  color: var(--color-status-green);
}

.quiz-option-card.incorrect {
  background: var(--color-incorrect-bg);
  border-color: var(--color-incorrect-border);
  color: var(--color-status-red);
}

.option-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-dot-inactive-bg);
  margin-top: 4px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.quiz-option-card.correct .option-dot {
  background: var(--color-status-green);
  box-shadow: 0 0 6px var(--color-status-green);
}

.quiz-option-card.incorrect .option-dot {
  background: var(--color-status-red);
  box-shadow: 0 0 6px var(--color-status-red);
}

.quiz-feedback-box {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

/* Expandable Principle Cards */
.expandable-card {
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}

.expandable-card:hover {
  border-color: var(--color-hairline-strong);
  background: var(--color-subtle-overlay-light);
}

.expand-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.expandable-card.expanded .expand-content {
  max-height: 600px;
  opacity: 1;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top-color: var(--color-hairline);
}

.sub-example-box {
  background: var(--color-example-box-bg);
  border: 1px solid var(--color-hairline);
  border-left: 3px solid var(--color-accent-blue);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-size: 13px;
  line-height: 1.6;
}

.sub-example-box.ai-app {
  border-left-color: var(--color-status-purple);
}

.sub-ex-tag {
  font-family: var(--font-geist);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-blue);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.sub-example-box.ai-app .sub-ex-tag {
  color: var(--color-status-purple);
}

/* Workflow Step Items */
.workflow-step-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.workflow-step-card {
  background: var(--color-workflow-card-bg);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-cards);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.workflow-step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.step-num-badge {
  font-family: var(--font-geist);
  font-size: 11px;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: var(--color-step-badge-bg);
  color: var(--color-accent-blue);
  border: 1px solid var(--color-step-badge-border);
  font-weight: 600;
}

/* Case Study Decomposition Items */
.decomp-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.decomp-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--color-decomp-bg);
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  font-size: 13px;
  line-height: 1.6;
}

.decomp-bullet {
  color: var(--color-accent-blue);
  font-weight: 700;
  font-size: 15px;
}

/* ==========================================================================
   SECTION PANELS & FROSTED GLASS CARDS
   ========================================================================== */

.canvas-section {
  padding-top: 3.5rem;
  margin-bottom: 5rem;
}

.canvas-section-header {
  margin-bottom: 2rem;
}

.canvas-section-num {
  font-family: var(--font-geist);
  font-size: 13px;
  color: var(--color-smoke);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.canvas-section-title {
  font-family: var(--font-dm-sans);
  font-size: 34px;
  font-weight: 500;
  color: var(--color-snow-white);
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.canvas-section-subtitle {
  font-size: 16px;
  color: var(--color-ash);
  max-width: 680px;
  line-height: 1.6;
}

/* Frosted Cards Container */
.frosted-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.frosted-card {
  background: var(--color-graphite-card);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-cards);
  padding: 1.75rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

.frosted-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-card-hover-border);
  box-shadow: var(--shadow-card-hover);
}

.frosted-card-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--color-icon-bg);
  border: 1px solid var(--color-hairline);
  display: grid;
  place-items: center;
  font-size: 16px;
  margin-bottom: 1.25rem;
}

.frosted-card-title {
  font-family: var(--font-geist);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-snow-white);
  margin-bottom: 0.5rem;
}

.frosted-card-body {
  font-size: 14px;
  color: var(--color-ash);
  line-height: 1.6;
}

/* Full Width Featured Panel */
.frosted-panel-lg {
  background: var(--color-graphite-card);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-panels);
  padding: 2.25rem;
  margin-bottom: 2rem;
}

/* Comparison Tables */
.dim-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1.5rem;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-ui);
  background: var(--color-table-bg);
}

.dim-table-wrapper::-webkit-scrollbar {
  height: 6px;
}
.dim-table-wrapper::-webkit-scrollbar-track {
  background: var(--color-scrollbar-table-track);
}
.dim-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-table-thumb);
  border-radius: 4px;
}

.dim-table {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  text-align: left;
}

.dim-table th {
  font-family: var(--font-geist);
  color: var(--color-snow-white);
  font-weight: 500;
  font-size: 13px;
  padding: 0.85rem 1.1rem;
  background: var(--color-table-header-bg);
  border-bottom: 1px solid var(--color-hairline-strong);
  white-space: nowrap;
}

.dim-table td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--color-table-row-border);
  color: var(--color-ash);
  line-height: 1.6;
  vertical-align: top;
}

.dim-table tbody tr:nth-child(even) {
  background: var(--color-table-even-row);
}

.dim-table tbody tr:last-child td {
  border-bottom: none;
}

.dim-table tbody tr:hover td {
  background: var(--color-table-row-hover);
  color: var(--color-snow-white);
}

.dim-table th:first-child,
.dim-table td:first-child {
  font-weight: 500;
  color: var(--color-snow-white);
  width: 140px;
  min-width: 120px;
}

/* Practice & Quiz Card */
.quiz-card {
  background: var(--color-quiz-card-bg);
  border: 1px solid var(--color-quiz-card-border);
  border-radius: var(--radius-cards);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .quiz-card { flex-direction: column; align-items: flex-start; }
}

.quiz-btn {
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-buttons);
  background: var(--color-quiz-btn-bg);
  color: var(--color-quiz-btn-text);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}

.quiz-btn:hover {
  background: var(--color-quiz-btn-hover-bg);
  transform: scale(1.02);
}

/* Modals */
.dim-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-modal-overlay-bg);
  backdrop-filter: blur(16px);
  z-index: 2000;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.dim-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.dim-modal {
  background: var(--color-modal-bg);
  border: 1px solid var(--color-hairline-strong);
  border-radius: var(--radius-cards);
  width: 100%;
  max-width: 600px;
  padding: 2rem;
  box-shadow: var(--shadow-modal);
  position: relative;
}

.dim-modal-close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  font-size: 20px;
  color: var(--color-smoke);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: color 0.2s;
}

.dim-modal-close:hover { color: var(--color-snow-white); }

/* Cheatsheet Code Box */
.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.code-box {
  background: var(--color-code-box-bg);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-ui);
  padding: 1rem;
  padding-right: 2.5rem;
  font-family: var(--font-geist);
  font-size: 13px;
  color: var(--color-bone);
  position: relative;
  margin-top: 1rem;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-buttons);
  border: 1px solid var(--color-hairline-strong);
  font-size: 11px;
  color: var(--color-smoke);
  background: var(--color-copy-btn-bg);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  z-index: 10;
}

.code-box:hover .copy-btn,
.code-box:focus-within .copy-btn,
.copy-btn:focus,
.copy-btn:active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.copy-btn:hover {
  color: var(--color-snow-white);
  border-color: var(--color-hover-border);
  background: var(--color-hover-overlay-heavy);
}

/* Footer */
.dim-footer {
  border-top: 1px solid var(--color-hairline);
  padding: 2.5rem 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-smoke);
}

/* ==========================================================================
   MOBILE & TOUCH VIEWPORT OVERHAUL (< 768px & < 480px)
   ========================================================================== */

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  body {
    padding: 0 !important;
  }

  .dim-app-shell {
    grid-template-columns: 1fr;
    height: auto;
    border-radius: 0;
    border: none;
    box-shadow: none;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .dim-rail {
    padding: 1.5rem 1.1rem;
    border-right: none;
    border-bottom: 1px solid var(--color-hairline);
    min-width: 0;
    width: 100%;
  }

  .dim-canvas {
    padding: 1.25rem 1rem;
    height: auto;
    overflow-y: visible;
    overflow-x: hidden;
    min-width: 0;
    width: 100%;
  }

  /* Typography Scaling */
  .rail-title {
    font-size: 26px;
    margin-bottom: 1rem;
    line-height: 1.2;
  }

  .canvas-section-title {
    font-size: 22px;
    margin-bottom: 0.5rem;
    line-height: 1.25;
  }

  .canvas-section-subtitle {
    font-size: 14px;
    line-height: 1.5;
  }

  .frosted-panel-lg h3 {
    font-size: 18px !important;
  }

  .mockup-card-title {
    font-size: 16px;
  }

  /* Mockup Simulator Sizing */
  .hero-mockup-section {
    margin-bottom: 2.5rem;
  }

  .mockup-window {
    border-radius: var(--radius-ui);
    min-width: 0;
    width: 100%;
  }

  .mockup-header {
    padding: 0.75rem 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .mockup-tabs {
    width: 100%;
  }

  .mockup-body {
    padding: 1rem 0.75rem;
    grid-template-columns: 1fr;
    gap: 1rem;
    min-width: 0;
  }

  .mockup-card-left,
  .mockup-card-right {
    padding: 1rem 0.85rem;
    min-width: 0;
    width: 100%;
  }

  .trace-item {
    font-size: 12px;
    padding: 0.5rem 0.75rem;
    min-width: 0;
    width: 100%;
  }

  .trace-item span {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .mockup-prompt-box {
    font-size: 12px;
    padding: 0.75rem;
  }

  /* Section Padding & Cards */
  .canvas-section {
    padding-top: 2rem;
    margin-bottom: 3rem;
  }

  .frosted-panel-lg {
    padding: 1.25rem 1rem !important;
    border-radius: var(--radius-ui) !important;
    margin-bottom: 1.5rem;
  }

  .frosted-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .frosted-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-ui);
  }

  .quote-box {
    padding: 0.85rem !important;
    font-size: 13px !important;
    margin-top: 1rem !important;
  }

  .workflow-step-card {
    padding: 1rem 0.85rem;
    border-radius: var(--radius-ui);
  }

  .decomp-container {
    gap: 0.75rem;
  }

  .decomp-card {
    padding: 0.85rem;
    font-size: 12.5px;
    line-height: 1.5;
  }

  .code-box {
    padding: 0.75rem 0.85rem;
    padding-right: 2.25rem;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .rail-title {
    font-size: 22px;
  }

  .canvas-section-title {
    font-size: 20px;
  }

  .announcement-bar {
    font-size: 12px;
    padding: 0.65rem 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .dim-footer {
    padding: 1.5rem 0 1rem;
    font-size: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}
