/* ============================================================
   layout.css — Stage layout & utility classes
   Slim header/footer, max middle stage. Asymmetric, intentional.
   ============================================================ */

/* ---------- Deck container — sits between header and footer ---------- */
.deck {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: var(--footer-h);
  overflow: hidden;
  z-index: 3;
  background: var(--canvas);
}

/* ---------- Slide base ---------- */
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: var(--stage-pad-y) var(--stage-pad-x);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
  z-index: 1;
  overflow: hidden;
}

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

.slide-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vh, 2rem);
  max-width: 1600px;
  margin: 0 auto;
}

/* ---------- Layout variants ---------- */
.slide--center .slide-inner {
  justify-content: center;
  align-items: flex-start;
}

.slide--center-axis .slide-inner {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.slide--stack .slide-inner {
  justify-content: flex-start;
}

.slide--split .slide-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: minmax(0, 1fr);  /* constrain row to stage height */
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.slide--split-balanced .slide-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

/* Columns must respect the row height — no overflow, no spillover. */
.slide--split .slide-inner > *,
.slide--split-balanced .slide-inner > * {
  min-height: 0;
  max-height: 100%;
}

/* When a column hosts a blueprint, let it stretch to fill the cell so the
   SVG inside can scale-to-fit. */
.slide--split .slide-inner > .blueprint,
.slide--split .slide-inner > .blueprint--bordered,
.slide--split-balanced .slide-inner > .blueprint,
.slide--split-balanced .slide-inner > .blueprint--bordered {
  align-self: stretch;
  height: 100%;
}

.slide--diagram .slide-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(1rem, 2vh, 2rem);
}

/* The diagram pane is the middle row — let it shrink to fit the stage. */
.slide--diagram .blueprint,
.slide--diagram .blueprint--bordered {
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide--diagram .blueprint svg {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Iconic slides (big visual, almost no text) ---------- */
.slide.iconic .slide-inner {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  justify-items: stretch;
  gap: clamp(0.75rem, 2vh, 1.5rem);
  text-align: center;
}

/* The hidden slide-head (eyebrow lives in the header band) must NOT take a
   row of the grid — flatten it so only iconic-stage + iconic-line layout. */
.slide.iconic .slide-head {
  display: contents;
}

.iconic-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iconic-stage svg {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.iconic-line {
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  font-size: clamp(1.625rem, 3vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 32ch;
  margin: 0 auto;
}

/* ---------- Actor cards (slide 17 — roles) ---------- */
.actor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  border: 1px solid var(--rule-2);
  background: var(--canvas-tint);
  position: relative;
}

.actor__icon {
  width: 44px;
  height: 44px;
  color: var(--punch);
  margin-bottom: 0.25rem;
}

.actor__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.actor__role {
  font-family: 'Geist', sans-serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}

.actor__desc {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.0625rem);
  line-height: 1.4;
  color: var(--ink-3);
}

.actor__caps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.actor__caps li {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.875rem, 1.05vw, 1rem);
  line-height: 1.45;
  color: var(--ink-2);
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.actor__caps li::before {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: var(--punch);
  margin-top: 0.5em;
}

/* ---------- Cover slide (logo-led, near-textless) ---------- */
.slide.cover .slide-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
}

.cover-corner {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--ink-muted);
}

.cover-corner--top    { align-self: start;  }
.cover-corner--bottom { align-self: end;    }

.cover-corner__rule {
  flex: 1;
  height: 1px;
  background: var(--rule-2);
  max-width: 280px;
}

.cover-stage {
  display: flex;
  flex-direction: column;
  align-items: center;       /* center the logo and tagline horizontally */
  justify-content: center;
  gap: clamp(1.5rem, 3.5vh, 3rem);
  width: 100%;
  text-align: center;
}

.cover-logo {
  height: clamp(96px, 18vh, 200px);
  width: auto;
  display: block;
}

.cover-tagline {
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  font-size: clamp(1.375rem, 2.5vw, 2.25rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink-2);
  max-width: 36ch;
  margin: 0 auto;
}

/* ---------- Slide head ---------- */
.slide-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 60ch;
}

.slide-head--wide { max-width: 90ch; }
.slide-head--full { max-width: none; }

/* Eyebrows are now surfaced in the running header band. Hide them in the
   slide body (wherever they live — slide-head, stack, etc.) to avoid the
   duplicate. JS can still read the text content for the header. */
.slide .eyebrow { display: none; }

/* Diagram slides need every pixel — tighten their stage padding. */
.slide--diagram {
  padding-top: clamp(1rem, 2.5vh, 2rem);
  padding-bottom: clamp(1rem, 2.5vh, 2rem);
}

.slide--diagram .slide-head {
  gap: 0.5rem;
}

