/* loops.21no.de - page styles on top of the shared 21no.de design system (assets.21no.de) */

/* === Loops additions === */
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 200;
  background: var(--accent); color: #000; padding: 8px 14px; border-radius: var(--radius-sm);
  font-weight: 500; transition: top 0.15s;
}
.skip-link:focus { top: 8px; color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html { scroll-padding-top: 72px; }
body { overflow-x: hidden; }
.nav-logo:hover { color: var(--text-primary); }
.hero { padding: 96px 0 72px; }
.hero h1 { max-width: 820px; margin-left: auto; margin-right: auto; }
.hero-badge .dot { animation: pulse 2.4s ease-in-out infinite; }
.hero-term { max-width: 640px; }
.hero-term pre { padding: 16px 18px; font-size: 13px; line-height: 1.7; overflow-x: auto; color: var(--text-secondary); }
.hero-term .p { color: var(--accent); }
.hero-term .ok { color: var(--green); }
.footer p + p { margin-top: 6px; }
.footer .social-links { flex-wrap: wrap; }
.page-404 { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 80px 24px; }
.page-404 h1 { font-size: clamp(56px, 12vw, 120px); font-weight: 700; letter-spacing: -4px; line-height: 1; margin-bottom: 12px; }
.page-404 p { color: var(--text-secondary); margin-bottom: 24px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (max-width: 768px) {
  .hero { padding: 60px 0 48px; }
  .hero h1 { letter-spacing: -1.6px; }
  .hero p { font-size: 17px; }
  .section { padding: 48px 0; }
  .nav-links a:not(.nav-cta) { display: inline; } /* base.css hides them; nav.css wraps them */
  .container { padding: 0 16px; }
}
@media (max-width: 480px) {
  .hero h1 { letter-spacing: -1.2px; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
}
/* === SL02: pipeline and skills === */
:root { --red: #e5484d; --blue-subtle: var(--accent-subtle); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.section code { font-size: 0.9em; color: var(--accent); background: var(--accent-subtle); padding: 1px 6px; border-radius: 4px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 24px; font-size: 14px; color: var(--text-secondary); }
.legend li { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.legend .units span { font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; margin-left: 4px; border: 1px solid var(--border-card); border-radius: 999px; color: var(--text-primary); white-space: nowrap; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch-loopctl { background: var(--green); }
.swatch-model { background: var(--purple); }
.pipeline { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; counter-reset: step; }
.pipe-step {
  position: relative; background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); padding: 18px 16px 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: opacity 0.4s, border-color 0.4s, box-shadow 0.4s, transform 0.4s;
}
.pipe-step:not(:last-child)::after {
  content: ''; position: absolute; top: 50%; right: -13px; width: 12px; height: 2px;
  background: var(--border-card); transition: background 0.4s;
}
.pipe-step.done:not(:last-child)::after { background: var(--accent); }
.pipe-num { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.pipe-step h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
.pipe-step p { font-size: 13px; color: var(--text-secondary); font-weight: 300; line-height: 1.5; flex: 1; }
.badge { align-self: flex-start; font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 4px; max-width: 100%; overflow-wrap: anywhere; }
.badge-loopctl { background: var(--green-subtle); color: var(--green); }
.badge-model { background: var(--purple-subtle); color: #b79cff; }
.pipeline.armed .pipe-step:not(.done):not(.active) { opacity: 0.45; }
.pipe-step.active { border-color: var(--accent); box-shadow: 0 0 24px var(--accent-glow); transform: translateY(-3px); }
.pipe-step.done { border-color: rgba(34, 211, 238, 0.35); }
.pipe-step.done .pipe-num::after { content: ' \2713'; color: var(--accent); }
.pipe-controls { display: flex; gap: 10px; margin-bottom: 40px; }
.pipe-controls .btn { padding: 6px 14px; font-size: 13px; }
.how-notes { margin-top: 8px; }
.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.skill-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.skill-card:hover { transform: none; }
.skill-card h3 { font-family: var(--font-mono); font-size: 17px; }
.io { margin: 10px 0 14px; display: grid; gap: 8px; }
.io dt { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent); }
.io dd { font-size: 13px; color: var(--text-secondary); font-weight: 300; line-height: 1.5; }
.demo-term { margin: 0; max-width: none; width: 100%; }
.demo-term .bar { flex-wrap: wrap; row-gap: 6px; }
.demo-term .title { margin-right: auto; }
.demo-controls { display: inline-flex; gap: 6px; }
.demo-btn {
  font-family: var(--font-sans); font-size: 11px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--text-secondary); border: 1px solid var(--border-card);
  border-radius: 4px; padding: 3px 9px; transition: color 0.15s, border-color 0.15s;
}
.demo-btn:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.2); }
.demo-out {
  height: 300px; overflow-y: auto; padding: 14px 16px; font-family: var(--font-mono);
  font-size: 12px; line-height: 1.65; color: var(--text-secondary); scroll-behavior: smooth;
}
.demo-out > div { white-space: pre-wrap; overflow-wrap: anywhere; animation: lineIn 0.25s ease-out both; }
.demo-out .ev-cmd { color: var(--text-primary); }
.demo-out .ev-spawn { color: #b79cff; }
.demo-out .ev-fail { color: var(--red); font-weight: 600; }
.demo-out .ev-pass { color: var(--green); font-weight: 600; }
.demo-out .ev-table { color: var(--text-primary); background: rgba(255,255,255,0.03); border-left: 2px solid var(--accent); padding: 6px 10px; margin: 4px 0; white-space: pre; overflow-x: auto; }
.demo-out .ev-report { color: var(--accent); font-weight: 600; }
.skill-card.is-playing .demo-out > div:last-child::after {
  content: ''; display: inline-block; width: 7px; height: 13px; margin-left: 4px; vertical-align: -2px;
  background: var(--accent); animation: blink 1s steps(2, start) infinite;
}
@keyframes lineIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes blink { to { visibility: hidden; } }
@media (max-width: 1000px) {
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipe-step:nth-child(3n)::after, .pipe-step:last-child::after { display: none; }
  .skills-grid, .features-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-step:nth-child(3n)::after { display: block; }
  .pipe-step:nth-child(2n)::after, .pipe-step:last-child::after { display: none; }
  .demo-out { height: 260px; font-size: 11.5px; }
}
/* === SL03: use cases and cost === */
.note { font-size: 13px; color: var(--text-secondary); margin: -16px 0 24px; }
.cost-table + .note { margin: 14px 0 18px; }
.uc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.uc-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.uc-card:hover { transform: none; }
.uc-toggle {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--accent);
  background: var(--accent-subtle); border: 1px solid rgba(34, 211, 238,0.2); border-radius: var(--radius-sm); padding: 6px 12px;
  transition: background 0.15s;
}
.uc-toggle::after { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.2s; }
.uc-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
.uc-toggle:hover { background: rgba(34, 211, 238,0.14); }
.uc-panel[hidden], .uc-toggle[hidden] { display: none; }
.uc-panel { animation: lineIn 0.25s ease-out both; }
.uc-panel dl { display: grid; gap: 12px; }
.uc-panel dt { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent); margin-bottom: 4px; }
.uc-panel dd { font-size: 14px; color: var(--text-secondary); font-weight: 300; line-height: 1.6; }
.uc-prompt { background: var(--bg-code); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.uc-prompt code { font-size: 12.5px; color: var(--text-primary); background: none; padding: 0; }
.cost-table { overflow-x: auto; border: 1px solid var(--border-card); border-radius: var(--radius-lg); background: var(--bg-card); }
.cost-table table { width: 100%; border-collapse: collapse; min-width: 520px; }
.cost-table caption { text-align: left; padding: 16px 20px 4px; font-size: 13px; color: var(--text-secondary); caption-side: top; }
.cost-table th, .cost-table td { padding: 14px 20px; text-align: left; vertical-align: middle; }
.cost-table thead th { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); }
.cost-table tbody th { font-weight: 500; font-size: 15px; white-space: nowrap; }
.cost-table tbody tr + tr > * { border-top: 1px solid var(--border-subtle); }
.cost-num { display: block; font-family: var(--font-mono); font-size: 14px; margin-bottom: 6px; }
.bar-track { display: block; height: 8px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.bar-track > .bar { display: block; height: 100%; width: 0; min-width: 4px; border-radius: 999px; transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
.bar-track > .bar-units, .bar-track > .bar.w-haiku, .bar-track > .bar.w-sonnet, .bar-track > .bar.w-opus { background: linear-gradient(90deg, var(--accent), #818cf8); }
.cost-spawns { font-family: var(--font-mono); font-size: 14px; white-space: nowrap; }
.cost-models { white-space: nowrap; }
.model-chip { display: inline-block; font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; margin-right: 6px; border: 1px solid var(--border-card); border-radius: 999px; color: var(--text-secondary); }
.cost-table .bar-track { min-width: 140px; }
.weights { margin-top: 20px; padding: 16px 20px; border: 1px solid var(--border-card); border-radius: var(--radius-lg); background: var(--bg-card); }
.weights-h { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 12px; }
.weights-list { list-style: none; display: grid; gap: 10px; }
.weights-list li { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 14px; }
.weights + .note { margin: 14px 0 24px; }
.w-name { font-family: var(--font-mono); font-size: 13px; }
.w-val { font-family: var(--font-mono); font-size: 13px; text-align: right; }
.bar-track > .bar.w-haiku { width: 4%; transition: none; }
.bar-track > .bar.w-sonnet { width: 20%; transition: none; }
.bar-track > .bar.w-opus { width: 100%; transition: none; opacity: 0.55; }
@media (max-width: 560px) { .weights-list li { grid-template-columns: 110px 1fr 32px; gap: 10px; } }
@media (max-width: 1000px) { .uc-grid { grid-template-columns: 1fr; } }
/* === SL04: safety and install === */
.safety-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.safety-grid > * { grid-column: span 2; }
.safety-grid > :nth-child(3n+1):nth-last-child(2), .safety-grid > :nth-child(3n+2):last-child { grid-column: span 3; }
.safety-grid > :nth-child(3n+1):last-child { grid-column: 1 / -1; }
.safety-card:hover { transform: none; }
.safety-card h3 { color: var(--text-primary); }
.safety-card p code, .lead code { font-size: 0.9em; color: var(--accent); background: var(--accent-subtle); padding: 1px 6px; border-radius: 4px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border-subtle); }
.tabs [role="tab"] {
  font-family: var(--font-mono); font-size: 13px; cursor: pointer; color: var(--text-secondary);
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tabs [role="tab"]:hover { color: var(--text-primary); }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }
.tab-panel { display: grid; gap: 18px; animation: lineIn 0.25s ease-out both; }
.copy-block { min-width: 0; }
.copy-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.copy-head h3 { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.copy-btn {
  font-family: var(--font-sans); font-size: 12px; font-weight: 500; cursor: pointer; min-width: 84px;
  background: var(--accent-subtle); color: var(--accent); border: 1px solid rgba(34, 211, 238,0.25);
  border-radius: var(--radius-sm); padding: 5px 12px; transition: background 0.15s;
}
.copy-btn:hover { background: rgba(34, 211, 238,0.16); }
.copy-pre {
  background: var(--bg-code); border: 1px solid var(--border-card); border-radius: var(--radius-lg);
  padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.7; color: var(--text-primary);
}
.copy-pre code { font-family: var(--font-mono); white-space: pre; }
.footer .social-links a:hover { color: var(--text-primary); }
@media (max-width: 1000px) { .safety-grid { grid-template-columns: 1fr; } .safety-grid > * { grid-column: auto !important; } }
/* === SL05: skill rows === */
.skill-rows { display: grid; gap: 20px; }
.skill-row {
  --c: var(--accent); --c-text: var(--accent-hover); --c-soft: var(--accent-subtle); --c-glow: rgba(34, 211, 238, 0.16);
  position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, var(--c-soft), transparent 55%), var(--bg-card);
  border: 1px solid var(--border-card); border-radius: 16px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.skill-row[data-accent="accent"] { --c: var(--accent); --c-text: var(--accent-hover); --c-soft: var(--accent-subtle); }
.skill-row[data-accent="green"] { --c: var(--green); --c-text: #6ee7b0; --c-soft: var(--green-subtle); --c-glow: rgba(61, 214, 140, 0.16); }
.skill-row[data-accent="purple"] { --c: var(--purple); --c-text: #b79cff; --c-soft: var(--purple-subtle); --c-glow: rgba(139, 92, 246, 0.2); }
.skill-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--c), transparent); }
.skill-row:hover, .skill-row:focus-within { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 24px 60px -28px var(--c-glow); }
.skill-id { padding: 32px 28px 28px 32px; display: flex; flex-direction: column; justify-content: center; gap: 18px; min-width: 0; }
.skill-head { display: flex; align-items: center; gap: 12px; }
.skill-glyph {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 18px;
  color: var(--c-text); background: var(--c-soft); border: 1px solid var(--c);
}
.skill-head h3 { font-family: var(--font-mono); font-size: 20px; font-weight: 600; letter-spacing: -0.4px; }
.skill-pitch { font-size: 15px; line-height: 1.65; color: var(--text-secondary); font-weight: 300; max-width: 46ch; }
.flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; }
.flow-node {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; min-width: 0;
  background: rgba(255,255,255,0.025); border: 1px solid var(--border-card); border-radius: var(--radius-md);
}
.flow-label { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--c-text); }
.flow-text { font-size: 13px; line-height: 1.5; color: var(--text-primary); overflow-wrap: anywhere; }
.flow-text code { font-size: 0.92em; color: var(--c-text); background: none; padding: 0; }
.flow-arrow { align-self: center; font-size: 18px; color: var(--c-text); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--font-mono); font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  color: var(--text-secondary); border: 1px solid var(--border-card); background: rgba(255,255,255,0.02);
}
.chip-haiku { color: var(--c-text); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.chip-sonnet { color: var(--text-primary); border-color: rgba(255,255,255,0.18); }
.unit-meter { display: grid; gap: 6px; margin-top: 4px; }
.unit-label { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-secondary); }
.unit-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.unit-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--c), var(--c-text)); transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1); }
.skill-term { padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; background: rgba(0,0,0,0.22); border-left: 1px solid var(--border-subtle); }
.skill-term .demo-term { flex: 1; border-color: var(--border-card); box-shadow: 0 18px 40px -24px rgba(0,0,0,0.8); }
.skill-term .demo-out { height: 320px; padding-top: 18px; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 34px); mask-image: linear-gradient(180deg, transparent 0, #000 34px); }
.stage-track { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); counter-reset: none; }
.stage-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); transition: color 0.3s; }
.stage-step::before { content: ''; position: absolute; top: 5px; right: 50%; width: 100%; height: 2px; background: var(--border-card); transition: background 0.4s; }
.stage-step:first-child::before { display: none; }
.stage-step.done::before, .stage-step.active::before { background: var(--c); }
.stage-dot { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--border-card); transition: background 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.3s; }
.stage-step.done { color: var(--text-secondary); }
.stage-step.done .stage-dot { background: var(--c); border-color: var(--c); }
.stage-step.active { color: var(--c-text); }
.stage-step.active .stage-dot { background: var(--bg-primary); border-color: var(--c); box-shadow: 0 0 0 4px var(--c-glow); transform: scale(1.15); }
@media (max-width: 720px) {
  .skill-row { grid-template-columns: 1fr; }
  .skill-id { padding: 26px 20px 20px 24px; }
  .skill-term { padding: 16px; border-left: 0; border-top: 1px solid var(--border-subtle); }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .skill-term .demo-out { height: 260px; }
  .stage-step { font-size: 10px; }
}
/* === SL06: polish === */
:root {
  --tok-prompt: #9aa3b2; --tok-cmd: var(--accent-hover); --tok-flag: #fbbf24; --tok-string: #86efac; --tok-path: #c4b5fd;
  --tok-number: #fda4af; --tok-comment: #8b8b98; --tok-ok: #3dd68c; --tok-fail: #ff7b80; --tok-warn: #f5d90a; --tok-key: #93c5fd;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px; --space-6: 48px; --space-8: 64px; --space-12: 96px;
}

