:root {
  --background: #101c25;
  --background-deep: #0c171d;
  --bar: #101d23;
  --glass: #172b33;
  --surface: #1a3039;
  --line: #405760;
  --white: #f3f6f3;
  --muted: #b9cbd0;
  --cyan: #99d2cc;
  --sky: #77b7b0;
  --ochre: #dbaa73;
  --paper: #f4f1ea;
  --paper-bright: #fbfaf5;
  --ink: #1c3038;
  --inset: clamp(1.05rem, 3.45vw, 4.15rem);
  background: var(--background);
  color: var(--white);
}

body {
  background: var(--background-deep);
}

.follow-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  background: var(--background-deep);
  pointer-events: none;
}

.follow-background canvas {
  position: absolute;
  display: block;
  inset: 0;
  width: 100%;
  height: 100%;
}

#transition-stage { opacity: 0; }

#glass-opening {
  position: fixed;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.follow-background::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, #07151cc7 0%, #07151c78 26%, transparent 51%, #0a171d12 72%, #08151c8c 100%),
    linear-gradient(90deg, #0b1a2040 0%, transparent 63%, #0b1a2018 100%);
  transition: opacity 360ms ease;
}

body:has(.slide[data-slide="1"]) .follow-background::after { opacity: .68; }

.shell {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
}

.toolbar,
.footer {
  z-index: 4;
  background: #101d23c9;
}

.toolbar { position: relative; border-bottom-color: var(--line); }
.toolbar .bar { min-height: 4.1rem; }
.bar { width: min(100%, 108rem); }
.identity { gap: .8rem; font-size: .97rem; font-weight: 720; }
.identity small { font-size: .75rem; letter-spacing: .01em; }
.mark { width: 1.34rem; height: 1.34rem; gap: 2.5px; transform: skewY(-7deg); }
.mark i { background: var(--cyan); border-radius: 0; }
.mark i:nth-child(2), .mark i:nth-child(3) { opacity: .38; }
.controls { gap: .52rem; }

.button {
  min-height: 2.7rem;
  padding: .52rem .92rem;
  font-size: .91rem;
  line-height: 1.15;
  font-weight: 690;
  border: 1px solid #51686d;
  border-radius: .26rem;
  color: var(--white);
  background: #1a2c32;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover,
.button:focus-visible {
  border-color: #b4d5d0;
  background: #284048;
}

.motion-picker {
  display: inline-flex;
  position: relative;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 650;
}
.motion-picker select {
  appearance: none;
  padding-right: 1.9rem;
  font-family: inherit;
  cursor: pointer;
}
.motion-picker::after {
  content: "";
  position: absolute;
  right: .74rem;
  width: .43rem;
  height: .43rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-.11rem) rotate(45deg);
  pointer-events: none;
}
@media (max-width: 35rem) {
  .toolbar .bar { flex-wrap: wrap; padding-block: .34rem; row-gap: .35rem; }
  .motion-picker { gap: .3rem; }
}
@media (max-width: 29rem) {
  .toolbar .bar { padding-inline: .7rem; }
  .toolbar .controls { margin-left: auto; }
}

.button.next {
  padding-inline: 1.3rem;
  color: #12252b;
  border-color: #9dd0c8;
  background: #a7d7cf;
}

.button.next:hover,
.button.next:focus-visible {
  border-color: #d8efea;
  background: #cceae3;
}

.progress {
  height: 1px;
  background: #3a5158;
}

.progress span {
  background: var(--cyan);
  transition: width 180ms ease-out;
}

.footer-inner { min-height: 3.55rem; }
.counter { font-size: .88rem; color: var(--muted); }

.slide,
.slide-exit {
  --room-accent: var(--cyan);
}

.slide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(24rem, 43%);
  grid-template-rows: auto;
  align-content: start;
  align-items: start;
  column-gap: clamp(1.2rem, 3vw, 3rem);
  padding-top: clamp(1.55rem, 3.3vh, 3.2rem);
  padding-bottom: clamp(1.8rem, 4vh, 3.5rem);
}

