:root {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-muted: rgba(255, 255, 255, 0.46);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.12);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --ease-apple: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] {
  --bg: #09090b;
  --surface: rgba(28, 28, 30, 0.72);
  --surface-strong: rgba(44, 44, 46, 0.9);
  --surface-muted: rgba(58, 58, 60, 0.52);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --border: rgba(255, 255, 255, 0.11);
  --shadow: 0 32px 110px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  min-height: 100%;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 18%, rgba(205, 221, 255, 0.9) 0, transparent 34%),
    radial-gradient(circle at 14% 72%, rgba(236, 218, 255, 0.75) 0, transparent 34%),
    linear-gradient(135deg, #fbfbfd 0%, #f2f2f7 48%, #e9e9ef 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.32) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.32) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 78%);
  opacity: .36;
}

button { font: inherit; }
.app-shell {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 22px;
  padding: 22px;
}

.sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.52);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 18px 60px rgba(0,0,0,.08);
  padding: 20px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(135deg, #111 0%, #777 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4);
}
.toc-list { display: grid; gap: 8px; }
.toc-item {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.toc-item:hover { background: rgba(0,0,0,.045); color: var(--text); }
.toc-item.active { background: rgba(0,0,0,.075); color: var(--text); }
.toc-item span { font-size: 12px; font-weight: 800; opacity: .58; }
.toc-item strong { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }

.presentation {
  position: relative;
  z-index: 3;
  min-width: 0;
  height: calc(100vh - 44px);
  display: grid;
  grid-template-rows: 58px 1fr 36px;
  gap: 14px;
}
.deck-header,
.deck-footer {
  display: grid;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,.56);
  backdrop-filter: blur(26px) saturate(145%);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
}
.deck-header {
  grid-template-columns: 1fr auto;
  padding: 0 14px 0 22px;
}
.header-title { font-size: 14px; font-weight: 700; color: var(--muted); letter-spacing: -0.01em; }
.header-controls { display: flex; align-items: center; gap: 10px; }
.nav-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}
.nav-button:hover { transform: translateY(-1px); background: #fff; }
.nav-button:active { transform: scale(.96); }
.nav-button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.slide-counter {
  width: 88px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.75);
}

