:root {
  --bg: #0b1020;
  --panel: #141b2f;
  --panel-2: #101729;
  --text: #edf2ff;
  --muted: #9aa8c7;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #41d7ff;
  --accent-soft: rgba(65, 215, 255, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --gap: 32px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: radial-gradient(circle at 20% 10%, rgba(65, 215, 255, 0.06), transparent 55%),
              radial-gradient(circle at 80% 90%, rgba(142, 230, 111, 0.04), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--panel-2);
  z-index: 50;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #8ee66f);
  transition: width 0.3s ease;
}

.deck {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 48px 96px;
  min-height: 0;
}

.deck:focus { outline: none; }

.slide {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--gap);
  width: 100%;
  max-width: 1280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  min-height: 480px;
  align-items: center;
}

.slide-image {
  background: var(--panel-2);
  border-radius: 12px;
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  aspect-ratio: 16 / 10;
  width: 100%;
}

.slide-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.slide-title {
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.slide-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 1.05rem;
  color: var(--muted);
}
.slide-bullets li {
  position: relative;
  padding-left: 24px;
}
.slide-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-soft);
}

.controls {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.control {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}
.control:hover, .control:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  outline: none;
}
.control:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.counter {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.95rem;
  min-width: 56px;
  text-align: center;
}

.hint {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.6;
  pointer-events: none;
  z-index: 20;
  text-align: center;
}

body.is-fullscreen .hint,
body.is-fullscreen .controls {
  opacity: 0.4;
}
body.is-fullscreen .controls:hover,
body.is-fullscreen .controls:focus-within {
  opacity: 1;
}

.error-page {
  align-items: center;
  justify-content: center;
}
.error {
  text-align: center;
  padding: 64px;
}
.error h1 {
  font-size: 5rem;
  margin: 0 0 8px;
  color: var(--accent);
}
.error a {
  color: var(--accent);
  text-decoration: none;
}
.error a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .deck { padding: 48px 16px 96px; }
  .slide {
    grid-template-columns: 1fr;
    padding: 24px;
    min-height: 0;
    gap: 20px;
  }
  .slide-image { aspect-ratio: 16 / 9; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
}
