/* AI.DA brain section. Brand: red #CC3226, deep #9E2219, warm white #f8f4f3, ink #1d1a19, Archivo + Public Sans. */
@font-face { font-family: "Archivo"; src: url("../assets/fonts/Archivo-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../assets/fonts/PublicSans-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --red: #cc3226; --deep: #9e2219; --warm: #f8f4f3; --ink: #1d1a19; --soft: #5b4e51; --mute: #8a7c7f;
  --line: #e9dede; --tint: #fbeceb; --ok: #2f7d4f; --card: #ffffff;
  --shadow: 0 1px 2px rgba(29, 26, 25, 0.06), 0 14px 36px -14px rgba(29, 26, 25, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--warm); color: var(--ink); font-family: "Public Sans", system-ui, sans-serif; font-size: 16px; line-height: 1.5; overflow-x: hidden; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- section ---------- */
.bd { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.bd-head { margin: 4px 0 16px; }
.bd-eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); }
.bd-eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.bd-h { font-family: "Archivo", sans-serif; font-weight: 800; font-size: clamp(26px, 4vw, 42px); line-height: 1.04; letter-spacing: -0.02em; margin: 10px 0 8px; max-width: 22ch; }
.bd-h em { font-style: normal; color: var(--red); }
.bd-lede { margin: 0; color: var(--soft); font-size: clamp(15px, 1.5vw, 17px); max-width: 62ch; }

/* ---------- stage ---------- */
.bd-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 440px; max-height: 660px;
  border-radius: 20px; overflow: hidden; border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 46% 52% at 50% 50%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 72%),
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(204, 50, 38, 0.07), rgba(204, 50, 38, 0) 70%),
    radial-gradient(circle at 1px 1px, rgba(29, 26, 25, 0.06) 1px, rgba(29, 26, 25, 0) 1.4px) 0 0 / 24px 24px,
    var(--warm);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.bd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; outline: none; }
.bd-canvas:active { cursor: grabbing; }
.bd-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--red); }
.bd-layer { position: absolute; inset: 0; pointer-events: none; }

/* HUD: counter */
.bd-count { position: absolute; left: 22px; top: 18px; pointer-events: none; }
.bd-count b { display: block; font-family: "Archivo", sans-serif; font-weight: 800; font-size: clamp(34px, 4.6vw, 54px); line-height: 0.95; letter-spacing: -0.03em; color: var(--red); font-variant-numeric: tabular-nums; }
.bd-count span { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink); max-width: 16ch; line-height: 1.3; }

/* HUD: current step chip */
.bd-chip { position: absolute; right: 18px; top: 18px; display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.88); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); opacity: 0; transform: translateY(-6px); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bd-chip.on { opacity: 1; transform: none; }
.bd-chip i { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; font-style: normal; font-family: "Archivo", sans-serif; font-weight: 800; font-size: 12px; }

/* play */
.bd-play { position: absolute; left: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px 12px 14px; border: 0; border-radius: 99px; background: var(--red); color: #fff; font-family: "Archivo", sans-serif; font-weight: 700; font-size: 15px; letter-spacing: 0.01em; cursor: pointer; box-shadow: 0 10px 24px -10px rgba(158, 34, 25, 0.7); transition: background 0.2s, transform 0.2s var(--ease); pointer-events: auto; z-index: 3; }
.bd-play:hover { background: var(--deep); }
.bd-play:active { transform: scale(0.97); }
.bd-play svg { width: 22px; height: 22px; flex: none; }
.bd-play[hidden] { display: none; }
.bd-hint { position: absolute; right: 18px; bottom: 22px; font-size: 12px; color: var(--mute); pointer-events: none; transition: opacity 0.4s; }

/* labels pinned to 3D positions */
.bd-pin { position: absolute; left: 0; top: 0; will-change: transform, opacity; opacity: 0; pointer-events: none; }
.bd-src { width: 120px; margin-left: -60px; text-align: center; font-size: 11.5px; font-weight: 600; line-height: 1.25; color: var(--soft); }
.bd-src::before { content: ""; display: block; width: 7px; height: 7px; margin: 0 auto 5px; border-radius: 2px; background: var(--ink); }
.bd-src.up::before { display: none; }
.bd-src.up::after { content: ""; display: block; width: 7px; height: 7px; margin: 5px auto 0; border-radius: 2px; background: var(--ink); }
.bd-src.l, .bd-src.r { display: flex; align-items: center; gap: 7px; width: max-content; margin-left: 0; }
.bd-src.l { text-align: right; }
.bd-src.r { text-align: left; }
.bd-src.l::before { display: none; }
.bd-src.r::before { flex: none; margin: 0; }
.bd-src.l::after { content: ""; flex: none; width: 7px; height: 7px; border-radius: 2px; background: var(--ink); }

.bd-reg { display: flex; align-items: flex-start; gap: 8px; white-space: nowrap; }
.bd-reg i { flex: none; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(204, 50, 38, 0.18); margin-left: -5px; }
.bd-reg div { padding: 5px 10px 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.94); border: 1px solid rgba(204, 50, 38, 0.28); box-shadow: 0 6px 18px -10px rgba(29, 26, 25, 0.35); }
.bd-reg b { display: block; font-family: "Archivo", sans-serif; font-weight: 700; font-size: 13.5px; color: var(--ink); }
.bd-reg span { display: block; font-size: 12px; color: var(--soft); white-space: normal; max-width: 30ch; line-height: 1.35; }
.bd-reg.left { flex-direction: row-reverse; }
.bd-stage.is-static .bd-reg span { display: none; }
.bd-stage.is-static .bd-reg div { padding: 3px 8px 4px; }
.bd-stage.is-static .bd-reg b { font-size: 12.5px; }
.bd-reg.left i { margin-left: 0; margin-right: -5px; }

