:root {
  --orange: #f6821f;
  --orange-deep: #f3501e;
  --ink: #0c0c0e;
  --paper: #fff;
  --muted: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.16);
}

* { box-sizing: border-box; margin: 0; }

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: Inter, Arial, sans-serif;
}

.deck { position: relative; width: 100vw; height: 100vh; }

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7vh 8vw;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.99);
  transition: opacity 0.42s ease, transform 0.42s ease, visibility 0s linear 0.42s;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.42s ease, transform 0.42s ease;
}

.dark {
  background:
    radial-gradient(1000px 460px at 50% 120%, rgba(246, 130, 31, 0.14), transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1.4px),
    linear-gradient(180deg, #101014, #09090b);
  background-size: auto, 22px 22px, auto;
}

.orange {
  background:
    radial-gradient(900px 480px at 50% 112%, rgba(255, 232, 150, 0.83), rgba(255, 196, 110, 0.28) 42%, transparent 68%),
    radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1.6px),
    linear-gradient(160deg, var(--orange-deep), #e8430e);
  background-size: auto, 22px 22px, auto;
}

.kicker {
  margin-bottom: 3.5vh;
  color: rgba(255, 255, 255, 0.52);
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.orange .kicker { color: rgba(255, 255, 255, 0.75); }

h1 {
  max-width: 18ch;
  font-size: clamp(3rem, 6.8vw, 6.5rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-wrap: balance;
}

h2 {
  max-width: 25ch;
  font-size: clamp(2.2rem, 4.5vw, 4.4rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
  text-wrap: balance;
}

.sub {
  max-width: 55ch;
  margin-top: 3vh;
  color: var(--muted);
  font-size: clamp(1rem, 1.65vw, 1.4rem);
  line-height: 1.5;
}

.orange .sub { color: rgba(255, 255, 255, 0.9); }
.accent { color: var(--orange); }
.orange .accent { color: #ffe5a1; }

.cf {
  position: fixed;
  z-index: 10;
  top: 3vh;
  right: 3vw;
  color: var(--orange);
  font-size: clamp(0.75rem, 1.1vw, 1rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  transition: color 0.3s ease;
}

body:has(.orange.active) .cf { color: #fff; }

.progress {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--orange);
  transition: width 0.35s ease;
}

body:has(.orange.active) .progress { background: #ffe5a1; }

.hint {
  position: fixed;
  z-index: 10;
  bottom: 3vh;
  left: 50%;
  width: max-content;
  max-width: 90vw;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.76rem;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 0.6s ease;
}

.hint.gone { opacity: 0; }

.speaker-row {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 2vw, 2.2rem);
  width: min(980px, 84vw);
  margin-top: 5vh;
}

.speaker { flex: 1; min-width: 0; text-align: center; }

.portrait {
  width: min(100%, clamp(115px, 16vh, 190px));
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.13);
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  filter: grayscale(1) contrast(1.08);
}

.speaker strong {
  display: block;
  margin-top: 1.2vh;
  font-size: clamp(0.95rem, 1.35vw, 1.25rem);
}

.ai-slide > h2 { max-width: none; }

.ai-stage {
  position: relative;
  width: min(1300px, 92vw);
  min-height: clamp(340px, 54vh, 580px);
  margin-top: 3.5vh;
}

.cloud,
.lifecycle {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0s linear 0.55s;
}

.cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 0.55rem;
}

.lifecycle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: center;
  gap: clamp(1.2rem, 2.5vw, 3rem);
}

.phase { text-align: left; }

.phase-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1.6vh;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
}

.phase-head .num {
  color: var(--orange);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.phase-head .rng {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.74rem;
  font-weight: 600;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
  padding: 0.5em 0.85em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.05);
  font-size: clamp(0.7rem, 1.02vw, 0.92rem);
  font-weight: 600;
  white-space: nowrap;
}

.cloud .chip {
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 0.4s ease var(--d, 0s), transform 0.55s cubic-bezier(0.2, 1.35, 0.3, 1) var(--d, 0s);
}

.ai-slide.step-1 .cloud,
.ai-slide.step-2 .cloud,
.ai-slide.step-3 .cloud {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease;
}

.ai-slide.step-1 .cloud .chip,
.ai-slide.step-2 .cloud .chip,
.ai-slide.step-3 .cloud .chip { opacity: 1; transform: none; }

.ai-slide.step-2 .cloud,
.ai-slide.step-3 .cloud {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.ai-slide.step-2 .lifecycle,
.ai-slide.step-3 .lifecycle {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.55s ease 0.25s;
}

.ai-slide.step-2 .phase-head,
.ai-slide.step-3 .phase-head { opacity: 1; transform: none; }

.lifecycle .chip {
  transition:
    color 0.4s ease var(--d, 0s),
    background 0.4s ease var(--d, 0s),
    border-color 0.4s ease var(--d, 0s),
    transform 0.55s cubic-bezier(0.3, 0, 0.2, 1) calc(var(--d, 0s) + 0.35s),
    opacity 0.4s ease var(--d, 0s),
    box-shadow 0.4s ease var(--d, 0s);
}

.ai-slide.step-3 .lifecycle .chip.ai {
  color: #09090b;
  border-color: var(--orange);
  background: var(--orange);
  opacity: 0.78;
  box-shadow: 0 8px 22px rgba(246, 130, 31, 0.3);
  transform: scale(0.68);
}

.ai-note {
  margin-top: 3.4vh;
  color: var(--orange);
  opacity: 0;
  font-size: clamp(1.05rem, 1.7vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  transform: translateY(8px);
  transition: opacity 0.5s ease 0.6s, transform 0.5s ease 0.6s;
}

.ai-slide.step-3 .ai-note { opacity: 1; transform: none; }
.ai-slide.flip .cloud { opacity: 0; visibility: hidden; transition: opacity 0.18s ease; }
.ai-slide.flip .lifecycle { opacity: 1; visibility: visible; transition: none; }
.ai-slide.flip .phase-head { opacity: 1; transform: none; transition: none; }
.ai-slide.flip .lifecycle .chip { will-change: transform; }

.ab-panels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: clamp(1rem, 2.6vw, 2.8rem);
  width: min(1240px, 88vw);
  margin-top: 5vh;
  text-align: left;
}

.ab-panel {
  padding: clamp(1.1rem, 2vw, 1.8rem);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  transition: opacity 0.55s ease, filter 0.55s ease;
}

.ab-panel .ab-label {
  color: #ffe5a1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.ab-divider {
  align-self: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
}

.ab-old .ab-flow {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.4vh;
}

.ab-old .ab-flow::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.35s cubic-bezier(0.4, 0, 0.2, 1) 0.12s;
}

.slide.active .ab-old .ab-flow::before { transform: scaleX(1); }

.ab-old .ab-stage,
.ab-old .ab-gap {
  position: relative;
  padding: 0.55em 0.9em;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 10px;
  opacity: 0;
  font-size: clamp(0.76rem, 1.1vw, 1rem);
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-10px);
  transition: opacity 0.5s ease var(--d, 0s), transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) var(--d, 0s);
}

