/* ─────────────────────────────────────────────────────────────
   Ian Reis — software engineer
   Precise, with one strong image: a black hole in the hero. The palette comes from it:
   deep space and the amber of its accretion disk. One type family, hairlines instead
   of shadows, one accent that only marks relationships and actions.
   ───────────────────────────────────────────────────────────── */

:root, [data-theme="light"] { /* light tokens also apply to any element set to light (theme lantern) */
  --paper: #F2F2F0;
  --surface: #FFFFFF;
  --ink: #15130F;
  --slate: #615B52;
  --hairline: #DDD9D2;
  --hairline-strong: #C2BCB2;
  --port: #A1998D;
  --accent: #A84B0C;
  --accent-tint: #F6E8DC;
  --accent-ring: rgba(168, 75, 12, 0.14);
  --btn-bg: #15130F;
  --btn-fg: #F2F2F0;
  --dot: rgba(21, 19, 15, 0.2);
  --scrim: rgba(21, 19, 15, 0.32);
  --lift: 0 18px 50px rgba(21, 19, 15, 0.12);
  --c1: #A84B0C; --c2: #D9782E; --c3: #E9B36A; --c4: #A1998D; --c5: #D3CDC3;

  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 56px);
  --maxw: 1200px;
  --bar-h: 64px;
  --ease: cubic-bezier(0.215, 0.61, 0.355, 1); /* power3.out */
  color-scheme: light;
}

[data-theme="dark"] { /* deep space, lit by the accretion disk */
  --paper: #07080B;
  --surface: #0F1116;
  --ink: #EFE8DC;
  --slate: #A39C90;
  --hairline: #1F2129;
  --hairline-strong: #2F323B;
  --port: #6E685E;
  --accent: #F2A04A;
  --accent-tint: rgba(242, 160, 74, 0.12);
  --accent-ring: rgba(242, 160, 74, 0.2);
  --btn-bg: #EFE8DC;
  --btn-fg: #07080B;
  --dot: rgba(239, 232, 220, 0.16);
  --scrim: rgba(2, 2, 4, 0.65);
  --lift: 0 18px 50px rgba(0, 0, 0, 0.6);
  --c1: #F2A04A; --c2: #E0703A; --c3: #F6D28B; --c4: #A39C90; --c5: #4A453E;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  background: var(--paper);
  scroll-padding-top: calc(var(--bar-h) + 16px);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--hairline-strong) transparent;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--paper); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.motion :focus-visible { animation: focus-in 0.35s var(--ease); }
@keyframes focus-in { from { outline-offset: 7px; outline-color: transparent; } }

kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; text-align: center;
  font: 500 11px/1.5 var(--mono); color: var(--slate);
  border: 1px solid var(--hairline); border-radius: 4px; background: var(--surface);
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: -64px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-fg); padding: 10px 16px; border-radius: 8px; font-weight: 500;
}
.skip:focus { top: 12px; }

/* theme switch: the new theme opens as a circle from the switch (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
@view-transition { navigation: auto; } /* lets the 404 page hand over with the same circle */

/* a skill card grows into its panel (and shrinks back): one shared element across both states */
::view-transition-group(skill-morph) { animation-duration: 0.62s; animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); }
::view-transition-image-pair(skill-morph) { overflow: clip; border-radius: 12px; }
::view-transition-old(skill-morph), ::view-transition-new(skill-morph) {
  width: 100%; height: 100%; object-fit: none; object-position: left top; animation-duration: 0.36s;
}
/* index entries glide to their new places when the filter changes */
::view-transition-group(*.ixm) { animation-duration: 0.55s; animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); }
.panel.no-anim, .panel.no-anim * { transition: none !important; }

/* ── Reading progress ── */
.progress { position: fixed; left: 0; right: 0; top: 0; z-index: 60; height: 2px; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* ── Buttons and links ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px; border-radius: 8px; border: 1px solid transparent;
  font: 500 15.5px/1 var(--font); letter-spacing: -0.005em; cursor: pointer; white-space: nowrap;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.35s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14.5px; gap: 8px; }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn--primary:hover { background: var(--accent); color: var(--paper); }
.btn--primary .icon { transition: transform 0.45s var(--ease); }
.btn--primary:hover .icon { transform: rotate(-12deg) scale(1.08); }
.btn--ghost { border-color: var(--hairline-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); }
.icon { width: 18px; height: 18px; flex: none; }
.btn--sm .icon { width: 16px; height: 16px; }

/* links: hairline at rest; the accent line grows from the side the pointer came in, and leaves by the side it went out */
.link {
  color: var(--ink); padding-bottom: 2px;
  background:
    linear-gradient(var(--accent), var(--accent)) var(--from, left) bottom / 0 1px no-repeat,
    linear-gradient(var(--hairline-strong), var(--hairline-strong)) left bottom / 100% 1px no-repeat;
  transition: background-size 0.45s var(--ease), color 0.2s;
}
.link:hover { color: var(--accent); background-size: 100% 1px, 100% 1px; }

