/* ============================================================
   POWERSORT — brand tokens (Brand Guidelines v1.0)
   dark blue #001C6B · blue #380FFF · light blue #0DEDF7
   green #00D600 · lime #B5FF00 · yellow #FFFF00
   type: IBM Plex Mono (headlines / data) + IBM Plex Sans (body)
   ============================================================ */
:root {
  --darkblue: #001C6B;
  --blue: #380FFF;
  --lightblue: #0DEDF7;
  --green: #00D600;
  --lime: #B5FF00;
  --yellow: #FFFF00;
  --ink: #EAF2FF;
  --panel: rgba(56, 15, 255, 0.16);
  --panel-line: rgba(13, 237, 247, 0.35);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--darkblue);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--lightblue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(181, 255, 0, 0.25);
  position: sticky;
  top: 0;
  background: rgba(0, 28, 107, 0.92);
  backdrop-filter: blur(6px);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.brand-logo { width: 72px; height: 72px; display: block; }
.brand-tagline {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--lightblue);
  letter-spacing: 0.04em;
}
.site-nav { display: flex; gap: clamp(0.8rem, 3vw, 2.2rem); flex-wrap: wrap; }
.site-nav a {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--lime);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.site-nav a:hover { border-bottom-color: var(--lime); }

/* ---------- sections ---------- */
.act { padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem); }
.act + .act { border-top: 1px solid rgba(181, 255, 0, 0.25); }
.act-head { max-width: 900px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
}
h1, h2 {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--lightblue);
  line-height: 1.08;
  margin: 0.5rem 0 1rem;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2rem, 5.4vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
h1 em, h2 em { font-style: normal; color: var(--lime); }
.lede { font-size: clamp(1rem, 1.6vw, 1.18rem); max-width: 62ch; color: var(--ink); }
.lede strong { color: var(--lime); font-weight: 600; }

/* ---------- hero stage ---------- */
.stage-wrap {
  margin-top: 2rem;
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  background:
    radial-gradient(1200px 500px at 70% -10%, rgba(56, 15, 255, 0.28), transparent 60%),
    var(--darkblue);
  padding: clamp(0.6rem, 2vw, 1.4rem);
  overflow: hidden;
}
#heroSvg { width: 100%; height: auto; display: block; }
.stage-footline {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.4rem 0.6rem 0.2rem; flex-wrap: wrap;
}
.stage-caption {
  font-family: var(--mono);
  color: var(--lightblue);
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  margin: 0;
  min-height: 1.4em;
}

/* ---------- buttons & controls ---------- */
.btn {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lightblue);
  background: transparent;
  border: 2px solid var(--lightblue);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(13, 237, 247, 0.12); }
.btn-lime { color: var(--darkblue); background: var(--lime); border-color: var(--lime); }
.btn-lime:hover { background: var(--yellow); border-color: var(--yellow); }
.btn-cyan { color: var(--darkblue); background: var(--lightblue); border-color: var(--lightblue); }
.btn-cyan:hover { background: #7ff6fb; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.9rem;
  margin-top: 1.6rem;
}
.controls-play { align-items: center; margin-top: 0.9rem; }
.ctl { display: flex; flex-direction: column; gap: 0.3rem; }
.ctl-grow { flex: 1 1 260px; }
.ctl > span {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em;
  color: var(--lime); text-transform: uppercase;
}
.ctl select, .ctl input[type="text"] {
  font-family: var(--mono); font-size: 0.95rem;
  color: var(--ink); background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid var(--panel-line); border-radius: 8px;
  padding: 0.5rem 0.7rem;
}
.ctl-speed { flex-direction: row; align-items: center; gap: 0.6rem; }
.ctl input[type="range"] { accent-color: var(--lime); width: 130px; }
.narration {
  font-family: var(--mono); font-size: 0.95rem; color: var(--yellow);
  margin: 0; flex: 1 1 320px; min-height: 1.4em;
}

/* ---------- playground layout ---------- */
.playground-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr minmax(190px, 240px);
  gap: 1rem;
  margin-top: 1.4rem;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .playground-grid { grid-template-columns: 1fr 1fr; }
  .panel-stage { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 640px) {
  .playground-grid { grid-template-columns: 1fr; }
}

