/* ==========================================================================
   SCRATCH MATHEMATICS — FULL-SCREEN RESPONSIVE APPLE.COM DESIGN SYSTEM (DARK & LIGHT)
   ========================================================================== */

:root,
html[data-theme="dark"] {
  --bg-base: #000000;
  --bg-alt: #0d0d0f;
  --surface: #161617;
  --surface-elevated: #1d1d1f;
  --surface-hover: #2c2c2e;
  --surface-glass: rgba(18, 18, 20, 0.82);

  --text-main: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #86868b;

  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --primary: #0071e3;
  --primary-hover: #0077ed;
  --link-blue: #2997ff;
  --primary-glow: rgba(0, 113, 227, 0.35);

  --emerald: #30d158;
  --emerald-hover: #28c04d;
  --emerald-soft: rgba(48, 209, 88, 0.14);
  --emerald-text: #30d158;

  --indigo-soft: rgba(41, 151, 255, 0.14);
  --indigo-text: #2997ff;

  --amber: #ff9f0a;
  --amber-soft: rgba(255, 159, 10, 0.15);
  --amber-text: #ff9f0a;

  --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.55);
  --shadow-cinema: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 80px rgba(41, 151, 255, 0.14);

  --gradient-text: linear-gradient(90deg, #2997ff 0%, #9b6bff 50%, #ff6482 100%);
  --gutter: clamp(16px, 3.8vw, 64px);
}