/* ── Header ── */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; color: var(--ink); /* follows its own tokens (dark over the hero) */
  border-bottom: 1px solid transparent; transition: background-color 0.3s, border-color 0.3s;
}
.bar.is-solid {
  background: color-mix(in srgb, var(--paper) 86%, transparent); border-bottom-color: var(--hairline);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.bar__in { display: flex; align-items: center; gap: 24px; height: var(--bar-h); }
.brand { font-weight: 600; font-size: 17px; letter-spacing: -0.015em; }
.nav { position: relative; display: flex; align-items: center; gap: clamp(18px, 2.4vw, 30px); margin-left: auto; }
.nav > a { padding: 8px 0; font-size: 15px; color: var(--slate); transition: color 0.2s; }
.nav > a:hover, .nav > a[aria-current] { color: var(--ink); }
.nav__ind {
  position: absolute; left: 0; bottom: 2px; width: 1px; height: 1px; background: var(--accent);
  transform-origin: left; opacity: 0;
  transform: translateX(var(--x, 0)) scaleX(var(--w, 0));
  transition: transform 0.55s var(--ease), opacity 0.3s;
}
.nav__ind.is-on { opacity: 1; }

.tools { display: flex; align-items: center; gap: 8px; }
.tool {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px;
  border: 1px solid var(--hairline); border-radius: 8px; background: transparent; color: var(--slate);
  font: 500 13px/1 var(--font); cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.tool:hover { border-color: var(--hairline-strong); color: var(--ink); }
.tool__keys { display: inline-flex; gap: 3px; }
.tool--lang { min-width: 42px; justify-content: center; letter-spacing: 0.02em; }

.theme-switch { display: inline-flex; padding: 8px 6px; background: none; border: 0; cursor: pointer; }
.theme-switch__track {
  position: relative; display: block; width: 42px; height: 22px;
  border: 1px solid var(--hairline-strong); border-radius: 999px; transition: border-color 0.3s;
}
.theme-switch__track::before { content: ""; position: absolute; left: 11px; right: 11px; top: 50%; height: 1px; background: var(--hairline-strong); }
.theme-switch__port {
  position: absolute; top: 50%; left: 4px; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--port);
  transition: transform 0.5s var(--ease), background-color 0.3s, border-color 0.3s;
}
.theme-switch:hover .theme-switch__track { border-color: var(--accent); }
html[data-theme="dark"] .theme-switch__port { transform: translateX(20px); background: var(--accent); border-color: var(--accent); }

/* ── Hero ── */
/* the hero: full screen, the black hole above, the words anchored at the bottom; it follows the theme
   (dark: glowing characters on space; light: the same black hole printed in ink on paper) */
.hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 100vh; min-height: 100svh; padding: calc(var(--bar-h) + 48px) 0 clamp(48px, 7vw, 96px);
  background: var(--paper); color: var(--ink);
}
/* a dark floor under the words so they stay readable over the light of the disk */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 58%; z-index: 0; pointer-events: none;
  background: linear-gradient(to top, var(--paper) 8%, color-mix(in srgb, var(--paper) 70%, transparent) 45%, transparent);
}
.hero__bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.6px);
  background-size: 24px 24px; background-position: center;
  -webkit-mask-image: radial-gradient(circle 340px at var(--mx, 74%) var(--my, 42%), #000 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.12) 80%);
  mask-image: radial-gradient(circle 340px at var(--mx, 74%) var(--my, 42%), #000 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.12) 80%);
}
.hero__ink { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; animation: fade 1.6s var(--ease) both; }
.hero__bg { transition: opacity 1.2s var(--ease); }
.hero.has-hole .hero__bg { opacity: 0; } /* the black hole draws the dot grid itself, bent by its gravity */
/* letters can be pulled and stretched by the black hole (transforms need inline-block; pre keeps the spaces) */
.hero__title .ch { display: inline-block; white-space: pre; will-change: auto; }
.hero.is-free .hero__line { overflow: visible; }
.hole__hint {
  position: absolute; left: 50%; bottom: 18px; z-index: 1; width: max-content; max-width: 90vw; translate: -50% 0;
  font: 400 12.5px/1.4 var(--mono); color: var(--slate); letter-spacing: 0.01em; pointer-events: none;
  opacity: 0; transition: opacity 0.8s var(--ease);
}
.hole__hint.is-on { opacity: 0.85; }
@media (max-width: 600px) { .hole__hint { max-width: calc(100vw - 48px); font-size: 11px; text-align: center; white-space: normal; } }
.hero.has-hole { cursor: crosshair; }
.hero.has-hole a, .hero.has-hole button, .hero.has-hole .hero__lead, .hero.has-hole .status { cursor: auto; }
.hero.has-hole a, .hero.has-hole button { cursor: pointer; }
/* wormhole jumps: the header stays put, the ring of characters draws above the spiralling page */
.vt-worm .bar { view-transition-name: site-bar; }
.worm { position: fixed; inset: 0; z-index: 200; width: 100vw; height: 100vh; pointer-events: none; view-transition-name: worm-ring; }
::view-transition-group(site-bar), ::view-transition-old(site-bar), ::view-transition-new(site-bar),
::view-transition-group(worm-ring), ::view-transition-new(worm-ring) { animation: none; }
/* Hawking radiation: heading letters keep their width while they show other characters */
.hk { display: inline-block; white-space: pre; text-align: center; will-change: transform; }

.hero__morph { position: absolute; z-index: 2; pointer-events: none; }
.hero__grid { position: relative; z-index: 1; width: 100%; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(32px, 5vw, 80px); align-items: end; }
.hero__title { font: 300 clamp(44px, 9.2vw, 132px)/0.94 var(--font); letter-spacing: -0.045em; }
:lang(pt-BR) .hero__title { font-size: clamp(40px, 8.2vw, 116px); }
.hero__line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.hero__inner { display: inline-block; white-space: nowrap; }
.motion .hero__title { animation: weigh 1.5s var(--ease) both; }
.motion .hero__inner { animation: rise 1s var(--ease) both; }
.motion .hero__line + .hero__line .hero__inner { animation-delay: 0.09s; }
@keyframes rise { from { transform: translateY(108%); } }
@keyframes weigh { from { font-weight: 100; } to { font-weight: 300; } }

.hero__side { padding-bottom: 0.7em; }
.status { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 14px; font-weight: 500; color: var(--accent); }
.status__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.status__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); }
.motion .status__dot::after { animation: ping 2.6s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(3.2); opacity: 0; } }
.hero__lead { max-width: 46ch; font-size: clamp(18px, 1.5vw, 20px); line-height: 1.55; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 32px; }
.motion .hero__side > * { animation: fade-up 0.9s var(--ease) both; }
.motion .hero__side > :nth-child(2) { animation-delay: 0.12s; }
.motion .hero__side > :nth-child(3) { animation-delay: 0.22s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }

