/* BeSpoke Everything Manual — Premium Dark Stylesheet */
:root {
  --gold: #D4AF37;
  --gold-light: #E8C95A;
  --gold-dim: rgba(212,175,55,0.10);
  --gold-border: rgba(212,175,55,0.25);
  --bg: #0F0F12;
  --bg-card: #1A1A22;
  --bg-elevated: #22222C;
  --bg-sidebar: #0A0A0E;
  --text: #E8E6E1;
  --text-dim: #9A968E;
  --text-on-dark: #C8C4BC;
  --border: rgba(255,255,255,0.06);
  --radius: 14px;
  --shadow: 0 2px 16px rgba(0,0,0,0.25);
  --sidebar-w: 260px;
  --content-max: 820px;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  border-right: 1px solid var(--border);
}

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

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color .2s;
}
.sidebar-close:hover { color: var(--text); }

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 28px; }
.logo-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--text);
}
.logo-subtitle {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.nav-section { margin-bottom: 20px; }
.nav-section-title {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 8px;
  font-weight: 600;
}

.nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  border: 1px solid transparent;
}
.nav-link:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.04);
}
.nav-link.active {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: var(--gold-border);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: rgba(255,255,255,0.2);
}

/* ── Main Content ─────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  overflow-x: hidden;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15,15,18,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
}
.topbar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  margin-right: 12px;
  color: var(--text);
}

.content-scroll {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 32px 80px;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 56px 0 40px;
  text-align: center;
}
.hero-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 8px;
}
.hero-logo {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}
.hero-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid var(--gold-border);
  margin-bottom: 20px;
}
.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: 6px;
  margin-bottom: 16px;
  color: #fff;
}
.hero-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.75;
}
.hero-subtitle strong {
  color: var(--text);
}

/* ── CTA Banner ──────────────────────────────────────── */
.cta-banner {
  background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(212,175,55,0.03));
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  padding: 28px 24px;
  margin: 0 auto 40px;
  text-align: center;
}
.feature-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.feature-badge {
  background: rgba(212,175,55,0.12);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border: 1px solid rgba(212,175,55,0.15);
  white-space: nowrap;
}
.cta-btn {
  display: inline-block;
  background: linear-gradient(135deg, #D4AF37, #B8941F);
  color: #1A1A1A;
  padding: 14px 40px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(212,175,55,0.25);
  text-shadow: 0 1px 1px rgba(255,255,255,0.25);
}
.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(212,175,55,0.35);
}
.cta-subtext {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
}

/* ── Chapters ─────────────────────────────────────────── */
.chapter {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
}
.chapter-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.chapter-number {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  padding: 4px 10px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.chapter h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.chapter h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--text);
}
.chapter h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text);
}
.chapter p {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.chapter p strong {
  color: var(--text);
  font-weight: 600;
}
.chapter a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}
.chapter a:hover {
  text-decoration: underline;
}

/* ── Lists ────────────────────────────────────────────── */
.chapter ul {
  margin: 10px 0 16px 0;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-dim);
}
.chapter ul li {
  margin-bottom: 4px;
}
.chapter ul li strong {
  color: var(--text);
}

.chapter ol {
  margin: 10px 0 16px 0;
  padding-left: 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-dim);
  counter-reset: ol-counter;
  list-style: none;
}
.chapter ol li {
  counter-increment: ol-counter;
  padding: 8px 0 8px 36px;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.chapter ol li:last-child { border-bottom: none; }
.chapter ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 8px;
  width: 24px;
  height: 24px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Outfit', sans-serif;
}
.chapter ol li strong {
  color: var(--text);
}

/* ── Code ─────────────────────────────────────────────── */
.chapter code, code {
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.15);
  color: var(--gold-light);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  word-break: break-all;
}

/* ── Tables ───────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
thead {
  background: var(--bg-elevated);
}
thead th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-dim);
  vertical-align: top;
}
tbody td strong {
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover {
  background: rgba(255,255,255,0.02);
}
/* Highlighted tier row */
tbody tr[style*="background"] {
  background: rgba(212,175,55,0.05) !important;
}

/* ── Image Grid ───────────────────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.screenshot {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}
.screenshot:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.screenshot.center { max-width: 340px; margin: 20px auto; }
.screenshot.mobile { max-width: 340px; margin-left: auto; margin-right: auto; }
.screenshot.desktop { max-width: 340px; margin-left: auto; margin-right: auto; }

.screenshot img {
  width: 100%;
  display: block;
  cursor: zoom-in;
}
.screenshot figcaption {
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ── Callout ──────────────────────────────────────────── */
.callout {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  margin: 20px 0;
}
.callout strong {
  color: var(--gold-light);
}
.callout a {
  color: var(--gold);
}

