:root {
  --navy: #0b1f3a;
  --navy-deep: #06152b;
  --cyan: #009db5;
  --cyan-soft: #d9eef0;
  --ivory: #f5f2ec;
  --ivory-deep: #ebe7df;
  --paper: #fcfbf8;
  --ink: #12223a;
  --ink-soft: #556170;
  --ink-faint: #7b8490;
  --white: #ffffff;
  --white-soft: rgba(255, 255, 255, 0.78);
  --white-faint: rgba(255, 255, 255, 0.18);
  --line: rgba(11, 31, 58, 0.14);
  --line-strong: rgba(11, 31, 58, 0.28);
  --control-surface: rgba(252, 251, 248, 0.94);
  --control-shadow: 0 8px 30px rgba(6, 21, 43, 0.12);
  --cover-gradient: linear-gradient(90deg, rgba(6, 21, 43, 0.88) 0%, rgba(6, 21, 43, 0.52) 43%, rgba(6, 21, 43, 0.08) 72%, rgba(6, 21, 43, 0.14) 100%);
  --caption-gradient: linear-gradient(180deg, rgba(6, 21, 43, 0) 24%, rgba(6, 21, 43, 0.82) 100%);
  --bg: var(--ivory);
  --bg-soft: var(--ivory-deep);
  --surface: var(--paper);
  --surface-2: var(--ivory-deep);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --text-1: var(--ink);
  --text-2: var(--ink-soft);
  --text-3: var(--ink-faint);
  --accent: var(--cyan);
  --accent-2: var(--navy);
  --accent-3: var(--cyan-soft);
  --good: var(--cyan);
  --warn: var(--cyan);
  --bad: var(--navy);
  --grad: linear-gradient(90deg, var(--cyan), var(--navy));
  --grad-soft: linear-gradient(135deg, var(--paper), var(--ivory-deep));
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: none;
  --shadow-lg: var(--control-shadow);
  --font-sans: var(--wave-font-sans);
  --font-serif: var(--wave-font-serif);
  --font-display: var(--wave-font-serif);
  --letter-tight: -0.035em;
  --letter-normal: 0;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html,
body {
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--text-1);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.deck {
  width: 100%;
  height: 100svh;
  height: 100dvh;
}

.slide {
  justify-content: flex-start;
  padding: clamp(58px, 6.4cqh, 82px) clamp(52px, 7cqw, 112px) clamp(52px, 6cqh, 72px);
  background: var(--bg);
}

.slide-shell {
  display: flex;
  width: min(100%, 1440px);
  height: 100%;
  min-width: 0;
  margin: 0 auto;
  flex-direction: column;
  justify-content: center;
}

.slide-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(16px, 2.5cqh, 26px);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.slide-topline::after {
  width: min(34cqw, 440px);
  height: 1px;
  content: "";
  background: var(--border);
}

.chapter-index {
  color: var(--accent);
}

.slide-title {
  max-width: 14ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 5.3cqw, 76px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: var(--letter-tight);
}

.slide-title .english,
.section-english {
  display: block;
  margin-top: 9px;
  color: var(--text-3);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.32em;
  font-weight: 400;
  letter-spacing: 0.035em;
}

.slide-intro {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--text-2);
  font-size: clamp(15px, 1.3cqw, 18px);
  line-height: 1.75;
}

