:root {
  color-scheme: light;
  --bg: #e9dfcd;
  --panel: #f3ebdc;
  --panel-2: #e4dac7;
  --line: rgba(28, 27, 23, 0.24);
  --line-strong: rgba(28, 27, 23, 0.58);
  --text: #171612;
  --muted: #69645b;
  --rust: #b65332;
  --cyan: #287b78;
  --teal: #287b78;
  --amber: #b65332;
  --red: #b65332;
  --purple: #3f7770;
  --green: #708f43;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 24%, rgba(182, 83, 50, 0.06), transparent 30rem),
    repeating-linear-gradient(0deg, rgba(55, 47, 35, 0.018) 0, rgba(55, 47, 35, 0.018) 1px, transparent 1px, transparent 4px),
    var(--bg);
  color: var(--text);
  font-family: Helvetica, Arial, sans-serif;
}

button {
  font: inherit;
}

#deck {
  height: 100%;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 82px;
  padding: 0 28px;
}

.topbar,
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  border-bottom: 1px solid var(--line);
}

.brand,
.top-actions,
.transport {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.22em;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border: 2px solid var(--cyan);
  border-radius: 4px;
  transform: rotate(45deg);
  box-shadow: none;
}

.brand-sub {
  color: var(--muted);
  font-weight: 500;
}

.top-actions {
  gap: 16px;
}

.ghost-button,
.round-button,
.play-button {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.ghost-button:hover,
.round-button:hover,
.play-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.24);
}

.ghost-button {
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slide-counter {
  color: var(--muted);
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
}

.stage-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(235px, 0.52fr) minmax(600px, 1.75fr);
  gap: clamp(22px, 3vw, 48px);
  align-items: center;
  padding: 24px 0;
}

.copy-panel {
  max-width: 350px;
  padding-left: clamp(0px, 2vw, 28px);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--rust);
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  max-width: 9.5em;
  margin: 0;
  font-size: clamp(38px, 4.25vw, 68px);
  line-height: 0.94;
  letter-spacing: -0.06em;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 800;
  text-wrap: balance;
}

h1.compact-title {
  font-size: clamp(36px, 4.05vw, 62px);
}

.subtitle {
  max-width: 37em;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.45;
}

.facts {
  display: none;
  gap: 10px;
  margin-top: 30px;
}

.fact {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.fact::before {
  content: attr(data-index);
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--cyan);
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.speaker-note {
  display: none;
}

.visual-panel {
  position: relative;
  min-height: 0;
  height: min(70vh, 720px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(rgba(38, 35, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 35, 29, 0.035) 1px, transparent 1px),
    var(--panel);
  background-size: 32px 32px, 32px 32px, auto, auto;
  box-shadow: 8px 10px 0 rgba(83, 68, 44, 0.08);
}

#scene {
  width: 100%;
  height: 100%;
  display: block;
}

.visual-label {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font: 600 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

.controls {
  position: relative;
  border-top: 1px solid var(--line);
}

.transport {
  gap: 8px;
}

.round-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.play-button {
  min-width: 74px;
  height: 38px;
  border-radius: 999px;
  color: var(--rust);
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slide-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 62vw;
}

.nav-item {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 22, 18, 0.25);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.nav-item.active {
  width: 32px;
  background: var(--rust);
}

.progress-track {
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: transparent;
}

#progressBar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--rust);
}

body.clean #deck {
  grid-template-rows: 0 minmax(0, 1fr) 0;
  padding: 0;
}

body.clean .topbar,
body.clean .controls,
body.clean .copy-panel,
body.clean .visual-label {
  display: none;
}

body.clean .stage-shell {
  display: block;
  padding: 0;
}

body.clean .visual-panel {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

@media (max-width: 950px) {
  #deck {
    grid-template-rows: 58px minmax(0, 1fr) 72px;
    padding: 0 16px;
  }

  .stage-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(340px, 1fr);
    gap: 16px;
    padding: 14px 0;
  }

  .copy-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    max-width: none;
  }

  .eyebrow,
  h1 {
    grid-column: 1;
  }

  .subtitle,
  .facts,
  .speaker-note {
    grid-column: 2;
  }

  .subtitle {
    grid-row: 1 / span 2;
    margin-top: 0;
  }

  .facts {
    display: none;
  }

  .speaker-note {
    margin-top: 12px;
  }

  .visual-panel {
    height: auto;
  }
}

