/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --c-base: #ffffff;
  --c-main: #1a1a2e;
  --c-accent: #2563eb;
  --c-muted: #64748b;
  --c-light: #f1f5f9;
  --c-border: #e2e8f0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--c-base);
  font-family: "Noto Sans JP", "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Slide Stage ── */
.slide-stage {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background: var(--c-base);
  position: relative;
}

.slide {
  width: 100vw;
  height: 100vh;
  max-width: calc(100vh * 16 / 9);
  max-height: calc(100vw * 9 / 16);
  margin: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: var(--c-base);
  color: var(--c-main);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  container-type: inline-size;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

/* ── Entrance animations ── */
.slide.active .slide-h1,
.slide.active .slide-h2 {
  animation: slideUp 0.5s ease-out both;
}

.slide.active .slide-body,
.slide.active .slide-caption {
  animation: slideUp 0.5s ease-out 0.1s both;
}

.slide.active .split-2-col:first-child,
.slide.active .split-3-col:nth-child(1),
.slide.active .flow-step:nth-child(1) {
  animation: slideUp 0.4s ease-out 0.15s both;
}

.slide.active .split-2-col:last-child,
.slide.active .split-3-col:nth-child(2),
.slide.active .flow-step:nth-child(3) {
  animation: slideUp 0.4s ease-out 0.25s both;
}

.slide.active .split-3-col:nth-child(3),
.slide.active .flow-step:nth-child(5) {
  animation: slideUp 0.4s ease-out 0.35s both;
}

.slide.active .slide-number-huge {
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.slide.active .slide-number-unit {
  animation: slideUp 0.4s ease-out 0.2s both;
}

.slide.active .slide-footer {
  animation: fadeIn 0.5s ease-out 0.3s both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(1.2cqw);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Slide Content ── */
.slide-content {
  width: 100%;
  height: 100%;
  padding: 5% 7%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Decorative accents ── */
.slide::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.2cqw;
  background: linear-gradient(90deg, var(--c-accent) 0%, transparent 60%);
  opacity: 0.6;
  z-index: 2;
}

.layout-section::before {
  background: linear-gradient(90deg, rgba(255,255,255,0.4) 0%, transparent 60%);
}

.slide::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle at 100% 100%, var(--c-accent) 0%, transparent 70%);
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

.layout-section::after {
  background: radial-gradient(circle at 100% 100%, rgba(255,255,255,0.1) 0%, transparent 70%);
  opacity: 0.15;
}

.slide-content {
  position: relative;
  z-index: 1;
}

/* ── Typography (cqw) ── */
.slide-h1 {
  font-size: 6.5cqw;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.slide-h2 {
  font-size: 5.8cqw;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.slide-h3 {
  font-size: 4.5cqw;
  font-weight: 700;
  line-height: 1.25;
}

.slide-title {
  font-size: 3.4cqw;
  font-weight: 700;
  line-height: 1.25;
}

.slide-body {
  font-size: 3cqw;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.slide-caption {
  font-size: 1.8cqw;
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-muted);
}

.slide-number-huge {
  font-size: 18cqw;
  font-weight: 900;
  line-height: 1;
  color: var(--c-accent);
  text-shadow: 0 0.3cqw 1.6cqw rgba(37, 99, 235, 0.2);
}

.slide-number-unit {
  font-size: 4cqw;
  font-weight: 700;
  color: var(--c-main);
}

/* ── Layouts ── */

/* center */
.layout-center {
  text-align: center;
  align-items: center;
  gap: 2cqw;
}

/* section (bridge) */
.layout-section {
  background: linear-gradient(135deg, var(--c-main) 0%, #16213e 100%);
  color: var(--c-base);
}

.layout-section .slide-content {
  text-align: center;
  align-items: center;
  gap: 1.5cqw;
}

.layout-section .slide-h1 {
  color: var(--c-base);
}

.layout-section .slide-body {
  color: rgba(255, 255, 255, 0.8);
}

/* split-2 */
.layout-split-2 .slide-content {
  gap: 2.5cqw;
}

.split-2-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3cqw;
  width: 100%;
}

.split-2-col {
  padding: 2.5cqw;
  border-radius: 0.6cqw;
  background: var(--c-light);
  display: flex;
  flex-direction: column;
  gap: 1cqw;
  border: 1px solid var(--c-border);
  box-shadow: 0 0.1cqw 0.6cqw rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.split-2-col:last-child {
  border-left: 0.15cqw solid var(--c-accent);
  background: linear-gradient(135deg, var(--c-light) 0%, rgba(37, 99, 235, 0.04) 100%);
}

.split-2-col .col-label {
  font-size: 2.6cqw;
  font-weight: 900;
  color: var(--c-accent);
  letter-spacing: 0.05em;
}

.split-2-col .col-content {
  font-size: 2.8cqw;
  line-height: 1.5;
  font-weight: 500;
}

/* split-3 */
.layout-split-3 .slide-content {
  gap: 2.5cqw;
}

.split-3-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2.5cqw;
  width: 100%;
}

.split-3-col {
  padding: 2cqw;
  border-radius: 0.6cqw;
  background: var(--c-light);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1cqw;
  border: 1px solid var(--c-border);
  box-shadow: 0 0.1cqw 0.6cqw rgba(0, 0, 0, 0.04);
  border-top: 0.15cqw solid var(--c-accent);
}

.split-3-col .col-label {
  font-size: 3.4cqw;
  font-weight: 900;
  color: var(--c-accent);
}

.split-3-col .col-content {
  font-size: 2.4cqw;
  line-height: 1.5;
  font-weight: 500;
}

/* left-right */
.layout-left-right .slide-content {
  gap: 2cqw;
}

.left-right-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3cqw;
  width: 100%;
}

.left-right-grid > div {
  padding: 2.5cqw;
  border-left: 0.2cqw solid var(--c-accent);
  display: flex;
  align-items: center;
}

.left-right-grid > div p {
  font-size: 2.8cqw;
  line-height: 1.5;
  font-weight: 500;
}

/* flow */
.layout-flow .slide-content {
  gap: 2.5cqw;
}

.flow-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
}

.flow-step {
  flex: 1;
  padding: 2cqw 1.2cqw;
  background: var(--c-light);
  border-radius: 0.4cqw;
  text-align: center;
  font-size: 2.2cqw;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid var(--c-border);
  box-shadow: 0 0.05cqw 0.2cqw rgba(0, 0, 0, 0.04);
}

.flow-step:last-child {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
  font-weight: 700;
}

.flow-arrow {
  flex: 0 0 auto;
  padding: 0 0.5cqw;
  color: var(--c-accent);
  font-size: 2cqw;
  font-weight: 700;
}

/* big-number */
.layout-big-number .slide-content {
  text-align: center;
  align-items: center;
  gap: 1cqw;
}

/* ── Prompt Layout ── */
.layout-prompt .slide-content {
  gap: 1.5cqw;
}

.prompt-block {
  width: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 0.8cqw;
  padding: 2cqw 2.5cqw;
  color: #fff;
  border: 1px solid rgba(37, 99, 235, 0.3);
  box-shadow: 0 0.2cqw 1.2cqw rgba(0, 0, 0, 0.12);
}

.prompt-label {
  font-size: 1.4cqw;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.2cqw;
  padding-bottom: 0.6cqw;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.prompt-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5cqw;
}

.prompt-line {
  display: flex;
  align-items: baseline;
  gap: 1cqw;
  font-size: 2cqw;
  line-height: 1.5;
}

.prompt-key {
  flex: 0 0 auto;
  color: #93b4f8;
  font-weight: 700;
  min-width: 4.5em;
  font-size: 1.8cqw;
}

.prompt-key::after {
  content: ":";
  margin-left: 0.2em;
}

.prompt-val {
  color: #e2e8f0;
  font-weight: 400;
}

.slide.active .prompt-block {
  animation: slideUp 0.5s ease-out 0.15s both;
}

/* Prompt command (single command display) */
.prompt-command {
  font-size: 3.2cqw;
  font-weight: 700;
  color: #4ade80;
  font-family: "SF Mono", "Monaco", "Cascadia Code", monospace;
  padding: 0.8cqw 0;
  line-height: 1.5;
}

.slide.active .prompt-command {
  animation: slideUp 0.5s ease-out 0.2s both;
}

.slide.active .prompt-line:nth-child(1) { animation: slideUp 0.3s ease-out 0.2s both; }
.slide.active .prompt-line:nth-child(2) { animation: slideUp 0.3s ease-out 0.28s both; }
.slide.active .prompt-line:nth-child(3) { animation: slideUp 0.3s ease-out 0.36s both; }
.slide.active .prompt-line:nth-child(4) { animation: slideUp 0.3s ease-out 0.44s both; }
.slide.active .prompt-line:nth-child(5) { animation: slideUp 0.3s ease-out 0.52s both; }

/* ── CTA Button (on slide) ── */
.slide-cta-btn {
  display: inline-block;
  margin-top: 1.5cqw;
  padding: 0.8cqw 2.4cqw;
  background: var(--c-accent);
  color: #fff;
  font-size: 2cqw;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0.4cqw;
  transition: opacity 0.2s;
  z-index: 10;
  position: relative;
}

.slide-cta-btn:hover {
  opacity: 0.85;
}

.slide.active .slide-cta-btn {
  animation: slideUp 0.4s ease-out 0.25s both;
}

/* ── QR Code ── */
.slide-qr {
  margin-top: 1.5cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8cqw;
}

.slide-qr img {
  border-radius: 0;
  box-shadow: none;
}

.slide-qr-url {
  font-size: 1.4cqw;
  color: var(--c-muted);
  font-family: "SF Mono", "Monaco", monospace;
}

.slide.active .slide-qr {
  animation: slideUp 0.5s ease-out 0.3s both;
}

/* ── CTA Button (sidebar) ── */
.sidebar-cta-btn {
  display: block;
  text-align: center;
  padding: 10px 16px;
  margin-bottom: 20px;
  background: var(--c-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
  transition: opacity 0.2s;
}

.sidebar-cta-btn:hover {
  opacity: 0.85;
}

/* accent highlight */
.accent-slide {
  border: 0.2cqw solid var(--c-accent);
  background: linear-gradient(135deg, var(--c-base) 0%, rgba(37, 99, 235, 0.06) 100%);
}

/* ── Headline accent underline ── */
.slide-h2 {
  position: relative;
  display: inline-block;
}

.layout-center .slide-h2::after,
.layout-split-2 .slide-h2::after,
.layout-split-3 .slide-h2::after,
.layout-flow .slide-h2::after,
.layout-left-right .slide-h2::after {
  content: "";
  position: absolute;
  bottom: -0.4cqw;
  left: 50%;
  transform: translateX(-50%);
  width: 3cqw;
  height: 0.15cqw;
  background: var(--c-accent);
  border-radius: 0.1cqw;
}

.layout-split-2 .slide-h2::after,
.layout-split-3 .slide-h2::after,
.layout-flow .slide-h2::after,
.layout-left-right .slide-h2::after {
  left: 0;
  transform: none;
}

/* ── Section slide polish ── */
.layout-section {
  background: linear-gradient(135deg, var(--c-main) 0%, #16213e 100%);
}

/* footer on title slide */
.slide-footer {
  position: absolute;
  bottom: 5%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.4cqw;
  color: var(--c-muted);
}

/* ── Status Bar ── */
.status-bar {
  position: fixed;
  top: 16px;
  right: 72px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(26, 26, 46, 0.45);
  font-family: "Inter", "Noto Sans JP", sans-serif;
  pointer-events: none;
}

.status-agenda {
  opacity: 0.8;
}

.status-slide-num {
  background: rgba(26, 26, 46, 0.08);
  color: rgba(26, 26, 46, 0.5);
  padding: 2px 10px;
  border-radius: 4px;
}

/* ── Menu Button ── */
.menu-btn {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 200;
  width: 44px;
  height: 44px;
  background: rgba(26, 26, 46, 0.06);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.2s;
}

.menu-btn:hover {
  background: rgba(26, 26, 46, 0.12);
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(26, 26, 46, 0.4);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-btn.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-btn.open span:nth-child(2) {
  opacity: 0;
}
.menu-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Sidebar ── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 85vw;
  height: 100vh;
  background: var(--c-main);
  color: var(--c-base);
  z-index: 160;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding: 80px 24px 32px;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 20px;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section-title {
  font-size: 15px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-section-title:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-section-title.active {
  background: rgba(37, 99, 235, 0.3);
  color: #93b4f8;
}

.sidebar-section-title .time {
  font-size: 12px;
  opacity: 0.5;
  font-weight: 400;
}

.sidebar-slide-list {
  list-style: none;
  padding: 4px 0 4px 24px;
}

.sidebar-slide-list li {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}

.sidebar-slide-list li:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-slide-list li.active {
  color: #93b4f8;
  font-weight: 600;
}

/* ── Talk Script ── */
.script-trigger {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 80;
}

.script-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 30vh;
  background: rgba(26, 26, 46, 0.95);
  color: #fff;
  z-index: 90;
  transform: translateY(100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
  padding: 24px 40px;
  font-size: 16px;
  line-height: 1.8;
  backdrop-filter: blur(8px);
}

.script-panel.visible {
  transform: translateY(0);
}

.script-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* ── Progress Bar ── */
.progress-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--c-accent);
  z-index: 70;
  transition: width 0.2s ease;
}