.bd-dec { width: 260px; margin-left: -130px; text-align: center; }
.bd-dec b { display: inline-block; padding: 7px 12px; border-radius: 10px; background: var(--ink); color: #fff; font-family: "Archivo", sans-serif; font-weight: 700; font-size: 13.5px; line-height: 1.3; box-shadow: 0 10px 24px -12px rgba(29, 26, 25, 0.6); }
.bd-dec b span { display: block; color: #ffb1a9; font-weight: 600; font-size: 12.5px; }

/* decision card */
.bd-card { position: absolute; right: 22px; top: 50%; width: 300px; margin-top: -112px; padding: 16px 16px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 4px rgba(29, 26, 25, 0.06), 0 24px 48px -18px rgba(29, 26, 25, 0.35); opacity: 0; pointer-events: none; will-change: transform, opacity; z-index: 2; }
.bd-card .k { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); display: flex; justify-content: space-between; }
.bd-card .k em { font-style: normal; color: var(--mute); letter-spacing: 0.06em; }
.bd-card h3 { margin: 6px 0 8px; font-family: "Archivo", sans-serif; font-weight: 800; font-size: 19px; line-height: 1.15; letter-spacing: -0.01em; }
.bd-card dl { margin: 0 0 12px; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; }
.bd-card dt { color: var(--mute); font-weight: 600; }
.bd-card dd { margin: 0; color: var(--ink); }
.bd-card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.bd-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--soft); }
.bd-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--mute); transition: background 0.3s; }
.bd-card[data-s="2"] .bd-status i, .bd-card[data-s="3"] .bd-status i { background: #d9921b; box-shadow: 0 0 0 4px rgba(217, 146, 27, 0.18); }
.bd-card[data-s="4"] .bd-status, .bd-card[data-s="5"] .bd-status { color: var(--ok); }
.bd-card[data-s="4"] .bd-status i, .bd-card[data-s="5"] .bd-status i { background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 125, 79, 0.16); }
.bd-approve { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: var(--red); color: #fff; font-family: "Archivo", sans-serif; font-weight: 700; font-size: 13px; transition: transform 0.18s var(--ease), background 0.3s, opacity 0.3s; }
.bd-card[data-s="0"] .bd-approve, .bd-card[data-s="1"] .bd-approve { opacity: 0.35; }
.bd-card[data-s="3"] .bd-approve { transform: scale(0.93); background: var(--deep); }
.bd-card[data-s="4"] .bd-approve, .bd-card[data-s="5"] .bd-approve { background: var(--ok); }
.bd-log { margin-top: 10px; font-size: 11.5px; color: var(--mute); opacity: 0; transition: opacity 0.4s; }
.bd-card[data-s="5"] .bd-log { opacity: 1; }

.bd-pred { position: absolute; right: 22px; top: 50%; width: 318px; margin-top: -116px; padding: 14px 16px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); box-shadow: 0 2px 4px rgba(29, 26, 25, 0.06), 0 24px 48px -18px rgba(29, 26, 25, 0.3); opacity: 0; pointer-events: none; will-change: transform, opacity; z-index: 1; }
.bd-pred.side-left { right: auto; left: 22px; top: auto; bottom: 18px; margin-top: 0; width: 300px; }
.bd-pred .k { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; flex-wrap: wrap; row-gap: 0; text-transform: uppercase; color: var(--red); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bd-pred .k em { white-space: nowrap; font-style: normal; color: var(--mute); letter-spacing: 0.04em; text-transform: none; font-weight: 600; }
.bd-pred ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bd-pred li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "w b" "bar bar"; column-gap: 10px; row-gap: 2px; align-items: center; will-change: transform, opacity; }
.bd-pred .w { grid-area: w; font-family: "Archivo", sans-serif; font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.bd-pred .h { font-family: "Public Sans", sans-serif; font-weight: 500; font-size: 12.5px; color: var(--soft); white-space: nowrap; }
.bd-pred b { grid-area: b; font-family: "Archivo", sans-serif; font-weight: 800; font-size: 18px; color: var(--red); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.bd-pred .bar { grid-area: bar; display: block; height: 4px; border-radius: 4px; background: var(--tint); overflow: hidden; margin-top: 3px; }
.bd-pred .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--deep), var(--red)); transform-origin: 0 50%; transform: scaleX(0); }
.bd-predlist { margin-top: 16px; }
.bd-predlist[hidden] { display: none; }
.bd-predlist ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--soft); }
.bd-predlist b { display: inline-block; min-width: 3.4ch; color: var(--red); font-family: "Archivo", sans-serif; }
.bd-credit { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); white-space: nowrap; font-size: 15px; font-weight: 600; color: var(--ink); opacity: 0; pointer-events: none; }
.bd-credit b { font-family: "Archivo", sans-serif; font-weight: 800; color: var(--red); font-size: 20px; letter-spacing: -0.01em; }
.bd-credit span { color: var(--mute); }

