/* Completion pass — source-backed audit, services, engagement,
   slide index/progress, and the Baltic-birch break (impact shake).
   Loaded after style.css and wheel-transition.css. */

/* ------------------------------------------------------------------ progress + index */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.progress i {
  display: block;
  width: 10%;
  height: 100%;
  background: linear-gradient(90deg, #EA580C, #FBBF24);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
  transition: width 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

#index-btn {
  padding-left: 12px;
  padding-right: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: #E6E9ED;
}

.index-dialog {
  width: min(92vw, 720px);
  max-width: none;
  max-height: 88vh;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: #0B1017;
  color: #FFFFFF;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

.index-dialog::backdrop { background: rgba(3, 6, 10, 0.82); backdrop-filter: blur(6px); }

.index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #D8DFE8;
}

.index-head b { color: #FFFFFF; }

.index-head button {
  min-height: 40px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  font: 700 12px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFFFFF;
  cursor: pointer;
}

.index-list {
  display: grid;
  gap: 6px;
  max-height: calc(88vh - 72px);
  margin: 0;
  padding: 10px;
  overflow: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.index-list button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 16px;
  text-align: left;
  color: #FFFFFF;
  cursor: pointer;
}

.index-list button span { font-family: var(--font-mono); font-size: 13px; font-weight: 800; color: var(--accent-bright); }
.index-list button b { font-weight: 600; line-height: 1.3; }
.index-list button:hover { border-color: rgba(255, 255, 255, 0.4); }
.index-list button[aria-current="true"] { border-color: var(--accent-bright); background: rgba(251, 191, 36, 0.12); }

/* ------------------------------------------------------------------ slide 3: the audit (carbon) */
.finding-list {
  display: grid;
  gap: clamp(7px, 1.1vh, 11px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.finding {
  display: grid;
  grid-template-columns: auto minmax(0, 0.95fr) minmax(0, 2.3fr) minmax(0, 1fr);
  gap: clamp(10px, 1.1vw, 18px);
  align-items: center;
  padding: clamp(8px, 1.2vh, 14px) clamp(12px, 1.1vw, 18px);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.finding h3 { font-size: clamp(17px, 1.3vw, 22px); line-height: 1.18; color: #FFFFFF; }
.finding p { font-size: clamp(16px, 1.08vw, 19px); line-height: 1.42; color: #E6EBF2; }

.finding-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }

.finding-src {
  font-family: var(--font-mono);
  font-size: clamp(12px, 0.8vw, 13px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.sev {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sev.high { background: #A61B1B; color: #FFFFFF; }
.sev.medium { background: var(--accent-bright); color: #0B0E15; }
.sev.low { background: transparent; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.42) inset; color: #E6EBF2; }

/* ------------------------------------------------------------------ slide 4: what Brandcore builds (paper) */
.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 22px);
}

.system-card {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 12px);
  padding: clamp(14px, 2vh, 22px) clamp(16px, 1.4vw, 22px);
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  border: 1px solid rgba(11, 16, 23, 0.1);
  box-shadow: 0 18px 40px rgba(11, 16, 23, 0.08);
}

.system-card-top { display: flex; align-items: center; gap: 12px; }
.system-card h3 { font-size: clamp(19px, 1.5vw, 25px); line-height: 1.15; color: var(--paper-ink); }
.system-card p { font-size: var(--fs-card-body); line-height: 1.42; color: #364150; }

.system-fix {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(11, 16, 23, 0.1);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ------------------------------------------------------------------ slide 9: three ways to deploy (carbon) */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 26px);
  align-items: stretch;
  padding-top: 8px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 12px);
  padding: clamp(16px, 2.2vh, 24px) clamp(18px, 1.6vw, 26px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
}

.plan-card.featured {
  border-color: var(--accent-bright);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0) 44%), var(--surface);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.5) inset, 0 28px 60px rgba(0, 0, 0, 0.5);
}

.plan-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.plan-flag {
  position: absolute;
  top: 0;
  right: 18px;
  transform: translateY(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0B0E15;
}

.plan-card h3 { font-size: clamp(22px, 1.8vw, 30px); line-height: 1.1; color: #FFFFFF; }
.plan-for { font-size: var(--fs-card-body); line-height: 1.4; color: #CBD3DF; }

.plan-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: clamp(8px, 1.1vh, 12px) 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.plan-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  font-size: clamp(15px, 1.02vw, 18px);
  font-weight: 600;
  line-height: 1.38;
  color: #FFFFFF;
}

.plan-list .ico { margin-top: 0.12em; font-size: 1.1em; stroke-width: 2.6; color: var(--accent-bright); }

.plan-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: clamp(12px, 0.84vw, 13.5px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #E6EBF2;
}

.plan-foot span { padding: 12px 16px; text-align: center; }
.plan-foot span + span { border-left: 1px solid var(--line); }
.plan-foot b { margin-left: 6px; font-weight: 800; color: var(--accent-bright); }

/* Desktop: a slide that outgrows its frame scrolls inside itself (wheel
   navigation yields to it) instead of clipping. */
@media screen and (min-width: 901px) {
  .audit .slide-body,
  .system .slide-body,
  .engage .slide-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    justify-content: safe center;
    scrollbar-width: thin;
  }

  .audit .slide-body > *,
  .system .slide-body > *,
  .engage .slide-body > * { flex-shrink: 0; }
}

@media screen and (min-width: 901px) and (max-height: 800px) {
  .finding { padding: 7px 14px; }
  .system-card { padding: 12px 16px; gap: 7px; }
  .plan-card { padding: 14px 18px; gap: 7px; }
  .plan-list { gap: 6px; }
  .plan-foot span { padding: 9px 12px; }
}

@media screen and (max-width: 900px) {
  .finding { grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; padding: 16px; }
  .finding-title { min-width: 0; }
  .finding-body { grid-column: 1 / -1; }
  .finding-meta { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .finding h3 { font-size: 20px; }
  .finding p { font-size: 16px; line-height: 1.55; }
  .finding-src { font-size: 12px; }
  .system-grid, .plan-grid { grid-template-columns: 1fr; gap: 16px; }
  .system-card, .plan-card { padding: 20px; }
  .system-card p { font-size: 16px; line-height: 1.55; }
  .plan-card h3 { font-size: 26px; }
  .plan-list li { font-size: 16px; }
  .plan-foot { grid-template-columns: 1fr; }
  .plan-foot span + span { border-left: 0; border-top: 1px solid var(--line); }
  #index-btn { font-size: 9px; padding-left: 8px; padding-right: 8px; }
}

/* ------------------------------------------------------------------ the break: impact shake */
#deck.boom-shake { animation: boom-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

@keyframes boom-shake {
  0% { transform: translate(0, 0) rotate(0); }
  8% { transform: translate(-11px, 6px) rotate(-0.3deg); }
  18% { transform: translate(10px, -7px) rotate(0.24deg); }
  30% { transform: translate(-8px, 5px) rotate(-0.16deg); }
  44% { transform: translate(6px, -4px) rotate(0.1deg); }
  60% { transform: translate(-3px, 2px); }
  80% { transform: translate(1px, -1px); }
  100% { transform: none; }
}

/* The cover charges before it breaks: the stage brightens and the orbit hint hides. */
.slide.cover.charging .stage-orbit { opacity: 0; }
.slide.cover.charging .stage-kicker i { box-shadow: 0 0 18px 6px rgba(255, 140, 70, 0.9); }

@media (prefers-reduced-motion: reduce) {
  #deck.boom-shake { animation: none; }
  .progress i { transition: none; }
}