/* ---------- Stage frame — for slides where content sits inside a bordered area ---------- */
.stage-frame {
  border: 1px solid var(--rule-2);
  background: var(--canvas-tint);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  position: relative;
}

.stage-frame--inverse {
  background: var(--inverse-bg);
  border-color: var(--inverse-bg);
  color: var(--inverse-text);
}

/* Scoped color inversion for nested type classes */
.stage-frame--inverse .title,
.stage-frame--inverse .subtitle,
.stage-frame--inverse .display { color: var(--inverse-text); }

.stage-frame--inverse .lede,
.stage-frame--inverse .body,
.stage-frame--inverse .pull { color: var(--inverse-muted); }

.stage-frame--inverse .caption,
.stage-frame--inverse .mono,
.stage-frame--inverse .footnote { color: var(--inverse-muted); }

.stage-frame--inverse .footnote-mark,
.stage-frame--inverse .text-punch { color: var(--punch-soft); }

.stage-frame--inverse .hairline { background: var(--rule-inverse); }
.stage-frame--inverse .hairline--accent { background: var(--punch); }
.stage-frame--inverse .eyebrow { color: var(--punch-soft); }
.stage-frame--inverse .eyebrow::before { background: var(--punch-soft); }
.stage-frame--inverse .slash { color: var(--punch-soft); }

/* ---------- Grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.25rem, 2.5vw, 2.5rem); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 2rem); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(0.875rem, 1.6vw, 1.5rem); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(0.875rem, 1.4vw, 1.25rem); }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(0.75rem, 1.2vw, 1rem); }

/* Asymmetric editorial grid */
.grid-asym {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.row {
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  align-items: flex-start;
}

.row--center { align-items: center; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack--tight { gap: 0.5rem; }
.stack--loose { gap: 1.75rem; }
.stack--xloose { gap: 2.5rem; }

/* ---------- Service card ---------- */
.svc-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(1rem, 1.6vw, 1.4rem);
  background: var(--canvas-tint);
  border: 1px solid var(--rule);
  position: relative;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
  min-height: 0;
}

.svc-card:hover {
  border-color: var(--rule-2);
  background: var(--canvas);
}

.svc-card--accent {
  border-color: var(--punch);
  background: rgba(196, 74, 46, 0.04);
}

.svc-card--inverse {
  background: var(--inverse-bg);
  color: var(--inverse-text);
  border-color: var(--inverse-bg);
}

.svc-card--inverse .svc-card__label { color: var(--inverse-text); }
.svc-card--inverse .svc-card__desc  { color: var(--inverse-muted); }
.svc-card--inverse .svc-card__index { color: var(--punch-soft); }

.svc-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.svc-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--punch);
  font-size: 22px;
}

.svc-card__icon svg,
.svc-card__icon iconify-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.svc-card__index {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 500;
}

.svc-card__label {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.2;
}

.svc-card__desc {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.8125rem, 0.95vw, 0.9375rem);
  line-height: 1.5;
  color: var(--ink-3);
}

.svc-card__tag {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* ---------- Group header for card sections ---------- */
.group-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.group-head__label {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.group-head__count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0;
}

.group-head__rule {
  flex: 1;
  height: 1px;
  background: var(--rule-2);
}

/* ---------- Numbered list ---------- */
.numbered {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vh, 1.75rem);
  list-style: none;
}

.numbered__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem;
  align-items: baseline;
}

/* Safety net — if a slide forgets the .numbered__body wrapper, the title and
   desc still stack neatly in column 2 instead of spreading across both. */
.numbered__item > .numbered__title,
.numbered__item > .numbered__desc {
  grid-column: 2;
}

.numbered__num {
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  font-size: 1.625rem;
  color: var(--punch);
  line-height: 1;
  min-width: 1.5em;
  letter-spacing: -0.04em;
}

.numbered__body { display: flex; flex-direction: column; gap: 0.25rem; }

.numbered__title {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: clamp(1.125rem, 1.4vw, 1.375rem);
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.018em;
}

.numbered__desc {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.9375rem, 1.1vw, 1.0625rem);
  line-height: 1.55;
  color: var(--ink-3);
}

/* ---------- Hairlines ---------- */
.hairline { width: 100%; height: 1px; background: var(--rule-2); border: 0; }
.hairline--strong { background: var(--rule-strong); }
.hairline--accent { background: var(--punch); width: 2.5rem; height: 2px; }
.hairline--short  { width: 2.5rem; }

/* ---------- Chips / tags ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--rule-2);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  background: var(--canvas-tint);
}

.chip--accent {
  border-color: var(--punch);
  color: var(--punch);
  background: rgba(196, 74, 46, 0.04);
}

.chip--inverse {
  background: var(--ink);
  color: var(--canvas);
  border-color: var(--ink);
}

/* ---------- Comparison row ---------- */
.compare {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}