/* ── Sections ── */
.sec { padding-block: clamp(48px, 7vw, 88px); }
.hero + .sec { padding-top: 0; }
.sec--last { padding-bottom: clamp(64px, 9vw, 120px); }
.sec__head {
  position: relative; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 32px;
  padding-top: 20px; margin-bottom: clamp(28px, 4vw, 48px);
}
.sec__head::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--hairline);
  transform-origin: left; transition: transform 1.1s var(--ease);
}
.sec__title { font: 400 clamp(28px, 3.2vw, 40px)/1.1 var(--font); letter-spacing: -0.03em; transition: opacity 0.8s var(--ease) 0.1s, transform 0.8s var(--ease) 0.1s; }
.sec__note { color: var(--slate); font-size: 15px; transition: opacity 0.8s var(--ease) 0.25s; }
.sec__note a { color: var(--ink); border-bottom: 1px solid var(--hairline-strong); transition: color 0.2s, border-color 0.2s; }
.sec__note a:hover { color: var(--accent); border-color: var(--accent); }

/* scroll reveals (JS adds .js only once the observer is running, so nothing stays hidden without it) */
.js.motion .sec__head:not(.is-in)::before { transform: scaleX(0); }
.js.motion .sec__head:not(.is-in) .sec__title { opacity: 0; transform: translateY(16px); }
.js.motion .sec__head:not(.is-in) .sec__note { opacity: 0; }
.reveal { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js.motion .reveal:not(.is-in) { opacity: 0; transform: translateY(18px); }

/* ── Skill map ── */
.map { position: relative; }
.motion .map:not(.is-ready) .node { opacity: 0; } /* until site.js takes over the scroll build */
.map__row + .map__row { margin-top: clamp(40px, 5vw, 64px); }
.map__labels { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 16px; }
.map__label { font: 500 14px/1.3 var(--font); color: var(--slate); }
.map__legend { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--slate); }
.map__legend-line { position: relative; width: 34px; height: 1px; background: var(--hairline-strong); }
.map__legend-line::before, .map__legend-line::after {
  content: ""; position: absolute; top: -3.5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--port);
}
.map__legend-line::before { left: -4px; }
.map__legend-line::after { right: -4px; background: var(--accent); border-color: var(--accent); }

.map__grid {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(36px, 5.2vw, 72px); align-items: center;
}
.col { display: flex; flex-direction: column; gap: 14px; }

.node {
  appearance: none; position: relative; display: grid; align-content: center; gap: 3px; width: 100%; min-height: 96px;
  margin: 0; padding: 15px 18px 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px;
  transition: border-color 0.25s, background-color 0.25s, opacity 0.3s, box-shadow 0.25s, translate 0.35s var(--ease);
}
.map.is-discrete .node {
  transition: border-color 0.25s, background-color 0.25s, box-shadow 0.25s, opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.node:hover { border-color: var(--hairline-strong); translate: 0 -2px; }
.node:active { translate: 0 0; }
.node__name { font-weight: 500; font-size: 17px; line-height: 1.25; letter-spacing: -0.012em; }
.node__desc { font-size: 14px; line-height: 1.4; color: var(--slate); }

.map__row--games .node { min-height: 74px; padding: 12px 16px 13px; background: transparent; }
.map__row--games .node__name { font-size: 16px; }

.node.has-in::before, .node.has-out::after {
  content: ""; position: absolute; top: 50%; z-index: 2; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--paper); border: 1.5px solid var(--port);
  transition: background-color 0.25s, border-color 0.25s, scale 0.35s var(--ease);
}
.node.has-in::before { left: -5.5px; }
.node.has-out::after { right: -5.5px; }

.map.is-tracing .node:not(.is-lit) { opacity: 0.38; }
.node.is-lit { border-color: var(--accent); }
.node.is-lit.has-in::before, .node.is-lit.has-out::after { background: var(--accent); border-color: var(--accent); scale: 1.15; }
.node.is-focus, .map__row--games .node.is-focus { background: var(--accent-tint); box-shadow: 0 0 0 3px var(--accent-ring); }
.node[aria-pressed="true"] .node__name::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; vertical-align: middle;
  border-radius: 50%; background: var(--accent);
}