/* syntax tokens (all >= 4.5:1 on --bg-code) */
.tok-prompt { color: var(--tok-prompt); user-select: none; }
.tok-cmd { color: var(--tok-cmd); font-weight: 500; }
.tok-flag { color: var(--tok-flag); }
.tok-string { color: var(--tok-string); }
.tok-path { color: var(--tok-path); }
.tok-number { color: var(--tok-number); }
.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-ok { color: var(--tok-ok); font-weight: 600; }
.tok-fail { color: var(--tok-fail); font-weight: 600; }
.tok-warn { color: var(--tok-warn); font-weight: 600; }
.tok-key { color: var(--tok-key); }

/* type scale and rhythm */
.hero h1 { font-size: clamp(42px, 6.4vw, 72px); letter-spacing: -0.045em; line-height: 1.04; text-wrap: balance; }
.hero p { font-weight: 300; line-height: 1.7; text-wrap: pretty; }
.section { padding: var(--space-12) 0; }
.section h2 { font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -0.035em; line-height: 1.12; text-wrap: balance; }
.section .lead { font-size: 18px; font-weight: 300; line-height: 1.7; color: var(--text-secondary); max-width: 62ch; margin-bottom: 0; }
.section-head { margin-bottom: var(--space-6); display: grid; gap: 0; }
.section-head .section-label { display: inline-flex; align-items: center; gap: 10px; }
.section-head .section-label::before { content: ''; width: 24px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }
.section-head .note { margin: var(--space-2) 0 0; }

