/* ==========================================================
   BLOOD — interactive revision deck
   Design canvas: 1920 × 1080, scaled to fit any screen.
   ========================================================== */
:root {
  --bg: #050507;
  --bg2: #0d0d11;
  --text: #f5f5f7;
  --text2: #a1a1aa;
  --text3: #6e6e78;
  --line: rgba(255, 255, 255, 0.10);
  --glass: rgba(255, 255, 255, 0.055);
  --glass2: rgba(255, 255, 255, 0.09);
  --red: #ff375f;
  --blood: #e5243b;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --green: #30d158;
  --teal: #40c8e0;
  --blue: #0a84ff;
  --indigo: #5e5ce6;
  --purple: #bf5af2;
  --pink: #ff6482;
  --accent: var(--red);
  --s: 1;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: "Inter", "SF Pro Display", -apple-system, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

/* ---------- stage ---------- */
#viewport { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(1200px 800px at 70% 10%, #15080c 0%, var(--bg) 60%); }
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1920px; height: 1080px;
  transform: translate(-50%, -50%) scale(var(--s));
  transform-origin: 50% 50%;
}

/* ---------- slides ---------- */
.slide {
  position: absolute; inset: 0;
  padding: 110px 120px 120px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: scale(1.015);
  filter: blur(6px);
  transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s var(--ease), visibility 0s linear .9s;
}
.slide.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: none; filter: none;
  transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s var(--ease), visibility 0s;
}
.slide.leaving-back { transform: scale(.985); }

.eyebrow {
  font-size: 26px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px; display: flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 18px currentColor; }
h1.title {
  font-size: 84px; line-height: 1.02; font-weight: 700; letter-spacing: -0.035em;
  max-width: 1500px;
}
h1.title .dim { color: var(--text3); font-weight: 600; }
.lead { font-size: 36px; line-height: 1.35; color: var(--text2); font-weight: 400; margin-top: 22px; max-width: 760px; }