.map__edges { position: absolute; left: 0; top: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.edge { fill: none; stroke: var(--hairline-strong); stroke-width: 1.5; transition: stroke 0.3s, stroke-width 0.3s, opacity 0.3s; }
.edge.is-lit { stroke: var(--accent); stroke-width: 2; }
.map.is-tracing .edge:not(.is-lit) { opacity: 0.4; }
.packet { fill: var(--accent); opacity: 0; }

/* skill panel: opens under the map on desktop, as a bottom sheet on phones */
.panel {
  display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: 0;
  transition: grid-template-rows 0.6s var(--ease), opacity 0.4s var(--ease), margin-top 0.6s var(--ease);
}
.panel.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: clamp(28px, 4vw, 44px); }
.panel__inner { min-height: 0; overflow: hidden; }
.panel__body {
  position: relative; padding: clamp(22px, 3vw, 32px) clamp(20px, 3vw, 36px);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
}
.panel__body::before { content: ""; position: absolute; left: -1px; top: 28px; width: 2px; height: 28px; background: var(--accent); border-radius: 2px; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel__title { font: 400 clamp(24px, 2.6vw, 32px)/1.15 var(--font); letter-spacing: -0.025em; outline: none; }
.panel__close {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--hairline); border-radius: 8px; background: transparent; color: var(--slate); cursor: pointer;
  transition: border-color 0.2s, color 0.2s, rotate 0.4s var(--ease);
}
.panel__close:hover { border-color: var(--hairline-strong); color: var(--ink); rotate: 90deg; }
.panel__close svg { width: 18px; height: 18px; }
.panel__lede { max-width: 62ch; margin-top: 12px; font-size: 17.5px; line-height: 1.6; color: var(--ink); }
.panel__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; margin-top: 24px; }
.panel__group[hidden] { display: none; }
.panel__label { margin-bottom: 10px; font: 500 13px/1.3 var(--font); color: var(--slate); }
.panel__links { display: grid; gap: 8px; }
.panel__links li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.panel__links small { font: 400 12px var(--mono); color: var(--slate); }
.panel__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px; border: 1px solid var(--hairline-strong); border-radius: 999px;
  background: transparent; font-size: 14px; cursor: pointer; transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }

/* ── Full index ── */
.ix { margin-top: clamp(56px, 7vw, 96px); }
.ix__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px;
  padding-top: 20px; margin-bottom: clamp(24px, 3vw, 36px); border-top: 1px solid var(--hairline);
}
.ix__title { font: 400 clamp(22px, 2.2vw, 28px)/1.2 var(--font); letter-spacing: -0.02em; }
.ix__note { margin-top: 6px; font-size: 15px; color: var(--slate); }
.ix__filter { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface); }
.ix__filter[hidden] { display: none; }
.ix__btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--slate); font: 500 14px/1 var(--font); cursor: pointer;
  transition: background-color 0.25s, color 0.25s;
}
.ix__btn:hover { color: var(--ink); }
.ix__btn b { font: 500 12px/1 var(--mono); color: var(--slate); transition: color 0.25s; }
.ix__btn[aria-pressed="true"] { background: var(--accent-tint); color: var(--ink); }
.ix__btn[aria-pressed="true"] b { color: var(--accent); }
.ix__groups { columns: 3 280px; column-gap: clamp(28px, 4vw, 56px); }
.ix__group { break-inside: avoid; margin-bottom: clamp(28px, 3vw, 40px); }
.ix__group[hidden] { display: none; }
.ix__gtitle {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--hairline);
  font: 500 14px/1.3 var(--font); color: var(--ink);
}
.ix__count { font: 400 12px/1 var(--mono); color: var(--slate); }
/* the item bleeds 8px to the left so the find-highlight has room around the marker */
.ix__item {
  position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  padding: 7px 8px 7px 26px; margin-left: -8px; border-radius: 6px; font-size: 15px; line-height: 1.4;
}
.ix__item[hidden] { display: none; }
.ix__item::before { content: ""; position: absolute; left: 9px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ix__item[data-status="study"]::before { background: transparent; border: 1.5px solid var(--accent); }
.ix__detail { font-size: 13.5px; color: var(--slate); }
.ix__tag {
  padding: 3px 6px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 4px;
  font: 500 11px/1 var(--mono); color: var(--accent);
}
.ix__group--study .ix__tag { display: none; } /* the group title already says it */
.ix__item.is-flash { animation: flash 1.8s var(--ease); }
@keyframes flash { 0%, 35% { background-color: var(--accent-tint); } 100% { background-color: transparent; } }

/* ── Work: contribution heatmap ── */
.activity { margin: 0 0 clamp(36px, 4.5vw, 56px); }
.activity[hidden] { display: none; }
.activity__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 14px; }
.activity__head .insight__label { margin: 0; }
.activity__total { font: 400 13px/1.4 var(--mono); color: var(--ink); }
.hm__months, .hm__grid { display: grid; grid-template-columns: repeat(var(--weeks, 53), minmax(0, 1fr)); gap: 3px; }
.hm__months { height: 14px; margin-bottom: 6px; font: 400 11px/1 var(--mono); color: var(--slate); }
.hm__months span { white-space: nowrap; }
.hm__grid { grid-template-rows: repeat(7, auto); grid-auto-flow: column; }
.hm__c {
  display: block; aspect-ratio: 1; border-radius: 2px; background: var(--hairline);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--c, 0) * 12ms);
}
.hm__c[data-l="x"] { background: transparent; }
.hm__c[data-l="1"], .hm__legend i[data-l="1"] { background: color-mix(in srgb, var(--accent) 28%, var(--paper)); }
.hm__c[data-l="2"], .hm__legend i[data-l="2"] { background: color-mix(in srgb, var(--accent) 52%, var(--paper)); }
.hm__c[data-l="3"], .hm__legend i[data-l="3"] { background: color-mix(in srgb, var(--accent) 76%, var(--paper)); }
.hm__c[data-l="4"], .hm__legend i[data-l="4"] { background: var(--accent); }
.hm__c[data-i]:hover { outline: 1.5px solid var(--ink); outline-offset: 1px; transition-delay: 0s; }
.js.motion .activity:not(.is-in) .hm__c { opacity: 0; transform: scale(0.3); }
.hm__legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 12px; font-size: 12px; color: var(--slate); }
.hm__legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--hairline); }
.hm__legend span:first-child { margin-right: 6px; }
.hm__legend span:last-child { margin-left: 6px; }