.panel {
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  background: var(--panel);
  padding: 1rem;
  min-width: 0;
}
.panel-stage { padding: 0.6rem; background: var(--darkblue); }
#playSvg { width: 100%; height: auto; display: block; }
.panel-title {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--lime); margin-bottom: 0.7rem;
}
.panel-note { font-family: var(--mono); font-size: 0.78rem; color: var(--lightblue); margin: 0.7rem 0 0; }

/* code panel */
.panel-code { container-type: inline-size; }
.panel-code pre {
  margin: 0; overflow-x: auto;
  font-family: var(--mono); font-size: clamp(0.62rem, 3.4cqw, 0.83rem); line-height: 1.55; color: var(--ink);
}
.panel-code b { color: var(--lightblue); font-weight: 700; }
.cl { display: block; padding: 0 0.4rem; border-radius: 5px; white-space: pre; }
.cl.active { background: var(--lime); color: var(--darkblue); }
.cl.active b { color: var(--blue); }

/* run stack panel — grows upward: first pushed run sits at the bottom */
.stack-box {
  display: flex; flex-direction: column-reverse; justify-content: flex-start;
  gap: 0.45rem; min-height: 220px;
}
.stack-entry {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 1rem;
  border: 1.5px solid var(--lightblue); border-radius: 8px;
  color: var(--lightblue);
  padding: 0.42rem 0.7rem;
  transition: transform 250ms ease, opacity 250ms ease,
              background 250ms ease, border-color 250ms ease, color 250ms ease;
}
.stack-entry .pw { color: var(--lime); }
.stack-entry.enter { transform: translateY(-10px); opacity: 0; }
.stack-entry.hot { background: var(--yellow); border-color: var(--yellow); color: var(--darkblue); }
.stack-entry.hot .pw { color: var(--blue); }
.stack-hint {
  font-family: var(--mono); font-size: 0.72rem; color: rgba(234, 242, 255, 0.65);
  margin-top: 0.8rem;
}

/* ---------- explainer cards ---------- */
.explain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.explain-card {
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  background: rgba(0, 0, 0, 0.14);
}
.explain-card h3 {
  font-family: var(--mono); color: var(--lime); font-size: 1.02rem;
  margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.55rem;
}
.explain-card .k {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem; border-radius: 6px;
  background: var(--lime); color: var(--darkblue); font-weight: 700; font-size: 0.95rem;
}
.explain-card p { margin: 0; font-size: 0.95rem; color: rgba(234, 242, 255, 0.9); }
.explain-card code { font-family: var(--mono); color: var(--lightblue); }