/* hero: layered glow, grid and grain, all CSS */
.hero { isolation: isolate; padding: 112px 0 88px; }
.hero::before {
  z-index: -1; width: 1200px; height: 900px; top: -45%;
  background:
    radial-gradient(circle at 50% 38%, rgba(34, 211, 238, 0.18), transparent 52%),
    radial-gradient(circle at 24% 62%, rgba(129, 140, 248, 0.12), transparent 48%),
    radial-gradient(circle at 78% 56%, rgba(61, 214, 140, 0.07), transparent 44%);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 35%, transparent 100%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='ur%6C(%23n)' opacity='.5'/%3E%3C/svg%3E"),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 160px 160px, 56px 56px, 56px 56px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 50% 25%, #000 15%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 75% at 50% 25%, #000 15%, transparent 75%);
}
.hero-badge { box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.05); backdrop-filter: blur(6px); }
.hero-actions { margin-top: var(--space-4); }

/* nav */
.nav { transition: background 0.25s, border-color 0.25s; }
.nav-links a { position: relative; padding: 6px 0; }
.nav-links a[aria-current="true"] { color: var(--text-primary); }
.nav-links a[aria-current="true"]:not(.nav-cta)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #818cf8);
}
.nav-cta { padding: 6px 14px !important; transition: opacity 0.15s, transform 0.15s var(--ease); }
.nav-cta:hover { transform: translateY(-1px); }