@media (max-height: 800px) and (min-width: 951px) {
  #deck {
    grid-template-rows: 52px minmax(0, 1fr) 62px;
  }

  .stage-shell {
    gap: 28px;
    padding: 14px 0;
  }

  h1 {
    font-size: clamp(36px, 4.2vw, 60px);
  }

  h1.compact-title {
    font-size: clamp(32px, 3.55vw, 50px);
  }

  .subtitle {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.45;
  }

  .facts {
    gap: 6px;
    margin-top: 18px;
  }

  .fact {
    font-size: 10px;
  }

  .speaker-note {
    margin-top: 16px;
    font-size: 10px;
  }

  .visual-panel {
    height: min(72vh, 620px);
  }
}

@media (max-width: 650px) {
  .brand-sub,
  .ghost-button,
  .speaker-note,
  .slide-nav {
    display: none;
  }

  .stage-shell {
    grid-template-rows: auto minmax(300px, 1fr);
  }

  .copy-panel {
    display: block;
  }

  h1 {
    font-size: 38px;
  }

  .subtitle {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===================== EXTENDED DECK: html / photo / iframe slides ===================== */
.html-layer {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  background: #eceae1;
}
.html-layer.show { display: block; }

.dstage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  transform: translate(-50%, -50%) scale(var(--dscale, 1));
  transform-origin: center center;
}

.dslide {
  position: absolute;
  inset: 0;
  background: #eceae1;
  color: #1b1a16;
  font-family: Helvetica, Arial, sans-serif;
  overflow: hidden;
}
.dslide .pad {
  position: absolute;
  inset: 0;
  padding: 52px 64px;
  display: flex;
  flex-direction: column;
}

.dhead { display: flex; align-items: center; gap: 11px; flex: none; }
.dmark { width: 22px; height: 22px; border: 2.5px solid #1b1a16; display: grid; place-items: center; flex: none; }
.dmark i { width: 9px; height: 9px; background: #b65332; display: block; }
.dbrand { font: 700 15px/1 ui-monospace, Menlo, monospace; letter-spacing: .02em; color: #1b1a16; }
.dhead .sub { font: 600 11px/1 ui-monospace, Menlo, monospace; letter-spacing: .18em; color: #9a948a; text-transform: uppercase; margin-left: 4px; }
.dhead .live { margin-left: auto; font: 600 11px/1 ui-monospace, Menlo, monospace; letter-spacing: .16em; color: #708f43; }
.dhline { height: 1px; background: rgba(28, 27, 23, .2); margin-top: 16px; flex: none; }

.dkick { font: 700 13px/1 ui-monospace, Menlo, monospace; letter-spacing: .24em; color: #9a948a; text-transform: uppercase; margin: 0; }
.dh1 { font-weight: 800; font-size: 52px; line-height: 1.02; letter-spacing: -.035em; margin: 0; color: #1b1a16; }
.dh1.big { font-size: 78px; }
.accent { color: #b65332; }
.dlede { font-size: 23px; line-height: 1.42; color: #2a2723; font-weight: 500; margin: 0; }
.dbody { font-size: 17px; line-height: 1.5; color: #46423a; margin: 0; }
.dnum { font: 700 14px/1 ui-monospace, Menlo, monospace; color: #bcb4a4; }
.dlabel { font: 700 13px/1 ui-monospace, Menlo, monospace; letter-spacing: .06em; color: #2a2723; text-transform: uppercase; }
.dmuted { color: #6b665c; }
.dfoot { font-weight: 700; font-size: 18px; color: #1b1a16; }

.dcols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 46px; }
.dcol .ln { height: 1px; background: rgba(28, 27, 23, .5); margin-bottom: 16px; }

.dframe { position: absolute; inset: 0; border: 0; width: 100%; height: 100%; background: #eceae1; }
.dimg { display: block; width: 100%; height: 100%; object-fit: cover; }
.dimg.contain { object-fit: contain; }
.bw { filter: grayscale(1) contrast(1.03); }

.dlegend-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid rgba(28, 27, 23, .14); }
.dlegend-row .name { display: flex; align-items: center; gap: 11px; font: 700 15px/1 ui-monospace, Menlo, monospace; letter-spacing: .02em; }
.dlegend-row .sw { width: 13px; height: 13px; flex: none; }
.dlegend-row .meta { font: 500 13px/1 ui-monospace, Menlo, monospace; color: #8a8577; }

.dtile { position: relative; background: #e3ddcd; border: 1px solid rgba(28, 27, 23, .18); overflow: hidden; display: grid; place-items: center; }
.dtile .tlabel { position: absolute; bottom: 0; left: 0; right: 0; padding: 10px 12px; font: 700 11px/1.3 ui-monospace, Menlo, monospace; letter-spacing: .12em; color: #6b665c; text-transform: uppercase; background: linear-gradient(transparent, rgba(236, 234, 225, .92)); text-align: center; }
.dtile iframe { width: 100%; height: 100%; border: 0; display: block; }