/* ---------- about & footer ---------- */
.act-about .about-links { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.site-footer {
  border-top: 1px solid rgba(181, 255, 0, 0.25);
  padding: 2rem clamp(1rem, 4vw, 3rem) 3rem;
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
}
.footer-logo { width: 56px; height: 56px; }
.site-footer p { font-family: var(--mono); font-size: 0.85rem; margin: 0; color: var(--lightblue); }
.site-footer .dim { color: rgba(181, 255, 0, 0.8); }

/* ---------- SVG element classes (shared by both stages) ---------- */
text { user-select: none; }
.svg-run-box { fill: var(--lime); }
.svg-run-num { font-family: var(--mono); font-weight: 600; fill: var(--darkblue); }
.svg-run-label { font-family: var(--mono); font-weight: 700; fill: var(--darkblue); }
.svg-bar { fill: var(--lightblue); }
.svg-bar.flash { fill: var(--yellow); }
.svg-edge { stroke: var(--lightblue); stroke-width: 2.5; fill: none; }
.svg-power-digit { font-family: var(--mono); font-weight: 600; }
.svg-ruler { stroke: var(--lime); stroke-width: 2.5; }
.svg-caption { font-family: var(--mono); fill: var(--lightblue); }

@media (prefers-reduced-motion: reduce) {
  .btn, .stack-entry { transition: none; }
}

/* binary readout in the hero */
.svg-binary { font-family: var(--mono); }

/* ============================================================
   MERGED SITE — dark-theme styles for the content sections
   (old class names kept so the vetted markup is unchanged)
   ============================================================ */

/* variable bridge: the old markup uses these names in inline styles */
:root {
  --clr-bg: var(--darkblue);
  --clr-surface: rgba(0, 0, 0, 0.14);
  --clr-primary: var(--lightblue);   /* old "navy heading" color → light on dark */
  --clr-accent: var(--lightblue);
  --clr-highlight: var(--lime);
  --clr-text: var(--ink);
  --clr-muted: #A9BCE8;
  --clr-border: rgba(13, 237, 247, 0.28);
  --clr-code-bg: rgba(13, 237, 247, 0.07);
  --radius: 10px;
}

figure { margin: 0; }
.container { max-width: 940px; margin-inline: auto; }
main section.act p { line-height: 1.7; }
main a { text-decoration: underline; text-decoration-color: rgba(13,237,247,.5); text-underline-offset: 2px; }
main a:hover { text-decoration-color: var(--lightblue); }
.site-nav a, .btn, .pub-links a { text-decoration: none; }

.skip-link {
  position: absolute; top: -100%; left: 0; z-index: 999;
  padding: .5rem 1rem; background: var(--lime); color: var(--darkblue);
  font-family: var(--mono); font-weight: 700; border-radius: 0 0 10px 0;
}
.skip-link:focus { top: 0; }

/* header: tight logo */
.brand-logo-tight { width: 132px; height: auto; display: block; }

/* hero page title */
.page-title {
  font-family: var(--mono); font-weight: 700; color: var(--lightblue);
  font-size: clamp(2.4rem, 6vw, 4rem); margin: 0; letter-spacing: -0.02em;
}
.tagline {
  font-size: clamp(1rem, 2vw, 1.2rem); color: rgba(234, 242, 255, 0.85);
  margin: 0.35rem 0 2.2rem;
}
.act-hero .eyebrow { display: inline-block; }
.act-title { margin-top: 0.45rem; }

/* section headings (old classes) */
.section-heading {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  color: var(--lightblue);
  border-left: 5px solid var(--lime);
  padding-left: .8rem;
  margin: 0 0 1.2rem;
  letter-spacing: -0.01em;
}
.section-intro {
  color: rgba(234, 242, 255, 0.9);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  max-width: 72ch;
}
.sub-heading {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  color: var(--lightblue);
  margin: 2.6rem 0 0.8rem;
}

/* overview cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--clr-surface);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 1.15rem 1.3rem;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--lime); transform: translateY(-2px); }
.card .card-icon { font-size: 1.6rem; margin-bottom: .45rem; }
.card h3 {
  font-family: var(--mono); font-size: .98rem; font-weight: 700;
  color: var(--lime); margin: 0 0 .4rem;
}
.card p { font-size: .92rem; color: rgba(234, 242, 255, 0.85); margin: 0; }

/* asset gallery */
.asset-gallery {
  margin-top: 1.75rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.asset-panel {
  background: var(--darkblue);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  overflow: hidden;
}
.asset-panel img, .asset-panel video { width: 100%; display: block; height: auto; }
.asset-panel figcaption {
  padding: .65rem 1rem;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--clr-muted);
  border-top: 1px solid rgba(13, 237, 247, 0.15);
}

/* algorithm steps */
.algo-steps { display: grid; gap: 1.25rem; counter-reset: step; margin-top: 1.5rem; }
.algo-step {
  display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; align-items: start;
}
.algo-step::before {
  counter-increment: step;
  content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem;
  background: var(--lime); color: var(--darkblue);
  border-radius: 50%;
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
}
.algo-step h3 {
  font-family: var(--mono); font-size: 1rem; font-weight: 700;
  color: var(--lightblue); margin: 0 0 .3rem;
}
.algo-step p { font-size: .95rem; margin: 0; color: rgba(234, 242, 255, 0.9); }

/* the interactive playground sits full-width inside the algorithm section */
.playground-wide { margin-top: 0.4rem; }
.demo-note {
  font-family: var(--mono); font-size: .8rem; color: var(--clr-muted);
  margin: .9rem 0 0; max-width: 80ch;
}

/* formula box */
.formula-box {
  background: rgba(56, 15, 255, 0.14);
  border: 1px solid var(--panel-line);
  border-left: 4px solid var(--lightblue);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-top: 2.2rem;
  font-size: .95rem;
}
.formula-box .label {
  font-family: var(--mono); font-weight: 700; font-size: 1.02rem;
  color: var(--lime); margin-bottom: .5rem;
}

/* inline code & code blocks (content sections) */
main code {
  font-family: var(--mono); font-weight: 500; font-size: .88em;
  background: var(--clr-code-bg); color: var(--lightblue);
  padding: .08em .35em; border-radius: 4px;
}
main pre {
  background: #001050;
  border: 1px solid rgba(13, 237, 247, 0.22);
  color: #DDEBFF;
  border-radius: 12px;
  padding: 1.15rem 1.4rem;
  overflow-x: auto;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.65;
  margin-top: 1rem;
}
main pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }
main pre a, main pre a:visited { color: var(--lightblue); text-decoration: underline; }
main pre a:hover { color: #ffffff; }
.code-comment { color: #8FB3FF; }
.code-keyword { color: var(--lime); font-weight: 600; }
.code-func    { color: var(--lightblue); }
.code-number  { color: #CFE8FF; }

/* comparison table */
.compare-table { width: 100%; border-collapse: collapse; margin-top: 1.2rem; font-size: .93rem; }
.compare-table th {
  background: rgba(13, 237, 247, 0.12);
  color: var(--lightblue);
  font-family: var(--mono);
  padding: .6rem 1rem; text-align: left; font-weight: 700;
}
.compare-table td { padding: .6rem 1rem; border-bottom: 1px solid rgba(13, 237, 247, 0.18); }
.compare-table tr:nth-child(even) td { background: rgba(255, 255, 255, 0.025); }
.compare-table tr:hover td { background: rgba(56, 15, 255, 0.18); }
.badge-good {
  display: inline-block;
  background: var(--lime); color: var(--darkblue);
  padding: .12em .6em; border-radius: 999px;
  font-size: .82rem; font-weight: 700;
}
.badge-good a { color: var(--darkblue); }

/* python banner */
.python-banner {
  display: flex; align-items: center; gap: 1.1rem;
  background: linear-gradient(135deg, #001C6B 0%, #380FFF 100%);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 1.4rem 1.8rem;
  margin-top: 1.5rem;
}
.python-banner .py-logo { font-size: 2.8rem; flex-shrink: 0; line-height: 1; }
.python-banner h3 { font-family: var(--mono); font-size: 1.15rem; margin: 0 0 .3rem; color: #fff; }
.python-banner p { font-size: .93rem; margin: 0; color: rgba(255, 255, 255, 0.92); }
.python-banner code { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* implementations */
.impl-list { display: grid; gap: 1rem; margin-top: 1.5rem; }
.impl-item {
  display: flex; align-items: flex-start; gap: 1rem;
  background: var(--clr-surface);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  transition: border-color .2s;
}
.impl-item:hover { border-color: var(--lightblue); }
.impl-lang {
  color: #fff; font-family: var(--mono); font-size: .78rem; font-weight: 700;
  padding: .3em .7em; border-radius: 8px; flex-shrink: 0; margin-top: .1rem;
  background: var(--blue);
}
.impl-lang.python { background: #306998; }
.impl-lang.java   { background: #b07219; }
.impl-lang.c      { background: #4d5a6a; }
.impl-item h3 { font-size: .98rem; margin: 0 0 .25rem; }
.impl-item h3 a { color: var(--lightblue); font-family: var(--mono); }
.impl-item p { font-size: .9rem; color: rgba(234, 242, 255, 0.82); margin: 0; }

/* publications */
.pub-list { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.pub-entry {
  background: var(--clr-surface);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
}
.pub-entry .pub-title { font-weight: 700; font-size: 1.02rem; color: var(--lightblue); margin-bottom: .3rem; }
.pub-entry .pub-authors { font-size: .9rem; color: var(--clr-muted); margin-bottom: .35rem; }
.pub-entry .pub-venue { font-size: .88rem; font-style: italic; color: var(--clr-muted); margin-bottom: .7rem; }
.pub-entry .pub-links { display: flex; gap: .7rem; flex-wrap: wrap; }

/* old link-button variants mapped onto the brand pill */
.btn-primary { color: var(--darkblue); background: var(--lime); border-color: var(--lime); font-size: .85rem; padding: .4rem .95rem; }
.btn-primary:hover { background: var(--yellow); border-color: var(--yellow); }
.btn-outline { font-size: .85rem; padding: .4rem .95rem; }

/* footer */
.site-footer { justify-content: flex-start; }
.site-footer .footer-links { margin-left: auto; }
.site-footer .footer-links a { color: var(--lightblue); }

/* ============================================================
   SPLASH — typed words, cursors fly onto the logo's three bars
   ============================================================ */
.splash-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: rgba(0, 28, 107, 0.985);
  cursor: pointer;
  transition: opacity .45s ease, visibility .45s ease;
}
.splash-screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-content {
  width: min(760px, 92vw);
  position: relative;
  display: grid;
  justify-items: center;
}
.splash-words {
  margin-bottom: 1.2rem;
  display: grid; gap: .25rem;
  justify-items: start; text-align: left;
  width: fit-content; max-width: 100%;
  text-transform: lowercase;
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(2.9rem, 11.5vw, 5.2rem);
  line-height: 1; color: var(--lightblue);
}
.word-line { display: inline-flex; align-items: baseline; gap: .14em; }
.word-cursor {
  display: inline-block;
  width: .55em; height: .13em;
  background: var(--lime);
  transform-origin: 0 0;
  will-change: transform;
  animation: splashCursorBlink .45s steps(1, end) 0s infinite;
}
/* timeline starts when JS has measured the flight paths (.splash-go) */
.splash-go .word-text { animation: splashWordFade 2s ease forwards; }
.splash-go .word-cursor {
  /* blink twice (0.9s), then hold steady — the words start fading at ~1.1s
     and the flight begins at 0.85s; a blinking cursor there is distracting */
  animation:
    splashCursorBlink .45s steps(1, end) 0s 2 both,
    splashCursorFly 1.5s cubic-bezier(.22, .61, .36, 1) .85s forwards;
}
.splash-go .splash-logo { animation: splashLogoReveal .5s ease forwards; animation-delay: 2.25s; }

.splash-logo {
  position: absolute; top: 50%; left: 50%;
  width: min(360px, 70vw); height: auto;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.94);
}

@keyframes splashWordFade { 0%, 54% { opacity: 1; } 72%, 100% { opacity: 0; } }
@keyframes splashCursorBlink { 0%, 15% { opacity: 1; } 26%, 75% { opacity: 0; } 86%, 100% { opacity: 1; } }
@keyframes splashCursorFly {
  to { transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--sx, 1), var(--sy, 1)); }
}
@keyframes splashLogoReveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .splash-words { display: none; }
  .splash-logo { animation: none !important; opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---- merged-layout glue ---- */
body { overflow-x: clip; }
main > section {
  padding: clamp(2.4rem, 5.5vw, 4.5rem) clamp(1rem, 4vw, 3rem);
}
main > section + section { border-top: 1px solid rgba(181, 255, 0, 0.25); }
main h3, main h4 { font-family: var(--mono); }

/* the playground escapes the 940px text column to full viewport width */
.playground-wide {
  margin-inline: calc(50% - 50vw);
  padding-inline: clamp(1rem, 4vw, 3rem);
}

/* ---- overview refinements ---- */
/* with three cards, let them share one row on wide screens */
.card-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
/* the personal housekeeping note steps back visually (text unchanged) */
.page-note {
  font-size: .92rem;
  color: var(--clr-muted);
  border-left: 3px solid rgba(13, 237, 247, 0.35);
  padding-left: .9rem;
  max-width: 70ch;
  margin: 1.1rem 0 0;
}

/* ---- compact hero: tighter spacing + smaller explainer cards,
        so "What is Powersort?" arrives sooner ---- */
.act-hero {
  padding-top: clamp(1.5rem, 3.2vw, 2.6rem);
  padding-bottom: clamp(1.5rem, 3.2vw, 2.4rem);
}
.tagline { margin-bottom: 1.4rem; }
.act-hero .stage-wrap { margin-top: 1.4rem; }
.act-hero .explain-grid {
  margin-top: 1.1rem;
  gap: .8rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.act-hero .explain-card { padding: .8rem .95rem; }
.act-hero .explain-card h3 { font-size: .88rem; margin-bottom: .35rem; gap: .45rem; }
.act-hero .explain-card .k { width: 1.45rem; height: 1.45rem; font-size: .8rem; border-radius: 5px; }
.act-hero .explain-card p { font-size: .84rem; line-height: 1.5; color: rgba(234, 242, 255, 0.85); }

/* ---- brand diagrams embedded in the overview cards ---- */
.card-fig { margin: .85rem 0 0; }
.card-fig img {
  display: block; width: 100%; height: auto;
  border-radius: 8px;
  border: 1px solid rgba(13, 237, 247, 0.18);
}
.card-fig figcaption {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--clr-muted);
  margin-top: .45rem;
}
/* let the two illustrated cards breathe on wide screens:
   snake card stays narrow, illustrated ones can grow */
@media (min-width: 900px) {
  .card-grid { grid-template-columns: 1.25fr 1.25fr 0.9fr; align-items: start; }
}
/* the note moved next to the contact box */
.page-note { margin: 2rem 0 0; }
