/* PM Deck and Writing Skills: the Acme pilot deck. Vanilla CSS, no build step.
   Two render modes share one markup:
   - stage mode (script on, viewport wider than 720px): a fixed 1280 by 720 stage, scaled to fit
   - flow mode (phones, script off, print): slides reflow with fluid type */

:root {
  --paper: #F2F3F0;
  --card: #FFFFFF;
  --ink: #1A1E23;
  --ink-2: #4D545C;
  --line: rgba(26, 30, 35, 0.14);
  --deep: #13213B;
  --deep-2: #1B2C4C;
  --on-deep: #F4F6F9;
  --on-deep-2: rgba(244, 246, 249, 0.74);
  --line-deep: rgba(244, 246, 249, 0.18);
  --mark: #D84A1B;
  --mark-text: #B83C12;
  --mark-deep: #FF8A5C;
  --hatch: rgba(216, 74, 27, 0.55);
  --page: #E3E5E1;
  --chrome-ink: #1A1E23;
  --chrome-ink-2: #5B636C;
  --chrome-line: rgba(26, 30, 35, 0.16);
  --focus: #1D4ED8;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --scale: 1;

  /* Stage tokens: px inside the 1280 by 720 stage. Flow mode overrides them below. */
  --pad-x: 72px;
  --pad-y: 56px;
  --t-cover: 84px;
  --t-title: 46px;
  --t-sub: 22px;
  --t-eyebrow: 16px;
  --t-body: 19px;
  --t-card: 17px;
  --t-h3: 22px;
  --t-big: 168px;
  --t-fact: 40px;
  --t-take: 17px;
  --t-source: 12px;
  --t-list: 24px;
  --gap: 28px;
  --body-top: 36px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C2129;
    --card: #262C36;
    --ink: #EEF1F4;
    --ink-2: #A9B2BD;
    --line: rgba(238, 241, 244, 0.16);
    --deep: #0D1524;
    --deep-2: #172238;
    --mark: #FF8A5C;
    --mark-text: #FF9A72;
    --hatch: rgba(255, 138, 92, 0.5);
    --page: #070B12;
    --chrome-ink: #EEF1F4;
    --chrome-ink-2: #A9B2BD;
    --chrome-line: rgba(238, 241, 244, 0.16);
    --focus: #93C5FD;
  }
}

/* Flow tokens: phones and script-off rendering */
@media (max-width: 720px) {
  :root {
    --pad-x: 20px;
    --pad-y: 28px;
    --t-cover: 2.4rem;
    --t-title: 1.75rem;
    --t-sub: 1.05rem;
    --t-eyebrow: 0.9rem;
    --t-body: 1rem;
    --t-card: 0.95rem;
    --t-h3: 1.1rem;
    --t-big: 5.5rem;
    --t-fact: 1.8rem;
    --t-take: 1rem;
    --t-source: 0.78rem;
    --t-list: 1.1rem;
    --gap: 16px;
    --body-top: 20px;
  }
}
html:not(.js) {
  --pad-x: clamp(20px, 5vw, 72px);
  --pad-y: 32px;
  --t-cover: clamp(2.4rem, 6vw, 5rem);
  --t-title: clamp(1.75rem, 3.4vw, 2.8rem);
  --t-sub: 1.15rem;
  --t-eyebrow: 1rem;
  --t-body: 1.05rem;
  --t-card: 1rem;
  --t-h3: 1.2rem;
  --t-big: clamp(5rem, 12vw, 9rem);
  --t-fact: 2rem;
  --t-take: 1.05rem;
  --t-source: 0.8rem;
  --t-list: 1.2rem;
  --gap: 20px;
  --body-top: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--chrome-ink);
  font-family: var(--font);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 10;
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 4px;
}
.skip:focus { left: 8px; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 6; }
.progress__bar { height: 100%; width: 0; background: var(--mark); transition: width 0.25s ease; }

/* Frame */
.deck { min-height: 100dvh; display: flex; flex-direction: column; }
.viewport {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}
.stagewrap { position: relative; width: 100%; max-width: 1280px; }
.stage { position: relative; width: 100%; }

/* Slides, flow mode first */
.slide {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 60vh;
  margin: 0 0 16px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--t-body);
  line-height: 1.45;
}
.slide--deep { background: var(--deep); color: var(--on-deep); }
.edge { display: none; }

html.js .slide { display: none; }
html.js .slide.is-active { display: flex; animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 720px) {
  html.js .slide { min-height: calc(100dvh - 140px); margin: 0; }
}