.bd-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--soft); font-size: 15px; }
.bd-fallback[hidden] { display: none; }

/* ---------- panel under the stage ---------- */
.bd-panel { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; margin-top: 22px; }
.bd-panel h3 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.bd-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: s; }
.bd-steps button { width: 100%; display: grid; grid-template-columns: 30px 1fr; gap: 2px 12px; align-items: start; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid transparent; background: transparent; cursor: pointer; transition: background 0.3s, border-color 0.3s; }
.bd-steps button:hover { background: rgba(255, 255, 255, 0.7); }
.bd-steps i { grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ink); font-style: normal; font-family: "Archivo", sans-serif; font-weight: 800; font-size: 13px; transition: background 0.3s, color 0.3s, border-color 0.3s; }
.bd-steps b { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 16px; }
.bd-steps span { font-size: 14px; color: var(--soft); }
.bd-steps li.on button { background: #fff; border-color: var(--line); box-shadow: var(--shadow); }
.bd-steps li.on i, .bd-steps li.done i { background: var(--red); border-color: var(--red); color: #fff; }

.bd-fams { display: flex; flex-wrap: wrap; gap: 7px; }
.bd-fams button { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.bd-fams button:hover, .bd-fams button.on { border-color: var(--red); color: var(--deep); background: var(--tint); }
.bd-fams button[aria-pressed="true"] { background: var(--red); color: #fff; border-color: var(--red); }
.bd-detail { min-height: 44px; margin: 12px 0 0; font-size: 14px; color: var(--soft); }
.bd-detail b { color: var(--ink); font-family: "Archivo", sans-serif; }
.bd-quote { margin: 18px 0 0; padding: 14px 16px; border-left: 3px solid var(--red); background: #fff; border-radius: 4px 12px 12px 4px; font-family: "Archivo", sans-serif; font-weight: 700; font-size: 17px; line-height: 1.3; }
.bd-note { margin: 10px 0 0; font-size: 13px; color: var(--mute); }

/* ---------- narrow ---------- */
@media (max-width: 720px) {
  .bd-stage { aspect-ratio: 3 / 4; min-height: 0; max-height: none; }
  .bd-count { left: 14px; top: 12px; }
  .bd-count b { font-size: 30px; }
  .bd-count span { font-size: 11px; max-width: 14ch; }
  .bd-chip { display: none; }
  .bd-play { left: 12px; bottom: 12px; padding: 10px 16px 10px 12px; font-size: 14px; }
  .bd-hint { display: none; }
  .bd-src { width: 84px; margin-left: -42px; font-size: 10.5px; }
  .bd-reg span { display: none; }
  .bd-reg b { font-size: 12.5px; }
  .bd-dec { width: 220px; margin-left: -110px; }
  .bd-card { left: 12px; right: 12px; width: auto; top: auto; bottom: 64px; margin-top: 0; padding: 13px 14px 12px; }
  .bd-card h3 { font-size: 17px; margin: 4px 0 6px; }
  .bd-card dl { margin-bottom: 10px; }
  .bd-pred { left: 12px; right: 12px; width: auto; top: auto; bottom: 64px; margin-top: 0; padding: 12px 14px 10px; }
  .bd-pred ol { gap: 6px; }
  .bd-pred .k { margin-bottom: 6px; }
  .bd-pred .h { font-size: 11.5px; }
  .bd-pred .w { font-size: 12.5px; }
  .bd-pred b { font-size: 16px; }
  .bd-credit { top: 18px; bottom: auto; left: auto; right: 14px; transform: none; font-size: 12.5px; text-align: right; }
  .bd-credit b { font-size: 15px; }
  .bd-panel { grid-template-columns: 1fr; gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