html[data-theme="light"] {
  --bg-base: #f5f5f7;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-elevated: #f5f5f7;
  --surface-hover: #e8e8ed;
  --surface-glass: rgba(255, 255, 255, 0.85);

  --text-main: #1d1d1f;
  --text-secondary: #515154;
  --text-muted: #86868b;

  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);

  --primary: #0071e3;
  --primary-hover: #0077ed;
  --link-blue: #0066cc;
  --primary-glow: rgba(0, 113, 227, 0.2);

  --emerald: #248a3d;
  --emerald-hover: #1e7534;
  --emerald-soft: rgba(52, 199, 89, 0.14);
  --emerald-text: #1d7332;

  --indigo-soft: rgba(0, 113, 227, 0.1);
  --indigo-text: #0066cc;

  --amber: #c93400;
  --amber-soft: rgba(255, 149, 0, 0.14);
  --amber-text: #b25000;

  --shadow-card: 0 12px 34px rgba(0, 0, 0, 0.06);
  --shadow-cinema: 0 28px 70px rgba(0, 0, 0, 0.14);

  --gradient-text: linear-gradient(90deg, #0066cc 0%, #7928ca 50%, #d92662 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.47059;
  letter-spacing: -0.016em;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

main {
  flex: 1;
  width: 100%;
}

code, pre {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   FULL-WIDTH APPLE GLOBAL NAVIGATION BAR
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 95;
  width: 100%;
  background: var(--surface-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.topbar-inner {
  width: 100%;
  height: 54px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  opacity: 0.94;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 1;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.28);
}

.brand-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.brand-accent {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 34px);
}

.nav-link {
  background: transparent;
  border: 0;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-link.active {
  color: var(--text-main);
  font-weight: 600;
}

.badge-count {
  background: var(--primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}

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

.theme-toggle-btn,
.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover,
.cart-btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
  background: var(--surface-elevated);
}

html[data-theme="dark"] .icon-moon {
  display: none;
}

html[data-theme="light"] .icon-sun {
  display: none;
}

.cart-badge {
  background: var(--text-main);
  color: var(--bg-base);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}

.auth-actions, .auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 6px 13px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: var(--surface-hover);
}

.btn-primary-sm {
  background: var(--primary);
  color: #ffffff;
  border: 0;
  padding: 6px 14px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.btn-primary-sm:hover {
  background: var(--primary-hover);
}

.btn-ghost-sm {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-ghost-sm:hover {
  color: var(--text-main);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  max-width: 190px;
}

#user-name-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--emerald);
}

/* Mobile Menu Button & Drawer */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  place-items: center;
  cursor: pointer;
}

.mobile-nav-drawer {
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  padding: 12px var(--gutter) 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-link {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.mobile-nav-link.active,
.mobile-nav-link:hover {
  background: var(--surface-elevated);
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   APPLE RIBBON ANNOUNCEMENT BAR
   ========================================================================== */
.apple-ribbon {
  width: 100%;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  padding: 10px var(--gutter);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.apple-ribbon-inner {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ribbon-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--link-blue);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.ribbon-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   FULL-WIDTH EDGE-TO-EDGE CINEMATIC HERO WITH TEXT OVERLAY
   ========================================================================== */
.hero-fullbleed {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 96px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #000000;
  color: #ffffff;
}

.hero-bg-slides {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.1s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.1s;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transform: scale(1.06);
  transition: transform 7s ease-out;
}

.hero-slide.active img {
  transform: scale(1);
}

/* Multi-stop cinematic scrim so overlaid white typography is razor-sharp */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(4, 7, 15, 0.88) 0%, rgba(4, 7, 15, 0.62) 48%, rgba(4, 7, 15, 0.22) 100%),
    linear-gradient(180deg, rgba(4, 7, 15, 0.25) 0%, rgba(4, 7, 15, 0.1) 50%, rgba(4, 7, 15, 0.9) 100%);
  pointer-events: none;
}

.hero-overlay-content {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: calc(100vh - 96px);
  padding: clamp(40px, 6vw, 84px) var(--gutter) clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
}

.hero-copy {
  margin-top: auto;
  margin-bottom: auto;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f5f5f7;
  padding: 7px 15px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.hero-fullbleed h1 {
  font-size: clamp(44px, 5.8vw, 82px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 20px;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.text-gradient {
  background: linear-gradient(90deg, #60a5fa 0%, #c084fc 50%, #fb7185 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text {
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.55;
  font-weight: 400;
  color: rgba(245, 245, 247, 0.92);
  margin: 0 0 32px;
  max-width: 640px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.hero-text code {
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  color: #ffffff;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Apple Pill Buttons & Glass Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 980px;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.22s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary,
.button-dark {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(0, 113, 227, 0.45);
}

.button-primary:hover,
.button-dark:hover {
  background: var(--primary-hover);
}

.button-glass {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.button-glass:hover {
  background: rgba(255, 255, 255, 0.26);
}

.button-secondary {
  background: var(--surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

.button-emerald,
.button-green {
  background: var(--emerald);
  color: #ffffff;
}

.button-emerald:hover,
.button-green:hover {
  background: var(--emerald-hover);
}

.full-width {
  width: 100%;
}

/* Prev / Next Floating Controls on Full-Bleed Hero */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.carousel-nav:hover {
  background: var(--primary);
  border-color: transparent;
  transform: translateY(-50%) scale(1.06);
}

.carousel-nav.prev { left: clamp(12px, 2vw, 32px); }
.carousel-nav.next { right: clamp(12px, 2vw, 32px); }

/* Bottom Glassmorphic Scene Selector Bar */
.hero-scene-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 240px));
  gap: 12px;
}

.hero-scene-bar .thumb-item {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
}

.hero-scene-bar .thumb-item:hover {
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.hero-scene-bar .thumb-item.active {
  background: rgba(0, 113, 227, 0.32);
  border-color: #2997ff;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.scene-num {
  font-size: 11px;
  font-weight: 800;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.18);
  padding: 3px 7px;
  border-radius: 6px;
}

.scene-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   FULL-WIDTH APPLE BENTO FEATURE GRID
   ========================================================================== */
.apple-bento-section {
  width: 100%;
  padding: 12px var(--gutter) clamp(44px, 5vw, 80px);
}

.bento-grid-4 {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(16px, 1.8vw, 24px);
}

.bento-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: clamp(22px, 2.2vw, 30px);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease;
}

.bento-tile:hover {
  transform: translateY(-4px);
}

.bento-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

.bento-tile h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text-main);
}

.bento-tile p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* ==========================================================================
   FULL-SCREEN RESPONSIVE SECTIONS & STUDIO WORKBENCH
   ========================================================================== */
.section {
  width: 100%;
  padding: clamp(48px, 6vw, 88px) var(--gutter);
}

.section-inner {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.studio-spotlight {
  min-height: calc(100vh - 54px);
  display: flex;
  align-items: center;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--link-blue);
  margin: 0 0 6px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(28px, 3.4vw, 46px);
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.08;
  margin: 0;
}

.section-heading h2 em {
  font-style: normal;
  color: var(--text-secondary);
}

.section-count {
  font-size: 13.5px;
  color: var(--text-muted);
}

.studio-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--surface-elevated);
  padding: 4px;
  border-radius: 980px;
  border: 1px solid var(--border);
}

.mode-tab {
  background: transparent;
  border: 0;
  padding: 7px 16px;
  border-radius: 980px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab.active {
  background: var(--text-main);
  color: var(--bg-base);
  font-weight: 600;
}

.workbench-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2vw, 28px);
  margin-bottom: 24px;
}

.workbench-grid.mode-video {
  grid-template-columns: 1fr;
}
.workbench-grid.mode-video #workbench-player-panel {
  display: none;
}

.workbench-grid.mode-play {
  grid-template-columns: 1fr;
}
.workbench-grid.mode-play #workbench-video-panel {
  display: none;
}

.workbench-panel {
  background: #000000;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: clamp(12px, 1.5vw, 20px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.panel-bar {
  min-height: 30px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #f5f5f7;
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 10px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30d158;
}

.dot-amber {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff9f0a;
}

.panel-right-label {
  margin-left: auto;
  color: #a1a1a6;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 10.5px;
}

.video-container, .iframe-container {
  width: 100%;
  aspect-ratio: 480 / 380;
  background: #09090b;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.panel-footer {
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #86868b;
  font-size: 12px;
}

.link-btn-light {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 0;
  padding: 6px 14px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.link-btn-light:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Workbench Action Bar */
.workbench-action-bar {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: clamp(20px, 2.4vw, 32px);
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: center;
  box-shadow: var(--shadow-card);
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  display: inline-block;
  border-radius: 980px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--indigo-soft);
  color: var(--indigo-text);
}

.tag-emerald, .tag-green {
  background: var(--emerald-soft);
  color: var(--emerald-text);
}

.tag-amber {
  background: var(--amber-soft);
  color: var(--amber-text);
}

#wb-summary {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-line;
}