.media-frame {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame.contain img {
  object-fit: contain;
}

.media-caption {
  margin: 8px 2px 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

.concept-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.concept-label::before {
  width: 26px;
  height: 1px;
  content: "";
  background: currentColor;
}

/* Cover, adapted from the Skill image-hero template. */
.slide-cover {
  padding: 0;
  background: var(--navy-deep);
  color: var(--white);
}

.cover-media,
.cover-scrim {
  position: absolute;
  inset: 0;
}

.cover-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 56%;
}

.cover-scrim {
  background: var(--cover-gradient);
}

.cover-copy {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(46cqw, 720px);
  height: 100%;
  padding: clamp(72px, 10cqh, 116px) clamp(42px, 7cqw, 112px) clamp(64px, 9cqh, 96px);
  flex-direction: column;
  justify-content: flex-end;
}

.cover-kicker {
  margin: 0 0 18px;
  color: var(--white-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cover-title {
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(54px, 6.6cqw, 94px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: var(--letter-tight);
}

.cover-english {
  margin: 16px 0 0;
  color: var(--white-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 1.65cqw, 25px);
  letter-spacing: 0.025em;
}

.cover-meta {
  display: grid;
  max-width: 620px;
  margin-top: clamp(26px, 4.2cqh, 42px);
  padding-top: 18px;
  border-top: 1px solid var(--white-faint);
  grid-template-columns: 1fr auto;
  gap: 12px 30px;
  color: var(--white-soft);
  font-size: clamp(13px, 1.1cqw, 16px);
  line-height: 1.45;
}

.cover-role {
  grid-column: 1 / -1;
}

.cover-role strong {
  color: var(--white);
  font-weight: 600;
}

/* Project background, adapted from two-column. */
.story-grid {
  display: grid;
  min-height: 0;
  margin-top: clamp(22px, 4cqh, 44px);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(34px, 6cqw, 88px);
  align-items: center;
}

.story-copy {
  min-width: 0;
  max-width: 34rem;
}

.story-copy p {
  margin: 0;
  color: var(--text-2);
  font-size: clamp(16px, 1.35cqw, 19px);
  line-height: 1.9;
}

.story-copy p + p {
  margin-top: 20px;
}

.story-media {
  height: min(58cqh, 610px);
}

.story-media img {
  object-position: 50% 52%;
}

/* Planning spread. */
.planning-layout {
  display: grid;
  min-height: 0;
  margin-top: clamp(22px, 3.2cqh, 34px);
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
  gap: clamp(18px, 2.4cqw, 34px);
  align-items: end;
}

.planning-main .media-frame {
  aspect-ratio: 16 / 7.55;
}

.planning-secondary {
  padding-bottom: clamp(4px, 3cqh, 30px);
}

.planning-secondary .media-frame {
  aspect-ratio: 16 / 9;
}

/* Four-image editorial grid. */
.design-grid {
  display: grid;
  min-height: 0;
  margin-top: clamp(20px, 3cqh, 30px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.7cqw, 24px);
}

.design-item {
  min-width: 0;
}

.design-item .media-frame {
  aspect-ratio: 16 / 5.25;
}

.design-item-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 2px 0;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
}

.design-item-title span:last-child {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Concept / built comparison. */
.comparison-grid {
  display: grid;
  min-height: 0;
  margin-top: clamp(22px, 3.5cqh, 36px);
  grid-template-columns: minmax(0, 1.38fr) minmax(280px, 0.62fr);
  gap: clamp(20px, 3cqw, 42px);
  align-items: stretch;
}

.comparison-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.comparison-side .media-frame {
  flex: 1;
  min-height: 0;
}

.comparison-side.concept .media-frame {
  aspect-ratio: 16 / 8.2;
}

.comparison-side.built .media-frame {
  background: var(--ivory-deep);
}

.comparison-side.built img {
  object-fit: cover;
  object-position: 50% 50%;
}

.comparison-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--text-1);
  font-size: 15px;
  font-weight: 700;
}

.comparison-heading span:last-child {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Five-image commercial-use grid, adapted from image-grid. */
.operation-grid {
  display: grid;
  min-height: 0;
  margin-top: clamp(20px, 3cqh, 30px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.4cqw, 20px);
  flex: 1;
}

.operation-item {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.operation-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.operation-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.operation-item:first-child img {
  object-position: 50% 48%;
}

.operation-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 38px 14px 12px;
  background: var(--caption-gradient);
  color: var(--white);
  font-size: 12px;
  line-height: 1.35;
}

/* WAVE role, adapted from big-quote. */
.role-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: clamp(44px, 7cqw, 110px);
  align-items: center;
}

.role-statement {
  padding-left: clamp(22px, 3cqw, 42px);
  border-left: 3px solid var(--accent);
}

.role-statement h1 {
  max-width: 9ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(56px, 7cqw, 104px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: var(--letter-tight);
}

.role-statement p {
  margin: 18px 0 0;
  color: var(--text-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 2cqw, 30px);
}

.role-facts {
  margin: 0;
}

.role-facts div {
  display: grid;
  padding: 15px 0;
  border-top: 1px solid var(--border);
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
}

.role-facts div:last-child {
  border-bottom: 1px solid var(--border);
}

.role-facts dt {
  color: var(--text-3);
  font-size: 12px;
}

.role-facts dd {
  margin: 0;
  color: var(--text-1);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.role-note {
  margin: 24px 0 0;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.8;
}

/* Closing, adapted from cta. */
.slide-closing {
  background: var(--navy);
  color: var(--white);
}

.closing-shell {
  position: relative;
  display: flex;
  width: min(100%, 1320px);
  height: 100%;
  margin: 0 auto;
  flex-direction: column;
  justify-content: center;
}

.closing-mark {
  position: absolute;
  top: 8%;
  left: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--white-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.closing-mark::after {
  width: min(38cqw, 520px);
  height: 1px;
  content: "";
  background: var(--white-faint);
}

.closing-title {
  max-width: 11ch;
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(58px, 7.8cqw, 112px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: var(--letter-tight);
}

.closing-english {
  max-width: 800px;
  margin: 22px 0 0;
  color: var(--white-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2cqw, 30px);
  line-height: 1.35;
}

.closing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(34px, 6cqh, 58px);
}

.closing-action {
  display: inline-flex;
  min-height: 48px;
  padding: 0 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--white-faint);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.closing-action.primary {
  border-color: var(--accent);
  background: var(--accent);
}

.closing-action:hover {
  border-color: var(--white-soft);
  background: var(--white-faint);
  text-decoration: none;
}

.closing-action.primary:hover {
  border-color: var(--white);
}

/* Visible controls layered over the Skill runtime. */
.deck-controls {
  position: fixed;
  right: max(24px, calc(env(safe-area-inset-right) + 12px));
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 30;
  display: flex;
  min-width: 196px;
  min-height: 48px;
  padding: 5px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control-surface);
  box-shadow: var(--control-shadow);
  color: var(--navy);
}

.deck-control-button {
  display: grid;
  width: 40px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: currentColor;
  cursor: pointer;
  font-size: 20px;
}

.deck-control-button:hover:not(:disabled) {
  background: var(--cyan-soft);
}

.deck-control-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.deck-controls .slide-number {
  min-width: 48px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.deck-help {
  position: fixed;
  bottom: 31px;
  left: 24px;
  z-index: 20;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.slide-cover ~ .deck-controls,
.slide-closing ~ .deck-controls {
  color: var(--navy);
}

.is-preview-mode .deck-controls,
.is-preview-mode .deck-help {
  display: none;
}

.is-embedded-mode .notes-overlay {
  display: none !important;
}

html.is-pointer-dragging,
html.is-pointer-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

.deck:not(:has(a:hover, button:hover)) {
  cursor: grab;
}

.deck img {
  -webkit-user-drag: none;
  user-select: none;
}

.overview.open {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .slide {
    padding-right: 42px;
    padding-left: 42px;
  }

  .story-grid,
  .role-layout {
    gap: 36px;
  }

  .planning-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.8fr);
  }
}

@media (max-width: 680px), (orientation: portrait) {
  .slide {
    padding: 58px 20px 54px;
  }

  .slide-shell {
    justify-content: flex-start;
  }

  .slide-topline {
    margin-bottom: 11px;
    font-size: 9px;
  }

  .slide-topline::after {
    width: 28cqw;
  }

  .slide-title {
    max-width: none;
    font-size: clamp(27px, 9.5cqw, 39px);
  }

  .slide-title .english,
  .section-english {
    margin-top: 5px;
    font-size: 0.34em;
  }

  .slide-intro {
    margin-top: 7px;
    font-size: 12.5px;
    line-height: 1.55;
  }

  .cover-copy {
    width: 100%;
    padding: 76px 20px 70px;
    background: var(--cover-gradient);
  }

  .cover-media img {
    object-position: 50% 50%;
  }

  .cover-title {
    max-width: 8ch;
    font-size: clamp(38px, 13cqw, 54px);
  }

  .cover-english {
    font-size: 16px;
  }

  .cover-meta {
    margin-top: 22px;
    grid-template-columns: 1fr;
    gap: 7px;
    font-size: 12px;
  }

  .story-grid {
    display: grid;
    margin-top: 14px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
  }

  .story-copy {
    max-width: none;
  }

  .story-copy p {
    font-size: 12.5px;
    line-height: 1.62;
  }

  .story-copy p + p {
    margin-top: 7px;
  }

  .story-media {
    height: auto;
    min-height: 0;
  }

  .story-media img {
    object-position: 50% 48%;
  }

  .planning-layout {
    margin-top: 14px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .planning-main .media-frame,
  .planning-secondary .media-frame {
    aspect-ratio: 16 / 6.9;
  }

  .planning-secondary {
    padding-bottom: 0;
  }

  .media-caption {
    margin-top: 4px;
    font-size: 9.5px;
    line-height: 1.35;
  }

  .design-grid {
    margin-top: 13px;
    gap: 9px;
  }

  .design-item .media-frame {
    aspect-ratio: 4 / 3;
  }

  .design-item-title {
    margin-top: 4px;
    font-size: 11px;
  }

  .design-item-title span:last-child {
    display: none;
  }

  .comparison-grid {
    margin-top: 14px;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .comparison-heading {
    margin-bottom: 5px;
    font-size: 11px;
  }

  .comparison-heading span:last-child {
    font-size: 8.5px;
  }

  .comparison-side.concept .media-frame,
  .comparison-side.built .media-frame {
    min-height: 0;
    aspect-ratio: auto;
  }

  .comparison-side.built img {
    object-position: 50% 46%;
  }

  .operation-grid {
    margin-top: 13px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1.15fr 0.88fr 0.88fr;
    gap: 8px;
  }

  .operation-item:first-child {
    grid-column: span 2;
    grid-row: auto;
  }

  .operation-caption {
    padding: 26px 9px 7px;
    font-size: 9px;
  }

  .role-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .role-statement {
    padding-left: 18px;
  }

  .role-statement h1 {
    max-width: none;
    font-size: clamp(40px, 12cqw, 54px);
  }

  .role-statement p {
    margin-top: 9px;
    font-size: 17px;
  }

  .role-facts div {
    padding: 9px 0;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
  }

  .role-facts dt {
    font-size: 10px;
  }

  .role-facts dd {
    font-size: 12px;
  }

  .role-note {
    margin-top: 14px;
    font-size: 10px;
    line-height: 1.55;
  }

  .slide-closing {
    padding: 54px 20px;
  }

  .closing-mark {
    top: 5%;
    font-size: 10px;
  }

  .closing-title {
    font-size: clamp(40px, 13cqw, 56px);
  }

  .closing-english {
    margin-top: 14px;
    font-size: 17px;
  }

  .closing-actions {
    margin-top: 28px;
  }

  .closing-action {
    min-height: 44px;
    padding: 0 16px;
    font-size: 12px;
  }

  .deck-controls {
    right: max(10px, calc(env(safe-area-inset-right) + 8px));
    bottom: max(10px, calc(env(safe-area-inset-bottom) + 8px));
    min-width: 152px;
    min-height: 52px;
    padding: 3px;
  }

  .deck-control-button {
    width: 44px;
    height: 44px;
  }

  .deck-help {
    display: none;
  }

  .overview.open {
    padding: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 480px) and (max-height: 640px) {
  .slide {
    padding-top: 44px;
    padding-bottom: 46px;
  }

  .slide-topline {
    margin-bottom: 7px;
  }

  .slide-title {
    font-size: 27px;
  }

  .slide-intro {
    font-size: 11px;
    line-height: 1.45;
  }

  .cover-copy {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .cover-kicker {
    margin-bottom: 10px;
  }

  .cover-title {
    font-size: 39px;
  }

  .cover-english {
    margin-top: 9px;
    font-size: 14px;
  }

  .cover-meta {
    margin-top: 15px;
    padding-top: 11px;
  }

  .story-grid,
  .planning-layout,
  .design-grid,
  .comparison-grid,
  .operation-grid {
    margin-top: 9px;
  }

  .story-copy p {
    font-size: 11px;
    line-height: 1.48;
  }

  .planning-main .media-frame,
  .planning-secondary .media-frame {
    aspect-ratio: 16 / 6.2;
  }

  .design-grid {
    gap: 7px;
  }

  .design-item-title {
    font-size: 9.5px;
  }

  .operation-grid {
    gap: 6px;
  }

  .role-layout {
    gap: 16px;
  }

  .role-statement h1 {
    font-size: 38px;
  }

  .role-note {
    margin-top: 9px;
  }

  .closing-title {
    font-size: 39px;
  }

  .closing-actions {
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .cover-media img,
  .closing-action,
  .deck-control-button {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