/* Stage mode */
@media (min-width: 721px) {
  html.js .deck { height: 100dvh; }
  html.js .viewport { overflow: hidden; }
  html.js .stagewrap {
    flex: none;
    width: calc(1280px * var(--scale));
    height: calc(720px * var(--scale));
    max-width: none;
  }
  html.js .stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 1280px;
    height: 720px;
    transform: scale(var(--scale));
    transform-origin: 0 0;
  }
  html.js .slide {
    position: absolute;
    inset: 0;
    min-height: 0;
    margin: 0;
    border-radius: 0;
  }
  html.js .edge {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 7%;
    z-index: 2;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }
  html.js .edge--prev { left: 0; }
  html.js .edge--next { right: 0; }
  html.js .edge:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
}

/* Chrome */
.chrome {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--chrome-line);
  font-size: 14px;
  color: var(--chrome-ink-2);
}
.chrome__name { margin: 0; }
.chrome__controls { display: flex; align-items: center; gap: 10px; }
.btn {
  font: inherit;
  font-weight: 600;
  color: var(--chrome-ink);
  background: transparent;
  border: 1px solid var(--chrome-line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.btn:hover { border-color: var(--chrome-ink); }
.btn:disabled { opacity: 0.4; cursor: default; }
.counter { min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
.chrome__link { color: var(--chrome-ink); }
.btn:focus-visible, .button:focus-visible, .chrome__link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 720px) {
  .chrome { flex-wrap: wrap; justify-content: center; }
  .chrome__name { width: 100%; text-align: center; font-size: 12px; }
}

/* Type inside slides */
.eyebrow { margin: 0 0 10px; font-size: var(--t-eyebrow); font-weight: 600; color: var(--mark-text); }
.slide--deep .eyebrow { color: var(--mark-deep); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.022em; line-height: 1.05; }
h2 { font-size: var(--t-title); max-width: 18ch; }
h3 { font-size: var(--t-h3); letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }
b { font-weight: 700; color: var(--ink); }
.slide--deep b { color: #FFFFFF; }
code { font-family: inherit; font-weight: 600; background: var(--line); padding: 0 0.3em; border-radius: 3px; }

/* Cover */
.slide--cover { justify-content: center; }
.cover__title {
  margin-top: 6px;
  font-size: var(--t-cover);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.98;
  max-width: 12ch;
}
.cover__sub { margin-top: 26px; font-size: var(--t-sub); line-height: 1.35; max-width: 46ch; color: var(--on-deep-2); }
.meta { margin-top: 34px; font-size: var(--t-body); font-weight: 500; }
.foot { margin-top: auto; padding-top: 24px; font-size: var(--t-source); color: var(--on-deep-2); }

/* Body region and takeaway */
.body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: var(--gap);
  align-content: start;
  margin-top: var(--body-top);
}
.take {
  margin-top: var(--gap);
  padding: 14px 20px;
  border-left: 4px solid var(--mark);
  background: var(--card);
  font-size: var(--t-take);
  line-height: 1.45;
}
.take--deep { background: var(--deep-2); border-left-color: var(--mark-deep); color: var(--on-deep); }
.take__label { color: var(--mark-text); }
.take--deep .take__label { color: var(--mark-deep); }
.source { margin-top: 12px; font-size: var(--t-source); color: var(--ink-2); }
.slide--deep .source { color: var(--on-deep-2); }

/* Slide 2: map */
.map {
  margin: var(--body-top) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: q;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
  font-size: var(--t-list);
}
.map li {
  counter-increment: q;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.map li::before { content: counter(q); color: var(--mark-text); font-weight: 700; min-width: 1.2em; }
.map__q { flex: 1 1 auto; }
.map__ref { color: var(--ink-2); font-size: var(--t-card); white-space: nowrap; }

/* Slide 3: KPI and gap bar */
.body--kpi { grid-template-columns: 1fr 1.6fr; align-items: center; }
.kpi__label { font-size: var(--t-card); color: var(--ink-2); }
.kpi__value { margin-top: 6px; font-size: var(--t-big); font-weight: 800; letter-spacing: -0.05em; line-height: 0.95; }
.kpi__unit { font-size: 0.45em; font-weight: 700; letter-spacing: 0; margin-left: 2px; }
.kpi__meta { margin-top: 12px; display: flex; align-items: center; gap: 14px; font-size: var(--t-card); color: var(--ink-2); }
.kpi__gap { color: var(--mark-text); font-weight: 700; border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px; }

.gapbar { margin: 0; }
.gapbar__track {
  position: relative;
  height: 56px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.gapbar__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 3px 0 0 3px; }
.gapbar__gap {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(135deg, var(--hatch) 0 6px, transparent 6px 12px);
}
.gapbar__tick { position: absolute; top: -12px; bottom: -12px; width: 4px; margin-left: -2px; background: var(--mark); border-radius: 2px; }
.gapbar__labels { position: relative; height: 1.6em; margin-top: 16px; font-size: var(--t-card); }
.gapbar__labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; font-weight: 700; }
.gapbar__now { color: var(--ink); }
.gapbar__target { color: var(--mark-text); }
.gapbar figcaption { margin-top: 10px; font-size: var(--t-card); color: var(--ink-2); }
.gapbar--small .gapbar__track { height: 36px; }
.gapbar--small .gapbar__tick { top: -8px; bottom: -8px; }

/* Slide 4: bars and facts */
.body--cost { grid-template-columns: 1.5fr 1fr; align-items: center; }
.bars { display: grid; gap: 22px; }
.bar__label { margin-bottom: 8px; font-size: var(--t-card); color: var(--ink-2); }
.bar__track { height: 40px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; }
.bar__fill { height: 100%; border-radius: 3px; }
.bar__fill--ink { background: var(--ink); }
.bar__fill--mark { background: var(--mark); }
.bar__value { margin-top: 6px; font-weight: 700; }
.facts { margin: 0; display: grid; gap: 18px; }
.facts div { border-top: 1px solid var(--line); padding-top: 10px; }
.facts dt { font-size: var(--t-fact); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.facts dd { margin: 4px 0 0; font-size: var(--t-card); color: var(--ink-2); }

/* Slide 5: steps */
.steps {
  flex: 1 1 auto;
  min-height: 0;
  list-style: none;
  margin: calc(var(--body-top) + 12px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  align-content: start;
}
.step {
  position: relative;
  min-height: 200px;
  padding: 40px 24px 26px;
  border: 1px solid var(--line-deep);
  border-radius: 4px;
  background: var(--deep-2);
}
.step__num {
  position: absolute;
  top: -20px;
  left: 24px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mark-deep);
  color: var(--deep);
  font-size: 18px;
  font-weight: 800;
}
.step h3 { color: var(--on-deep); }
.step p { margin-top: 10px; font-size: var(--t-card); color: var(--on-deep-2); }

/* Slide 6: zero and contrast */
.body--contrast { grid-template-columns: 1fr 1.6fr; align-items: center; }
.zero__value { font-size: var(--t-big); font-weight: 800; letter-spacing: -0.05em; line-height: 0.95; color: var(--mark); }
.zero__label { margin-top: 8px; max-width: 22ch; font-size: var(--t-card); color: var(--ink-2); }
.contrast { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.contrast__col { padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; }
.contrast__col--on { border-top: 4px solid var(--mark); }
.contrast__col ul { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: var(--t-card); }

/* Slide 7: design facts */
.body--pilot { grid-template-columns: 1.2fr 1fr; align-items: center; }
.design { margin: 0; display: grid; gap: 12px; }
.design div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding-top: 10px; border-top: 1px solid var(--line); font-size: var(--t-card); }
.design dt { font-weight: 700; }
.design dd { margin: 0; color: var(--ink-2); }

/* Slide 8: next steps */
.next {
  flex: 1 1 auto;
  min-height: 0;
  list-style: none;
  margin: var(--body-top) 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  align-content: start;
  counter-reset: n;
}
.next li {
  counter-increment: n;
  display: grid;
  grid-template-columns: 44px 150px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--line-deep);
  font-size: var(--t-list);
}
.next li::before { content: counter(n); color: var(--on-deep-2); font-weight: 700; }
.next__date { color: var(--mark-deep); font-weight: 700; white-space: nowrap; }

/* Slide 9: about */
.lead { margin-top: 14px; max-width: 60ch; font-size: var(--t-sub); line-height: 1.4; color: var(--ink-2); }
.body--about { grid-template-columns: 1.3fr 1fr; align-items: start; }
.body--about ul { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: var(--t-card); }
.about__link { margin-top: var(--gap); }
.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--mark); color: #FFFFFF; }

/* Phone layout */
@media (max-width: 720px) {
  .map, .body--kpi, .body--cost, .body--contrast, .body--pilot, .body--about, .contrast, .steps { grid-template-columns: 1fr; }
  .steps { gap: 36px; }
  .step { min-height: 0; }
  .design div { grid-template-columns: 1fr; gap: 4px; }
  .next li { grid-template-columns: 32px 1fr; row-gap: 2px; }
  .next li p { grid-column: 2; }
  .zero__label { max-width: none; }
  .meta { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html.js .slide.is-active { animation: none; }
  .progress__bar { transition: none; }
}

/* Print: one slide per page, in stage sizes */
@media print {
  @page { size: 1280px 720px; margin: 0; }
  html, body { background: #FFFFFF; }
  .progress, .chrome, .edge, .skip { display: none !important; }
  .deck { min-height: 0; height: auto; }
  .viewport { display: block; padding: 0; overflow: visible; }
  .stagewrap, .stage {
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    transform: none !important;
  }
  .slide {
    display: flex !important;
    position: relative !important;
    inset: auto !important;
    width: 1280px;
    height: 720px;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    animation: none !important;
    page-break-after: always;
    break-after: page;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