.package-contents-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.chips-label {
  font-weight: 600;
  color: var(--text-main);
}

.chip {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 980px;
  font-size: 12px;
  color: var(--text-secondary);
}

.workbench-cta-box {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wb-bundle-link-item:hover {
  border-color: var(--link-blue) !important;
  background: var(--surface) !important;
}

.cta-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.cta-price-row .price-big {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

/* ==========================================================================
   FULL-SCREEN FLUID CATALOG GRID
   ========================================================================== */
.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 15px 20px 15px 46px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

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

.filter-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.filter-pill.active {
  background: var(--text-main);
  color: var(--bg-base);
  border-color: var(--text-main);
  font-weight: 600;
}

.catalog-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(18px, 2vw, 26px);
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow-card);
}

.card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  cursor: pointer;
}

.card-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.project-card:hover .card-thumb-wrap img {
  filter: grayscale(0%);
}

.card-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.project-card:hover .card-thumb-overlay {
  opacity: 1;
}

.card-thumb-play {
  background: #ffffff;
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 980px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.proj-code {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.owned-pill {
  background: var(--emerald-soft);
  color: var(--emerald-text);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 980px;
}

.price-pill {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.card-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.card-cat-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--indigo-soft);
  color: var(--indigo-text);
  padding: 3px 10px;
  border-radius: 980px;
}

.card-age-label {
  font-size: 11px;
  color: var(--text-muted);
}

.project-card h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 8px 0 6px;
  color: var(--text-main);
}

.project-card p,
.card-brief-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.feat-badge {
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-elevated);
  padding: 4px 10px;
  border-radius: 980px;
  color: var(--text-secondary);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.btn-card {
  padding: 9px 12px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  border: 0;
  transition: all 0.2s ease;
}

.btn-watch-play {
  background: var(--surface-elevated);
  color: var(--text-main);
}

.btn-watch-play:hover {
  background: var(--surface-hover);
}

.btn-buy-pkg {
  background: var(--primary);
  color: #ffffff;
}

.btn-buy-pkg:hover {
  background: var(--primary-hover);
}

.btn-download-pkg {
  background: var(--emerald);
  color: #ffffff;
}

/* ==========================================================================
   BUNDLES, PURCHASES & SECURITY VIEWS
   ========================================================================== */
.section-lead {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 780px;
  margin: 0 0 36px;
}

.bundles-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}

.bundle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: clamp(24px, 2.5vw, 34px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  box-shadow: var(--shadow-card);
}

.bundle-badge {
  display: inline-block;
  color: #f56300;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bundle-card h3 {
  font-size: 24px;
  letter-spacing: -0.025em;
  margin: 8px 0 4px;
}

.bundle-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--link-blue);
  margin-bottom: 10px;
}

.bundle-pricing {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 14px 0;
}

.bundle-price {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-main);
}

.bundle-compare {
  font-size: 16px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.empty-state-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 56px 28px;
  text-align: center;
  max-width: 680px;
  margin: 24px auto;
  box-shadow: var(--shadow-card);
}

.empty-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.dashboard-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-card);
}

.stat-card small {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card strong {
  font-size: 38px;
  font-weight: 700;
  color: var(--text-main);
}

.stat-card span {
  font-size: 13px;
  color: var(--text-secondary);
}

.sub-heading {
  font-size: 22px;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

.unlocked-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.security-cards-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  margin-bottom: 36px;
}

.sec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.sec-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--link-blue);
}