/* ── Work: live insights ── */
.insights { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); margin-bottom: clamp(32px, 4vw, 48px); }
.insights[hidden] { display: none; }
.insight { margin: 0; }
.insight__label { margin-bottom: 14px; font-size: 14px; color: var(--slate); }
.langbar { display: flex; gap: 3px; height: 10px; }
.langbar span { display: block; height: 100%; border-radius: 3px; transform-origin: left; transition: transform 1s var(--ease), opacity 0.3s; transition-delay: calc(var(--i, 0) * 90ms); }
.js.motion .insight:not(.is-in) .langbar span { transform: scaleX(0); }
.langbar__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font: 400 13px/1.5 var(--mono); color: var(--slate); }
.langbar__legend li { display: inline-flex; align-items: center; gap: 8px; }
.langbar__legend i { width: 8px; height: 8px; border-radius: 2px; }
.langbar__legend b { font-weight: 500; color: var(--ink); }

/* ── Repositories and games ── */
.repos { border-top: 1px solid var(--hairline); }
.repo { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: baseline; border-bottom: 1px solid var(--hairline); }
.repo::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: var(--ox, 0px) 50%; transition: transform 0.7s var(--ease); }
.repo:hover::after, .repo:focus-within::after { transform: scaleX(1); }
.repo__main { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 32px; align-items: baseline; padding: 22px 0; }
.repo__name { display: block; font-weight: 500; font-size: 19px; line-height: 1.3; letter-spacing: -0.015em; overflow-wrap: anywhere; transition: color 0.2s, transform 0.45s var(--ease); }
.repo:hover .repo__name { color: var(--accent); transform: translateX(6px); }
.repo__desc { color: var(--slate); font-size: 15.5px; line-height: 1.5; }
.repo__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 150px; padding: 22px 0; font: 400 13px/1.45 var(--mono); color: var(--slate); }
.repo__lang { color: var(--ink); }
.repo__main:focus-visible { outline-offset: -2px; }
.more { margin-top: 28px; }

/* floating preview: last commit (repos) or cover (games) */
.peek { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; will-change: transform; }
.peek__in {
  width: 300px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 12px; box-shadow: var(--lift); opacity: 0; transform: scale(0.94) translateY(6px);
  transform-origin: top left; transition: opacity 0.25s var(--ease), transform 0.35s var(--ease);
}
.peek.is-on .peek__in { opacity: 1; transform: none; }
.peek__label { font: 500 12px/1.4 var(--font); color: var(--slate); }
.peek__msg { margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.peek__meta { margin-top: 10px; font: 400 12px/1.4 var(--mono); color: var(--slate); }
.peek--cover .peek__in { width: 252px; padding: 6px; }
.peek__img { display: block; width: 240px; height: 190px; object-fit: cover; border-radius: 8px; background: var(--hairline); }

/* ── Contact ── */
.contact { display: grid; gap: 28px; max-width: 720px; }
.contact__lead { font-size: clamp(22px, 2.6vw, 30px); font-weight: 300; line-height: 1.3; letter-spacing: -0.02em; text-wrap: balance; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.email { display: inline-flex; }
.email .btn { border-radius: 0; }
.email__link { border-radius: 8px 0 0 8px !important; }
.email__copy { border-left: 0; border-radius: 0 8px 8px 0 !important; padding: 0 16px; color: var(--slate); }
.email__copy:hover { color: var(--ink); border-color: var(--ink); border-left: 0; }
.email__copy.is-done { color: var(--accent); }
.contact__more { display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--slate); font-size: 15px; }

/* ── Footer ── */
.foot { border-top: 1px solid var(--hairline); }
.foot__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 22px; font-size: 14px; color: var(--slate); }
.foot__tools { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot__btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; background: none; border: 0; color: var(--slate); font-size: 14px; cursor: pointer; transition: color 0.2s; }
.foot__btn:hover, .foot__btn[aria-pressed="true"] { color: var(--ink); }

/* ── Command menu ── */
.palette { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: min(16vh, 150px) 16px 16px; }
.palette[hidden] { display: none; }
.palette__scrim { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.palette__box {
  position: relative; width: min(620px, 100%); overflow: hidden;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--lift);
}
.motion .palette__scrim { animation: fade 0.25s var(--ease); }
/* the box itself grows from wherever the menu was opened (site.js) */
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.palette__search { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); color: var(--slate); }
.palette__input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 17px/1.4 var(--font); color: var(--ink); }
.palette__input::placeholder { color: var(--slate); }
.palette__list { max-height: min(52vh, 440px); overflow: auto; padding: 6px 8px 8px; }
.palette__group { padding: 12px 10px 6px; font: 500 12px/1 var(--font); color: var(--slate); }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 15px; }
.palette__item[aria-selected="true"] { background: var(--accent-tint); color: var(--ink); }
.palette__item[aria-selected="true"] .palette__mark { background: var(--accent); border-color: var(--accent); }
.palette__mark { width: 8px; height: 8px; flex: none; border-radius: 50%; border: 1.5px solid var(--port); transition: background-color 0.15s, border-color 0.15s; }
.palette__item kbd { margin-left: auto; }
.palette__empty { padding: 18px 12px; color: var(--slate); font-size: 15px; }
.palette__hint { padding: 10px 18px; border-top: 1px solid var(--hairline); font-size: 12.5px; color: var(--slate); }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 95; padding: 10px 18px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); font: 500 14px/1.3 var(--font); pointer-events: none;
  opacity: 0; transform: translate(-50%, 16px); transition: opacity 0.3s var(--ease), transform 0.45s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── Inspect mode: the page shows its own grid and components ── */