.compare__label {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--ink-2);
}

.compare__yes,
.compare__no {
  font-family: 'Geist', sans-serif;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
}

.compare__yes { color: var(--punch); }
.compare__no  { color: var(--ink-faint); }
.compare__partial { color: var(--ink-3); font-size: 0.75rem; letter-spacing: 0.02em; text-transform: none; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.slide.active .reveal {
  opacity: 1;
  transform: translateY(0);
}

.slide.active .reveal:nth-child(1)  { transition-delay: 0.05s; }
.slide.active .reveal:nth-child(2)  { transition-delay: 0.13s; }
.slide.active .reveal:nth-child(3)  { transition-delay: 0.22s; }
.slide.active .reveal:nth-child(4)  { transition-delay: 0.30s; }
.slide.active .reveal:nth-child(5)  { transition-delay: 0.38s; }
.slide.active .reveal:nth-child(6)  { transition-delay: 0.46s; }
.slide.active .reveal:nth-child(7)  { transition-delay: 0.54s; }
.slide.active .reveal:nth-child(8)  { transition-delay: 0.62s; }
.slide.active .reveal:nth-child(9)  { transition-delay: 0.70s; }
.slide.active .reveal:nth-child(10) { transition-delay: 0.78s; }

.reveal[data-delay="1"] { transition-delay: 0.15s !important; }
.reveal[data-delay="2"] { transition-delay: 0.25s !important; }
.reveal[data-delay="3"] { transition-delay: 0.35s !important; }
.reveal[data-delay="4"] { transition-delay: 0.45s !important; }
.reveal[data-delay="5"] { transition-delay: 0.55s !important; }
.reveal[data-delay="6"] { transition-delay: 0.65s !important; }
.reveal[data-delay="7"] { transition-delay: 0.75s !important; }
.reveal[data-delay="8"] { transition-delay: 0.85s !important; }

/* ---------- Utilities ---------- */
.text-punch  { color: var(--punch); }
.text-muted  { color: var(--ink-muted); }
.text-soft   { color: var(--ink-3); }
.italic      { font-style: italic; }
.flex-1      { flex: 1; }
.ml-auto     { margin-left: auto; }
.mt-auto     { margin-top: auto; }

/* ---------- Tag badges ---------- */
.tag {
  font-family: 'Geist', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

/* ---------- Annotation / footnote ---------- */
.footnote {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-muted);
  letter-spacing: 0;
}

.footnote-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--punch);
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
}

/* ---------- Stat tile ---------- */
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: clamp(1rem, 2vw, 1.75rem) clamp(1rem, 1.6vw, 1.5rem);
  border-left: 1px solid var(--rule-2);
  position: relative;
}

.stat-tile:first-child { border-left: 0; padding-left: 0; }

.stat-tile__head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}

.stat-tile__num {
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  font-size: clamp(2.5rem, 5.4vw, 4.5rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.stat-tile__unit {
  font-size: 0.5em;
  color: var(--punch);
  font-weight: 400;
  margin-left: 0.05em;
}

.stat-tile__label {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stat-tile__sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.45;
  margin-top: 0.25rem;
}

/* ---------- Step flow ---------- */
.step-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  align-items: stretch;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-left: 1px solid var(--rule-2);
  position: relative;
}

.step:first-child { border-left: 0; padding-left: 0; }

.step__num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--punch);
  letter-spacing: 0.06em;
}

.step__label {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.step__desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

/* ---------- Responsive ---------- */

/* iPad Pro 11" landscape (~1194x834) — tighten paddings so grids breathe
   and 5-col layouts stay legible without overlapping. */
@media (max-width: 1280px) {
  :root {
    --stage-pad-x: clamp(1.5rem, 4vw, 3rem);
    --stage-pad-y: clamp(1rem, 3vh, 2.25rem);
  }

  .slide--split .slide-inner,
  .slide--split-balanced .slide-inner {
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  /* Services grid (10 cards) — 5-col is too tight on iPad; use 5x2 with
     compact padding rather than dropping to fewer columns. */
  .grid-5 { gap: 0.75rem; }
  .svc-card { padding: 0.85rem 0.9rem; gap: 0.5rem; }
  .svc-card__desc { font-size: 0.8125rem; line-height: 1.4; }
}

/* iPad portrait / narrow laptops */
@media (max-width: 900px) {
  .slide--split .slide-inner,
  .slide--split-balanced .slide-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-asym { grid-template-columns: 1fr; }
}

/* Phones */
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  :root { --header-h: 44px; --footer-h: 44px; }
}