/* ── Section Divider ──────────────────────────────────── */
.section-divider {
  text-align: center;
  padding: 56px 0 24px;
  position: relative;
}
.section-divider span {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--bg);
  padding: 0 20px;
  position: relative;
  z-index: 1;
}
.section-divider::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border), transparent);
  margin-bottom: -8px;
}

/* ── Lightbox ─────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity .25s;
}
.lightbox.visible { opacity: 1; }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}

/* ── Section Loading Indicator ────────────────────────── */
.section-loading {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.section-loading.visible { opacity: 1; }
.section-loading .section-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border: 1px solid var(--border);
}

/* ── Video / Slideshow Player ─────────────────────────── */
.video-player {
  margin: 24px auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0A0908;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  max-width: 380px;
}

.slide-container {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0A0908;
  overflow: hidden;
}

.slide-img {
  width: 100%;
  display: block;
  object-fit: contain;
  transition: opacity .35s ease;
  max-height: 560px;
}

.slide-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px 20px 18px;
  background: linear-gradient(transparent, rgba(0,0,0,0.88));
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  min-height: 56px;
  display: flex;
  align-items: flex-end;
}

/* Loading Spinner */
.slide-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,9,8,0.6);
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.slide-loader.visible { opacity: 1; }

.loader-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(200,164,90,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Controls Bar */
.slide-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #131110;
  border-top: 1px solid rgba(200,164,90,0.12);
}

.slide-btn {
  background: none;
  border: 1px solid rgba(200,164,90,0.2);
  color: var(--gold);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.slide-btn:hover {
  background: var(--gold-dim);
  border-color: var(--gold-border);
}

.slide-counter {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
  min-width: 44px;
  text-align: center;
  flex-shrink: 0;
}

.slide-progress {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.slide-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gold);
  border-radius: 2px;
  transition: width .3s;
}

.subtitle-track {
  background: #131110;
  padding: 12px;
  border-top: 1px solid rgba(200,164,90,0.06);
  max-height: 220px;
  overflow-y: auto;
}

.subtitle-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sub-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all .2s ease;
  border: 1px solid transparent;
  line-height: 1.5;
}
.sub-item:hover {
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.03);
}
.sub-item.active {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: var(--gold-border);
  font-weight: 500;
}

/* ── Footer ───────────────────────────────────────────── */
.manual-footer {
  text-align: center;
  padding: 56px 0 40px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}
.manual-footer p { margin-bottom: 6px; }
.manual-footer a { color: var(--gold); text-decoration: none; }

/* ── Mobile Overlay ───────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ── Responsive: Tablet ──────────────────────────────── */
@media (max-width: 1024px) {
  .content-scroll { padding: 0 24px 64px; }
}

/* ── Responsive: Mobile ──────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .sidebar-overlay.open { display: block; }
  .sidebar-close { display: flex; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
  }
  .content-scroll {
    padding: 0 16px 56px;
  }

  /* Hero */
  .hero { padding: 32px 0 24px; }
  .hero-title { letter-spacing: 4px; }
  .hero-subtitle { font-size: 14px; line-height: 1.7; }

  /* CTA Banner */
  .cta-banner { padding: 20px 16px; border-radius: 16px; margin-bottom: 28px; }
  .feature-badge { font-size: 11px; padding: 5px 12px; }
  .cta-btn { padding: 12px 32px; font-size: 14px; }

  /* Chapters */
  .chapter { padding: 28px 0 24px; }
  .chapter h2 { font-size: 20px; }
  .chapter h3 { font-size: 16px; margin-top: 24px; }
  .chapter p { font-size: 14px; }
  .chapter ul, .chapter ol { font-size: 14px; }

  /* Tables — card-style on mobile */
  table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  thead th { padding: 10px 12px; font-size: 10px; }
  tbody td { padding: 10px 12px; }

  /* Images */
  .image-grid { grid-template-columns: 1fr; gap: 12px; }
  .screenshot.mobile,
  .screenshot.center,
  .screenshot.desktop { max-width: 100%; }

  /* Video */
  .video-player { max-width: 100%; }
  .slide-container { min-height: 300px; }

  /* Callout */
  .callout { padding: 14px 16px; font-size: 13px; }

  /* Code */
  code { font-size: 11.5px; padding: 1px 6px; }

  /* Section Divider */
  .section-divider { padding: 40px 0 20px; }
}

/* ── Very small screens ──────────────────────────────── */
@media (max-width: 400px) {
  .content-scroll { padding: 0 12px 48px; }
  .chapter h2 { font-size: 18px; }
  .chapter-header { gap: 10px; }
  .hero-title { font-size: 28px; letter-spacing: 3px; }
  .feature-badge { font-size: 10px; padding: 4px 10px; }
  .cta-btn { padding: 11px 24px; font-size: 13px; }
  table { font-size: 11px; }
  thead th { padding: 8px 10px; }
  tbody td { padding: 8px 10px; }
}
