/* ============================================================
   SLIDESHOW LAYOUT — Strict 100vh Viewport Fitting
   Every slide fits completely within the screen without scrolling.
   ============================================================ */

/* ── Body: no page scroll ─────────────────────────────────── */
html, body {
  overflow: hidden;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* ── Slide deck wrapper ───────────────────────────────────── */
.slide-deck {
  position: fixed;
  inset: 0;
  overflow: hidden;
  width: 100vw;
  height: 100dvh;
}

/* ── Main content (slide container) ──────────────────────── */
#main-content {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ── Each scene = one self-contained slide ────────────────── */
.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden; /* No inner scroll on presentation slides */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--scene-py) var(--scene-px);
  padding-right: calc(var(--scene-px) + var(--nav-w));
  box-sizing: border-box;

  /* Hidden by default */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 1;
}

.scene.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: all;
  z-index: 10;
}

/* ── Dark / Light variants with Notebook Grid ─────────────── */
.scene--dark {
  background-color: var(--grid-paper-dark);
  color: var(--c-light-text);
  background-image:
    /* Technical registration margin line on left */
    linear-gradient(to right, transparent calc(var(--scene-px) - 1.25rem), var(--grid-margin-dark) calc(var(--scene-px) - 1.25rem), var(--grid-margin-dark) calc(var(--scene-px) - 1.25rem + 1px), transparent calc(var(--scene-px) - 1.25rem + 1px)),
    /* Technical blueprint CAD grid */
    linear-gradient(to right, var(--grid-line-dark) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-dark) 1px, transparent 1px);
  background-size: 100% 100%, var(--grid-size) var(--grid-size), var(--grid-size) var(--grid-size);
}

.scene--light {
  background-color: var(--grid-paper-light);
  color: var(--c-ink);
  background-image:
    /* Authentic vintage notebook red margin line */
    linear-gradient(to right, transparent calc(var(--scene-px) - 1.25rem), var(--grid-margin-red) calc(var(--scene-px) - 1.25rem), var(--grid-margin-red) calc(var(--scene-px) - 1.25rem + 1.5px), transparent calc(var(--scene-px) - 1.25rem + 1.5px)),
    /* Notebook square graph grid (classic Seyès / engineering blue) */
    linear-gradient(to right, var(--grid-line-blue) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-blue) 1px, transparent 1px);
  background-size: 100% 100%, var(--grid-size) var(--grid-size), var(--grid-size) var(--grid-size);
}

/* ── Inner containers ─────────────────────────────────────── */
.scene__inner {
  position: relative;
  width: 100%;
  max-width: var(--max-w-content);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: calc(100dvh - var(--scene-py) * 2);
  box-sizing: border-box;
}

.scene__inner--center {
  align-items: center;
  text-align: center;
}

.scene__inner--narrow {
  max-width: var(--max-w-narrow);
}

.scene__inner--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}

/* ── Chapter number label ─────────────────────────────────── */
.scene__chapter-num {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--ls-wider);
  color: var(--c-ink-muted);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
}

.scene__chapter-num--light {
  color: rgba(242, 241, 238, 0.4);
}

/* ── Year badge ───────────────────────────────────────────── */
.year-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-3);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--ls-wide);
  color: var(--c-ink-mid);
}

/* ── Period timeline bar ──────────────────────────────────── */
.period-year {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--ls-wide);
  color: var(--c-ink-muted);
}

.period-year--light {
  color: rgba(242, 241, 238, 0.5);
}

.period-line {
  flex: 1;
  height: 1px;
  background: var(--c-rule);
  position: relative;
  overflow: hidden;
}

.period-line--light {
  background: var(--c-rule-dark);
}

.period-line__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--c-ink-muted);
}

/* ── Brand Logos in Headers & Cards ───────────────────────── */
.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--c-white);
  padding: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-rule);
  flex-shrink: 0;
}

.brand-logo-img--dark {
  background: var(--c-dark-alt);
  border-color: var(--c-rule-dark);
}

/* ── Real Asset Showcase Containers ───────────────────────── */
.showcase-banner {
  width: 100%;
  height: clamp(140px, 24vh, 220px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--c-rule);
  background: var(--c-bg-alt);
  margin-top: var(--space-4);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.showcase-banner--dark {
  background: var(--c-dark-alt);
  border-color: var(--c-rule-dark);
}

.showcase-banner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ── Bespoke iPhone Device Mockups ────────────────────────── */
.device-strip {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  align-items: center;
  margin-top: var(--space-2);
}

.phone-mockup {
  position: relative;
  border-radius: var(--mockup-radius);
  padding: var(--mockup-bezel);
  background: #1e1e24;
  box-shadow: var(--mockup-shadow);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  cursor: pointer;
}

.phone-mockup:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 24px 48px -6px rgba(0,0,0,0.35), 0 0 0 1px var(--c-accent);
}

.phone-mockup__island {
  position: absolute;
  top: calc(var(--mockup-bezel) + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 9px;
  background: #000000;
  border-radius: 20px;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.phone-mockup__screen {
  position: relative;
  border-radius: calc(var(--mockup-radius) - var(--mockup-bezel));
  overflow: hidden;
  display: block;
  height: clamp(155px, 27vh, 220px);
  background: #000;
}

.phone-mockup__screen img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: cover;
}

.phone-mockup__glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.03) 35%, transparent 60%);
  pointer-events: none;
  border-radius: calc(var(--mockup-radius) - var(--mockup-bezel));
}