.grad-red { background: linear-gradient(100deg, #ff6b81, #ff2d55 45%, #c9182b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-blue { background: linear-gradient(100deg, #64d2ff, #0a84ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-purple { background: linear-gradient(100deg, #da8fff, #8e5cf7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-gold { background: linear-gradient(100deg, #ffe066, #ff9f0a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-green { background: linear-gradient(100deg, #7dffb0, #30d158); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* layout */
.split { display: grid; grid-template-columns: 680px 1fr; gap: 60px; height: 100%; }
.split.wide-text { grid-template-columns: 820px 1fr; }
.split.narrow-text { grid-template-columns: 560px 1fr; }
.col { display: flex; flex-direction: column; min-height: 0; }
.col.center { justify-content: center; }
.visual { position: relative; min-height: 0; height: 100%; }
.full-visual { position: absolute; inset: 0; }
.three-host { position: absolute; inset: 0; }
.three-host canvas { display: block; outline: none; }
.row { display: flex; gap: 24px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* bullets */
ul.bullets { list-style: none; margin-top: 46px; display: flex; flex-direction: column; gap: 26px; }
ul.bullets li {
  font-size: 40px; line-height: 1.2; font-weight: 500; letter-spacing: -0.012em;
  padding-left: 46px; position: relative; color: var(--text);
}
ul.bullets li::before {
  content: ""; position: absolute; left: 4px; top: .48em; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 16px var(--accent);
}
ul.bullets li .sub { display: block; font-size: 28px; color: var(--text2); font-weight: 400; margin-top: 6px; }
ul.bullets li b, .hl { color: var(--accent); font-weight: 650; }
ul.bullets.sm li { font-size: 34px; }

/* stat tiles */
.stats { display: flex; gap: 22px; margin-top: 44px; flex-wrap: wrap; }
.stat {
  background: var(--glass); border: 1px solid var(--line); border-radius: 28px;
  padding: 24px 30px 22px; min-width: 190px; backdrop-filter: blur(18px);
  transition: transform .4s var(--ease), background .4s, border-color .4s;
}
.stat:hover { transform: translateY(-4px); background: var(--glass2); border-color: rgba(255,255,255,.2); }
.stat .v { font-size: 64px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.stat .v small { font-size: 30px; font-weight: 600; color: var(--text2); margin-left: 6px; letter-spacing: 0; }
.stat .k { font-size: 24px; color: var(--text2); margin-top: 10px; font-weight: 500; }

/* glass card */
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 32px; backdrop-filter: blur(22px); }
.card { padding: 30px 34px; }
.card h3 { font-size: 36px; font-weight: 650; letter-spacing: -0.02em; }
.card p { font-size: 27px; color: var(--text2); margin-top: 10px; line-height: 1.35; }

/* chips / controls */
.chips { display: flex; flex-wrap: wrap; gap: 14px; }
.chip {
  font-size: 26px; font-weight: 600; padding: 14px 26px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); color: var(--text);
  transition: all .35s var(--ease); white-space: nowrap;
}
.chip:hover { background: var(--glass2); border-color: rgba(255,255,255,.25); transform: translateY(-2px); }
.chip.on { background: var(--text); color: #000; border-color: var(--text); box-shadow: 0 10px 40px rgba(255,255,255,.18); }
.chip.red.on { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 10px 40px rgba(255,55,95,.4); }
.chip .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: 2px; }
.btn-primary { white-space: nowrap;
  font-size: 28px; font-weight: 650; padding: 18px 38px; border-radius: 999px; background: var(--text); color: #000;
  transition: transform .3s var(--ease), box-shadow .3s; box-shadow: 0 10px 40px rgba(255,255,255,.15);
}
.btn-primary:hover { transform: scale(1.04); box-shadow: 0 16px 60px rgba(255,255,255,.28); }

/* range slider */
.slider-wrap { display: flex; flex-direction: column; gap: 14px; }
.slider-wrap label { font-size: 26px; color: var(--text2); display: flex; justify-content: space-between; font-weight: 500; }
.slider-wrap label b { color: var(--text); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 10px; background: rgba(255,255,255,.12); outline: none; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 38px; height: 38px; border-radius: 50%; background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.5), 0 0 0 6px rgba(255,255,255,.12); }
input[type=range]::-moz-range-thumb { width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 0; }

/* reveal on enter */
.reveal { opacity: 0; transform: translateY(34px); filter: blur(10px); transition: opacity .9s var(--ease), transform 1s var(--ease), filter .9s var(--ease); }
.slide.active .reveal { opacity: 1; transform: none; filter: none; transition-delay: calc(var(--i, 0) * 110ms + 250ms); }

/* step fragments */
.frag { opacity: .14; filter: blur(2px); transition: opacity .7s var(--ease), filter .7s, transform .7s var(--ease); }
.frag.shown { opacity: 1; filter: none; }

/* tooltip */
#tip {
  position: absolute; z-index: 50; pointer-events: none; max-width: 560px;
  padding: 26px 30px 24px; border-radius: 26px;
  background: rgba(22, 22, 28, 0.82); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(10px) scale(.97); transition: opacity .28s var(--ease), transform .35s var(--ease);
}
#tip.on { opacity: 1; transform: none; }
#tip .tt { font-size: 30px; font-weight: 700; letter-spacing: -0.015em; display: flex; align-items: center; gap: 12px; }
#tip .tt i { width: 12px; height: 12px; border-radius: 50%; background: var(--tipc, var(--red)); box-shadow: 0 0 14px var(--tipc, var(--red)); flex: none; }
#tip .tb { font-size: 24px; line-height: 1.42; color: #d4d4dc; margin-top: 12px; }
#tip .tb ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
#tip .tb li { padding-left: 22px; position: relative; }
#tip .tb li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--tipc, var(--red)); }
#tip .tb .note { display: block; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); color: var(--yellow); font-size: 21px; }
#tip .tb b { color: #fff; }
[data-tip] { cursor: help; }

