@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --c-bg: #E96D47;
  --c-bg-dark: #C85A3A;
  --c-card: #FFFFFF;
  --c-text: #1B1B1B;
  --c-text-on-bg: #FFFFFF;
  --c-text-muted: rgba(27, 27, 27, 0.55);
  --c-text-faint: rgba(27, 27, 27, 0.35);
  --c-code-bg: #2B2B2B;
  --c-code-text: #F0EEEB;
  --c-code-accent: #F5C76A;
  --c-card-shadow: rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #000;
  color: var(--c-text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Slide Stage ── */
.slide-stage {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background: #000;
}

#slide-frame {
  width: 100vw;
  height: 100vh;
  max-width: calc(100vh * 16 / 9);
  max-height: calc(100vw * 9 / 16);
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  container-name: slide;
}

/* ── Slide Base (Orange background) ── */
.slide {
  position: absolute;
  inset: 0;
  padding: 5cqw 6cqw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
  background: var(--c-bg);
  color: var(--c-text-on-bg);
}

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

/* ── Cover (full-bleed image) ── */
.slide.layout-cover {
  padding: 0;
  background: #000;
}

.cover-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Section Divider (Darker) ── */
.slide.layout-section {
  background: var(--c-text);
  color: var(--c-text-on-bg);
  align-items: center;
  text-align: center;
}

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

.slide-h2 {
  font-size: 3cqw;
  line-height: 1.25;
  font-weight: 700;
}

.slide-title {
  font-size: 3.5cqw;
  line-height: 1.2;
  font-weight: 700;
}

.slide-body {
  font-size: 1.7cqw;
  line-height: 1.7;
  font-weight: 400;
  opacity: 0.85;
}

.slide-small {
  font-size: 1.2cqw;
  line-height: 1.5;
  font-weight: 400;
  opacity: 0.6;
}

/* ── Headline ── */
.headline {
  margin-bottom: 2.5cqw;
  white-space: pre-line;
}

/* ── Body text ── */
.body-text {
  white-space: pre-line;
}

/* ── White Card ── */
.card {
  background: var(--c-card);
  border-radius: 1.2cqw;
  padding: 2.5cqw 3cqw;
  color: var(--c-text);
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
}

/* ── Items Grid (cards) ── */
.items-grid {
  display: flex;
  gap: 2cqw;
  margin-top: 2cqw;
}

.item-card {
  flex: 1;
  background: var(--c-card);
  border-radius: 1.2cqw;
  padding: 2cqw 2.2cqw;
  color: var(--c-text);
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.6cqw;
}

.item-icon {
  font-size: 2.5cqw;
  line-height: 1;
  margin-bottom: 0.3cqw;
}

.item-icon.numbered {
  width: 3cqw;
  height: 3cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  color: #fff;
  border-radius: 50%;
  font-size: 1.6cqw;
  font-weight: 900;
}

.item-icon.slash {
  width: 3cqw;
  height: 3cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-text);
  color: var(--c-card);
  border-radius: 0.5cqw;
  font-size: 1.8cqw;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
}

.item-label {
  font-size: 1.8cqw;
  font-weight: 700;
  color: var(--c-text);
}

