/* Story carousel — tell it, don't make them read */
:root {
  --ink: #061412;
  --paper: #f3f7f6;
  --teal: #1f7a8c;
  --teal-deep: #166575;
  --signal: #0e9f8e;
  --mint: #5eead4;
  --amber: #d97706;
  --slate: #5b6b68;
  --line: rgba(6, 20, 18, 0.12);
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --chrome: 52px;
  --footer: 64px;
  --slide-ms: 520ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; }

/* —— Chrome —— */
.story-chrome {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--chrome);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 1rem;
  background: rgba(6, 20, 18, 0.55);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(94, 234, 212, 0.1);
  color: #e8f2f0;
}
.story-chrome__back,
.story-chrome__cta {
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 5.5rem;
}
.story-chrome__back { color: rgba(232, 242, 240, 0.7); }
.story-chrome__back:hover { color: #fff; }
.story-chrome__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
}
.story-chrome__brand img { width: 22px; height: 22px; }
.story-chrome__cta {
  text-align: right;
  color: var(--mint);
}
.story-chrome__cta:hover { color: #fff; }

/* —— Stage —— */
.story {
  position: relative;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  padding-top: var(--chrome);
  padding-bottom: var(--footer);
}

.deck {
  position: relative;
  height: 100%;
  width: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem 1.25rem 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(12%) scale(0.98);
  transition:
    opacity var(--slide-ms) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--slide-ms) cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear var(--slide-ms);
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 70% 20%, rgba(14, 159, 142, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 15% 90%, rgba(31, 122, 140, 0.18), transparent 50%),
    linear-gradient(165deg, #041110 0%, #0a1c1a 48%, #0f2e2a 100%);
  color: #e8f2f0;
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
  pointer-events: auto;
  z-index: 2;
}
.slide.is-exit {
  opacity: 0;
  transform: translateX(-10%) scale(0.98);
  z-index: 1;
}
.slide--soft {
  background:
    radial-gradient(ellipse 70% 50% at 80% 10%, rgba(31, 122, 140, 0.12), transparent 55%),
    linear-gradient(180deg, #eef4f3 0%, #f3f7f6 55%, #e8f0ee 100%);
  color: var(--ink);
}

.slide__inner {
  width: min(100%, 720px);
  text-align: center;
  display: grid;
  gap: 1.25rem;
  justify-items: center;
}

.kicker {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mint);
}
.slide--soft .kicker { color: var(--teal); }

.line {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5.6vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  max-width: 16ch;
}
.line em {
  font-style: normal;
  color: var(--mint);
}
.slide--soft .line em { color: var(--teal); }

.whisper {
  font-size: clamp(0.92rem, 2.2vw, 1.08rem);
  color: rgba(232, 242, 240, 0.68);
  max-width: 34ch;
  line-height: 1.4;
}
.slide--soft .whisper { color: var(--slate); }

.recovery {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(232, 242, 240, 0.85);
}
.recovery strong {
  color: var(--mint);
  font-weight: 800;
  font-size: 1.15em;
}

/* Enter animation for active slide children */
.slide.is-active .pop {
  animation: pop-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.slide.is-active .pop-d1 { animation-delay: 0.12s; }
.slide.is-active .pop-d2 { animation-delay: 0.24s; }
.slide.is-active .pop-d3 { animation-delay: 0.36s; }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* —— Visual blocks —— */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.brand-mark img {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 0 18px rgba(14, 159, 142, 0.5));
}
.brand-mark span {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.bubble {
  display: inline-block;
  max-width: 22rem;
  padding: 1rem 1.2rem;
  border-radius: 18px 18px 18px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(94, 234, 212, 0.28);
  font-size: clamp(1.05rem, 2.8vw, 1.3rem);
  font-weight: 600;
  line-height: 1.35;
  color: #e8f2f0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
.bubble strong { color: var(--mint); font-weight: 800; }

.vendors {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.vendor {
  width: 6.2rem;
  padding: 0.9rem 0.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(94, 234, 212, 0.22);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
.vendor small {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(232, 242, 240, 0.55);
}
.vendor--fake {
  border-color: rgba(217, 119, 6, 0.55);
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.2);
}

.erp-mini {
  width: min(100%, 300px);
  aspect-ratio: 1.15;
}
.erp-mini svg { width: 100%; height: 100%; overflow: visible; }
.erp-mini .link {
  stroke: rgba(94, 234, 212, 0.35);
  stroke-width: 1.75;
  stroke-dasharray: 4 6;
  fill: none;
  animation: dash 10s linear infinite;
}
.erp-mini .node circle {
  fill: #0e3d38;
  stroke: var(--mint);
  stroke-width: 2;
}
.erp-mini .node--core circle {
  fill: var(--signal);
  stroke: #0a6b64;
}
.erp-mini text {
  fill: #e8f2f0;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}
.erp-mini text.sap,
.graph text.sap {
  font-size: 7.5px;
  font-weight: 600;
  opacity: 0.72;
  letter-spacing: 0.04em;
}
@keyframes dash { to { stroke-dashoffset: -120; } }

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 34rem;
}
.check {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.25);
  color: rgba(232, 242, 240, 0.45);
  background: rgba(255, 255, 255, 0.03);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.check small {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
  vertical-align: 0.05em;
}
.slide.is-active .check {
  animation: check-on 0.4s ease both;
}
.slide.is-active .check:nth-child(1) { animation-delay: 0.12s; }
.slide.is-active .check:nth-child(2) { animation-delay: 0.28s; }
.slide.is-active .check:nth-child(3) { animation-delay: 0.44s; }
.slide.is-active .check:nth-child(4) { animation-delay: 0.6s; }
.slide.is-active .check:nth-child(5) { animation-delay: 0.76s; }
.slide.is-active .check:nth-child(6) { animation-delay: 0.92s; }
@keyframes check-on {
  to {
    color: #e8f2f0;
    border-color: rgba(94, 234, 212, 0.5);
    background: rgba(14, 159, 142, 0.2);
  }
}

.score-burst {
  width: min(100%, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 40% 35%, rgba(251, 191, 36, 0.35), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(217, 119, 6, 0.35), #1a1208 70%);
  border: 3px solid rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 40px rgba(217, 119, 6, 0.45);
}
.score-burst strong {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5.5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fde68a;
  display: block;
}
.score-burst span {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(253, 230, 138, 0.75);
}

.graph {
  width: min(100%, 320px);
  aspect-ratio: 1.05;
}
.graph svg { width: 100%; height: 100%; overflow: visible; }
.graph .edge {
  fill: none;
  stroke: rgba(217, 119, 6, 0.65);
  stroke-width: 2;
  stroke-dasharray: 5 6;
  animation: dash 8s linear infinite;
}
.graph .edge--soft { stroke: rgba(94, 234, 212, 0.4); }
.graph .n circle { stroke-width: 2; }
.graph .n--hot circle {
  fill: #d97706;
  stroke: #fde68a;
  filter: drop-shadow(0 0 12px rgba(217, 119, 6, 0.75));
}
.graph .n--v circle { fill: #0e3d38; stroke: #5eead4; }
.graph .n--b circle { fill: #3a2410; stroke: #fbbf24; }
.graph .n--p circle { fill: #3a1610; stroke: #fb923c; }
.graph text {
  fill: #e8f2f0;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}
.slide.is-active .graph .n {
  animation: node-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.slide.is-active .graph .n:nth-child(1) { animation-delay: 0.1s; }
.slide.is-active .graph .n:nth-child(2) { animation-delay: 0.2s; }
.slide.is-active .graph .n:nth-child(3) { animation-delay: 0.3s; }
.slide.is-active .graph .n:nth-child(4) { animation-delay: 0.4s; }
.slide.is-active .graph .n:nth-child(5) { animation-delay: 0.5s; }
@keyframes node-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.case-card {
  width: min(100%, 380px);
  text-align: left;
  padding: 1.15rem 1.2rem;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.case-card__id {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.35rem;
}
.case-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
}
.case-card p {
  font-size: 0.9rem;
  color: var(--slate);
  line-height: 1.4;
}
.case-card p small {
  display: inline;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--teal);
}
.case-card .who {
  margin-top: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
.case-card .who::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(14, 159, 142, 0.5);
  animation: ping 1.5s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(14, 159, 142, 0.45); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.done-mark {
  width: 120px;
  height: 120px;
}
.done-mark svg { width: 100%; height: 100%; }
.done-mark .ring {
  fill: none;
  stroke: rgba(14, 159, 142, 0.25);
  stroke-width: 8;
}
.done-mark .arc {
  fill: none;
  stroke: var(--signal);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transform-origin: center;
  transform: rotate(-90deg);
}
.slide.is-active .done-mark .arc {
  animation: draw-arc 1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}
.done-mark .tick {
  fill: none;
  stroke: var(--signal);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
}
.slide.is-active .done-mark .tick {
  animation: draw-tick 0.45s ease 0.85s forwards;
}
@keyframes draw-arc { to { stroke-dashoffset: 0; } }
@keyframes draw-tick { to { stroke-dashoffset: 0; } }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--signal);
  color: #041110;
  transition: transform 0.2s ease, background 0.2s ease;
}
.btn:hover { background: #12b8a5; transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--mint);
  border: 1px solid rgba(94, 234, 212, 0.35);
}
.btn--ghost:hover { background: rgba(94, 234, 212, 0.1); color: #fff; }

/* —— Footer controls —— */
.story-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  height: var(--footer);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  background: rgba(6, 20, 18, 0.72);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(94, 234, 212, 0.1);
  color: #e8f2f0;
}
.story-bar__side {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.story-bar__side--right { justify-content: flex-end; }

.nav-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(94, 234, 212, 0.28);
  display: grid;
  place-items: center;
  color: var(--mint);
  transition: background 0.2s ease, opacity 0.2s ease;
}
.nav-btn:hover { background: rgba(94, 234, 212, 0.12); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.nav-btn svg { width: 18px; height: 18px; }

.dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(232, 242, 240, 0.22);
  transition: transform 0.25s ease, background 0.25s ease, width 0.25s ease;
}
.dot.is-on {
  width: 22px;
  border-radius: 999px;
  background: var(--signal);
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: rgba(94, 234, 212, 0.12);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--signal);
  transform-origin: left center;
}
.story.is-playing .progress > i {
  animation: progress-fill var(--hold, 4.2s) linear forwards;
}
@keyframes progress-fill {
  from { width: 0; }
  to { width: 100%; }
}

.tap-hint {
  position: absolute;
  bottom: calc(var(--footer) + 0.65rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(232, 242, 240, 0.4);
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.tap-hint.is-gone { opacity: 0; }

@media (max-width: 520px) {
  :root { --chrome: 48px; --footer: 60px; }
  .line { max-width: 12ch; }
  .vendor { width: 4.8rem; font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .slide.is-active .pop,
  .slide.is-active .check,
  .slide.is-active .graph .n,
  .slide.is-active .done-mark .arc,
  .slide.is-active .done-mark .tick,
  .story.is-playing .progress > i {
    animation: none !important;
    transition: none !important;
  }
  .slide { transform: none; }
  .slide.is-active { opacity: 1; visibility: visible; }
}