/* hotspot */
.hotspot { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: 0 0 0 0 rgba(255,255,255,.6); animation: pulse 2.2s infinite; cursor: help; z-index: 5; }
.hotspot::after { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 700; color: #000; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 70% { box-shadow: 0 0 0 26px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.tag { position: absolute; font-size: 24px; font-weight: 600; padding: 8px 18px; border-radius: 999px; background: rgba(15,15,20,.7); border: 1px solid var(--line); backdrop-filter: blur(12px); white-space: nowrap; transform: translate(-50%, -50%); pointer-events: auto; }

/* chrome: progress + chapter label */
#chrome-top { position: absolute; top: 44px; left: 120px; right: 120px; display: flex; align-items: center; justify-content: space-between; z-index: 20; pointer-events: none; }
#chapter-label { font-size: 22px; font-weight: 600; color: var(--text3); letter-spacing: .1em; text-transform: uppercase; }
#slide-num { font-size: 22px; font-weight: 600; color: var(--text3); font-variant-numeric: tabular-nums; }
#progress { position: absolute; left: 120px; right: 120px; bottom: 46px; display: flex; gap: 10px; z-index: 20; }
#progress .seg { flex: var(--n); height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; cursor: pointer; position: relative; }
#progress .seg i { position: absolute; inset: 0; width: 0; background: var(--c, #fff); border-radius: 6px; transition: width .7s var(--ease); }
#progress .seg:hover { background: rgba(255,255,255,.2); }
#nav-btns { position: absolute; right: 120px; bottom: 70px; display: flex; gap: 12px; z-index: 21; opacity: .0; transition: opacity .4s; }
#stage:hover #nav-btns { opacity: 1; }
#nav-btns button { width: 60px; height: 60px; border-radius: 50%; background: var(--glass); border: 1px solid var(--line); font-size: 28px; backdrop-filter: blur(12px); }
#nav-btns button:hover { background: var(--glass2); }
#step-ind { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); display: flex; gap: 10px; z-index: 20; }
#step-ind i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.2); transition: all .4s var(--ease); }
#step-ind i.on { background: #fff; width: 28px; border-radius: 6px; }

/* overview */
#overview { position: fixed; inset: 0; z-index: 100; background: rgba(5,5,7,.92); backdrop-filter: blur(30px); display: none; overflow-y: auto; padding: 60px 80px; }
#overview.on { display: block; }
#overview h2 { font-size: 40px; font-weight: 700; margin-bottom: 30px; letter-spacing: -0.02em; }
#overview .ov-ch { margin-bottom: 36px; }
#overview .ov-ch h3 { font-size: 22px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
#overview .ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
#overview .ov-item { padding: 16px 20px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); font-size: 18px; cursor: pointer; transition: all .25s; text-align: left; }
#overview .ov-item:hover { background: var(--glass2); transform: translateY(-2px); }
#overview .ov-item span { color: var(--text3); margin-right: 10px; font-variant-numeric: tabular-nums; }

#hint { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--text3); z-index: 30; transition: opacity 1s; letter-spacing: .04em; }

/* SVG diagram defaults */
svg text { font-family: inherit; }
.svg-label { fill: var(--text); font-size: 26px; font-weight: 600; }
.svg-sub { fill: var(--text2); font-size: 21px; font-weight: 500; }
.node rect, .node circle { transition: all .4s var(--ease); }
.node { cursor: help; }
.node:hover rect, .node:hover circle { filter: brightness(1.25); }
.flow { stroke-dasharray: 8 12; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -40; } }

/* table-ish rows */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 14px 28px; font-size: 28px; align-items: baseline; }
.kv dt { color: var(--text2); font-weight: 500; }
.kv dd { font-weight: 650; }

/* footer ref */
.ref { position: absolute; left: 120px; bottom: 74px; font-size: 19px; color: var(--text3); letter-spacing: .02em; }

/* utility */
.muted { color: var(--text2); }
.center-abs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.big-num { font-size: 150px; font-weight: 800; letter-spacing: -0.06em; line-height: .9; }
.legend { display: flex; gap: 26px; flex-wrap: wrap; font-size: 24px; color: var(--text2); }
.legend i { display: inline-block; width: 16px; height: 16px; border-radius: 5px; margin-right: 10px; vertical-align: -2px; }
.pill-label { display: inline-block; font-size: 22px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; padding: 8px 16px; border-radius: 999px; background: var(--glass2); color: var(--text2); }
.kbd { display: inline-block; padding: 2px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass); font-size: .9em; }
