/* ==========================================================================
   Portfolio — shared design system
   ========================================================================== */
:root {
  --bg: #07090f;
  --bg-2: #0b0f19;
  --surface: #10151f;
  --surface-2: #151b28;
  --surface-3: #1b2232;
  --border: #212a3c;
  --border-2: #2c3750;
  --text: #e8ebf3;
  --text-2: #b4bccd;
  --muted: #7d879c;
  --accent: #5b8cff;
  --accent-2: #9b6bff;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #38bdf8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, .65);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --max: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.grad-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  width: 900px; height: 600px; left: 50%; top: -260px; transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  filter: blur(20px);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-family: var(--mono); font-size: 13px; font-weight: 700;
}
.nav-links { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.nav-links a { color: var(--text-2); font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 640px) { .nav-links a.hide-sm { display: none; } }

/* ---------- buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent-line); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface);
  white-space: nowrap;
}
.chip.accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); display: inline-block; }
.dot.live { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---------- sections ---------- */
section { padding: 72px 0; }
@media (max-width: 720px) { section { padding: 52px 0; } }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 800; }
h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 750; }
h3 { font-size: 19px; font-weight: 650; }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--text-2); max-width: 720px; }
.section-head { margin-bottom: 34px; max-width: 760px; }
.section-head p { color: var(--text-2); margin: 12px 0 0; }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- project hero ---------- */
.p-hero { padding: 56px 0 30px; }
.p-hero .back { font-size: 14px; color: var(--muted); display: inline-flex; gap: 6px; margin-bottom: 26px; }
.p-hero .back:hover { color: var(--text); }
.p-hero-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.p-icon {
  width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 28px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.p-hero h1 { font-size: clamp(36px, 6vw, 58px); }
.p-hero .lead { margin: 16px 0 24px; }
.disclaimer {
  margin-top: 22px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start;
  border: 1px dashed var(--border-2); border-radius: 10px; padding: 10px 12px; max-width: 760px;
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; margin-top: 34px; }
.kpi { padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.kpi .v { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.kpi .v .u { font-size: 16px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.kpi .l { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- before/after ---------- */
.ba { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .ba { grid-template-columns: 1fr auto 1fr; align-items: stretch; } }
.ba .card h3 { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.ba ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ba li { display: flex; gap: 10px; color: var(--text-2); font-size: 15px; }
.ba li::before { flex: none; font-family: var(--mono); font-size: 13px; margin-top: 2px; }
.ba .before li::before { content: "✕"; color: var(--bad); }
.ba .after li::before { content: "✓"; color: var(--ok); }
.ba .before { border-color: color-mix(in srgb, var(--bad) 25%, var(--border)); }
.ba .after { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-soft) inset, var(--shadow); }
.ba-arrow { display: grid; place-items: center; color: var(--accent); font-size: 26px; }
@media (max-width: 859px) { .ba-arrow { transform: rotate(90deg); } }

/* ---------- features ---------- */
.feat { position: relative; overflow: hidden; }
.feat .ic { font-size: 22px; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); margin-bottom: 14px; }
.feat p { color: var(--text-2); font-size: 14.5px; margin: 8px 0 0; }
.feat:hover { border-color: var(--accent-line); }

/* ---------- impact bars ---------- */
.impact { display: grid; gap: 18px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 8px; }
.bar-row .top b { font-family: var(--mono); color: var(--accent); }
.bar-pair { display: grid; gap: 6px; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.bar.before i { background: color-mix(in srgb, var(--bad) 70%, #000); }
.bar.after i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.bar-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-legend .b::before { background: color-mix(in srgb, var(--bad) 70%, #000); }
.bar-legend .a::before { background: var(--accent); }

/* ---------- flow diagram (nodes) ---------- */
.flow-card { padding: 0; overflow: hidden; }
.flow-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.flow-head .sp { margin-left: auto; }
.flow {
  position: relative; width: 100%;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.06) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg-2);
}
.flow svg.edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flow .edge { fill: none; stroke: var(--border-2); stroke-width: 1.6; }
.flow .edge.flowing { stroke: var(--accent-line); stroke-dasharray: 5 7; animation: dash 1.1s linear infinite; }
.flow .edge.hot { stroke: var(--accent); stroke-width: 2.2; filter: drop-shadow(0 0 6px var(--accent)); }
@keyframes dash { to { stroke-dashoffset: -24; } }
.flow .packet { fill: #fff; filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 0 2px #fff); }
.flow .elabel { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.node {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 10px 10px 9px; border-radius: 12px; width: 132px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  transition: border-color .25s, box-shadow .25s, transform .25s;
  z-index: 2;
}
.node .ni { font-size: 18px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); flex: none; }
.node .nt { font-size: 12.5px; font-weight: 650; line-height: 1.2; }
.node .ns { font-size: 10px; color: var(--muted); font-family: var(--mono); line-height: 1.25; margin-top: 2px; }
.node.k-ai .ni { background: color-mix(in srgb, var(--accent-2) 22%, transparent); }
.node.k-io .ni { background: color-mix(in srgb, var(--info) 18%, transparent); }
.node.k-db .ni { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.node.k-out .ni { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.node.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 28px -4px var(--accent);
  transform: translate(-50%, -50%) scale(1.06);
}
.node .badge {
  position: absolute; top: -9px; right: -8px; font-family: var(--mono); font-size: 10px;
  background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 6px; opacity: 0; transition: opacity .2s;
}
.node.on .badge { opacity: 1; }
@media (max-width: 640px) {
  .node { padding: 7px 6px; gap: 4px; width: 104px; }
  .node .ni { width: 24px; height: 24px; font-size: 14px; }
  .node .nt { font-size: 11px; }
  .node .ns { display: none; }
}
.flow-log {
  border-top: 1px solid var(--border); font-family: var(--mono); font-size: 12px; color: var(--text-2);
  height: 120px; overflow: hidden; padding: 10px 18px; background: var(--bg);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.flow-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: logIn .3s ease; }
.flow-log .t { color: var(--muted); margin-right: 8px; }
.flow-log .ok { color: var(--ok); } .flow-log .ai { color: var(--accent-2); } .flow-log .w { color: var(--warn); }
@keyframes logIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- interactive demo player ("video") ---------- */
.player { border: 1px solid var(--border-2); border-radius: 16px; overflow: hidden; background: var(--bg-2); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), 0 0 0 1px var(--accent-soft); }
.player-chrome { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.player-chrome .lights { display: flex; gap: 6px; }
.player-chrome .lights i { width: 11px; height: 11px; border-radius: 50%; background: #3a4255; }
.player-chrome .lights i:nth-child(1) { background: #ff5f57; } .player-chrome .lights i:nth-child(2) { background: #febc2e; } .player-chrome .lights i:nth-child(3) { background: #28c840; }
.player-chrome .url { flex: 1; min-width: 0; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--bg-2); border-radius: 7px; padding: 4px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-chrome .rec { font-family: var(--mono); font-size: 11px; color: var(--bad); display: flex; align-items: center; gap: 6px; }
.player-chrome .rec .dot { background: var(--bad); box-shadow: none; }
.stage { position: relative; min-height: 460px; background: var(--bg); overflow: hidden; }
@media (max-width: 640px) { .stage { min-height: 520px; } }
.player-caption {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface);
  min-height: 56px;
}
.player-caption .step-n { font-family: var(--mono); font-size: 11px; color: var(--accent); white-space: nowrap; }
.player-caption .txt { font-size: 14px; color: var(--text); flex: 1; min-width: 0; }
.player-controls { display: flex; align-items: center; gap: 10px; padding: 10px 16px 14px; background: var(--surface); }
.pc-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-2); background: var(--surface-2); flex: none; }
.pc-btn:hover { border-color: var(--accent); }
.pc-btn.main { background: var(--accent); border-color: transparent; color: #fff; }
.pc-btn svg { width: 15px; height: 15px; }
.segments { flex: 1; display: flex; gap: 4px; min-width: 0; }
.seg { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; cursor: pointer; position: relative; padding: 0; border: 0; }
.seg::after { content: ""; position: absolute; inset: -8px 0; }
.seg i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; }
.seg.done i { width: 100%; }
.pc-time { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.player-hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }

/* ---------- shared mock UI primitives (inside stage) ---------- */
.ui { position: absolute; inset: 0; display: flex; font-size: 13px; }
.ui-side { width: 190px; flex: none; background: var(--bg-2); border-right: 1px solid var(--border); padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; }
.ui-side .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 4px 8px 14px; font-size: 14px; }
.ui-side .logo i { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: inline-block; }
.ui-side a { padding: 7px 10px; border-radius: 7px; color: var(--muted); display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.ui-side a.on { background: var(--accent-soft); color: var(--text); }
.ui-side a .n { margin-left: auto; font-family: var(--mono); font-size: 10px; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; }
@media (max-width: 760px) { .ui-side { display: none; } }
.ui-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ui-top { height: 50px; flex: none; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.ui-top h4 { font-size: 14px; font-weight: 650; }
.ui-top .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ui-body { flex: 1; min-height: 0; padding: 14px 16px; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.ui-input { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 7px 10px; color: var(--text-2); font-size: 12.5px; min-width: 0; }
.ui-btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ui-btn.ghost { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-2); }
.ui-btn.pressed { transform: scale(.94); filter: brightness(1.2); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.stat .l { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font-size: 20px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 11px; font-family: var(--mono); }
.up { color: var(--ok); } .down { color: var(--bad); }

.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.tbl tr.new td { animation: rowIn .6s ease; }
.tbl tr.hl td { background: var(--accent-soft); }
@keyframes rowIn { from { background: var(--accent-soft); opacity: 0; transform: translateX(-8px); } }
.tbl-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
@media (max-width: 640px) { .tbl .hide-sm { display: none; } }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.pill.info { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.pill.ai { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }
.pill.mute { background: var(--surface-3); color: var(--muted); }

/* chat */
.chat { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow: hidden; justify-content: flex-end; padding: 6px 2px; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; animation: msgIn .35s ease; white-space: pre-line; }
.msg.in { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: color-mix(in srgb, var(--accent) 85%, #000); color: #fff; border-bottom-right-radius: 4px; }
.msg.sys { align-self: center; background: transparent; color: var(--muted); font-size: 11.5px; font-family: var(--mono); padding: 2px; }
.msg .meta { display: block; font-size: 10px; opacity: .65; margin-top: 4px; font-family: var(--mono); }
.msg.card-msg { padding: 0; overflow: hidden; }
.msg.card-msg .cm-b { padding: 10px 12px; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 11px 14px; background: var(--surface-2); border-radius: 14px; border: 1px solid var(--border); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%,100% { opacity: .25 } 50% { opacity: 1 } }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* AI side panel / reasoning */
.ai-panel { background: color-mix(in srgb, var(--accent-2) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent-2) 35%, var(--border)); border-radius: 10px; padding: 10px 12px; font-size: 12px; }
.ai-panel .h { display: flex; align-items: center; gap: 6px; color: var(--accent-2); font-family: var(--mono); font-size: 11px; margin-bottom: 6px; }
.ai-line { display: flex; gap: 8px; color: var(--text-2); animation: msgIn .3s ease; padding: 2px 0; }
.ai-line b { color: var(--text); font-weight: 600; }

.toast {
  position: absolute; right: 14px; bottom: 14px; z-index: 20; max-width: min(320px, calc(100% - 28px));
  background: var(--surface-2); border: 1px solid var(--border-2); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; box-shadow: var(--shadow);
  animation: toastIn .4s cubic-bezier(.2,.9,.3,1.2);
}
.toast b { display: block; margin-bottom: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }

.cursor {
  position: absolute; z-index: 30; width: 18px; height: 18px; pointer-events: none;
  transition: left .7s cubic-bezier(.4,0,.2,1), top .7s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
}
.cursor.click::after { content: ""; position: absolute; left: -10px; top: -10px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--accent); animation: ripple .5s ease-out forwards; }
@keyframes ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

.spark { width: 100%; height: 100%; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.panel .ph { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.row { display: flex; gap: 12px; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.flex1 { flex: 1; min-width: 0; }
.hide-sm { }
@media (max-width: 640px) { .stage .hide-sm { display: none !important; } .row.wrap-sm { flex-direction: column; } }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .8s ease; }
.glow-hl { animation: glowHl 1.2s ease; }
@keyframes glowHl { 0% { box-shadow: 0 0 0 0 var(--accent); } 40% { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 20px var(--accent); } 100% { box-shadow: none; } }

/* ---------- video slot ---------- */
.video-slot { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-2); background: var(--surface); }
.video-slot iframe, .video-slot video { width: 100%; height: 100%; border: 0; }

/* ---------- project nav / footer ---------- */
.pnav { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.pnav a { display: block; padding: 18px 20px; }
.pnav a:hover { border-color: var(--accent-line); }
.pnav small { color: var(--muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.pnav .t { font-weight: 700; font-size: 18px; margin-top: 4px; }
.pnav .next { text-align: right; }
.cta { text-align: center; padding: 48px 22px; }
.cta p { color: var(--text-2); max-width: 560px; margin: 12px auto 24px; }
footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* ---------- hero / closing buttons ---------- */
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; }
.cta-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 560px) {
  .cta-btns .btn, .p-hero .hero-ctas .btn { flex: 1 1 100%; justify-content: center; }
  .cta { padding: 34px 18px; }
}

/* ---------- mobile-first compaction ---------- */
@media (max-width: 560px) {
  .card { padding: 16px; }
  .feat .ic { float: left; width: 34px; height: 34px; font-size: 17px; margin: 0 12px 4px 0; }
  .feat h3 { font-size: 16px; line-height: 34px; }
  .feat p { clear: both; font-size: 14px; margin-top: 6px; }
  .section-head { margin-bottom: 22px; }
  .kpi { padding: 14px; } .kpi .v { font-size: 24px; }
  .ba li { font-size: 14px; }
}
