:root {
  --bg: #1b1830; --bg2: #120f24; --panel: #241f42; --panel2: #2d2752; --line: #3a3560;
  --ink: #f2eefc; --muted: #a49fc4; --amber: #ffb84d; --teal: #3cc9b0; --red: #e5584f; --green: #5ec26a;
  --shadow: 4px 4px 0 #0b0916;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: #7ee8d4; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: #2a1d05; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.teal { color: var(--teal); }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(27,24,48,.9); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.3px; }
.logo { image-rendering: pixelated; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--ink); }
.main-nav .gh { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); background: var(--panel); border: 2px solid var(--line); padding: 6px 12px; border-radius: 8px; box-shadow: 3px 3px 0 #0b0916; }
@media (max-width: 640px) { .main-nav a:not(.gh):not([href$="docs/"]) { display: none; } .main-nav { gap: 12px; } .gh span { display: none; } }

/* buttons */
.btn { display: inline-block; text-decoration: none; font-weight: 800; color: var(--ink); background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 11px 20px; box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s; }
.btn:hover { color: var(--ink); transform: translate(2px,2px); box-shadow: 2px 2px 0 #0b0916; }
.btn.primary { background: var(--amber); border-color: #ffd28a; color: #2a1d05; }
.btn.primary:hover { color: #2a1d05; }

/* hero */
.hero { background: radial-gradient(900px 420px at 80% -10%, #3a2f70 0%, transparent 70%), radial-gradient(700px 400px at 0% 100%, #16324a 0%, transparent 70%); padding: 64px 0 56px; border-bottom: 2px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--amber); margin: 0 0 14px; }
h1 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.08; letter-spacing: -1.5px; margin: 0 0 18px; }
.lead { font-size: 19px; color: #cfc9ea; margin: 0 0 26px; max-width: 34em; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; }
.chips { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 26px 0 0; }
.chips li { font-family: var(--mono); font-size: 12px; background: var(--bg2); border: 2px solid var(--line); border-radius: 6px; padding: 3px 10px; color: var(--muted); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* animated stage */
.stage-wrap { width: 100%; aspect-ratio: 16 / 9; border: 3px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 6px 6px 0 #0b0916; background: var(--bg2); position: relative; }
.stage { position: absolute; left: 0; top: 0; width: 640px; height: 360px; transform: scale(var(--k, 1)); transform-origin: 0 0; background: url(assets/map.png) -600px -32px / 1920px 1152px no-repeat; image-rendering: pixelated; }
.spr { position: absolute; display: block; width: 36px; height: 50px; background-repeat: no-repeat; background-size: 108px 208px; image-rendering: pixelated; }
.spr.marina { background-image: url(assets/sheet-marina.png); } .spr.carla { background-image: url(assets/sheet-carla.png); }
.spr.diego { background-image: url(assets/sheet-diego.png); } .spr.elisa { background-image: url(assets/sheet-elisa.png); }
.spr.r { background-position-y: -104px; } .spr.l { background-position-y: -52px; }
.walker { position: absolute; width: 36px; height: 50px; }
.walker .spr { left: 0; top: 0; animation: walk .64s steps(1) infinite; }
.w1 { left: 30px; top: 150px; animation: patrol1 9s linear infinite alternate; }
.w2 { left: 60px; top: 196px; animation: patrol2 12s linear infinite alternate; }
.w1 .r, .w2 .r { animation: walk .64s steps(1) infinite, showFirst 18s steps(1) infinite; }
.w1 .l, .w2 .l { animation: walk .64s steps(1) infinite, showSecond 18s steps(1) infinite; }
.w2 .r { animation-duration: .64s, 24s; } .w2 .l { animation-duration: .64s, 24s; }
@keyframes walk { 0% { background-position-x: -36px } 25% { background-position-x: 0 } 50% { background-position-x: -72px } 75% { background-position-x: 0 } }
@keyframes patrol1 { to { transform: translateX(380px); } }
@keyframes patrol2 { to { transform: translateX(340px); } }
@keyframes showFirst { 0%, 49.99% { opacity: 1 } 50%, 100% { opacity: 0 } }
@keyframes showSecond { 0%, 49.99% { opacity: 0 } 50%, 100% { opacity: 1 } }
.bubble { position: absolute; background: #fff; color: #1d1a2b; font: 700 11px/1 var(--sans); padding: 5px 7px; border: 2px solid #1d1a2b; border-radius: 6px; white-space: nowrap; animation: pop 4s steps(1) infinite; }
.bubble::after { content: ""; position: absolute; left: 12px; bottom: -8px; border: 4px solid transparent; border-top-color: #1d1a2b; }
.b2 { animation-delay: 2s; }
@keyframes pop { 0%, 45% { opacity: 1 } 50%, 100% { opacity: 0 } }
.live { position: absolute; font: 800 10px/1 var(--mono); background: #1d1a2b; color: #fff; padding: 3px 6px; border-radius: 4px; display: flex; align-items: center; gap: 5px; }
.live i { width: 7px; height: 7px; background: var(--red); border-radius: 50%; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { .walker, .walker .spr, .bubble, .live i { animation: none !important; } .walker .l { opacity: 0; } .bubble { opacity: 1; } }

/* targets */
.targets { background: var(--bg2); border-bottom: 2px solid var(--line); padding: 26px 0 18px; }
.targets ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; }
.targets b { display: block; font: 800 26px/1.2 var(--mono); color: var(--amber); }
.targets span { color: var(--muted); font-size: 14px; }
.targets .note { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 0; }
@media (max-width: 700px) { .targets ul { grid-template-columns: 1fr 1fr; } }

/* sections */
.section { padding: 76px 0; }
.section.alt { background: var(--bg2); border-block: 2px solid var(--line); }
h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.8px; line-height: 1.15; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 18px; margin: 0 0 36px; max-width: 40em; }
.narrow { max-width: 760px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards.three { margin-top: 28px; }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p, .card li { color: #cfc9ea; margin: 0; font-size: 15px; }
.card ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.status .card.ok { border-color: #3d7a4a; } .status .card.ok h3 { color: var(--green); }
.status .card.mid { border-color: #8a7020; } .status .card.mid h3 { color: #f2d14b; }
.status .card.todo { border-color: #7a3a36; } .status .card.todo h3 { color: #ff8f86; }
.more { margin: 26px 0 0; font-weight: 700; }
.faq { display: grid; gap: 12px; }
.faq-item { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.faq-item summary { cursor: pointer; padding: 16px 20px; font-weight: 800; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--amber); font-weight: 800; }
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 10px; }
.faq-item .prose { padding: 0 20px 6px; }
.faq-item .prose p { margin: 0 0 14px; }
.final-cta { text-align: center; }
.final-cta .sub { margin-inline: auto; margin-bottom: 26px; }
.final-cta .cta { justify-content: center; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } .section { padding: 56px 0; } }
.diagram { margin: 0; background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.diagram svg { width: 100%; height: auto; display: block; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { padding-left: 30px; position: relative; color: #cfc9ea; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 14px; background: var(--teal); box-shadow: 3px 3px 0 #0b0916; }
.ticks b { color: var(--ink); margin-right: 6px; }
.cast-box { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); text-align: center; }
.cast-box img { max-width: 100%; height: auto; image-rendering: pixelated; }
.cast-box .walk { border-radius: 8px; margin-top: 14px; }
.caption { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* screenshots */
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; border: 3px solid var(--line); border-radius: 12px; box-shadow: 6px 6px 0 #0b0916; image-rendering: pixelated; background: var(--bg2); }
.shots figcaption { color: var(--muted); font-size: 14px; margin-top: 12px; text-align: center; }
@media (max-width: 800px) { .shots { grid-template-columns: 1fr; } }

/* code */
.code { position: relative; margin: 18px 0; }
.code pre { margin: 0; background: #0d0a1c; border: 2px solid var(--line); border-radius: 10px; padding: 18px 18px; overflow-x: auto; box-shadow: var(--shadow); }
.code:has(.copy) pre { padding-top: 40px; }
code { font-family: var(--mono); font-size: .9em; }
pre code { font-size: 14px; line-height: 1.6; color: #d9f5ee; }
.copy { position: absolute; top: 8px; right: 8px; font: 700 12px var(--mono); background: var(--panel2); color: var(--ink); border: 2px solid var(--line); border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.copy:hover { border-color: var(--teal); }

/* footer */
.site-footer { border-top: 2px solid var(--line); padding: 34px 0 46px; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0 0 6px; } .fine { font-size: 13px; }

/* docs */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 36px; padding-top: 34px; padding-bottom: 60px; }
.sidebar { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; padding-right: 8px; font-size: 14px; }
.side-group h4 { font: 800 11px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--amber); margin: 22px 0 6px; }
.side-group ul { list-style: none; margin: 0; padding: 0; }
.side-group a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.side-group a:hover { color: var(--ink); background: var(--panel); }
.side-group a[aria-current] { color: var(--ink); background: var(--panel2); box-shadow: inset 3px 0 0 var(--teal); font-weight: 700; }
.search input { width: 100%; background: var(--bg2); border: 2px solid var(--line); color: var(--ink); border-radius: 8px; padding: 8px 12px; font: inherit; }
.search ul { list-style: none; margin: 6px 0 0; padding: 4px; background: var(--panel); border: 2px solid var(--line); border-radius: 8px; }
.search li a, .search li.none { display: block; padding: 6px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.search li a:hover { background: var(--panel2); } .search li.none { color: var(--muted); }
.side-toggle { display: none; }
.doc { min-width: 0; }
.prose h1 { font-size: 36px; letter-spacing: -1px; margin: 0 0 18px; }
.prose h2 { font-size: 25px; margin: 44px 0 12px; padding-top: 6px; border-top: 2px solid var(--line); letter-spacing: -.4px; }
.prose h3 { font-size: 19px; margin: 30px 0 8px; }
.prose p, .prose li { color: #dcd7f2; }
.prose ul, .prose ol { padding-left: 24px; } .prose li { margin: 4px 0; }
.prose :not(pre) > code { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: #ffd28a; }
.prose blockquote { margin: 18px 0; padding: 4px 18px; border-left: 4px solid var(--amber); background: rgba(255,184,77,.08); border-radius: 0 8px 8px 0; }
.prose blockquote p { color: #f3e6cf; }
.prose hr { border: 0; border-top: 2px solid var(--line); margin: 34px 0; }
.anchor { color: var(--line); text-decoration: none; margin-left: -1.1em; padding-right: .4em; font-weight: 400; opacity: 0; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; color: var(--teal); }
.table-wrap { overflow-x: auto; margin: 18px 0; border: 2px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel); font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: var(--amber); font-family: var(--mono); }
tr:last-child td { border-bottom: 0; }
.edit { margin: 40px 0 0; font-size: 14px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.pager a { display: block; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 12px 16px; text-decoration: none; color: var(--ink); font-weight: 700; box-shadow: 3px 3px 0 #0b0916; }
.pager a:hover { border-color: var(--teal); }
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.pager .next { text-align: right; }
.toc { position: sticky; top: 84px; align-self: start; font-size: 13px; max-height: calc(100vh - 100px); overflow: auto; }
.toc h4 { font: 800 11px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 3px 12px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); } .toc .d3 a { padding-left: 26px; }
@media (max-width: 1080px) { .docs { grid-template-columns: 230px minmax(0,1fr); } .toc { display: none; } }
@media (max-width: 820px) {
  .docs { grid-template-columns: 1fr; gap: 16px; }
  .side-toggle { display: block; background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 8px 14px; font: 700 14px var(--sans); width: max-content; cursor: pointer; }
  .sidebar { display: none; position: static; max-height: none; }
  .sidebar.open { display: block; }
}