.item-desc {
  font-size: 1.3cqw;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ── Code Block (dark terminal style) ── */
.code-block {
  background: var(--c-code-bg);
  color: var(--c-code-text);
  padding: 2.2cqw 2.8cqw;
  border-radius: 1cqw;
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  font-size: 1.4cqw;
  line-height: 1.9;
  white-space: pre-line;
  margin-top: 2cqw;
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
  position: relative;
}

.code-block .code-label {
  position: absolute;
  top: 0.8cqw;
  right: 1.2cqw;
  font-size: 0.9cqw;
  opacity: 0.4;
  font-weight: 400;
}

.code-block .code-prompt {
  color: var(--c-code-accent);
  font-weight: 700;
}

.code-block .code-comment {
  opacity: 0.45;
}

/* ── Pricing Grid ── */
.pricing-grid {
  display: flex;
  gap: 1.5cqw;
  margin-top: 2cqw;
}

.pricing-card {
  flex: 1;
  background: var(--c-card);
  border-radius: 1.2cqw;
  padding: 2cqw 1.8cqw;
  color: var(--c-text);
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6cqw;
  position: relative;
}

.pricing-card.recommended {
  border: 0.25cqw solid var(--c-bg);
}

.pricing-badge {
  position: absolute;
  top: -0.9cqw;
  background: var(--c-bg);
  color: #fff;
  font-size: 0.85cqw;
  font-weight: 700;
  padding: 0.2cqw 0.9cqw;
  border-radius: 0.4cqw;
}

.pricing-name {
  font-size: 1.6cqw;
  font-weight: 700;
}

.pricing-price {
  font-size: 2.2cqw;
  font-weight: 900;
  color: var(--c-bg);
}

.pricing-limit {
  font-size: 1.1cqw;
  color: var(--c-text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── File Tree ── */
.file-tree {
  background: var(--c-code-bg);
  color: var(--c-code-text);
  border-radius: 1cqw;
  padding: 2cqw 2.5cqw;
  margin-top: 2cqw;
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  font-size: 1.3cqw;
  line-height: 2;
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
}

.ft-row {
  display: flex;
  align-items: baseline;
  gap: 0.6cqw;
}

.ft-blank {
  height: 1cqw;
}

.ft-icon {
  font-size: 1.2cqw;
  flex-shrink: 0;
}

.ft-name {
  font-weight: 700;
  white-space: nowrap;
}

.ft-desc {
  color: var(--c-code-accent);
  font-size: 1cqw;
  opacity: 0.7;
  white-space: nowrap;
}

/* ── Left-Right Layout ── */
.slide.layout-left-right {
  flex-direction: column;
}

.lr-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5cqw;
  margin-top: 2cqw;
  width: 100%;
}

.lr-card {
  background: var(--c-card);
  border-radius: 1.2cqw;
  padding: 2.5cqw;
  display: flex;
  flex-direction: column;
  gap: 0.8cqw;
  color: var(--c-text);
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
}

.lr-card.recommended {
  border: 0.2cqw solid var(--c-bg);
  position: relative;
}

.lr-card-badge {
  position: absolute;
  top: -1cqw;
  left: 2cqw;
  background: var(--c-bg);
  color: #fff;
  font-size: 0.9cqw;
  font-weight: 700;
  padding: 0.3cqw 1cqw;
  border-radius: 0.4cqw;
}

.lr-card-title {
  font-size: 2cqw;
  font-weight: 700;
}

.lr-card-price {
  font-size: 2.8cqw;
  font-weight: 900;
  color: var(--c-bg);
}

.lr-card-point {
  font-size: 1.3cqw;
  color: var(--c-text-muted);
  line-height: 1.6;
}

.lr-card-point::before {
  content: '・';
}

/* ── Item Link ── */
.item-link {
  text-decoration: none;
  cursor: pointer;
  position: relative;
  z-index: 60;
  transition: transform 150ms, box-shadow 150ms;
}

.item-link:hover {
  transform: translateY(-0.3cqw);
  box-shadow: 0 0.6cqw 2cqw var(--c-card-shadow);
}

/* ── Footer Link ── */
.footer-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.3cqw;
  position: relative;
  z-index: 60;
  transition: opacity 150ms;
}

.footer-link:hover {
  opacity: 1;
}

/* ── Footer ── */
.slide-footer {
  margin-top: auto;
  padding-top: 2cqw;
  font-size: 1.1cqw;
  line-height: 1.7;
  opacity: 0.65;
  white-space: pre-line;
}

/* ── Status Bar ── */
.status-bar {
  position: absolute;
  top: 1.5cqw;
  right: 2cqw;
  display: flex;
  align-items: center;
  gap: 1.5cqw;
  z-index: 100;
}

.status-info {
  font-size: 1cqw;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 0.8cqw;
}

.menu-btn {
  width: 2.5cqw;
  height: 2.5cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.8cqw;
  border-radius: 0.4cqw;
  transition: color 150ms;
}

.menu-btn:hover {
  color: #fff;
}

/* ── Sidebar ── */
.sidebar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  z-index: 200;
}

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

.sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 30cqw;
  height: 100%;
  background: var(--c-card);
  transform: translateX(100%);
  transition: transform 300ms ease;
  z-index: 210;
  display: flex;
  flex-direction: column;
  padding: 3cqw;
  overflow-y: auto;
}

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

.sidebar-title {
  font-size: 1.5cqw;
  font-weight: 700;
  margin-bottom: 2cqw;
  padding-bottom: 1cqw;
  border-bottom: 1px solid rgba(27, 27, 27, 0.1);
  color: var(--c-text);
}

.sidebar-agenda {
  margin-bottom: 1.5cqw;
}

.sidebar-agenda-label {
  font-size: 1.1cqw;
  font-weight: 700;
  color: var(--c-text-faint);
  margin-bottom: 0.5cqw;
  display: flex;
  justify-content: space-between;
}

.sidebar-slide-item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 1cqw;
  padding: 0.5cqw 0.8cqw;
  border: none;
  background: transparent;
  color: var(--c-text);
  cursor: pointer;
  border-radius: 0.3cqw;
  line-height: 1.4;
  font-family: 'Noto Sans JP', sans-serif;
  transition: background 100ms;
}

.sidebar-slide-item:hover {
  background: rgba(212, 132, 90, 0.08);
}

.sidebar-slide-item.current {
  background: rgba(212, 132, 90, 0.15);
  color: var(--c-bg-dark);
  font-weight: 700;
}

/* ── Talk Script ── */
.script-trigger {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3cqw;
  z-index: 150;
}

.script-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 30%;
  background: rgba(27, 27, 27, 0.94);
  color: #f0eeeb;
  padding: 2cqw 3cqw;
  font-size: 1.3cqw;
  line-height: 1.8;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 200ms ease;
  z-index: 160;
  white-space: pre-line;
  backdrop-filter: blur(8px);
}

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

/* ── Navigation Areas ── */
.nav-left,
.nav-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 50;
  cursor: pointer;
}

.nav-left { left: 0; }
.nav-right { right: 0; }

/* ── Slide Counter ── */
.slide-counter {
  position: absolute;
  bottom: 1.5cqw;
  right: 2cqw;
  font-size: 1cqw;
  color: rgba(255, 255, 255, 0.25);
  z-index: 90;
}

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