/* buttons and states */
.btn { transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.2s var(--ease), box-shadow 0.2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active, .demo-btn:active, .copy-btn:active, .uc-toggle:active, .tabs [role="tab"]:active { transform: translateY(1px); }
.btn-primary:hover { box-shadow: 0 6px 28px rgba(34, 211, 238, 0.32); }
a:focus-visible, button:focus-visible, [role="tab"]:focus-visible, .demo-out:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}
.tabs [role="tab"] { border-radius: 6px 6px 0 0; }
.tabs [role="tab"]:hover { background: rgba(255, 255, 255, 0.03); }
.tabs [role="tab"][aria-selected="true"] { background: linear-gradient(180deg, transparent, var(--accent-subtle)); }

/* cards */
.card { transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s; }
.card:hover, .uc-card:hover, .safety-card:hover { transform: translateY(-2px); box-shadow: 0 18px 44px -26px rgba(0, 0, 0, 0.9); border-color: rgba(255, 255, 255, 0.14); }
.card h3 { letter-spacing: -0.02em; }

/* code windows */
.code-block {
  border: 1px solid transparent; border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 90px) padding-box,
    linear-gradient(var(--bg-code), var(--bg-code)) padding-box,
    linear-gradient(140deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 40%, rgba(34, 211, 238, 0.22)) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 22px 48px -26px rgba(0, 0, 0, 0.9), 0 0 40px -22px rgba(34, 211, 238, 0.25);
  min-width: 0;
}
.tab-panel .code-block, .uc-panel .code-block { margin: 0; max-width: none; }
.code-block .bar { background: rgba(255, 255, 255, 0.02); padding: 10px 14px; min-height: 44px; }
.code-block .bar .dot { width: 10px; height: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); opacity: 0.9; }
.code-block .bar .title { margin-right: auto; font-size: 12px; color: var(--text-secondary); }
.lang-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-secondary); padding: 2px 8px; border: 1px solid var(--border-card); border-radius: 999px; background: rgba(255, 255, 255, 0.03);
}
.code-block > pre, .copy-pre, .uc-prompt {
  margin: 0; background: none; border: 0; border-radius: 0; padding: 14px 16px;
  overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.75; color: var(--text-primary);
  font-variant-numeric: tabular-nums; font-feature-settings: "calt" 0, "liga" 0; tab-size: 2;
}
.uc-prompt { white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-pre code, .uc-prompt code { background: none; padding: 0; font-size: inherit; color: inherit; }
.demo-out { font-variant-numeric: tabular-nums; tab-size: 2; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.code-block .copy-btn { margin-left: 4px; }
.tab-panel > *, .tab-panels { min-width: 0; }

/* tracks and meters */
.pipe-step { transition: opacity 0.4s, border-color 0.4s, box-shadow 0.4s, transform 0.4s var(--ease), background 0.4s; }
.pipe-step.active { background: linear-gradient(180deg, var(--accent-subtle), var(--bg-card)); }
.pipe-step.active .pipe-num { color: var(--accent); }
.pipe-step.active:not(:last-child)::after {
  background: linear-gradient(90deg, var(--accent), transparent 80%); background-size: 200% 100%;
  animation: connector 1.1s linear infinite;
}
.stage-step.active::before { background: linear-gradient(90deg, var(--c), var(--c-text), var(--c)); background-size: 200% 100%; animation: connector 1.4s linear infinite; }
.stage-step.active .stage-dot { animation: ring 1.8s ease-out infinite; }
@keyframes connector { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 var(--c-glow), 0 0 14px var(--c); } 100% { box-shadow: 0 0 0 9px transparent, 0 0 14px var(--c); } }

/* scroll reveal: armed by JS only */
.reveal-ready [data-reveal] { transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), border-color 0.25s, box-shadow 0.25s, background 0.4s; }
.reveal-ready [data-reveal]:not(.revealed) { opacity: 0; transform: translateY(18px); }