.ab-old .ab-stage { background: rgba(0, 0, 0, 0.14); }

.ab-old .ab-gap {
  color: rgba(255, 255, 255, 0.6);
  border-style: dashed;
  font-size: clamp(0.66rem, 0.95vw, 0.82rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.slide.active .ab-old .ab-stage,
.slide.active .ab-old .ab-gap { opacity: 1; transform: none; }

.ab-caption {
  margin-top: 2.4vh;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.78rem, 1.05vw, 0.95rem);
  line-height: 1.45;
}

.ab-new { opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0s linear 0.5s; }
.ab-new .ab-lands { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 2.4vh; }

.ab-new .ab-land {
  padding: 0.5em 0.8em;
  border-radius: 10px;
  color: var(--orange-deep);
  background: #fff;
  opacity: 0;
  font-size: clamp(0.76rem, 1.1vw, 1rem);
  font-weight: 800;
  transform: scale(0.6);
  transition: opacity 0.34s ease var(--d, 0s), transform 0.44s cubic-bezier(0.2, 1.35, 0.3, 1) var(--d, 0s);
}

.ab-slide.step-1 .ab-new,
.ab-slide.step-2 .ab-new { opacity: 1; visibility: visible; transition: opacity 0.55s ease; }

.ab-slide.step-1 .ab-new .ab-land,
.ab-slide.step-2 .ab-new .ab-land { opacity: 1; transform: none; }

.ab-slide.step-1 .ab-old,
.ab-slide.step-2 .ab-old { opacity: 0.38; filter: saturate(0.5); }

.ab-close {
  margin-top: 4.5vh;
  color: #ffe5a1;
  opacity: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.7rem);
  font-style: italic;
  transform: translateY(10px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.ab-slide.step-2 .ab-close {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease 0.12s, transform 0.6s ease 0.12s;
}

.sr-status {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 850px) {
  .slide { padding: 6vh 5vw; }
  .lifecycle { grid-template-columns: 1fr; gap: 1.4rem; }
  .ai-stage { min-height: 62vh; }
  .chip { font-size: clamp(0.58rem, 2vw, 0.76rem); }
  .ab-panels { grid-template-columns: 1fr; gap: 1rem; margin-top: 3vh; }
  .ab-divider { display: none; }
  .ab-close { margin-top: 3vh; }
  .ab-old .ab-flow::before { display: none; }
}

@media (max-height: 650px) {
  .speaker-row { margin-top: 3vh; }
  .portrait { width: clamp(90px, 15vh, 130px); }
  .ai-stage { min-height: 50vh; margin-top: 2vh; }
  .chip { font-size: clamp(0.58rem, 0.9vw, 0.76rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