:is(.slide, .slide-exit):is([data-room="office"], [data-room="corridor"]) { --room-accent: #f1c79a; }
:is(.slide, .slide-exit)[data-room="dock"] { --room-accent: #f4ce9c; }
:is(.slide, .slide-exit)[data-room="ice"] { --room-accent: #ace3db; }

.slide-exit {
  position: fixed;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.slide-exit :is(.slide-heading, .content) { position: absolute; }

.slide-heading {
  grid-column: 1;
  grid-row: 1;
  max-width: min(100%, 52rem);
  margin: 0;
  padding-bottom: 0;
  border: 0;
  text-shadow: 0 2px 20px #08161cc9, 0 1px 4px #091922e0;
}

.chapter {
  margin-bottom: .52rem;
  color: var(--room-accent);
  font-size: .83rem;
  line-height: 1.32;
  font-weight: 750;
  letter-spacing: .12em;
}

h1 {
  max-width: 25ch;
  color: var(--white);
  font-size: clamp(2.32rem, 4.55vw, 4.85rem);
  font-weight: 725;
  line-height: 1;
  letter-spacing: -.064em;
  text-wrap: balance;
}

.takeaway {
  max-width: 62ch;
  margin-top: .62rem;
  color: #deebec;
  font-size: clamp(1.02rem, 1.46vw, 1.33rem);
  line-height: 1.42;
  text-wrap: pretty;
}

.content {
  display: block;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 42rem;
  min-width: 0;
  justify-self: end;
}

.evidence {
  padding: clamp(.72rem, 1.3vw, 1.25rem);
  border: 1px solid #d5e0d6;
  border-radius: .28rem;
  background: #f4f1eaf5;
  color: var(--ink);
  color-scheme: light;
  box-shadow: 0 1rem 2.55rem #05101658;
}

.evidence :focus-visible {
  outline-color: #166668;
  outline-offset: 2px;
}

.inline-evidence {
  --ie-ink: var(--ink);
  --ie-text: #273b40;
  --ie-muted: #46595c;
  --ie-cyan: #245c5b;
  --ie-amber: #8a5525;
  --ie-rule: #b6c6bc;
  --ie-card: var(--paper-bright);
  --ie-gap: .7rem;
  --ie-pad: .7rem;
  font-size: clamp(.96rem, 1.12vw, 1.13rem);
  line-height: 1.43;
}

.ie-card,
.ie-timeline,
.ie-comparison,
.ie-amount-records,
.ie-model-photo,
.ie-allocations {
  border: 1px solid var(--ie-rule);
  border-radius: .18rem;
  background: var(--ie-card);
}

.ie-card {
  border-top: 2px solid #70968e;
}

.ie-card-grid,
.ie-record-grid,
.ie-record .ie-fields {
  min-width: 0;
}

.ie-heading {
  line-height: 1.25;
  font-weight: 745;
}

.ie-timeline-entry + .ie-timeline-entry,
.ie-allocation + .ie-allocation,
.ie-record .ie-fields,
.ie-matrix tbody tr + tr,
.ie-amount-entry + .ie-amount-entry {
  border-color: var(--ie-rule);
}

.ie-sequence-entry {
  border: 1px solid var(--ie-rule);
  border-left: 3px solid #548780;
  border-radius: .16rem;
  background: var(--ie-card);
}

.ie-paper-trail .ie-timeline {
  background: none;
  padding-inline: 0;
}

.ie-paper-trail .ie-conclusion,
.ie-conclusion { border-color: #82aaa1; }

.ie-callout {
  color: #483927;
  border-left-color: #a36330;
  background: #f3e8d9;
}

.ie-model-photo img { object-position: center; }

.ie-source,
.ie-links {
  font-size: .82em;
  line-height: 1.4;
}

.ie-links a:hover,
.ie-cover-context a:hover,
.inline-evidence a:hover {
  color: #122d35;
}

.ie-cover-context {
  padding: 0;
  border: 0;
  background: none;
}

.ie-cover-context .ie-heading { font-size: 1.06em; }
.ie-cover-context .ie-copy { display: inline; }
.ie-cover-context .ie-copy + .ie-copy { margin-inline-start: .8em; }

.scene-beat {
  width: fit-content;
  margin: .68rem 0 0;
  padding: .34rem .65rem .37rem;
  border-left: 2px solid #edbc80;
  border-radius: 0 .14rem .14rem 0;
  background: #132820e6;
  color: #ffe0b5;
  font-size: clamp(.88rem, 1.28vw, 1.03rem);
  font-weight: 650;
  line-height: 1.38;
}

.index {
  border-color: #68817e;
  border-radius: .3rem;
  background: #172a32;
  color: var(--white);
}

.index-head {
  border-bottom-color: #52666b;
  background: #172a32;
}

.index-entry { min-height: 2.55rem; border-radius: .2rem; }
.index-entry:hover, .index-entry[aria-current="page"] { background: #2c484b; }
.index-entry span { color: var(--muted); }

body.presenting,
body.presenting .shell {
  overflow: visible;
}

body.presenting .shell {
  display: flex;
  height: auto;
  min-height: 100svh;
  min-height: 100dvh;
}

body.presenting .slide {
  position: static;
  left: auto;
  width: min(100%, 108rem);
  padding: clamp(1.1rem, 3.5vh, 2.3rem) var(--inset) clamp(1.35rem, 3.4vh, 2.5rem);
  transform: none;
  touch-action: pan-y;
}

body.presenting h1 {
  font-size: clamp(2.1rem, 4.45vw, 4.85rem);
}

body.presenting .slide-heading {
  margin: 0;
  padding: 0;
}

body.presenting .takeaway { margin-top: .44rem; }
body.presenting .evidence { padding: clamp(.72rem, 1.15vw, 1.03rem); }
body.presenting .inline-evidence { font-size: clamp(1rem, 1.22vw, 1.14rem); }

@media (max-width: 64rem) {
  .slide {
    grid-template-columns: minmax(0, 1fr) minmax(0, 48%);
  }
  h1 { letter-spacing: -.058em; }
}

@media (min-width: 52.0625rem) and (max-height: 49rem) {
  .toolbar .bar { min-height: 3.65rem; }
  .footer-inner { min-height: 3.24rem; }
  .slide { padding-top: clamp(1rem, 2.35vh, 1.85rem); }
  h1 { font-size: clamp(2.2rem, 4.35vw, 4.3rem); }
  .evidence { padding: .85rem; }
}

@media (max-width: 52rem) {
  .slide,
  body.presenting .slide {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(clamp(17rem, 49svh, 27rem), max-content) auto;
    padding-top: 1.25rem;
    padding-bottom: 1.55rem;
  }

  .content {
    grid-column: 1;
    grid-row: 2;
    width: min(100%, 42rem);
    justify-self: center;
  }

  .toolbar .bar { min-height: 3.5rem; }
  h1, body.presenting h1 { font-size: clamp(2.05rem, 6.6vw, 4.2rem); line-height: 1.02; }
  .takeaway { font-size: 1rem; }
  .chapter { font-size: .78rem; letter-spacing: .09em; }
  .inline-evidence, body.presenting .inline-evidence { font-size: 1rem; }
  .evidence { box-shadow: 0 .7rem 1.7rem #05101646; }
}

@media (max-width: 35rem) {
  .identity { gap: .5rem; font-size: .9rem; }
  .identity small { display: none; }
  .mark { width: 1.12rem; height: 1.12rem; }
  .button { padding-inline: .55rem; font-size: .86rem; }
  .button.next { padding-inline: 1.18rem; }
  .controls { gap: .32rem; }
  .footer { padding-bottom: env(safe-area-inset-bottom); }
  .index-content { grid-template-columns: minmax(0, 1fr); }
  .ie-sequence { grid-template-columns: minmax(0, 1fr); }
  .ie-cover-context .ie-copy { display: block; }
  .ie-cover-context .ie-copy + .ie-copy { margin-inline-start: 0; }
}

@media (max-width: 52rem) and (max-height: 31rem) {
  .slide,
  body.presenting .slide {
    grid-template-rows: minmax(clamp(14rem, 54svh, 17rem), max-content) auto;
  }
}

.cover-company, .cover-meeting, .cover-period, .cover-credits { display: none; }

.slide[data-slide="1"],
body.presenting .slide[data-slide="1"] {
  grid-template-columns: minmax(0, 1fr) minmax(9.5rem, 16%);
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  padding-block: clamp(1.35rem, 3.5vh, 3rem);
}

:is(.slide, .slide-exit)[data-slide="1"] .slide-heading {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  align-items: start;
  align-content: stretch;
  gap: clamp(1rem, 3.6vh, 3rem);
  width: min(100%, 51vw, 50rem);
}

:is(.slide, .slide-exit)[data-slide="1"] .cover-company {
  display: block;
  margin: 0;
  max-width: 100%;
  font-size: clamp(1.32rem, 2.65vw, 2.72rem);
  font-weight: 680;
  line-height: 1.17;
  letter-spacing: -.012em;
  text-wrap: balance;
}

:is(.slide, .slide-exit)[data-slide="1"] .slide-title-copy {
  display: grid;
  align-self: center;
  align-content: center;
  min-height: clamp(15rem, 43vh, 28rem);
  margin-block-end: clamp(.65rem, 6vh, 3.75rem);
  padding: clamp(1.5rem, 3.8vh, 3.2rem) clamp(1.3rem, 2.6vw, 2.85rem);
  border: 1px solid #a4dcda72;
  background: linear-gradient(111deg, #0a1e2bd9, #0a202b9e 75%, #0a202b91);
  box-shadow: inset 0 1px #bcffff19, 0 1.2rem 3.3rem #010a144b;
}

:is(.slide, .slide-exit)[data-slide="1"] h1 {
  max-width: 11ch;
  font-size: clamp(2.78rem, 5.1vw, 5.65rem);
  font-weight: 745;
  letter-spacing: -.043em;
  line-height: 1.07;
  text-wrap: balance;
}

:is(.slide, .slide-exit)[data-slide="1"] :is(.chapter, .takeaway, .scene-caption, .evidence) {
  display: none;
}

:is(.slide, .slide-exit)[data-slide="1"] :is(.cover-meeting, .cover-period) {
  display: block;
  margin: 0;
  font-size: clamp(1rem, 1.86vw, 1.96rem);
  font-weight: 550;
  line-height: 1.3;
}

:is(.slide, .slide-exit)[data-slide="1"] .cover-meeting {
  margin-top: clamp(1.3rem, 4vh, 3.4rem);
}

:is(.slide, .slide-exit)[data-slide="1"] .cover-period {
  margin-top: .32em;
  color: #a2d2cd;
}

:is(.slide, .slide-exit)[data-slide="1"] .content {
  width: 100%;
  align-self: center;
}

:is(.slide, .slide-exit)[data-slide="1"] .cover-credits {
  display: grid;
  gap: clamp(.9rem, 2.8vh, 2.1rem);
  padding: clamp(.85rem, 2vw, 1.55rem);
  margin: 0;
  border-left: 1px solid #a0e1e16e;
  background: linear-gradient(90deg, #0b202ba8, #101b2180);
  font-size: clamp(1.05rem, 1.9vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 2px 8px #050d15be;
  list-style: none;
}

:is(.slide, .slide-exit)[data-slide="1"] .cover-credits li + li::before {
  display: block;
  width: 1.1em;
  height: 1px;
  margin-bottom: clamp(.8rem, 2.4vh, 1.75rem);
  background: #9ed4cfc2;
  content: "";
}

@media (max-width: 52rem) {
  .slide[data-slide="1"],
  body.presenting .slide[data-slide="1"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    row-gap: clamp(.75rem, 2.8vh, 1.75rem);
  }

  :is(.slide, .slide-exit)[data-slide="1"] .slide-heading { width: 100%; }

  :is(.slide, .slide-exit)[data-slide="1"] .slide-title-copy {
    min-height: 0;
    margin: 0;
    padding-block: clamp(1.1rem, 4.5vh, 2.4rem);
  }

  :is(.slide, .slide-exit)[data-slide="1"] h1 {
    font-size: clamp(2rem, 8.2vw, 4.65rem);
  }

  :is(.slide, .slide-exit)[data-slide="1"] .cover-credits {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1.15rem;
  }

  :is(.slide, .slide-exit)[data-slide="1"] .cover-credits li + li::before { display: none; }
}

html[data-motion="reduced"] .follow-background::after,
html[data-motion="reduced"] :is(.button,.progress span) { transition: none; }