.inspect { position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s; }
html.inspecting .inspect { opacity: 1; visibility: visible; }
.inspect__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; height: 100%; }
.inspect__grid i {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-inline: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.inspect__badge {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 8px 14px; border-radius: 8px;
  background: var(--accent); color: var(--paper); font: 500 12.5px/1.3 var(--mono); white-space: nowrap;
}
[data-c] { outline: 1px dashed transparent; outline-offset: -1px; transition: outline-color 0.8s var(--ease); }
html.inspecting [data-c] { outline-color: color-mix(in srgb, var(--accent) 55%, transparent); }
html.inspecting [data-c]:not(.bar) { position: relative; }
html.inspecting [data-c]::after {
  content: attr(data-c); position: absolute; left: 0; top: 0; z-index: 6; padding: 2px 7px;
  background: var(--accent); color: var(--paper); font: 500 11px/1.4 var(--mono); border-radius: 0 0 6px 0; pointer-events: none;
}
html.motion.inspecting [data-c]::after { animation: fade 0.6s var(--ease) 0.25s both; }
/* the scan line that sweeps the grid in and out */
.inspect__scan {
  position: fixed; left: 0; right: 0; top: 0; height: 2px; opacity: 0; pointer-events: none;
  background: var(--accent); box-shadow: 0 0 18px 2px color-mix(in srgb, var(--accent) 60%, transparent);
}
html.inspecting .sec { box-shadow: inset 0 clamp(48px, 7vw, 88px) 0 color-mix(in srgb, var(--accent) 5%, transparent); }
html.inspecting .hero + .sec { box-shadow: none; }

/* ── Brand: "Ian Reis" folds into "IR" once you scroll ── */
.brand { display: inline-flex; align-items: baseline; }
.brand__h {
  display: inline-block; overflow: hidden; max-width: 3.2em; white-space: pre; vertical-align: bottom;
  transition: max-width 0.55s var(--ease), opacity 0.35s var(--ease);
}
.bar.is-compact .brand__h { max-width: 0; opacity: 0; }
.brand__k { transition: letter-spacing 0.55s var(--ease); }
.bar.is-compact .brand__k + .brand__h + .brand__k { margin-left: 0.04em; }

/* ── Thread: one line down the margin, connecting every section like a circuit ── */
.thread { position: absolute; z-index: 1; width: 1px; pointer-events: none; }
.thread[hidden] { display: none; }
.thread__track, .thread__fill { position: absolute; left: 0; top: 0; width: 1px; height: 100%; }
.thread__track { background: var(--hairline); }
.thread__fill { background: var(--accent); transform: scaleY(0); transform-origin: top; }
.thread__port {
  position: absolute; left: -4.5px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--port);
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), scale 0.5s var(--ease);
}
.thread__port::after { content: ""; position: absolute; left: 9px; top: 3.5px; width: 19px; height: 1px; background: var(--hairline); transition: background-color 0.4s var(--ease); }
.thread__port.is-on { background: var(--accent); border-color: var(--accent); scale: 1.1; }
.thread__port.is-on::after { background: var(--accent); }
.thread__head {
  position: absolute; left: -4px; top: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  opacity: 0; transition: opacity 0.4s var(--ease); will-change: transform;
}
.thread__head.is-on { opacity: 1; }
.thread__head::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); }
.motion .thread__head.is-on::after { animation: ping 2.6s var(--ease) infinite; }

/* ── Click ring: a small echo of the theme circle, from the exact point you pressed ── */
.ripple {
  position: fixed; z-index: 120; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%;
  border: 1.5px solid var(--accent); pointer-events: none;
}

/* ── Heatmap: crosshair on hover, loading shimmer ── */
.activity.is-done .hm__c { transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); transition-delay: 0s; }
.hm__grid.is-cross .hm__c:not(.is-x):not([data-l="x"]) { opacity: 0.4; }
.hm__months span { transition: color 0.25s; }
.hm__months span.is-on { color: var(--ink); }
.activity__total { font-variant-numeric: tabular-nums; }
.is-loading .hm__grid, .is-loading .langbar { position: relative; overflow: hidden; }
.is-loading .hm__grid::after, .is-loading .langbar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--accent) 14%, transparent) 50%, transparent 100%);
  transform: translateX(-100%);
}
.motion .is-loading .hm__grid::after, .motion .is-loading .langbar::after { animation: shimmer 1.3s var(--ease) infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.langbar .sk { flex: 1; background: var(--hairline); border-radius: 3px; }
.activity__total:empty::before, .is-loading .activity__total::before { content: "\2014"; color: var(--slate); }
.is-loading .activity__total { font-size: 0; }
.is-loading .activity__total::before { font-size: 13px; }

/* ── Command menu: keyboard shortcuts view ── */
.palette__key { display: flex; align-items: center; gap: 14px; padding: 9px 12px; font-size: 14.5px; color: var(--ink); }
.palette__key span:first-child { display: inline-flex; gap: 4px; min-width: 92px; }
.palette__item kbd + kbd { margin-left: 4px; }

/* ── Theme lantern: hold the theme switch and drag a window into the other theme ── */
#theme-toggle { touch-action: none; }
.lantern {
  position: fixed; inset: 0; z-index: 85; overflow: hidden; pointer-events: none;
  background: var(--paper); color: var(--ink); clip-path: circle(0 at 50% 50%);
}
.lantern__stage { position: absolute; left: 0; top: 0; width: 100%; will-change: transform; }
.lantern__ring {
  position: fixed; left: 0; top: 0; z-index: 86; width: 300px; height: 300px; margin: -150px 0 0 -150px;
  border-radius: 50%; border: 1.5px solid var(--accent); pointer-events: none; will-change: transform;
  box-shadow: 0 0 0 6px var(--accent-ring);
}

/* ── Algorithm lab: index entries that run ── */
.ix__run {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 2px; align-self: center;
  border: 1px solid var(--hairline-strong); border-radius: 50%; background: transparent; color: var(--accent);
  cursor: pointer; transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), scale 0.3s var(--ease);
}
.ix__run svg { width: 9px; height: 9px; margin-left: 1px; }
.ix__run:hover, .ix__item.is-running .ix__run { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.ix__run:active { scale: 0.92; }
.ix__item.is-running { background: var(--accent-tint); }
.lab {
  position: fixed; z-index: 72; width: 366px; padding: 12px 13px 14px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--lift); pointer-events: none;
}
.lab[hidden] { display: none; }
.lab.is-pinned { pointer-events: auto; }
.lab__head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.lab__title { flex: 1; min-width: 0; font: 500 13.5px/1.3 var(--font); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab__btn {
  display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent;
  color: var(--slate); cursor: pointer; opacity: 0; transition: opacity 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s;
}
.lab.is-pinned .lab__btn { opacity: 1; }
.lab__btn:hover { background: var(--accent-tint); color: var(--ink); }
.lab__btn svg { width: 16px; height: 16px; }
.lab__canvas { display: block; border-radius: 8px; background: var(--paper); }
.lab__note { min-height: 2.8em; margin-top: 10px; font: 400 13px/1.4 var(--font); color: var(--slate); }
.lab.is-sheet { left: 16px !important; right: 16px; top: auto !important; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; display: flex; flex-direction: column; align-items: center; }
.lab.is-sheet[hidden] { display: none; }
.lab.is-sheet .lab__head, .lab.is-sheet .lab__note { align-self: stretch; }
.lab.is-sheet .lab__canvas { max-width: 100%; height: auto !important; }

/* ── Contribution city: a switch in the heatmap header ── */
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--hairline); border-radius: 8px; margin-left: auto; }
.activity__head .seg { order: 3; }
.seg__b {
  padding: 4px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--slate);
  font: 500 12.5px/1.3 var(--font); cursor: pointer; transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.seg__b:hover { color: var(--ink); }