.stage {
  position: relative;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.54);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.72), transparent 38%, rgba(255,255,255,.28));
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(42px, 0, 0) scale(.985);
  transition: opacity 420ms ease, transform 560ms var(--ease-apple);
  will-change: opacity, transform;
}
.slide.is-before { transform: translate3d(-42px, 0, 0) scale(.985); }
.slide.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  z-index: 2;
}
.slide-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: clamp(42px, 5vw, 72px);
  display: grid;
  gap: clamp(28px, 4vw, 58px);
  align-items: center;
}
.hero-layout,
.standard-layout {
  grid-template-columns: minmax(0, .95fr) minmax(360px, .85fr);
}
.copy-block {
  display: grid;
  align-content: center;
  min-height: 380px;
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: .02em;
  text-transform: uppercase;
}
h1, h2 {
  margin: 0;
  max-width: 760px;
  color: var(--text);
  letter-spacing: -0.072em;
  line-height: .94;
}
h1 { font-size: clamp(58px, 7vw, 98px); }
h2 { font-size: clamp(48px, 5.5vw, 82px); }
.lead {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.46;
  letter-spacing: -0.018em;
}
.visual-panel,
.content-cards,
.panel-list,
.metrics-grid,
.final-actions {
  align-self: stretch;
  min-height: 390px;
  border-radius: 30px;
}
.visual-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(244,244,248,.58));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.8), 0 20px 60px rgba(0,0,0,.08);
}
.hero-panel::before,
.design-panel::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(80, 120, 255, .18), transparent 64%);
}
.device-card,
.stack-card {
  position: absolute;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 28px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 24px 60px rgba(0,0,0,.12);
}
.device-card.large { width: 58%; height: 56%; left: 13%; top: 18%; }
.device-card.small { width: 38%; height: 34%; right: 12%; bottom: 16%; }
.floating-orb {
  position: absolute;
  width: 110px;
  height: 110px;
  right: 18%;
  top: 18%;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #d9dce6);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.9), 0 22px 50px rgba(0,0,0,.16);
}
.content-cards,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.content-card,
.metric-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.66);
  padding: 22px;
  text-align: left;
  color: var(--text);
  transition: transform 180ms ease, background 180ms ease;
}
.content-card { cursor: pointer; }
.content-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.92); }
.content-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 28px; }
.content-card strong,
.metric-card strong { display: block; font-size: 22px; letter-spacing: -0.04em; margin-bottom: 8px; }
.content-card small,
.metric-card small { color: var(--muted); font-size: 15px; line-height: 1.4; }
.panel-list {
  display: grid;
  align-content: center;
  gap: 14px;
}
.panel-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.66);
  padding: 20px;
}
.panel-row > span {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.055);
  color: var(--muted);
  font-weight: 800;
}
.panel-row strong { display: block; font-size: 21px; letter-spacing: -0.035em; }
.panel-row small { color: var(--muted); font-size: 15px; }
.stack-card.one { width: 66%; height: 56%; left: 17%; top: 14%; }
.stack-card.two { width: 58%; height: 48%; left: 24%; top: 24%; opacity: .72; }
.stack-card.three { width: 50%; height: 40%; left: 31%; top: 34%; opacity: .52; }
.final-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.primary-action,
.secondary-action {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 14px 20px;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}
.primary-action { background: #1d1d1f; color: #fff; }
.secondary-action { background: rgba(255,255,255,.76); color: var(--text); }
.primary-action:hover,
.secondary-action:hover { transform: translateY(-2px); }
.deck-footer {
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 0 16px;
}
.progress {
  height: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #1d1d1f;
  transition: width 360ms var(--ease-soft);
}
.footer-hint { color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .slide, .progress-bar, .toc-item, .nav-button, .content-card { transition: none !important; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .app-shell {
    min-height: 100vh;
    height: auto;
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .sidebar {
    position: sticky;
    top: 14px;
    z-index: 10;
    border-radius: 24px;
  }
  .toc-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toc-item { grid-template-columns: 1fr; gap: 4px; }
  .presentation { height: 760px; grid-template-rows: 58px 1fr 36px; }
  .hero-layout, .standard-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .copy-block { min-height: auto; }
  .visual-panel, .content-cards, .panel-list, .metrics-grid, .final-actions { min-height: 280px; }
}

@media (max-width: 620px) {
  .toc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck-header { grid-template-columns: 1fr; height: auto; gap: 10px; padding: 12px; }
  .header-controls { justify-content: space-between; }
  .presentation { height: 820px; }
  .slide-inner { padding: 28px; }
  h1 { font-size: 48px; }
  h2 { font-size: 42px; }
  .content-cards, .metrics-grid { grid-template-columns: 1fr; }
  .footer-hint { display: none; }
  .deck-footer { grid-template-columns: 1fr; }
}


html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 78% 18%, rgba(72, 91, 145, 0.42) 0, transparent 34%),
    radial-gradient(circle at 14% 72%, rgba(88, 68, 115, 0.38) 0, transparent 34%),
    linear-gradient(135deg, #09090b 0%, #111114 48%, #050507 100%);
}

html[data-theme="dark"] body::before {
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  opacity: .42;
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .deck-header,
html[data-theme="dark"] .deck-footer,
html[data-theme="dark"] .stage {
  background: rgba(28, 28, 30, .58);
}

html[data-theme="dark"] .stage::after {
  background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 38%, rgba(255,255,255,.04));
}

html[data-theme="dark"] .brand-mark {
  background: linear-gradient(135deg, #f5f5f7 0%, #6e6e73 100%);
}

html[data-theme="dark"] .nav-button,
html[data-theme="dark"] .slide-counter,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .panel-row,
html[data-theme="dark"] .secondary-action {
  background: rgba(44, 44, 46, .72);
  color: var(--text);
}

html[data-theme="dark"] .nav-button:hover,
html[data-theme="dark"] .content-card:hover {
  background: rgba(58, 58, 60, .92);
}

html[data-theme="dark"] .visual-panel {
  background: linear-gradient(145deg, rgba(44,44,46,.92), rgba(28,28,30,.58));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.08), 0 24px 70px rgba(0,0,0,.34);
}

html[data-theme="dark"] .device-card,
html[data-theme="dark"] .stack-card {
  background: rgba(58,58,60,.76);
  border-color: rgba(255,255,255,.1);
}

html[data-theme="dark"] .floating-orb {
  background: linear-gradient(135deg, #3a3a3c, #8e8e93);
}

html[data-theme="dark"] .primary-action {
  background: #f5f5f7;
  color: #1d1d1f;
}

html[data-theme="dark"] .progress {
  background: rgba(255,255,255,.12);
}

html[data-theme="dark"] .progress-bar {
  background: #f5f5f7;
}

.theme-toggle {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  color: var(--muted);
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover { transform: translateY(-1px); background: var(--surface-strong); color: var(--text); }
.theme-toggle:active { transform: scale(.98); }
.theme-toggle-track {
  width: 42px;
  height: 24px;
  display: block;
  position: relative;
  border-radius: 999px;
  background: rgba(0,0,0,.12);
  transition: background 220ms ease;
}
.theme-toggle-thumb {
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform 260ms cubic-bezier(.25,1,.5,1), background 220ms ease;
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(44,44,46,.72);
  color: var(--muted);
}
html[data-theme="dark"] .theme-toggle-track { background: rgba(255,255,255,.18); }
html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(18px);
  background: #f5f5f7;
}

@media (max-width: 620px) {
  .theme-toggle-label { display: none; }
  .theme-toggle { padding-right: 6px; }
}
