:root {
  --pink: #fb72f3; --ink: #201e1d;
  --bg: #f3f2f2; --fg: #201e1d; --card: #ffffff; --muted: #5d5a59;
  --stripe-a: #e6e4e4; --stripe-b: #dcd9d9; --scrim: rgba(243,242,242,.82);
  --chip: #201e1d; --pin: #b4b0ae; --wing: rgba(255,255,255,.75);
  --font: "Archivo", system-ui, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #171615; --fg: #f3f2f2; --card: #22201f; --muted: #a9a5a3;
  --stripe-a: #2c2a29; --stripe-b: #353231; --scrim: rgba(23,22,21,.85);
  --chip: #3b3938; --pin: #8f8b89; --wing: rgba(243,242,242,.28);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 400 15px/1.5 var(--font); overflow-x: hidden; transition: background .25s, color .25s; }
a { color: inherit; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--pink); }
::selection { background: var(--pink); color: var(--ink); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
img { display: block; max-width: 100%; }

/* header */
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; background: var(--bg); border-bottom: 2px solid var(--fg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scope { margin-right: auto; display: flex; flex-direction: column; align-items: center; }
.scope-body { display: flex; gap: 6px; align-items: center; background: var(--pink); border: 2px solid var(--chip); padding: 4px; }
.bclock { display: flex; gap: 4px; padding: 5px 7px; background: #141312; border: 2px solid var(--chip); }
.bcol { display: flex; flex-direction: column; gap: 3px; }
.bcol.gap { margin-right: 6px; }
.bcol:last-child { margin-right: 0; }
.bclock i, .bclock b { width: 7px; height: 7px; display: block; }
.bclock i { background: rgba(251,114,243,.16); transition: background .15s, box-shadow .15s; }
.bclock i.on { background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.scope { cursor: default; }
.scope-screen { width: 132px; height: 38px; display: block; border: 2px solid var(--chip); background: #141312; }
.scope-panel { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.knob { width: 12px; height: 12px; border-radius: 50%; background: var(--chip); position: relative; display: block; }
.knob::after { content: ""; position: absolute; left: 5px; top: 1px; width: 2px; height: 5px; background: var(--pink); }
.scope-led { width: 4px; height: 4px; background: #ffffff; display: block; }
.scope-feet { display: flex; justify-content: space-between; width: calc(100% - 24px); }
.scope-feet i { width: 10px; height: 4px; background: var(--chip); display: block; }
.brand { margin-right: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand .sub { font-weight: 500; font-size: 14px; letter-spacing: .02em; }
.keys { display: flex; gap: 8px; flex-wrap: nowrap; padding-bottom: 4px; flex: none; }
.key { all: unset; cursor: pointer; box-sizing: border-box; height: 38px; min-width: 42px; padding: 0 12px; display: flex; align-items: center; justify-content: center; font: 600 13px/1 var(--font); background: var(--card); color: var(--fg); border: 2px solid var(--fg); box-shadow: 0 4px 0 var(--fg); transition: transform .06s, box-shadow .06s; }
.key:hover { background: var(--pink); color: var(--ink); }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--fg); }
.key:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.key svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

/* canvas + cards */
#canvas { position: relative; min-height: calc(100vh - 70px); overflow: hidden; isolation: isolate; z-index: 0; }
.card { position: absolute; left: 0; top: 0; background: var(--card); color: var(--fg); border: 2px solid var(--fg); box-shadow: 4px 4px 0 var(--pink); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-y; transition: box-shadow .15s; }
.card.lifted { box-shadow: 8px 8px 0 var(--pink); cursor: grabbing; }
.card.contact, .card.about { background: var(--pink); color: var(--ink); box-shadow: 4px 4px 0 var(--fg); }
.card.contact.lifted, .card.about.lifted { box-shadow: 8px 8px 0 var(--fg); }
.card .pad { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.card.about .pad, .card.contact .pad { padding: 16px; gap: 12px; }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; pointer-events: none; }
.ph { aspect-ratio: 4/3; background: repeating-linear-gradient(135deg, var(--stripe-a) 0 8px, var(--stripe-b) 8px 16px); display: flex; align-items: flex-end; padding: 8px; font: 11px ui-monospace, Menlo, monospace; color: var(--muted); }
.ph-wide { aspect-ratio: 16/9; padding: 10px; }
.slides { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.slides img { position: absolute; inset: 0; height: 100%; opacity: 0; transition: opacity .6s; }
.slides img.on { opacity: 1; }
.slides .count { position: absolute; right: 6px; bottom: 6px; background: var(--card); color: var(--fg); border: 2px solid var(--fg); font: 600 10px/1 ui-monospace, Menlo, monospace; padding: 3px 5px; }
.modal .facts { font-size: 17px; line-height: 1.45; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.card h3 { font-size: 21px; letter-spacing: -.015em; }
.card .sm { margin: 0; font-size: 13px; line-height: 1.35; }
.muted { color: var(--muted); }
.modal .see { font-weight: 600; margin-left: .4em; white-space: nowrap; }
.card h2 { font-size: 30px; }
.card p { margin: 0; text-wrap: pretty; }
.card.about p + p { font-size: 15px; }
.card.about .pad { gap: 10px; }
.mail { font-weight: 800; font-size: 24px; letter-spacing: -.02em; color: var(--ink); }
.socials { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; font-weight: 600; }
.card .socials a { color: var(--ink); }

/* footer */

/* modal */
.modal { position: fixed; inset: 0; z-index: 1000; background: var(--scrim); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow: auto; }
.modal[hidden] { display: none; }
.modal article { width: 100%; max-width: 760px; background: var(--bg); color: var(--fg); border: 2px solid var(--fg); box-shadow: 8px 8px 0 var(--pink); padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.modal .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; font-size: 12px; color: var(--muted); }
.modal .close { all: unset; cursor: pointer; font-size: 13px; color: var(--fg); padding: 4px 10px; border: 2px solid var(--fg); }
.modal .close:hover { background: var(--pink); color: var(--ink); }
.modal h2 { font-size: clamp(36px, 6vw, 64px); line-height: .98; letter-spacing: -.035em; }
.modal img { width: 100%; }
.yt { position: relative; aspect-ratio: 16/9; background: #141312; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.yt span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--pink); color: #201e1d; border: 2px solid #201e1d; font: 600 20px/1 ui-monospace, Menlo, monospace; padding: 10px 16px; }
a.yt { display: block; }
.modal .gallery .yt { grid-column: 1 / -1; }
.modal .gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.modal p { margin: 0; font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.modal .socials { font-size: 15px; }
.modal dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 15px; border-top: 2px solid var(--fg); padding-top: 16px; }
.modal dt { color: var(--muted); }
.modal dd { margin: 0; }
body.locked { overflow: hidden; }

/* bicho + multímetro */
.critter { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; will-change: transform; }
.chip-hit { position: absolute; left: -38px; top: -22px; width: 76px; height: 44px; pointer-events: auto; cursor: pointer; }
.chip-pin { position: absolute; width: 5px; height: 10px; background: var(--pin); }
.chip-body { position: absolute; left: 6px; top: 10px; width: 64px; height: 24px; background: var(--chip); display: flex; align-items: center; padding-left: 8px; font: 700 7px ui-monospace, Menlo, monospace; color: #8d8987; letter-spacing: .05em; }
.chip-notch { position: absolute; right: -4px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bg); }
.chip-led { position: absolute; right: 9px; top: 4px; width: 4px; height: 4px; background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.meter-body { position: absolute; left: -17px; top: -26px; width: 34px; height: 50px; background: var(--pink); border: 2px solid var(--chip); display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 4px; }
.meter-lcd { width: 26px; height: 12px; background: #d9e3c8; border: 1px solid var(--chip); font: 700 6px ui-monospace, Menlo, monospace; color: var(--ink); display: flex; align-items: center; justify-content: flex-end; padding-right: 2px; white-space: nowrap; overflow: hidden; }
.meter-dial { width: 14px; height: 14px; border-radius: 50%; background: var(--chip); position: relative; }
.meter-dial::after { content: ""; position: absolute; left: 6px; top: 1px; width: 2px; height: 6px; background: var(--pink); }
.meter-jacks { display: flex; gap: 8px; }
.meter-jacks i { width: 5px; height: 5px; border-radius: 50%; background: var(--chip); }
.meter-jacks i + i { box-shadow: inset 0 0 0 1.5px var(--pink); }
.wing { position: absolute; top: -34px; width: 22px; height: 13px; border-radius: 50%; background: var(--wing); border: 1.5px solid var(--chip); z-index: -1; }
.webs { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 49; overflow: visible; }

@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  .scope { margin: 0 auto; }
  .keys { width: 100%; flex: 1 1 100%; flex-wrap: wrap; }
  .key { flex: 1 1 auto; height: 42px; }
}