/* ── Tech Tags ────────────────────────────────────────────── */
.tech-tag {
  display: inline-flex;
  padding: 2px 8px;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--c-ink-mid);
}

/* ── Discipline Pills ─────────────────────────────────────── */
.discipline-pill {
  display: inline-flex;
  padding: 4px var(--space-3);
  border: 1px solid var(--c-rule);
  border-radius: 100px;
  font-size: var(--text-xs);
  color: var(--c-ink-mid);
  background: var(--c-white);
}

/* ── Slide counter ────────────────────────────────────────── */
.slide-counter {
  position: fixed;
  bottom: var(--space-6);
  left: var(--scene-px);
  z-index: var(--z-nav);
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--ls-wide);
  pointer-events: none;
  transition: color 0.4s ease;
}

.slide-counter__current {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--c-light-text);
}

body.scene-is-light .slide-counter__current {
  color: var(--c-ink);
}

.slide-counter__sep,
.slide-counter__total {
  color: rgba(242, 241, 238, 0.3);
}

body.scene-is-light .slide-counter__sep,
body.scene-is-light .slide-counter__total {
  color: var(--c-ink-muted);
}

/* ── Slide prev/next buttons ──────────────────────────────── */
.slide-controls {
  position: fixed;
  bottom: var(--space-6);
  right: calc(var(--scene-px) + var(--nav-w));
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.slide-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(242, 241, 238, 0.2);
  background: transparent;
  color: rgba(242, 241, 238, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.slide-nav:hover:not(:disabled) {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(217, 79, 44, 0.08);
}

.slide-nav:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

body.scene-is-light .slide-nav {
  border-color: rgba(26, 26, 26, 0.18);
  color: var(--c-ink-muted);
}

body.scene-is-light .slide-nav:hover:not(:disabled) {
  border-color: var(--c-ink);
  color: var(--c-ink);
  background: rgba(26, 26, 26, 0.05);
}

/* ── Hint label bottom center ─────────────────────────────── */
.slide-hint {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  font-size: 11px;
  letter-spacing: var(--ls-wider);
  color: rgba(242, 241, 238, 0.3);
  pointer-events: none;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

body.scene-is-light .slide-hint {
  color: rgba(26, 26, 26, 0.3);
}

/* ── Presentation Controls: Fullscreen & Shortcuts Modal ── */
.slide-nav--action {
  font-size: 13px;
  font-weight: var(--weight-medium);
}

.shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(12, 12, 11, 0.78);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease-out), visibility 0.22s var(--ease-out);
}

.shortcuts-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.shortcuts-modal__box {
  background: #141413;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  max-width: 440px;
  width: 90%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color: var(--c-light-text);
  transform: scale(0.96);
  transition: transform 0.22s var(--ease-spring);
}

.shortcuts-modal.is-open .shortcuts-modal__box {
  transform: scale(1);
}

.shortcuts-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: var(--space-3);
}

.shortcuts-modal__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--ls-tight);
}

.shortcuts-modal__close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color var(--dur-fast);
}

.shortcuts-modal__close:hover {
  color: var(--c-light-text);
}

.shortcuts-modal__list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  font-size: var(--text-sm);
  align-items: center;
}

.shortcuts-modal__list dt {
  color: rgba(242, 241, 238, 0.7);
}

.shortcuts-modal__list dd {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-family: inherit;
  font-weight: var(--weight-medium);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ── Progress Bar Milestones ──────────────────────────────── */
.progress-milestones {
  position: fixed;
  top: 6px;
  left: 0;
  right: 0;
  z-index: var(--z-progress);
  display: flex;
  justify-content: space-between;
  padding: 0 var(--scene-px);
  pointer-events: none;
}

.progress-milestone {
  font-size: 10px;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: rgba(242, 241, 238, 0.3);
  transition: color 0.4s ease;
}

body.scene-is-light .progress-milestone {
  color: rgba(26, 26, 26, 0.28);
}

/* ── Cursor Spotlight (Active on Dark and Light Slides) ─── */
.cursor-spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-glow);
  opacity: 1;
  transition: opacity 0.5s ease;
}

/* ── Responsive adjustments for laptops & smaller screens ─── */
@media (max-height: 750px) {
  .scene {
    padding-top: var(--space-3);
    padding-bottom: var(--space-8);
  }
  .showcase-banner {
    height: clamp(110px, 18vh, 160px);
  }
  .device-frame {
    height: clamp(120px, 20vh, 170px);
  }
}

@media (max-width: 1024px) {
  .scene {
    padding-right: var(--scene-px);
    padding-bottom: calc(var(--scene-py) + 3.5rem);
    overflow-y: auto; /* Fallback for touch devices */
  }

  .scene__inner--split {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .slide-controls {
    right: var(--space-4);
    bottom: calc(56px + var(--space-3));
  }

  .slide-counter {
    left: var(--space-4);
    bottom: calc(56px + var(--space-3));
  }

  .slide-hint {
    bottom: calc(56px + var(--space-3));
  }
}