/* footer */
.footer { position: relative; padding: var(--space-8) 0 var(--space-6); background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.035)); }
.footer::before { content: ''; position: absolute; top: -1px; left: 50%; width: min(520px, 70%); height: 1px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.6; }
.footer .social-links { gap: var(--space-1) var(--space-3); margin-bottom: var(--space-3); }
.footer .social-links a { padding: 6px 12px; border: 1px solid var(--border-card); border-radius: 999px; transition: color 0.15s, border-color 0.2s, transform 0.2s var(--ease); }
.footer .social-links a:hover { color: var(--text-primary); border-color: rgba(34, 211, 238, 0.4); transform: translateY(-1px); }
.footer p { color: var(--text-secondary); }

@media (max-width: 768px) {
  .section { padding: var(--space-8) 0; }
  .section-head { margin-bottom: var(--space-4); }
  .hero { padding: 72px 0 56px; }
  .code-block > pre, .copy-pre, .uc-prompt { font-size: 12.5px; padding: 12px; }
}
@media (max-width: 400px) {
  .container { padding: 0 14px; }
  .hero h1 { font-size: 38px; letter-spacing: -0.04em; }
  .code-block .bar { gap: 6px; padding: 8px 10px; }
  .tabs [role="tab"] { padding: 9px 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-ready [data-reveal], [data-reveal], .code-block, .copy-btn, .btn, .card, .nav, .footer .social-links a { transition: none !important; }
  .reveal-ready [data-reveal]:not(.revealed) { opacity: 1; transform: none; }
  .pipe-step.active:not(:last-child)::after, .stage-step.active::before, .stage-step.active .stage-dot, .hero-badge .dot { animation: none !important; }
  .tok-cmd, .tok-ok { transition: none !important; }
  .unit-fill, .stage-step, .stage-step::before, .stage-dot, .skill-row { transition: none !important; }
  .stage-step.active .stage-dot { transform: none; }
  .tab-panel { animation: none !important; }
  .bar-track > .bar { transition: none !important; }
  .uc-panel { animation: none !important; }
  .demo-out > div, .skill-card.is-playing .demo-out > div:last-child::after { animation: none !important; }
  .pipe-step.active { transform: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}

/* cost table: stacked rows on narrow screens instead of a clipped horizontal scroll */
@media (max-width: 560px) {
  .cost-table { overflow: visible; }
  .cost-table table { min-width: 0; }
  .cost-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cost-table tbody tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name spawns" "models models" "units units"; gap: 10px 12px; padding: 16px 18px; }
  .cost-table tbody tr + tr { border-top: 1px solid var(--border-subtle); }
  .cost-table tbody tr + tr > * { border-top: 0; }
  .cost-table tbody th, .cost-table tbody td { display: block; padding: 0; }
  .cost-table tbody th { grid-area: name; }
  .cost-table .cost-spawns { grid-area: spawns; color: var(--text-secondary); font-size: 13px; align-self: center; }
  .cost-table .cost-spawns::after { content: ' spawns'; }
  .cost-table .cost-models { grid-area: models; }
  .cost-table tbody td:last-child { grid-area: units; }
  .cost-table .cost-num::after { content: ' units'; color: var(--text-secondary); font-size: 12px; }
  .cost-table .bar-track { min-width: 0; margin-top: 6px; }
}
/* Without JS: final widths (from unitPercents and barWidths; tests/nojs.test.js keeps them in sync). */
.pipe-controls[hidden], .demo-controls[hidden], .cost-replay[hidden] { display: none; }
html:not(.js) .unit-fill[data-units="13.4"] { width: 100%; }
html:not(.js) .unit-fill[data-units="6"] { width: 44.78%; }
html:not(.js) .unit-fill[data-units="1.4"] { width: 10.45%; }
html:not(.js) .bar[data-row="bugfix"] { width: 10.45%; }
html:not(.js) .bar[data-row="feature"] { width: 44.78%; }
html:not(.js) .bar[data-row="product"] { width: 100%; }
