/* Compiled Canvas – small additions on top of Bootstrap 5 */
:root {
  --brand: #e8590c;
  --brand-dark: #c94c0a;
  --gold: #f6b93b;
}
.text-brand { color: #ff7a2f; }
.bg-brand { background: var(--brand) !important; }
.btn-brand {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
}
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .card:hover, .navbar-brand:hover { text-decoration: none; }

/* ---------- hero with animated algorithm canvas */
.hero { position: relative; background: #111; overflow: hidden; }
.hero::after { /* soften the canvas behind the text */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(17,17,17,.95) 0%, rgba(17,17,17,.75) 55%, rgba(17,17,17,.35) 100%);
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 767.98px) {
  .hero::after { background: linear-gradient(180deg, rgba(17,17,17,.92) 0%, rgba(17,17,17,.8) 100%); }
}
.hero .container { z-index: 1; }

.code-card { background: #1b1b1b; border: 1px solid #333; border-radius: .6rem; overflow: hidden; }
.code-card-bar { display: flex; align-items: center; gap: 6px; padding: .5rem .75rem; background: #232323; border-bottom: 1px solid #333; }
.code-card-bar span { width: 10px; height: 10px; border-radius: 50%; background: #555; }
.code-card-bar span:nth-child(1) { background: #ff5f57; }
.code-card-bar span:nth-child(2) { background: #febc2e; }
.code-card-bar span:nth-child(3) { background: #28c840; }
.code-card-bar small { margin-left: .5rem; color: #999; font-size: .75rem; }
.code-card pre { padding: 1rem 1.1rem; color: #e9e3d8; font-size: .9rem; min-height: 11.5em; background: transparent; }
.code-card .kw { color: #ff7a2f; }
.code-card .num { color: #f6b93b; }
.caret { display: inline-block; width: 8px; height: 1.1em; background: #ff7a2f; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- course cards */
.course-card { transition: transform .2s ease, box-shadow .2s ease; }
.course-card:hover { transform: translateY(-4px); box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.12) !important; }
.course-card.soon { border-style: dashed; }
.dsa-visual { background: #151515; min-height: 220px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.bars span {
  width: 22px; height: calc(var(--h) * 15px); border-radius: 4px 4px 0 0; background: #444;
  animation: bar 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * .18s);
}
@keyframes bar {
  0%, 100% { background: #444; transform: scaleY(1); }
  30% { background: var(--brand); transform: scaleY(1.12); }
  60% { background: var(--gold); transform: scaleY(.9); }
}
.bars span { transform-origin: bottom; }

.video-card img { transition: transform .3s ease; }
.video-card:hover img { transform: scale(1.05); }
.video-card .ratio { overflow: hidden; }

.step-num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; margin-bottom: .75rem;
  background: var(--brand); color: #fff; font-weight: 700;
}

/* ---------- inner page header */
.page-head { background: var(--bs-tertiary-bg); border-bottom: 1px solid var(--bs-border-color); }

/* ---------- problem lists */
.ptable tr.is-done a.fw-semibold { color: var(--bs-secondary-color); text-decoration: line-through; }
pre { padding: 1rem; font-size: .875rem; background: var(--bs-tertiary-bg); }
pre code.hljs { background: transparent; padding: 0; }
.copy { font-size: .75rem; }
.reveal-body:not([hidden]) { animation: drop .25s ease; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.progress-bar { transition: width .8s ease; }

/* ---------- scroll motion */
.js .fade-up { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .fade-up.in { opacity: 1; transform: none; }
.js .stagger tbody tr { opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; }
.js .stagger.in tbody tr { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .fade-up, .js .stagger tbody tr { opacity: 1 !important; transform: none !important; transition: none !important; }
  .bars span, .caret, .progress-bar-animated { animation: none !important; }
}
@media (max-width: 575.98px) {
  .pager .btn { width: 100%; }
  .bars span { width: 16px; }
}

/* ---------- the DSA path (stations light up in sequence) */
.path { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2.25rem 0; position: relative; counter-reset: st; }
.station { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: 0 .25rem; }
.station::before { /* connector drawn from the previous station */
  content: ""; position: absolute; top: 19px; right: 50%; width: 100%; height: 3px; background: var(--bs-border-color);
  transform-origin: left; transform: scaleX(0); transition: transform .45s ease; transition-delay: calc(var(--i) * .12s);
}
.station:nth-child(5n+1)::before { display: none; }
.station .dot {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; background: var(--bs-body-bg); border: 3px solid var(--bs-border-color); color: var(--bs-secondary-color);
  transform: scale(.4); opacity: 0; transition: transform .4s cubic-bezier(.3,1.6,.5,1), opacity .3s, background .3s, border-color .3s;
  transition-delay: calc(var(--i) * .12s);
}
.station .name { font-size: .85rem; font-weight: 600; opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; transition-delay: calc(var(--i) * .12s + .1s); }
.path.in .station::before { transform: scaleX(1); }
.path.in .station .dot, .path.in .station .name { opacity: 1; transform: none; }
.station.here .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.path.in .station.here .dot { animation: here 2s ease-out infinite; animation-delay: 2s; }
.station.here::before { background: var(--brand); }
@keyframes here { 0% { box-shadow: 0 0 0 0 rgba(232,89,12,.55); } 70%, 100% { box-shadow: 0 0 0 14px rgba(232,89,12,0); } }
.path::after { /* the spark travelling along the first row */
  content: ""; position: absolute; top: 15px; left: 8%; width: 11px; height: 11px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 12px 4px rgba(246,185,59,.7); opacity: 0;
}
.path.in::after { animation: spark 6s ease-in-out 2.2s infinite; }
@keyframes spark { 0% { left: 8%; opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { left: 88%; opacity: 0; } }
@media (max-width: 767.98px) {
  .path { grid-template-columns: 1fr; gap: 1rem; padding-left: .25rem; }
  .station { flex-direction: row; text-align: left; gap: .9rem; }
  .station::before { top: auto; bottom: 50%; right: auto; left: 18px; width: 3px; height: calc(100% + 1rem); transform-origin: top; transform: scaleY(0); }
  .station:nth-child(5n+1)::before { display: block; }
  .station:first-child::before { display: none; }
  .path.in .station::before { transform: scaleY(1); }
  .path::after { display: none; }
}

/* ---------- animated step icons */
.step-icon { width: 56px; height: 56px; margin-bottom: .75rem; }
.step-icon svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.step-icon .ring, .step-icon .track { stroke: var(--bs-border-color); stroke-width: 3; }
.step-icon .pulse { stroke: var(--brand); stroke-width: 2; transform-origin: center; animation: pulse 2.2s ease-out infinite; }
.step-icon .play { fill: var(--brand); }
@keyframes pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
.step-icon .brackets { stroke: var(--brand); stroke-width: 3.5; stroke-dasharray: 60; stroke-dashoffset: 60; }
.in .step-icon .brackets { animation: draw 1s ease forwards; }
.step-icon .cursor { fill: var(--gold); animation: blink 1s steps(1) infinite; }
.step-icon .fill { stroke: #198754; stroke-width: 4; stroke-dasharray: 113; stroke-dashoffset: 113; transform: rotate(-90deg); transform-origin: center; }
.in .step-icon .fill { animation: draw 1.4s ease forwards .2s; }
.step-icon .tick { stroke: #198754; stroke-width: 3.5; stroke-dasharray: 24; stroke-dashoffset: 24; }
.in .step-icon .tick { animation: draw .5s ease forwards 1.4s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- topic header: array with a sliding window */
.array-strip { position: relative; display: inline-flex; gap: 6px; padding: 4px; }
.array-strip span {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); font: 600 .85rem ui-monospace, Menlo, monospace;
}
.array-strip .window {
  position: absolute; top: 0; left: 0; height: 42px; width: calc(3 * 34px + 2 * 6px + 8px); border: 2px solid var(--brand);
  border-radius: 9px; background: rgba(232,89,12,.08); animation: slide 7s ease-in-out infinite;
}
@keyframes slide { 0%, 8% { transform: translateX(0); } 92%, 100% { transform: translateX(calc(6 * 40px)); } }
@media (max-width: 400px) { .array-strip span { width: 28px; height: 28px; } .array-strip .window { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .station::before, .station .dot, .station .name { transition: none !important; opacity: 1 !important; transform: none !important; }
  .path::after, .array-strip .window, .step-icon * { animation: none !important; }
  .step-icon .brackets, .step-icon .fill, .step-icon .tick { stroke-dashoffset: 0 !important; }
}

/* understanding traces */
.trace { padding: .75rem 1rem; font-size: .85rem; background: var(--bs-tertiary-bg); white-space: pre; overflow-x: auto; }
.understanding p:last-child { margin-bottom: 0; }

/* about the creator */
.about-photo { width: 220px; height: 220px; object-fit: cover; border: 4px solid var(--brand); }
.creator:hover { text-decoration: none; }
.creator:hover span { color: #fff; }

/* ================= 3D bobblehead ================= */
.toon { width: 260px; height: 300px; perspective: 900px; }
.toon-stage { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .25s ease-out; }
.toon-shadow { position: absolute; left: 50%; bottom: 6px; width: 150px; height: 22px; margin-left: -75px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,.35), transparent 70%); animation: shadow 3.2s ease-in-out infinite; }
.toon-body { position: absolute; left: 50%; bottom: 14px; width: 150px; margin-left: -75px; transform: translateZ(10px);
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.25)); animation: bodybob 3.2s ease-in-out infinite; }
.toon-head { position: absolute; left: 50%; top: 8px; width: 190px; height: 190px; margin-left: -95px; border-radius: 50%;
  overflow: hidden; transform: translateZ(40px); transform-origin: 50% 100%;
  box-shadow: 0 18px 30px rgba(0,0,0,.35), inset 0 -12px 24px rgba(0,0,0,.35), 0 0 0 5px var(--brand), 0 0 0 9px rgba(232,89,12,.25);
  animation: bobble 3.2s ease-in-out infinite; }
.toon-head img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transform: scale(2.05); transform-origin: 46% 27%; }
.toon-shine { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.45), transparent 38%), radial-gradient(circle at 70% 85%, rgba(0,0,0,.35), transparent 50%); }
.toon-chip { position: absolute; z-index: 2; padding: .2rem .55rem; border-radius: 8px; font: 700 .8rem ui-monospace, Menlo, monospace;
  background: #111; color: var(--gold); box-shadow: 0 6px 14px rgba(0,0,0,.3); transform: translateZ(70px); }
.toon-chip.c1 { left: -6px; top: 40px; animation: float 4s ease-in-out infinite; }
.toon-chip.c2 { right: -4px; top: 18px; color: #ff7a2f; animation: float 4.6s ease-in-out .6s infinite; }
.toon-chip.c3 { right: 6px; top: 150px; color: #fff; background: var(--brand); animation: float 5s ease-in-out 1.2s infinite; }
.toon-code { animation: blink 1.2s steps(1) infinite; }
@keyframes bobble { 0%, 100% { transform: translateZ(40px) rotate(-5deg); } 50% { transform: translateZ(40px) rotate(5deg) translateY(-6px); } }
@keyframes bodybob { 0%, 100% { transform: translateZ(10px) translateY(0); } 50% { transform: translateZ(10px) translateY(-3px); } }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.9); opacity: .8; } }
@keyframes float { 0%, 100% { transform: translateZ(70px) translateY(0); } 50% { transform: translateZ(70px) translateY(-10px); } }

/* ================= 3D tilt for cards ================= */
[data-tilt] { transform-style: preserve-3d; will-change: transform; }
.topic-card { color: inherit; border: 1px solid var(--bs-border-color); transition: transform .2s ease, box-shadow .2s ease, border-color .2s; }
.topic-card:hover { border-color: var(--brand); box-shadow: 0 1rem 2rem rgba(0,0,0,.12) !important; }
.topic-num { font: 800 1.6rem ui-monospace, Menlo, monospace; color: var(--brand); line-height: 1; }
.ring-sm { --p: 0; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#198754 calc(var(--p) * 1%), var(--bs-border-color) 0); transition: background .6s; }
.ring-sm::before { content: ""; grid-area: 1/1; width: 36px; height: 36px; border-radius: 50%; background: var(--bs-body-bg); }
.ring-sm span { grid-area: 1/1; position: relative; font: 600 .7rem ui-monospace, Menlo, monospace; }
.diff-bar { display: flex; height: 6px; border-radius: 4px; overflow: hidden; background: var(--bs-border-color); }
.diff-bar span { width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.in .diff-bar span, .diff-bar.in span { width: var(--w); }
.js .fade-up { transition-delay: calc(var(--d, 0) * 60ms); }

/* topic header chart */
.diff-chart { display: flex; gap: 14px; align-items: flex-end; height: 92px; }
.diff-chart > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 46px; font-size: .75rem; }
.col-bar { width: 26px; height: 0; border-radius: 5px 5px 0 0; transition: height 1s cubic-bezier(.2,.8,.2,1); }
.diff-chart.in .col-bar { height: calc(var(--h) * .55); }
.diff-chart b { line-height: 1.1; margin-top: 3px; }
.diff-chart small { color: var(--bs-secondary-color); }

/* problem list rows */
.ptable tbody tr { transition: background .2s, transform .2s, box-shadow .2s; }
.ptable tbody tr:hover { transform: translateX(4px); box-shadow: inset 3px 0 0 var(--brand); }
.done-box { transition: transform .15s; }
.done-box:checked { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }

/* ================= problem page ================= */
.journey { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 1rem; counter-reset: j; font-size: .8rem; }
.journey li { position: relative; padding: .3rem .8rem .3rem 1.9rem; margin-right: .35rem; margin-bottom: .35rem; border-radius: 999px;
  background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); counter-increment: j; transition: background .35s, color .35s, transform .35s; }
.journey li::before { content: counter(j); position: absolute; left: .35rem; top: 50%; width: 1.2rem; height: 1.2rem; margin-top: -.6rem;
  border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .7rem; background: var(--bs-border-color); color: var(--bs-body-color); }
.journey li.done { background: rgba(232,89,12,.12); color: var(--bs-body-color); }
.journey li.done::before { content: "✓"; background: var(--brand); color: #fff; animation: pop .35s ease; }
.journey li[data-step="solved"].done { background: rgba(25,135,84,.15); }
.journey li[data-step="solved"].done::before { background: #198754; }
.trace .tl { display: block; }
.js .trace .tl { opacity: 0; transform: translateX(-8px); transition: opacity .35s ease, transform .35s ease; transition-delay: calc(var(--i) * 220ms); }
.js .trace.in .tl { opacity: 1; transform: none; }
.problem-card { transition: transform .2s; }

/* confetti */
.confetti { position: fixed; z-index: 2000; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; animation: confetti 1.1s ease-out forwards; }
@keyframes confetti { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .toon-head, .toon-body, .toon-shadow, .toon-chip, .toon-code { animation: none !important; }
  .js .trace .tl { opacity: 1 !important; transform: none !important; }
  .diff-bar span { width: var(--w) !important; } .col-bar { height: calc(var(--h) * .55) !important; }
}
@media (max-width: 575.98px) { .toon { transform: scale(.85); } }

/* ================= highlighted video call-to-action ================= */
.video-cta { display: flex; align-items: center; gap: .9rem; max-width: 520px; margin: .25rem 0 .6rem; padding: .55rem; border-radius: 14px;
  background: #fff4ee; border: 2px solid #ff0033; color: #111 !important; text-decoration: none !important;
  box-shadow: 0 8px 22px rgba(255,0,51,.18); transition: transform .2s, box-shadow .2s; position: relative; }
[data-bs-theme="dark"] .video-cta { background: #2a1414; color: #fff !important; }
.video-cta:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 14px 30px rgba(255,0,51,.28); }
.video-thumb { position: relative; flex: none; width: 150px; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden; background: #000; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.video-cta:hover .video-thumb img { transform: scale(1.08); }
.play { position: absolute; left: 50%; top: 50%; width: 44px; height: 31px; margin: -15px 0 0 -22px; border-radius: 9px; background: #ff0033;
  display: grid; place-items: center; box-shadow: 0 0 0 0 rgba(255,0,51,.6); animation: playpulse 1.8s ease-out infinite; }
.play span { width: 0; height: 0; border-left: 13px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
@keyframes playpulse { 0% { box-shadow: 0 0 0 0 rgba(255,0,51,.55); } 70%, 100% { box-shadow: 0 0 0 14px rgba(255,0,51,0); } }
.video-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.video-kicker { font: 800 .72rem system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #ff0033; margin-bottom: .2rem; }
.video-text strong { font-size: .95rem; }
.video-text small { color: var(--bs-secondary-color); margin-top: .15rem; }
.video-pill { animation: playpulse 1.8s ease-out infinite; }
@media (max-width: 420px) { .video-thumb { width: 110px; } .video-text strong { font-size: .85rem; } }
@media (prefers-reduced-motion: reduce) { .play, .video-pill { animation: none; } }

/* ================= animated caricature (drawn from the GitHub photo) ================= */
.toon { width: 280px; height: auto; }
.toon-stage { height: auto; }
.caricature { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 14px 18px rgba(0,0,0,.22)); }
.caricature * { transform-box: view-box; }
.cc-head { transform-origin: 150px 240px; animation: ccbob 3.4s ease-in-out infinite; }
.cc-body { transform-origin: 150px 350px; animation: ccbreath 3.4s ease-in-out infinite; }
.cc-wave { transform-origin: 204px 276px; animation: ccwave 2.2s ease-in-out infinite; }
.cc-eyes { transform-origin: 162px 140px; animation: ccblink 4.6s infinite; }
.cc-pupils { animation: cclook 7s ease-in-out infinite; }
.cc-shadow { transform-origin: 150px 362px; animation: ccshadow 3.4s ease-in-out infinite; }
.cc-clouds { animation: ccclouds 18s linear infinite alternate; }
@keyframes ccbob { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-5px); } }
@keyframes ccbreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015, .99); } }
@keyframes ccwave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-10deg); } }
@keyframes ccblink { 0%, 90%, 100% { transform: scaleY(1); } 93% { transform: scaleY(.08); } 96% { transform: scaleY(1); } }
@keyframes cclook { 0%, 30% { transform: translate(0, 0); } 40%, 60% { transform: translate(-5px, 2px); } 70%, 100% { transform: translate(0, 0); } }
@keyframes ccshadow { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.92); } }
@keyframes ccclouds { from { transform: translateX(-10px); } to { transform: translateX(14px); } }
@media (prefers-reduced-motion: reduce) { .caricature * { animation: none !important; } }
@media (max-width: 575.98px) { .toon { width: 240px; transform: none; } }

/* caricature pose: laptop hand, blessing hand, aura */
.cc-aura { transform-origin: 152px 140px; animation: ccaura 4s ease-in-out infinite; }
.cc-rays { transform-origin: 152px 140px; animation: ccrays 30s linear infinite; }
.cc-halo { filter: drop-shadow(0 0 6px #ffc629); }
.cc-palmglow { transform-origin: 238px 214px; animation: ccpalm 2.6s ease-in-out infinite; }
.cc-bless { transform-origin: 204px 276px; animation: ccbless 4s ease-in-out infinite; }
.cc-screen { animation: ccscreen 2.4s ease-in-out infinite; }
.cc-code { animation: blink 1.2s steps(1) infinite; }
@keyframes ccaura { 0%, 100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes ccrays { to { transform: rotate(360deg); } }
@keyframes ccpalm { 0%, 100% { opacity: .5; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes ccbless { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-2deg) translateY(-2px); } }
@keyframes ccscreen { 0%, 100% { opacity: .12; } 50% { opacity: .32; } }

/* ================= profile caricature with a light aura ================= */
.profile-art { position: relative; max-width: 440px; transition: transform .25s ease-out; }
.profile-art img { position: relative; z-index: 1; width: 100%; height: auto; filter: drop-shadow(0 18px 24px rgba(0,0,0,.18)); animation: float-art 6s ease-in-out infinite; }
.profile-art .aura { position: absolute; z-index: 0; left: 50%; top: 22%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(255,246,214,.95) 0%, rgba(255,198,41,.55) 35%, rgba(255,138,31,.18) 60%, transparent 72%);
  animation: aura 4s ease-in-out infinite; }
.profile-art .aura::after { content: ""; position: absolute; inset: 6%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,214,107,.35) 0 4deg, transparent 4deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 38%, #000 40%, #000 64%, transparent 70%); mask: radial-gradient(circle, transparent 38%, #000 40%, #000 64%, transparent 70%);
  animation: ccrays 40s linear infinite; }
@keyframes aura { 0%, 100% { opacity: .85; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } }
@keyframes float-art { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.creator-face { object-fit: cover; object-position: 50% 6%; background: #fff3e0; }

/* ================= animated colour blobs behind every page ================= */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs span { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(80px); opacity: .22; animation: blob 26s ease-in-out infinite alternate; }
.bg-blobs span:nth-child(1) { background: #ff8a1f; left: -12vmax; top: -10vmax; }
.bg-blobs span:nth-child(2) { background: #7c4dff; right: -14vmax; top: 30vh; animation-duration: 32s; }
.bg-blobs span:nth-child(3) { background: #00b3a4; left: 20vw; bottom: -18vmax; animation-duration: 38s; }
@keyframes blob { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vw, 4vh) scale(1.1); } 100% { transform: translate(-4vw, 8vh) scale(.95); } }
body { background: #fbf8f3; }
[data-bs-theme="dark"] body { background: #121014; }
[data-bs-theme="dark"] .bg-blobs span { opacity: .16; }
main > section.bg-body-tertiary { background: rgba(255,255,255,.55) !important; backdrop-filter: blur(6px); }

/* ================= colourful page headers ================= */
.page-head { position: relative; overflow: hidden; color: #fff; border: 0;
  background: linear-gradient(120deg, #1b1220 0%, #3b1c3f 40%, #a83e06 78%, #e8590c 100%); }
.page-head::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(circle at 20% 30%, rgba(255,198,41,.25), transparent 40%), radial-gradient(circle at 80% 70%, rgba(124,77,255,.35), transparent 45%);
  animation: headglow 14s ease-in-out infinite alternate; }
.page-head > .container { position: relative; }
@keyframes headglow { to { transform: translate(6%, -4%) rotate(8deg); } }
.page-head .breadcrumb-item a { color: #ffd9a8; }
.page-head .breadcrumb-item.active, .page-head .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.7); }
.page-head .text-body-secondary, .page-head small { color: rgba(255,255,255,.78) !important; }
.page-head .lead { color: rgba(255,255,255,.88); }
.page-head .progress { background: rgba(255,255,255,.2); }
.page-head .card { color: var(--bs-body-color); }
.page-head .card .text-body-secondary, .page-head .card small { color: var(--bs-secondary-color) !important; }
.page-head .diff-chart b { color: #fff; }
.page-head .video-cta { background: #fff; }
.page-head .badge.text-bg-light { background: rgba(255,255,255,.95) !important; }
.problem-head.diff-easy { background: linear-gradient(120deg, #0f2a1f 0%, #155e46 45%, #1f9d6b 80%, #f6b93b 100%); }
.problem-head.diff-medium { background: linear-gradient(120deg, #2a1a07 0%, #6b3d07 40%, #d9820b 80%, #ffc629 100%); }
.problem-head.diff-hard { background: linear-gradient(120deg, #2a0c16 0%, #6d1430 45%, #c22a4a 80%, #ff8a1f 100%); }
.lc-num-big { display: inline-block; font: 800 .85rem ui-monospace, Menlo, monospace; padding: .15rem .55rem; border-radius: 6px; background: rgba(255,255,255,.18); margin-bottom: .4rem; }
.pattern-badge { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.problem-head .journey li { background: rgba(255,255,255,.14); color: rgba(255,255,255,.85); }
.problem-head .journey li::before { background: rgba(255,255,255,.3); color: #fff; }
.problem-head .journey li.done { background: rgba(255,255,255,.95); color: #1b1220; }

/* ================= tinted section cards on problem pages ================= */
.sec { --tone: #e8590c; position: relative; margin-bottom: 1rem; padding: 1.1rem 1.25rem 1.2rem; border-radius: 16px;
  background: color-mix(in srgb, var(--tone) 7%, var(--bs-body-bg)); border: 1px solid color-mix(in srgb, var(--tone) 22%, transparent);
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--tone) 60%, transparent); transition: transform .2s, box-shadow .2s; }
.sec:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--tone) 70%, transparent); }
.sec::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 4px; background: var(--tone); }
.sec-title { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; font-weight: 800; margin-bottom: .75rem; }
.sec-title small { font-weight: 500; font-size: .8rem; color: var(--bs-secondary-color); }
.sec-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .85rem; font-weight: 800; color: #fff; background: var(--tone);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--tone) 50%, transparent); }
.sec-problem { --tone: #2f6fed; }
.sec-understand { --tone: #7c4dff; }
.sec-hints { --tone: #e09a00; }
.sec-approach { --tone: #0aa596; }
.sec-mistake { --tone: #e5484d; }
.sec-solution { --tone: #e8590c; background: linear-gradient(135deg, #17141c, #231a26); color: #f2ede4; border-color: #3a2c3a; }
.sec-solution .sec-title { color: #fff; }
.sec-solution pre { background: #0f0d12; color: #e9e3d8; border: 1px solid #3a2c3a; }
.sec-solution pre code.hljs { color: #e9e3d8; }
.sec .trace { background: rgba(255,255,255,.75); }
[data-bs-theme="dark"] .sec .trace { background: rgba(0,0,0,.25); }
.sec .hint .reveal-body { background: rgba(255,255,255,.7); border-radius: 0 8px 8px 0; padding-top: .5rem; padding-bottom: .5rem; }
.side-sticky { position: sticky; top: 76px; }
.solve-card { border: 0; background: linear-gradient(135deg, #fff3e8, #ffffff); }
.complexity-card .card-header { background: linear-gradient(90deg, #7c4dff, #2f6fed); color: #fff; }

/* ================= course tiles (all courses equal) ================= */
.course-tile { --tone: #e8590c; border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 12%, var(--bs-body-bg)) 0%, var(--bs-body-bg) 60%);
  transition: transform .2s, box-shadow .2s; }
.course-tile:hover { box-shadow: 0 18px 34px -16px color-mix(in srgb, var(--tone) 75%, transparent); }
.course-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font: 800 .95rem ui-monospace, Menlo, monospace;
  color: #fff; background: linear-gradient(135deg, var(--tone), color-mix(in srgb, var(--tone) 60%, #000)); box-shadow: 0 6px 14px color-mix(in srgb, var(--tone) 45%, transparent);
  animation: iconbob 4s ease-in-out infinite; }
@keyframes iconbob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-4deg); } }
.t-orange { --tone: #e8590c; } .t-blue { --tone: #2f6fed; } .t-violet { --tone: #7c4dff; } .t-teal { --tone: #0aa596; } .t-pink { --tone: #d6336c; }
.t-green { --tone: #2b9348; } .t-amber { --tone: #e09a00; } .t-indigo { --tone: #4c51bf; } .t-red { --tone: #e5484d; }

/* topic cards get a coloured top edge */
.topic-card { border-top: 4px solid var(--brand); background: linear-gradient(180deg, #fff7f0 0%, var(--bs-body-bg) 45%); }
.ptable { background: transparent; }
.table-responsive { background: rgba(255,255,255,.75); border-radius: 14px; padding: .25rem .5rem; box-shadow: 0 10px 24px -18px rgba(0,0,0,.3); }
.ptable tbody tr:nth-child(odd) { background: rgba(232,89,12,.035); }

@media (prefers-reduced-motion: reduce) {
  .bg-blobs span, .page-head::before, .profile-art img, .profile-art .aura, .profile-art .aura::after, .course-icon { animation: none !important; }
}
@media (max-width: 991.98px) { .side-sticky { position: static; } }

/* profile picture: sensible size on every screen */
.profile-art { width: 100%; max-width: 340px; }
@media (max-width: 991.98px) { .profile-art { max-width: 300px; } }
@media (max-width: 767.98px) {
  .profile-art { max-width: 250px; }
  .about-text { text-align: center; }
  .about-text .d-flex { justify-content: center; }
}
@media (max-width: 400px) { .profile-art { max-width: 210px; } }
#about .row { align-items: center; }

/* ================= episode pages ================= */
.ep-player { max-width: 960px; border-radius: 16px; overflow: hidden; background: #000; transform: perspective(1400px) rotateX(1.5deg);
  box-shadow: 0 26px 50px -18px rgba(0,0,0,.65), 0 0 0 3px rgba(255,255,255,.14); transition: transform .35s ease; animation: ep-rise .7s ease both; }
.ep-player:hover { transform: perspective(1400px) rotateX(0); }
@keyframes ep-rise { from { opacity: .4; transform: perspective(1400px) rotateX(7deg) translateY(16px); } }
.ep-moments { columns: 2; column-gap: 1rem; }
.ep-moments li { break-inside: avoid; }
.ep-moments a { display: flex; gap: .6rem; padding: .3rem .45rem; border-radius: 8px; color: inherit; text-decoration: none; transition: background .15s, transform .15s; }
.ep-moments a:hover { background: color-mix(in srgb, var(--tone) 16%, transparent); transform: translateX(3px); }
.ep-moments time { flex: none; min-width: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--tone); }
.ep-transcript summary { cursor: pointer; font-weight: 700; color: var(--tone); }
.ep-transcript[open] summary { margin-bottom: .75rem; }
.ep-try { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-bottom: 1px dashed var(--bs-border-color); text-decoration: none; font-size: .92rem; transition: transform .15s; }
.ep-try:hover { transform: translateX(3px); }
.ep-notes-link { display: inline-block; margin-bottom: .5rem; font-size: .85rem; font-weight: 700; }
.page-head .ep-notes-link { color: #ffd9a8; }
@media (max-width: 575.98px) { .ep-moments { columns: 1; } }
@media (prefers-reduced-motion: reduce) { .ep-player { animation: none; transform: none; } }

/* ==================================================================
   Enterprise theme: one clean look across every page.
   Black, brand orange, amber, gold and off-white, as on the channel.
   ================================================================== */
:root { --ink: #0e0d0c; --ink-2: #1a1816; --paper: #faf7f2; --amber: #ff8a1f; --gold-2: #ffc629; --line: rgba(14,13,12,.1); --shadow-lg: 0 30px 60px -28px rgba(14,13,12,.35); }
[data-bs-theme="dark"] { --paper: #141210; --line: rgba(255,255,255,.1); --shadow-lg: 0 30px 60px -28px rgba(0,0,0,.8); }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--paper); -webkit-font-smoothing: antialiased; font-size: 1.02rem; line-height: 1.6; }
[data-bs-theme="dark"] body { background: var(--paper); }
h1, h2, h3, h4, h5, h6 { letter-spacing: -.02em; }
pre, code { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
.btn { border-radius: 8px; font-weight: 600; }
.btn-lg { padding: .72rem 1.35rem; font-size: 1rem; }
.btn-brand { box-shadow: 0 10px 22px -10px rgba(232,89,12,.8); transition: transform .18s, box-shadow .18s, background .18s; }
.btn-brand:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -10px rgba(232,89,12,.85); }

/* background wash is now barely there */
.bg-blobs span { opacity: .07; }
.bg-blobs span:nth-child(2) { background: #ffc629; }
.bg-blobs span:nth-child(3) { background: #ff8a1f; }

/* reading progress */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1040; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; background: linear-gradient(90deg, #e8590c, #ff8a1f, #ffc629); transform: scaleX(0); transform-origin: left; }

/* nav */
.site-nav { background: rgba(14,13,12,.82); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid rgba(255,255,255,.08); padding: .8rem 0; transition: padding .2s, background .2s, box-shadow .2s; }
.site-nav.scrolled { padding: .45rem 0; background: rgba(14,13,12,.95); box-shadow: 0 10px 26px -14px rgba(0,0,0,.7); }
.site-nav .nav-link { font-weight: 500; font-size: .95rem; }

/* section furniture */
.band { padding: 6rem 0; position: relative; overflow-x: clip; }
.band-tint { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
[data-bs-theme="dark"] .band-tint { background: #1a1816; }
.section-head { max-width: 680px; margin-bottom: 3rem; }
.section-head.d-flex { max-width: none; }
.section-head h2, .split-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; line-height: 1.15; margin-bottom: .75rem; }
.section-head p { color: var(--bs-secondary-color); font-size: 1.1rem; margin: 0; }
.eyebrow { display: inline-block; font: 700 .76rem "JetBrains Mono", ui-monospace, monospace; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); margin-bottom: .85rem; }
.eyebrow.on-dark { color: var(--gold-2); }

/* scroll reveals */
.js .slide-l, .js .slide-r, .js .zoom-in { opacity: 0; transition: opacity .75s ease, transform .75s cubic-bezier(.2,.7,.2,1); }
.js .slide-l { transform: translateX(-36px); } .js .slide-r { transform: translateX(36px); } .js .zoom-in { transform: scale(.95) translateY(16px); }
.js .slide-l.in, .js .slide-r.in, .js .zoom-in.in { opacity: 1; transform: none; }

/* hero */
.hero { background: var(--ink); }
.hero::after { display: none; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 56px 56px;
  -webkit-mask: radial-gradient(ellipse 85% 80% at 70% 40%, #000 25%, transparent 78%); mask: radial-gradient(ellipse 85% 80% at 70% 40%, #000 25%, transparent 78%); }
.hero::before { content: ""; position: absolute; width: 760px; height: 760px; right: -180px; top: -280px; border-radius: 50%; background: radial-gradient(circle, rgba(232,89,12,.34), transparent 66%); }
.hero-row { padding: 5.5rem 0 8.5rem; }
.hero-title { font-size: clamp(2.4rem, 5.2vw, 3.9rem); font-weight: 800; line-height: 1.06; letter-spacing: -.035em; margin-bottom: 1.25rem; }
.hero-lead { font-size: 1.16rem; color: rgba(255,255,255,.7); max-width: 34rem; margin-bottom: 2rem; }
.hero-stage { position: relative; padding: 1.5rem 0; }
.app-window { background: #171513; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; overflow: hidden; box-shadow: 0 50px 90px -34px #000, 0 0 0 1px rgba(232,89,12,.14);
  transform: perspective(1500px) rotateY(-5deg) rotateX(2deg); }
.app-bar { display: flex; align-items: center; gap: 7px; padding: .6rem .85rem; background: #201d1a; border-bottom: 1px solid rgba(255,255,255,.08); }
.app-bar span { width: 10px; height: 10px; border-radius: 50%; background: #4a4540; }
.app-bar small { margin-left: .5rem; color: rgba(255,255,255,.5); font: 500 .74rem "JetBrains Mono", monospace; }
.app-viz { padding: 1.35rem 1.25rem 1.1rem; }
.viz-title { color: rgba(255,255,255,.75); font-size: .92rem; margin-bottom: .95rem; }
.viz-title b { color: var(--gold-2); }
.viz-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.viz-row span { display: grid; place-items: center; aspect-ratio: 1; max-height: 62px; width: 100%; border-radius: 9px; background: #26221e; border: 1px solid rgba(255,255,255,.1); color: #f5efe6; font: 700 1.05rem "JetBrains Mono", monospace; transition: all .35s ease; }
.viz-row .l, .viz-row .r { background: var(--brand); border-color: var(--amber); transform: translateY(-5px); box-shadow: 0 12px 20px -10px var(--brand); }
.viz-row .r { background: #d97a0f; }
.viz-row .out { opacity: .28; }
.viz-row .hit { background: var(--gold-2); border-color: #ffe08a; color: #1b1500; box-shadow: 0 12px 24px -10px var(--gold-2); }
.viz-note { margin-top: .9rem; min-height: 1.5em; color: #f5efe6; font: 500 .88rem "JetBrains Mono", monospace; }
.app-code { border-top: 1px solid rgba(255,255,255,.08); padding: .9rem 1.25rem 1rem; background: #12100e; }
.app-code pre { color: #e9e3d8; font-size: .82rem; min-height: 8em; background: transparent; border: 0; padding: 0; }
.app-code .kw { color: #ff8a1f; } .app-code .num { color: var(--gold-2); }
.float-card { position: absolute; display: flex; align-items: center; gap: .55rem; padding: .6rem .85rem; border-radius: 10px; background: #fff; color: #141210; box-shadow: 0 20px 34px -16px rgba(0,0,0,.75); font-size: .85rem; animation: float-card 6s ease-in-out infinite; }
.float-card small { display: block; color: #6d655b; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; margin-right: .1rem; }
.fc-1 { top: 0; right: -6px; flex-direction: column; align-items: flex-start; gap: 0; }
.fc-2 { bottom: 0; left: -22px; animation-delay: -2s; }
.fc-2 .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 4px rgba(255,198,41,.3); }
.fc-3 { bottom: 0; right: 26px; animation-delay: -4s; }
.fc-3 svg { width: 26px; height: 26px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.fc-3 circle { stroke: #eee3d4; } .fc-3 .arc { stroke: #198754; stroke-dasharray: 100; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: center; } .fc-3 path { stroke: #198754; }
@keyframes float-card { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (max-width: 991.98px) { .hero-row { padding: 3.5rem 0 7rem; } .app-window { transform: none; } .fc-2 { left: 8px; } .fc-3 { right: 8px; } .fc-1 { right: 8px; } }

/* stats overlap the hero */
.stat-wrap { position: relative; margin-top: -4rem; z-index: 2; }
.stat-bar { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bs-body-bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.stat-bar > div { padding: 1.6rem 1.25rem; text-align: center; }
.stat-bar > div + div { border-left: 1px solid var(--line); }
.stat-bar strong { display: block; font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-bar span { color: var(--bs-secondary-color); font-size: .9rem; }
@media (max-width: 767.98px) { .stat-bar { grid-template-columns: repeat(2, 1fr); } .stat-bar > div:nth-child(3) { border-left: 0; } .stat-bar > div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ticker moves with the scroll */
.ticker { overflow: hidden; padding: 2.6rem 0 0; }
.ticker-row { display: flex; gap: 3rem; white-space: nowrap; width: max-content; will-change: transform; }
.ticker-row span { font-size: clamp(1.1rem, 2vw, 1.45rem); font-weight: 700; letter-spacing: -.02em; color: color-mix(in srgb, var(--bs-body-color) 28%, transparent); }

/* course cards: all equal */
.course-tile[class] { --tone: var(--brand); position: relative; background: var(--bs-body-bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .22s, box-shadow .22s, border-color .22s; }
.course-tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #e8590c, #ffc629); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.course-tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(232,89,12,.35); }
.course-tile:hover::before { transform: scaleX(1); }
.course-tile .card-body { padding: 1.6rem; }
.course-icon { width: 50px; height: 50px; border-radius: 12px; background: rgba(232,89,12,.1); color: var(--brand); box-shadow: none; animation: none; }
.course-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.status-pill { font-size: .74rem; font-weight: 700; padding: .22rem .62rem; border-radius: 99px; background: rgba(120,110,100,.13); color: var(--bs-secondary-color); }
.status-pill.live { background: rgba(25,135,84,.13); color: #15803d; }
[data-bs-theme="dark"] .status-pill.live { color: #4ade80; }
.course-link { font-weight: 700; color: var(--brand); }
.course-soon { font-size: .9rem; color: var(--bs-secondary-color); }

/* step story: sticky graphic on the right */
.story-visual { position: sticky; top: 96px; aspect-ratio: 520 / 360; background: linear-gradient(150deg, #1a1816, #0e0d0c); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
.story-scene { position: absolute; inset: 0; opacity: 0; transform: translateY(18px) scale(.97); transition: opacity .5s ease, transform .5s ease; }
.story-scene.active { opacity: 1; transform: none; }
.story-scene svg { width: 100%; height: 100%; display: block; }
.story-step { min-height: 56vh; display: flex; flex-direction: column; justify-content: center; padding-left: 1.5rem; border-left: 3px solid var(--line); opacity: .38; transition: opacity .35s, border-color .35s; }
.story-step.active { opacity: 1; border-color: var(--brand); }
.story-step:last-child { min-height: 40vh; }
.story-num { font: 700 .86rem "JetBrains Mono", monospace; color: var(--brand); margin-bottom: .45rem; }
.story-step h3 { font-size: 1.6rem; font-weight: 800; }
.story-step p { color: var(--bs-secondary-color); font-size: 1.08rem; margin: 0; }
.s-panel { fill: #1f1c19; stroke: rgba(255,255,255,.1); } .s-screen { fill: #12100e; }
.s-bars rect { fill: #3a342e; } .s-bars rect:nth-child(n+4) { fill: #e8590c; } .s-bars rect:nth-child(n+6) { fill: #ffc629; }
.s-bars rect { transform-box: fill-box; transform-origin: bottom; }
.story-scene.active .s-bars rect { animation: s-grow .7s ease both; }
.s-bars rect:nth-child(2) { animation-delay: .06s !important; } .s-bars rect:nth-child(3) { animation-delay: .12s !important; } .s-bars rect:nth-child(4) { animation-delay: .18s !important; }
.s-bars rect:nth-child(5) { animation-delay: .24s !important; } .s-bars rect:nth-child(6) { animation-delay: .3s !important; } .s-bars rect:nth-child(7) { animation-delay: .36s !important; }
@keyframes s-grow { from { transform: scaleY(.1); opacity: .2; } }
.s-play { fill: rgba(232,89,12,.92); } .s-play-tri { fill: #fff; }
.s-track { fill: rgba(255,255,255,.14); } .s-progress { fill: #e8590c; } .s-knob { fill: #ffc629; }
.s-line { fill: rgba(255,255,255,.16); } .s-line.strong { fill: rgba(255,255,255,.55); }
.s-hint { fill: rgba(255,198,41,.14); stroke: rgba(255,198,41,.5); } .s-hint-dot { fill: #ffc629; }
.s-code { fill: #0e0d0c; stroke: rgba(232,89,12,.55); }
.s-code-lines rect { fill: rgba(255,255,255,.3); transform-box: fill-box; transform-origin: left; } .s-code-lines .b { fill: #ff8a1f; } .s-code-lines .g { fill: #ffc629; }
.story-scene.active .s-code-lines rect { animation: s-type .6s ease both; }
.s-code-lines rect:nth-child(2) { animation-delay: .1s !important; } .s-code-lines rect:nth-child(3) { animation-delay: .2s !important; } .s-code-lines rect:nth-child(4) { animation-delay: .3s !important; }
.s-code-lines rect:nth-child(5) { animation-delay: .4s !important; } .s-code-lines rect:nth-child(6) { animation-delay: .5s !important; } .s-code-lines rect:nth-child(7) { animation-delay: .6s !important; }
@keyframes s-type { from { transform: scaleX(0); } }
.s-ring-bg, .s-ring { fill: none; stroke-width: 16; } .s-ring-bg { stroke: rgba(255,255,255,.12); }
.s-ring { stroke: #e8590c; stroke-linecap: round; stroke-dasharray: 72 100; transform: rotate(-90deg); transform-origin: 150px 172px; }
.story-scene.active .s-ring { animation: s-ring 1.1s ease both; }
@keyframes s-ring { from { stroke-dasharray: 0 100; } }
.s-tick { fill: none; stroke: #ffc629; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.s-fill { fill: #e8590c; transform-box: fill-box; transform-origin: left; } .s-fill.a { fill: #ff8a1f; } .s-fill.b { fill: #ffc629; } .s-fill.c { fill: #f5efe6; }
.story-scene.active .s-fill { animation: s-type .9s ease both; }
@media (max-width: 991.98px) {
  .story-pin { position: sticky; top: 64px; z-index: 2; align-self: flex-start; }
  .story-visual { position: relative; top: 0; max-width: 420px; margin: 0 auto; }
  .story-step { min-height: 52vh; }
}

/* growth chart */
.chart-card { background: var(--bs-body-bg); border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; box-shadow: var(--shadow-lg); }
.growth { width: 100%; height: auto; display: block; font-family: "JetBrains Mono", monospace; }
.g-grid path { fill: none; stroke: var(--line); stroke-width: 1.5; }
.g-slow, .g-fast { fill: none; stroke-width: 6; stroke-linecap: round; }
.g-slow { stroke: #e8590c; } .g-fast { stroke: #e0a800; }
.g-label { font-size: 19px; font-weight: 700; } .g-label.slow { fill: #e8590c; } .g-label.fast { fill: #b58900; }
[data-bs-theme="dark"] .g-label.fast { fill: #ffc629; } [data-bs-theme="dark"] .g-fast { stroke: #ffc629; }
.g-axis { font-size: 14px; fill: var(--bs-secondary-color); }
.tick-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.tick-list li { position: relative; padding: .28rem 0 .28rem 1.75rem; font-weight: 500; }
.tick-list li::before { content: ""; position: absolute; left: .2rem; top: .62rem; width: 11px; height: 6px; border-left: 2.5px solid var(--brand); border-bottom: 2.5px solid var(--brand); transform: rotate(-45deg); }

/* episode and video cards */
.video-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .22s, box-shadow .22s; }
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* closing band and footer */
.cta-band { padding: 5.5rem 0; color: #fff; background: radial-gradient(ellipse 60% 120% at 50% 130%, rgba(232,89,12,.5), transparent 70%), var(--ink); }
.cta-band h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 800; margin-bottom: .6rem; }
.cta-band p { color: rgba(255,255,255,.72); font-size: 1.1rem; margin-bottom: 1.75rem; }
.site-footer { background: #0a0908; color: rgba(255,255,255,.6); padding: 3.5rem 0 1.75rem; font-size: .93rem; border-top: 1px solid rgba(255,255,255,.08); }
.foot-head { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #fff; margin-bottom: .8rem; }
.site-footer a:not(.navbar-brand) { display: block; color: rgba(255,255,255,.62); padding: .2rem 0; }
.site-footer a:hover { color: #fff; }
.foot-note { margin: 2.25rem 0 0; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .84rem; }

/* inner pages: same dark header as the home hero */
.page-head { background: var(--ink); }
.page-head::before { inset: 0; background: radial-gradient(ellipse 55% 130% at 92% 0%, rgba(232,89,12,.42), transparent 70%); animation: none; }
.page-head::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask: linear-gradient(90deg, transparent 30%, #000); mask: linear-gradient(90deg, transparent 30%, #000); }
.page-head > .container { z-index: 1; }
.problem-head.diff-easy { background: var(--ink); } .problem-head.diff-medium { background: var(--ink); } .problem-head.diff-hard { background: var(--ink); }
.problem-head.diff-easy::before { background: radial-gradient(ellipse 55% 130% at 92% 0%, rgba(25,135,84,.5), transparent 70%); }
.problem-head.diff-medium::before { background: radial-gradient(ellipse 55% 130% at 92% 0%, rgba(255,198,41,.38), transparent 70%); }
.problem-head.diff-hard::before { background: radial-gradient(ellipse 55% 130% at 92% 0%, rgba(220,38,76,.48), transparent 70%); }
.page-head .breadcrumb-item a { color: var(--gold-2); }
.page-head h1 { font-weight: 800; letter-spacing: -.03em; }
.page-head .btn-outline-secondary { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255,255,255,.4); --bs-btn-hover-bg: rgba(255,255,255,.12); --bs-btn-hover-border-color: #fff; --bs-btn-hover-color: #fff; }
.sec { background: var(--bs-body-bg); border: 1px solid var(--line); border-radius: 14px; padding: 1.35rem 1.5rem; box-shadow: 0 10px 24px -22px rgba(14,13,12,.5); }
.sec::before { top: 18px; bottom: 18px; width: 3px; }
.sec:hover { box-shadow: 0 18px 32px -24px rgba(14,13,12,.55); transform: none; }
.sec-solution { background: #141210; }
.sec .trace { background: var(--paper); }
.card { border-radius: 14px; border-color: var(--line); }
.topic-card { border-top: 1px solid var(--line); background: var(--bs-body-bg); transition: transform .22s, box-shadow .22s, border-color .22s; }
.topic-card:hover { box-shadow: var(--shadow-lg); border-color: rgba(232,89,12,.35); }
.topic-num { color: var(--brand); font-family: "JetBrains Mono", monospace; font-weight: 700; }
.solve-card { background: var(--bs-body-bg); border: 1px solid var(--line); }
.complexity-card .card-header { background: var(--ink); }
.table-responsive { background: var(--bs-body-bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
.ptable tbody tr:nth-child(odd) { background: transparent; }
.ptable thead th { font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; color: var(--bs-secondary-color); }

@media (max-width: 767.98px) { .band { padding: 4rem 0; } .site-nav .btn-brand { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .slide-l, .js .slide-r, .js .zoom-in { opacity: 1 !important; transform: none !important; }
  .float-card, .story-scene.active * { animation: none !important; }
  .app-window { transform: none; }
}