.sec-card h3 {
  font-size: 21px;
  margin: 10px 0;
}

.sec-card p, .sec-list {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.sec-list {
  padding-left: 18px;
  margin: 8px 0 16px;
}

.sec-status {
  background: var(--emerald-soft);
  color: var(--emerald-text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 14px;
}

.security-tester-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(20px, 2.5vw, 32px);
  box-shadow: var(--shadow-card);
}

.security-test-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.sec-console {
  background: #000000;
  border: 1px solid var(--border-strong);
  color: #30d158;
  padding: 18px;
  border-radius: 14px;
  font-size: 12.5px;
  white-space: pre-wrap;
  margin: 0;
  max-height: 240px;
  overflow: auto;
}

/* ==========================================================================
   CATALOG & PIPELINE ADMIN VIEW (#view-admin)
   ========================================================================== */
.admin-workflow-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 22px;
  margin-bottom: 28px;
}

.admin-card-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(20px, 2.5vw, 32px);
  box-shadow: var(--shadow-card);
}

.admin-box-header h3 {
  font-size: 22px;
  margin: 10px 0 18px;
  letter-spacing: -0.02em;
}

.admin-add-grid {
  display: grid;
  grid-template-columns: 120px 1.4fr 1.2fr 150px;
  gap: 16px;
  align-items: start;
}

.admin-span-full {
  grid-column: 1 / -1;
}

.admin-table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  background: var(--surface-elevated);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-id-pill {
  display: inline-block;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 8px;
  color: var(--link-blue);
}

.admin-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  background: var(--surface-elevated);
  color: var(--text-main);
  transition: border-color 0.2s ease;
}

.admin-input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-danger-sm {
  background: rgba(255, 69, 58, 0.14);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.32);
  padding: 6px 12px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-danger-sm:hover {
  background: #ff453a;
  color: #ffffff;
}

.bundle-picker-box {
  margin-top: 18px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 18px;
}

.bundle-picker-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.bundle-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  max-height: 310px;
  overflow-y: auto;
  padding: 4px 2px;
}

.bundle-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
}

.bundle-check-item:hover {
  border-color: var(--border-strong);
}

.bundle-check-item.selected {
  border-color: var(--primary);
  background: var(--indigo-soft);
}

.bundle-check-code {
  font-family: "SF Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 11.5px;
  color: var(--link-blue);
  flex-shrink: 0;
}

.bundle-check-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text-main);
}

.bundle-check-price {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .admin-add-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .admin-add-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MODALS & SHOPPING BAG
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-panel.module-popup-panel {
  width: min(1140px, 95vw);
  max-width: 1140px;
  max-height: 94vh;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 19px;
}

.close-btn {
  background: var(--surface-elevated);
  border: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 20px 24px;
  background: var(--surface-elevated);
  border-top: 1px solid var(--border);
}

.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  margin-bottom: 16px;
}

.cart-total-row strong {
  font-size: 24px;
}

.checkout-card-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.demo-payment-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--link-blue);
  margin-bottom: 6px;
}

.small-muted {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.demo-quick-box {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  margin-bottom: 20px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--surface-elevated);
  padding: 4px;
  border-radius: 980px;
  margin-bottom: 20px;
}

.auth-tab {
  background: transparent;
  border: 0;
  padding: 8px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.auth-tab.active {
  background: var(--text-main);
  color: var(--bg-base);
  font-weight: 600;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  background: var(--surface-elevated);
  color: var(--text-main);
}

.form-group textarea,
textarea.admin-input {
  resize: vertical;
  min-height: 68px;
  font-family: inherit;
  line-height: 1.45;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-error {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  padding: 14px 20px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  max-width: 380px;
}

footer {
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 32px var(--gutter);
}

.footer-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

.back-top-link {
  color: var(--link-blue);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (ULTRAWIDE, LAPTOP, TABLET, MOBILE)
   ========================================================================== */
@media (max-width: 960px) {
  .main-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: grid;
  }
  .workbench-grid,
  .workbench-action-bar,
  .bundles-grid {
    grid-template-columns: 1fr;
  }
  .hero-scene-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .studio-spotlight {
    min-height: auto;
  }
}

@media (max-width: 600px) {
  .theme-label {
    display: none;
  }
  .auth-actions .btn-outline {
    display: none;
  }
  .hero-scene-bar {
    grid-template-columns: 1fr 1fr;
  }
  .carousel-nav {
    display: none;
  }
  .catalog-grid,
  .unlocked-grid,
  .security-cards-grid {
    grid-template-columns: 1fr;
  }
}