.seg__b[aria-pressed="true"] { background: var(--accent-tint); color: var(--ink); }
.city[hidden], .hm[hidden], .hm__legend[hidden] { display: none; }
.city { position: relative; }
.city__canvas {
  display: block; width: 100%; height: clamp(240px, 26vw, 340px); border-radius: 10px; cursor: grab; touch-action: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-tint) 70%, var(--paper)) 0%, var(--paper) 78%);
}
html[data-theme="dark"] .city__canvas { background: radial-gradient(120% 90% at 70% 0%, color-mix(in srgb, var(--accent) 12%, var(--paper)) 0%, var(--paper) 70%); }
.city__canvas.is-drag { cursor: grabbing; }
.city__hint { margin-top: 10px; font-size: 12.5px; color: var(--slate); }

/* ── Overview: every section becomes an artboard on one canvas ── */
html.overview { overflow: hidden; scrollbar-gutter: stable; }
html.overview body {
  background-color: color-mix(in srgb, var(--paper) 93%, var(--ink));
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px; background-attachment: fixed;
}
html.overview main > section {
  position: relative; z-index: 2; background-color: var(--paper); border-radius: calc(var(--ov-px, 4px) * 10);
  clip-path: inset(0 round calc(var(--ov-px, 4px) * 10)); /* clips without changing layout (overflow would stop margin collapsing) */
  outline: var(--ov-px, 4px) solid var(--hairline-strong); outline-offset: 0;
  box-shadow: 0 calc(var(--ov-px, 4px) * 10) calc(var(--ov-px, 4px) * 34) rgba(0, 0, 0, 0.14);
  transition: outline-color 0.25s var(--ease);
}
html.overview main > section.is-ov-hot { outline: calc(var(--ov-px, 4px) * 2) solid var(--accent); }
html.overview .bar { transform: translateY(-110%); opacity: 0; transition: transform 0.45s var(--ease), opacity 0.3s; }
html.overview .foot, html.overview .thread, html.overview .progress, html.overview .lab, html.overview .peek { opacity: 0; visibility: hidden; }
html.ov-leaving body { background: var(--paper); }
html.ov-leaving main > section {
  box-shadow: none; outline-color: transparent; border-radius: 0; clip-path: inset(0 round 0);
  transition: outline-color 0.3s, box-shadow 0.3s, border-radius 0.6s var(--ease), clip-path 0.6s var(--ease);
}
.ov { position: fixed; inset: 0; z-index: 90; }
.ov[hidden] { display: none; }
.ov__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ov__line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.ov__port { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.ov__hit {
  position: absolute; display: block; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: zoom-in;
}
.ov__hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.ov__tag {
  position: absolute; left: 0; bottom: calc(100% + 8px); display: inline-flex; gap: 8px; align-items: baseline;
  font: 500 13px/1.2 var(--font); color: var(--ink); white-space: nowrap;
}
.ov__tag b { font: 500 11px/1 var(--mono); color: var(--accent); }
.ov__hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--slate); font: 400 13px/1.3 var(--font); white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 999px) {
  .hero__grid { grid-template-columns: 1fr; row-gap: 28px; }
  .hero__side { padding-bottom: 0; }
  .nav { display: none; }
  .tools { margin-left: auto; }
  .insights { grid-template-columns: 1fr; }

  .map { max-width: 600px; }
  .map__grid { grid-template-columns: 1fr; }
  .col + .col { position: relative; margin-top: 22px; }
  .col + .col::before { content: ""; position: absolute; left: 24px; top: -22px; width: 1px; height: 22px; background: var(--hairline-strong); }
  .col--empty { display: none; }
  .node, .map__row--games .node { min-height: 0; }
  .map__edges { display: none; }
  .node.has-in::before, .node.has-out::after { display: none; }
  .map__legend { display: none; }

  .panel, .panel.is-open { position: fixed; left: 0; right: 0; bottom: 0; z-index: 65; display: block; margin: 0; opacity: 1; transform: translateY(105%); transition: transform 0.5s var(--ease); }
  .panel.is-open { transform: none; }
  .panel__inner { overflow: visible; }
  .panel__body { max-height: 72vh; overflow: auto; border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--lift); }
  .panel__cols { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .tool__keys { display: none; }
  .repo { grid-template-columns: 1fr; }
  .repo__main { grid-template-columns: 1fr; row-gap: 4px; padding: 20px 0 6px; }
  .repo__meta { flex-direction: row; align-items: baseline; gap: 14px; min-width: 0; padding: 0 0 20px; }
  .foot__in { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .tool--lang { display: none; }
  .bar__in { gap: 12px; }
  .hero__actions .btn, .contact__actions .btn { width: 100%; }
  .contact__actions { flex-direction: column; }
  .email { width: 100%; }
  .email__link { flex: 1; width: auto !important; font-size: 14.5px; padding: 0 12px; }
  .email__copy { width: auto !important; }
}

@media (hover: none) {
  .node:hover { translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}

/* ── Print: the page becomes a one-page résumé ── */
@media print {
  :root, [data-theme="dark"] {
    --paper: #fff; --surface: #fff; --ink: #111; --slate: #444; --hairline: #ccc; --hairline-strong: #999; --accent: #A84B0C;
    color-scheme: light;
  }
  @page { margin: 14mm 16mm; }
  body { font-size: 10.5pt; line-height: 1.45; background: #fff; }
  .bar, .progress, .hero__bg, .map__edges, .panel, .insights, .activity, .palette, .peek, .toast, .inspect, .thread, .ripple,
  .foot__tools, .skip, .more, .status__dot, .email__copy, .map__legend, .contact__actions .btn--primary .icon { display: none !important; }
  .hero { display: block; min-height: 0; padding: 0 0 10pt; overflow: visible; background: none; }
  .hero::after, .hero canvas { display: none !important; }
  .hero__grid { display: block; }
  .hero__title { font-size: 26pt; font-weight: 400 !important; animation: none !important; }
  .hero__line { display: inline; overflow: visible; padding: 0; margin: 0; }
  .hero__inner, .hero__side > * { animation: none !important; }
  .hero__title .ch { font-weight: inherit !important; }
  .status { margin: 6pt 0 4pt; color: #111; }
  .hero__lead { max-width: none; font-size: 11pt; }
  .hero__actions { display: none; }
  .sec { padding: 10pt 0 0; }
  .sec__head { margin-bottom: 6pt; padding-top: 6pt; break-after: avoid; page-break-after: avoid; }
  .sec__head::before { transform: none !important; }
  .sec__title { font-size: 15pt; opacity: 1 !important; transform: none !important; }
  .sec__note { display: none; }
  .map__row + .map__row { margin-top: 8pt; }
  .map__grid { display: block; }
  .col, .col + .col { display: inline; margin: 0; }
  .col + .col::before, .col--empty { display: none !important; }
  .col li { display: inline; }
  .node, .map__row--games .node {
    display: inline; width: auto; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none;
    font-size: 11pt; opacity: 1 !important; transform: none !important;
  }
  .node::before, .node::after { display: none !important; }
  .node__name, .map__row--games .node__name { font-size: 11pt; font-weight: 400; }
  .node__name::after { content: ", "; }
  .node[data-id="dash"] .node__name::after, .node[data-id="auto"] .node__name::after, .node[data-id="game"] .node__name::after { content: ""; }
  .ix { margin-top: 8pt; }
  .ix__head { padding-top: 6pt; margin-bottom: 6pt; break-after: avoid; }
  .ix__title { font-size: 12pt; }
  .ix__note, .ix__filter { display: none !important; }
  .ix__groups { columns: 3; column-gap: 14pt; }
  .ix__group, .ix__group[hidden] { display: block !important; margin-bottom: 7pt; opacity: 1 !important; transform: none !important; }
  .ix__gtitle { padding-bottom: 2pt; margin-bottom: 2pt; font-size: 9pt; }
  .ix__count { display: none; }
  .ix__item, .ix__item[hidden] { display: flex !important; padding: 0.5pt 0 0.5pt 9pt; margin: 0; font-size: 8.5pt; line-height: 1.3; }
  .ix__item::before { left: 0; top: 4pt; width: 4px; height: 4px; }
  .ix__detail { font-size: 7.5pt; }
  .ix__tag { padding: 0 3px; font-size: 6.5pt; }
  .node__desc, .node .sr { display: none; }
  .map__labels { margin: 4pt 0 2pt; }
  .reveal, .repo { opacity: 1 !important; transform: none !important; }
  .repo { break-inside: avoid; }
  .repo__main, .repo__meta { padding: 3pt 0; }
  .repo__name { font-size: 10.5pt; transform: none !important; }
  .repo__desc { font-size: 9pt; line-height: 1.35; }
  .repo__meta { font-size: 7.5pt; min-width: 0; }
  .repo__main::after { content: attr(href); display: block; grid-column: 1 / -1; font: 8pt var(--mono); color: #555; }
  .contact { max-width: none; gap: 6pt; }
  .contact__lead { font-size: 11pt; font-weight: 400; }
  .contact__actions { gap: 4pt 18pt; }
  .contact__actions .btn { min-height: 0; padding: 0; border: 0; background: none; color: #111; font-weight: 400; }
  .contact__actions .btn--primary span { display: none; }
  .contact__actions .btn--primary::after { content: "github.com/ian-Reis"; }
  .contact__more { font-size: 10pt; }
  .foot { border: 0; }
}
