/* FONTES — servidas pelo próprio site (nada é pedido ao Google).
   Instrument Sans e IBM Plex Mono, licença SIL Open Font License (ver fonts/OFL-*.txt) */
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans.woff") format("woff"); font-weight: 400 700; font-stretch: 75% 100%; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-italic.woff") format("woff"); font-weight: 400 700; font-stretch: 75% 100%; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-400-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }

/* =========================================================
   HENRIQUE NETTO — visual do site
   preto e branco de microscópio de campo claro;
   vermelho = ação / foco / ligação     verde = sistema / máquina
========================================================= */

:root {
    --paper: #FFFFFF;
    --ink:   #000000;
    --mute:  #6E6E6E;
    --red:   #FF3B2F;
    --red-d: #C8190F;
    --green: #3DFF6E;
    --rule:  rgba(0, 0, 0, 0.14);
    --desk:  #F1F1EF;

    --sans: 'Instrument Sans', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;

    /* o círculo inteiro à vista */
    --R: min(43vh, 38vw);
    --cy: 50%;
    --gut: clamp(16px, 3.4vw, 48px);
    --ease: cubic-bezier(0.7, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--paper); color: var(--ink);
    font-family: var(--sans); font-size: 17px; line-height: 1.55;
    -webkit-font-smoothing: antialiased; min-height: 100vh;
}
body[data-route="home"] { overflow: hidden; background: var(--ink); }
::selection { background: var(--green); color: var(--ink); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { left: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body:not([data-route="home"]) .vh { display: none; }

/* botão vermelho: as ações que precisam chamar atenção */
.btn-red, .viewer-ctrl .red {
    font-family: var(--mono); font-size: 12.5px; text-decoration: none;
    background: var(--red); color: #000; border: 1px solid var(--red);
    padding: 6px 11px; transition: background 0.15s, border-color 0.15s;
}
.btn-red:hover, .viewer-ctrl .red:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* =========================================================
   A LÂMINA
========================================================= */
.scope { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.scope-dark { position: absolute; inset: 0; background: var(--ink); transition: opacity 0.9s var(--ease); pointer-events: auto; }

.field {
    position: absolute; inset: 0; background: var(--paper);
    clip-path: circle(var(--R) at 50% var(--cy));
    transition: clip-path 1s var(--ease);
    pointer-events: auto; cursor: crosshair; touch-action: none; overflow: hidden;
}
.field.can-drag { cursor: grab; }
.field.grabbing { cursor: grabbing; }
body.boot .field { clip-path: circle(0px at 50% var(--cy)); transition: none; }

.optics { position: absolute; inset: 0; will-change: filter; }

.field::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 4;
    background: radial-gradient(circle at 50% var(--cy),
        transparent calc(var(--R) * 0.72),
        rgba(0, 0, 0, 0.07) calc(var(--R) * 0.95),
        rgba(0, 0, 0, 0.35) var(--R));
}

/* aro: um anel desenhado com border-radius (antisserrilhado) cobre o recorte */
.rim {
    position: absolute; left: 50%; top: var(--cy);
    width: calc(var(--R) * 2 + 2px); height: calc(var(--R) * 2 + 2px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 0 3px #000, 0 0 0 4px rgba(0, 0, 0, 0.6);
    pointer-events: none; transition: opacity 0.6s;
}
body.boot .rim { opacity: 0; }

.specimen { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.grid-fine  { stroke: #000; stroke-opacity: 0.045; stroke-width: 1; }
.grid-major { stroke: #000; stroke-opacity: 0.09;  stroke-width: 1; }

.reticle {
    position: absolute; left: 50%; top: var(--cy);
    width: calc(var(--R) * 2); height: calc(var(--R) * 2);
    transform: translate(-50%, -50%); pointer-events: none; z-index: 3;
    background:
        linear-gradient(#000, #000) center / 1px 100% no-repeat,
        linear-gradient(#000, #000) center / 100% 1px no-repeat;
    opacity: 0.06; transition: opacity 0.6s;
}

.edge { fill: none; stroke: #000; stroke-opacity: 0.09; stroke-width: 0.9; transition: stroke-opacity 0.3s, stroke 0.3s; }
.edge.on  { stroke: var(--red); stroke-opacity: 1; stroke-width: 1.4; }
.edge.off { stroke-opacity: 0.035; }

.cell { cursor: pointer; outline: none; transition: opacity 0.3s; -webkit-touch-callout: none; user-select: none; }
.cell .hit { fill: transparent; }
.cell .membrane { fill: var(--paper); stroke: #000; stroke-width: 1.1; }
.cell .cilia { fill: none; stroke: #000; stroke-width: 0.8; stroke-linecap: round; opacity: 0.55; }
.cell .nucleus { filter: grayscale(1) contrast(1.15); transition: filter 0.25s; }
.cell .ring { fill: none; stroke: var(--red); stroke-width: 1.4; stroke-dasharray: 3 3; opacity: 0; transition: opacity 0.25s; }
.cell .label, .cell .year { pointer-events: none; }
.cell .label {
    font-family: var(--sans); font-size: 13.5px; font-weight: 500; font-stretch: 85%;
    fill: #000; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round;
}
.cell .year { font-family: var(--mono); font-size: 10px; fill: var(--mute); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.cell.on .membrane, .cell:focus-visible .membrane { stroke: var(--red); }
.cell.on .cilia { stroke: var(--red); opacity: 1; }
.cell.on .nucleus, .cell:focus-visible .nucleus { filter: none; }
.cell.on .ring, .cell:focus-visible .ring { opacity: 1; }
.cell.on .label { fill: var(--red-d); }
.cell.off { opacity: 0.25; }
.cell.anomaly .membrane { stroke: var(--red); }
.cell.anomaly .nucleus { filter: invert(1) grayscale(1); }

/* matérias: tamanho segundo o número de ligações */
.spore { cursor: pointer; transition: opacity 0.3s; }
.spore .hit { fill: transparent; }
.spore text { font-family: var(--mono); fill: #8c8c8c; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.spore.on text { fill: var(--red-d); }
.spore.off { opacity: 0.25; }

/* troca de objetiva (mais rápida) */
.turret {
    position: absolute; left: 50%; top: var(--cy);
    width: calc(var(--R) * 2.8); height: calc(var(--R) * 2.8);
    border-radius: 50%;
    transform: translate(-300%, -50%);
    background: radial-gradient(circle, #000 0 46%, rgba(0, 0, 0, 0.92) 54%, rgba(0, 0, 0, 0.5) 62%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none; z-index: 5;
}
.field.turning .turret { animation: turret 0.42s cubic-bezier(0.6, 0, 0.3, 1) both; }
.field.turning .optics { animation: refocus 0.56s linear both; }
@keyframes turret {
    0%   { transform: translate(-200%, -50%) rotate(-10deg); }
    45%  { transform: translate(-50%, -50%)  rotate(0deg); }
    55%  { transform: translate(-50%, -50%)  rotate(0deg); }
    100% { transform: translate(100%, -50%)  rotate(10deg); }
}
@keyframes refocus {
    0%   { filter: blur(0) brightness(1); }
    25%  { filter: blur(5px) brightness(0.6); }
    40%  { filter: blur(10px) brightness(0.15); }
    56%  { filter: blur(6px) brightness(0.8) drop-shadow(4px 0 0 rgba(255, 59, 47, 0.7)) drop-shadow(-4px 0 0 rgba(61, 255, 110, 0.7)); }
    72%  { filter: blur(0.5px) brightness(1.06); }
    84%  { filter: blur(2px) brightness(1.02); }
    100% { filter: blur(0) brightness(1); }
}

.scan { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--green); opacity: 0; z-index: 3; pointer-events: none; box-shadow: 0 0 8px var(--green); }
.scan.run { animation: scan 1.1s linear; }
@keyframes scan { 0% { top: 0; opacity: 0.9; } 100% { top: 100%; opacity: 0.2; } }

.field.tear .optics { animation: tear 0.32s steps(1) both; }
@keyframes tear {
    0%   { clip-path: inset(0); transform: none; }
    20%  { clip-path: inset(18% 0 62% 0); transform: translateX(-14px); }
    40%  { clip-path: inset(55% 0 20% 0); transform: translateX(10px); }
    60%  { clip-path: inset(0 0 80% 0);   transform: translateX(-6px); }
    80%  { clip-path: inset(70% 0 0 0);   transform: translateX(4px); }
    100% { clip-path: inset(0); transform: none; }
}

.probe {
    position: absolute; pointer-events: none; background: var(--ink); color: var(--paper);
    padding: 10px 12px 11px; max-width: 260px; opacity: 0; transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s; z-index: 6;
}
.probe.show { opacity: 1; transform: none; }
.probe b { display: block; font-weight: 600; font-size: 15px; line-height: 1.2; margin-bottom: 4px; }
.probe span { display: block; font-size: 13px; color: #bdbdbd; line-height: 1.4; }
.probe small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--green); margin-top: 6px; }

.coord {
    position: absolute; z-index: 6; pointer-events: none;
    font-family: var(--mono); font-size: 10px; color: #000; background: var(--paper);
    padding: 1px 4px; transform: translate(14px, 14px); opacity: 0; transition: opacity 0.2s;
}
.field:hover .coord { opacity: 0.8; }
.field.grabbing .coord { opacity: 0; }

.term { position: absolute; font-family: var(--mono); font-size: 11.5px; line-height: 1.65; color: var(--green); font-variant-numeric: tabular-nums; transition: opacity 0.5s; }
.term .dim, .term-hint { color: #8a8a8a; }
.term .alert { color: var(--red); }
.term-tl { left: var(--gut); bottom: var(--gut); }
.term-hint { display: block; margin-top: 14px; }
.term-br { right: var(--gut); bottom: var(--gut); text-align: right; }
.objectives { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; pointer-events: auto; }
.objectives button { font-family: var(--mono); font-size: 11.5px; color: #8a8a8a; padding: 1px 6px; border: 1px solid #333; }
.objectives button:hover { color: var(--green); border-color: var(--green); }
.objectives button[aria-pressed="true"] { background: var(--green); color: #000; border-color: var(--green); }

.boot-log { position: absolute; left: var(--gut); top: 110px; font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--green); white-space: pre; transition: opacity 0.8s; z-index: 7; }
body:not(.booting) .boot-log { opacity: 0; }

.scope-hint { display: none; }
body:not([data-route="home"]) .scope-hint { display: none !important; }

.dock {
    position: absolute; inset: 0; display: none;
    background: radial-gradient(circle at calc(var(--gut) + 17px) 38px, var(--red) 0 4px, transparent 4.5px);
}

body:not([data-route="home"]) .scope { z-index: 11; }
body:not([data-route="home"]) .scope-dark { opacity: 0; pointer-events: none; }
body:not([data-route="home"]) .field { clip-path: circle(17px at calc(var(--gut) + 17px) 38px); cursor: pointer; }
body:not([data-route="home"]) .field::after,
body:not([data-route="home"]) .rim,
body:not([data-route="home"]) .term,
body:not([data-route="home"]) .reticle,
body:not([data-route="home"]) .probe,
body:not([data-route="home"]) .boot-log,
body:not([data-route="home"]) .coord { opacity: 0; pointer-events: none; }
body:not([data-route="home"]) .dock { display: block; }
body:not([data-route="home"]) .specimen { pointer-events: none; }
body:not([data-route="home"]) .scope::after {
    content: ''; position: absolute; left: var(--gut); top: 21px;
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid #000; pointer-events: none;
}

/* =========================================================
   CABEÇALHO
========================================================= */
.masthead {
    position: fixed; top: 0; left: 0; right: 0; z-index: 10;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
    padding: 22px var(--gut) 0; pointer-events: none; color: var(--paper);
    transition: color 0.6s, padding 0.6s var(--ease);
}
.masthead > * { pointer-events: auto; }
body:not([data-route="home"]) .masthead {
    color: var(--ink); padding-left: calc(var(--gut) + 50px);
    background: linear-gradient(var(--paper) 82%, rgba(255, 255, 255, 0)); padding-bottom: 18px;
}
.wordmark { text-decoration: none; display: flex; flex-wrap: wrap; align-items: center; line-height: 1.15; max-width: 340px; }
.wm-name { white-space: nowrap; font-size: 19px; font-weight: 600; font-stretch: 80%; }
.wordmark:hover .wm-name { color: var(--red); }
.wm-cursor { width: 0.5em; height: 0.95em; background: var(--green); margin-left: 3px; align-self: center; animation: blink 1.05s steps(1) infinite; }
body:not([data-route="home"]) .wm-cursor { background: var(--ink); }
.wm-sub { opacity: 0.65; font-family: var(--mono); font-size: 11.5px; }
@keyframes blink { 50% { opacity: 0; } }

.nav { display: flex; gap: 22px; font-size: 15px; padding-top: 2px; }
.nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.nav a:hover { border-color: currentColor; }
.nav a[aria-current="page"] { border-bottom-color: var(--red); }
.nav .nav-sub { font-family: var(--mono); font-size: 11px; opacity: 0.6; }
.nav .nav-archive { margin-left: 18px; padding-left: 22px; border-left: 1px solid currentColor; border-bottom-color: transparent; }
.nav .nav-archive[aria-current="page"] { border-bottom-color: var(--red); }

/* =========================================================
   PÁGINAS
========================================================= */
.pages { display: block; outline: none; }
body[data-route="home"] .pages { display: none; }
.page { padding: 120px var(--gut) 64px; max-width: 1440px; margin: 0 auto; }

.pages.arrive .page { animation: page-in 0.3s ease-out both; }
.pages.arrive .title, .pages.arrive .ficha { animation: arrive 0.42s steps(1) both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes arrive {
    0%   { opacity: 0; }
    12%  { opacity: 1; clip-path: inset(0 0 72% 0); transform: translateX(-10px); text-shadow: 3px 0 var(--red), -3px 0 var(--green); }
    30%  { clip-path: inset(30% 0 30% 0); transform: translateX(8px); }
    50%  { clip-path: inset(0 0 22% 0); transform: translateX(-3px); text-shadow: 1px 0 var(--red), -1px 0 var(--green); }
    70%  { clip-path: inset(0); transform: none; text-shadow: none; }
    100% { opacity: 1; clip-path: none; transform: none; }
}

.title { font-size: clamp(44px, 8.4vw, 132px); font-weight: 500; font-stretch: 75%; line-height: 0.9; letter-spacing: -0.025em; max-width: 14ch; text-wrap: balance; }
/* falha ocasional no título */
.title.glitch { animation: titleglitch 0.36s steps(1) both; }
@keyframes titleglitch {
    0%   { clip-path: inset(0 0 60% 0); transform: translateX(-8px); text-shadow: 4px 0 var(--red), -4px 0 var(--green); }
    25%  { clip-path: inset(40% 0 10% 0); transform: translateX(6px); }
    50%  { clip-path: inset(0 0 30% 0); transform: translateX(-2px); text-shadow: 2px 0 var(--red), -2px 0 var(--green); }
    75%  { clip-path: inset(0); transform: none; text-shadow: none; }
    100% { clip-path: none; }
}
.lede { font-size: clamp(19px, 1.8vw, 23px); line-height: 1.45; max-width: 36ch; margin-top: 28px; }
.prose p { max-width: 62ch; margin-bottom: 1em; }
.muted { color: var(--mute); }

.section { margin-top: 96px; }
.section-h { font-size: 15px; font-weight: 600; padding-bottom: 12px; border-bottom: 1px solid var(--ink); margin-bottom: 4px; display: flex; justify-content: space-between; gap: 16px; }
.section-h .muted { font-weight: 400; font-family: var(--mono); font-size: 12px; }

/* ---------- ÍNDICE ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 40px; }
.chip { text-decoration: none; font-family: var(--mono); font-size: 12px; padding: 4px 9px 5px; border: 1px solid var(--rule); transition: border-color 0.15s, background 0.15s, color 0.15s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-pressed="true"] .muted { color: var(--green); }
.chip.all { border-color: var(--red); color: var(--red-d); }
.chip.all[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #000; }

.index { width: 100%; border-collapse: collapse; margin-top: 32px; table-layout: fixed; }
.index th:nth-child(1) { width: 120px; } .index th:nth-child(2) { width: 42%; } .index th:nth-child(3) { width: 24%; }
.index th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: 11.5px; color: var(--mute); padding: 0 16px 10px 0; border-bottom: 1px solid var(--ink); }
.index th:first-child { padding-left: 10px; }
.index td { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.index tr.row { cursor: pointer; -webkit-touch-callout: none; user-select: none; }
.index tr.row:hover, .index tr.row:focus-within { background: var(--ink); color: var(--paper); }
.index tr.row:hover .c-year, .index tr.row:focus-within .c-year { color: var(--green); }
.index tr.row:hover .c-meio, .index tr.row:hover .c-tags { color: #b5b5b5; }
.index tr.row td:first-child { padding-left: 10px; }
.index .c-year { font-family: var(--mono); font-size: 13px; white-space: nowrap; width: 120px; }
.index .c-title a { display: block; font-size: clamp(22px, 2.4vw, 32px); font-weight: 500; font-stretch: 80%; line-height: 1.05; text-decoration: none; letter-spacing: -0.01em; }
.index .c-meio { font-size: 14px; color: var(--mute); max-width: 34ch; }
.index .c-tags { font-family: var(--mono); font-size: 11.5px; color: var(--mute); }
.index th.c-meio, .index th.c-tags { font-family: var(--mono); font-size: 11.5px; }
.index tr.hidden { display: none; }

/* lente (imagem ou mapa) */
.lens {
    position: fixed; width: 170px; height: 170px; border-radius: 50%; overflow: hidden;
    pointer-events: none; z-index: 30; border: 1px solid var(--ink); background: var(--paper);
    box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--ink);
    opacity: 0; transform: translate(-50%, -50%) scale(0.6);
    transition: opacity 0.2s, transform 0.25s var(--ease);
}
.lens.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.lens img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lens svg { width: 100%; height: 100%; display: block; }
.lens .map-dots { fill: none; stroke: #000; stroke-linecap: round; stroke-width: 0.95; }
.lens .map-pin { fill: var(--red); }
.lens .map-ring { fill: none; stroke: var(--red); stroke-width: 0.5; animation: ping 1.1s ease-out 1 both; transform-box: fill-box; transform-origin: center; }
@keyframes ping { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(2.6); opacity: 0; } }
.lens .map-label { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font-family: var(--mono); font-size: 9.5px; }
.lens .map-label span { background: var(--ink); color: var(--paper); padding: 1px 6px; }
.lens img.pull { animation: lensfocus 0.5s linear; }
@keyframes lensfocus { 0% { filter: blur(8px) brightness(0.4); } 60% { filter: blur(0.5px); } 80% { filter: blur(1.6px); } 100% { filter: none; } }

/* ---------- OBRA ---------- */
.work-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.work-year { font-family: var(--mono); font-size: 14px; color: var(--mute); padding-bottom: 10px; }
.work-body { display: grid; grid-template-columns: minmax(240px, 4fr) 8fr; gap: 48px var(--gut); margin-top: 64px; }
.ficha { position: sticky; top: 110px; align-self: start; }
.ficha dl { display: grid; grid-template-columns: 92px 1fr; border-top: 1px solid var(--ink); }
.ficha dt, .ficha dd { padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.ficha dt { color: var(--mute); font-family: var(--mono); font-size: 11.5px; padding-top: 13px; }
.ficha .tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* relatório de observação */
.report { position: relative; max-width: 760px; padding: 0 0 4px; }
.report::before, .report::after {
    /* marcas de registo nos cantos */
    content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none;
}
.report::before { left: -18px; top: -6px; border-left: 1px solid var(--ink); border-top: 1px solid var(--ink); }
.report::after { right: -18px; bottom: -10px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.report-bar { position: relative; height: 7px; background: #d2d2d0; }
.report-bar.glitch { animation: bar-glitch 0.45s steps(1) both; }
@keyframes bar-glitch {
    0%   { clip-path: inset(0 62% 0 0); transform: translateX(-10px); box-shadow: 3px 0 var(--red); }
    20%  { clip-path: inset(0 0 0 38%); transform: translateX(14px); box-shadow: -3px 0 var(--green); }
    40%  { clip-path: inset(0 22% 0 9%); transform: translateX(-4px); box-shadow: none; }
    60%  { clip-path: none; transform: none; }
}
.ruler {
    height: 12px; margin: 0 0 26px;
    background:
        repeating-linear-gradient(90deg, #b4b4b2 0 1px, transparent 1px 10px) 0 0 / 100% 5px no-repeat,
        repeating-linear-gradient(90deg, #b4b4b2 0 1px, transparent 1px 50px) 0 0 / 100% 12px no-repeat;
    border-top: 1px solid #b4b4b2;
}
.report-body { list-style: none; counter-reset: para; }
.report-body li {
    counter-increment: para;
    display: grid; grid-template-columns: 44px 1fr; gap: 0 10px;
    margin-bottom: 1.3em;
}
.report-body li::before {
    content: "§" counter(para, decimal-leading-zero);
    font-family: var(--mono); font-size: 11.5px; color: var(--red-d); padding-top: 4px;
}
.report-body li { padding-right: 54px; }
.report-body p { font-family: var(--mono); font-size: 14.5px; line-height: 1.8; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.report-foot {
    display: flex; justify-content: flex-end; gap: 16px; flex-wrap: wrap;
    margin-top: 18px; padding-top: 10px; border-top: 1px dashed var(--ink);
    font-family: var(--mono); font-size: 11px; color: var(--mute);
}

.video { aspect-ratio: 16 / 9; margin-top: 64px; background: var(--ink); }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- CABEÇALHO DA GALERIA ---------- */
.desk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 72px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.desk-head .muted { font-family: var(--mono); font-size: 12px; }
.desk-tools { display: flex; gap: 14px; align-items: baseline; }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 var(--gut); }
.link-row { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.link-row .dot { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; border: 1px solid var(--ink); }
.link-row .dot img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15); transition: filter 0.2s; }
.link-row:hover .dot img { filter: none; }
.link-row b { display: block; font-weight: 500; font-size: 17px; line-height: 1.2; }
.link-row span { font-family: var(--mono); font-size: 11.5px; color: var(--mute); }
.link-row:hover b { color: var(--red-d); }

/* ---------- SOBRE ---------- */
.about-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 48px var(--gut); margin-top: 64px; }
.quote { color: #555; text-align: justify; hyphens: auto; font-size: 16px; line-height: 1.45; font-style: italic; }
.quote cite { display: block; font-style: normal; font-size: 12px; color: var(--mute); margin-top: 10px; font-family: var(--mono); }
.contact dl { display: grid; grid-template-columns: 92px 1fr; border-top: 1px solid var(--ink); margin-top: 40px; }
.contact dt, .contact dd { padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.contact dt { color: var(--mute); font-family: var(--mono); font-size: 11.5px; padding-top: 14px; }
.contact a { text-decoration-color: var(--red); text-underline-offset: 3px; }
.contact a:hover { color: var(--red-d); }
.stats { display: flex; flex-wrap: wrap; gap: 20px 28px; margin-top: 36px; }
.stats div { font-family: var(--mono); font-size: 11.5px; color: var(--mute); }
.stats small { display: block; margin-top: 3px; white-space: nowrap; }   /* tamanho no main.js: a fonte fica da largura da linha de cima */
.stats-emo { display: flex; align-items: flex-start; gap: 18px; margin-left: 12px; }
.stats .stats-emo img { display: block; height: 40px; width: auto; }
.stats b { display: block; font-family: var(--sans); font-size: 40px; font-weight: 500; font-stretch: 75%; color: var(--ink); line-height: 1; margin-bottom: 4px; }

/* currículo com a mesma linguagem do índice */
.cv { width: 100%; border-collapse: collapse; }
.cv td { padding: 13px 16px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.cv tr td:first-child { padding-left: 10px; }
.cv .y { font-family: var(--mono); font-size: 12.5px; width: 104px; white-space: nowrap; color: var(--mute); }
.cv .t { font-size: clamp(18px, 1.7vw, 22px); font-weight: 500; font-stretch: 82%; line-height: 1.15; width: 46%; }
.cv .p { color: var(--mute); font-size: 14px; }
.cv tr.has-loc { cursor: crosshair; -webkit-touch-callout: none; user-select: none; }
.cv tr.has-loc:hover { background: var(--ink); color: var(--paper); }
.cv tr.has-loc:hover .y { color: var(--green); }
.cv tr.has-loc:hover .p { color: #b5b5b5; }
.cv .p span.has-loc { display: grid; grid-template-columns: 34px 1fr; padding: 3px 0; cursor: crosshair; -webkit-touch-callout: none; user-select: none; }   /* mesma exposição em vários lugares: cada linha tem o seu mapa */
.cv .p span.has-loc b { font-family: var(--mono); font-size: 12.5px; font-weight: 400; }
.cv .p span.has-loc:hover { background: var(--ink); color: #b5b5b5; }
.cv .p span.has-loc:hover b { color: var(--green); }
.cv a { text-decoration: none; }
.cv tr.link-tr { cursor: pointer; }
.cv tr.link-tr:hover { background: var(--ink); color: var(--paper); }
.cv tr.link-tr:hover .p { color: #b5b5b5; }
.cv tr.link-tr .t a::after { content: " ↗"; color: var(--red); font-family: var(--mono); font-size: 0.7em; }
.cv tr.link-tr.internal .t a::after { content: " →"; }

/* ---------- TEXTO ---------- */
.essay-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; font-size: 14px; line-height: 1.45; padding-bottom: 14px; margin-bottom: 48px; border-bottom: 1px solid var(--rule); }
.lang { display: flex; gap: 14px; font-family: var(--mono); font-size: 12.5px; }
.lang a { text-decoration: none; color: var(--mute); border-bottom: 1px solid transparent; }
.lang a:hover { color: var(--ink); }
.lang a[aria-current] { color: var(--ink); border-color: var(--red); }
.essay-by { margin-top: 18px; font-size: 12.5px; color: var(--mute); font-family: var(--mono); }
.essay-body { margin-top: 72px; max-width: 64ch; margin-left: clamp(0px, 16vw, 300px); }
.essay-body p { font-size: 18.5px; line-height: 1.7; margin-bottom: 1.15em; hyphens: auto; }
.essay-quote { margin: 1.6em 0 1.8em; padding-left: 22px; border-left: 2px solid var(--red); font-size: 17px; line-height: 1.65; font-style: italic; }
.essay-body .essay-note { font-size: 14.5px; line-height: 1.6; color: var(--mute); padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 1.4em 0 1.8em; }
.work-ref { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.work-ref:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.back-link { display: inline-block; margin-top: 64px; }

/* ---------- RODAPÉ ---------- */
.foot { margin-top: 120px; padding-top: 18px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 12px 24px; font-size: 14px; color: var(--mute); }
.foot > :last-child { justify-self: end; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--red-d); }

/* =========================================================
   VISOR
========================================================= */
.viewer { position: fixed; inset: 0; z-index: 50; background: var(--ink); display: grid; grid-template-rows: 1fr auto; color: var(--paper); }
.viewer[hidden] { display: none; }
.viewer-figure { display: flex; align-items: center; justify-content: center; padding: 28px var(--gut) 8px; min-height: 0; }
.viewer-figure img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.viewer-figure img.pull { animation: lensfocus 0.5s linear; }
.viewer-bar { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; align-items: center; padding: 14px var(--gut) 18px; font-size: 14px; }
#viewer-count { font-family: var(--mono); font-size: 12px; color: var(--green); }
.viewer-title { opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-ctrl { display: flex; gap: 6px; }
.viewer-ctrl button { min-width: 40px; height: 34px; padding: 0 12px; border: 1px solid #444; font-family: var(--mono); font-size: 13px; transition: border-color 0.15s, color 0.15s; }
.viewer-ctrl button:not(.red):hover { border-color: var(--green); color: var(--green); }

/* =========================================================
   RESPONSIVO
========================================================= */
@media (max-width: 900px) {
    .work-body, .about-grid { grid-template-columns: 1fr; }
    .ficha { position: static; }
    .index .c-meio, .index th.c-meio { display: none; }
    .report::before, .report::after { display: none; }
}
@media (max-width: 640px) {
    body { font-size: 16px; }
    /* no celular o campo sangra para os lados */
    :root { --R: min(43vw, 34vh); --cy: 48%; }
    .field::after { background: none; }
    .masthead { padding-top: 16px; gap: 10px; }
    .wm-name { font-size: 16px; white-space: normal; max-width: 6.2em; }
    .brand .frase { display: none; }
    .nav { gap: 10px; font-size: 13px; }
    .nav .nav-sub { font-family: var(--mono); font-size: 11px; opacity: 0.6; }
.nav .nav-archive { margin-left: 2px; padding-left: 10px; }
    /* no celular o nome é o único botão de início; a lente recolhida sai */
    body:not([data-route="home"]) .field { clip-path: circle(0 at 0 0); }
    body:not([data-route="home"]) .scope::after { display: none; }
    body:not([data-route="home"]) .masthead { padding-left: var(--gut); }
    .term-tl { display: none; }
    .scope-hint { display: block; position: absolute; left: 50%; top: calc(var(--cy) + var(--R) + 20px); transform: translateX(-50%); width: max-content; max-width: 90vw; font-size: 12.5px; color: #8a8a8a; }
    .boot-log { font-size: 10.5px; top: 86px; }
    .page { padding-top: 104px; }
    .index .c-tags, .index th.c-tags { display: none; }
    .index .c-year { width: 74px; }
    .section { margin-top: 72px; }
    .cv .t { width: auto; }
    .cv .y { width: 64px; }
    .cv .p { font-size: 13px; }
    .report-body li { grid-template-columns: 1fr; padding-right: 0; }
    .report-body p { font-size: 13.5px; }
    .viewer-bar { grid-template-columns: 60px 1fr auto; }
    .viewer-title { display: none; }
    .cell .label, .cell .year, .spore text { display: none; }
    .probe { left: 16px !important; right: 16px; top: auto !important; bottom: 70px; max-width: none; }
    .coord { display: none; }
    .stats b { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.pages { overflow-x: clip; }

/* galeria da obra: só a instrução, em negrito */
.desk-only { font-size: 15px; font-weight: 600; }

/* trilha do índice: seta em L até a obra aberta */
.nav a[data-nav="indice"] { position: relative; }
.nav-crumb {
    position: absolute; left: 3px; top: calc(100% + 3px);
    display: flex; align-items: flex-end; gap: 5px; pointer-events: none;
    font-family: var(--mono); font-size: 11px; white-space: nowrap; color: currentColor;
}
.nav-crumb i { flex: none; width: 9px; height: 30px; border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; opacity: 0.6; position: relative; top: -5px; }
.nav-crumb i::after { content: ""; position: absolute; right: -1px; bottom: -3px; border: 3px solid transparent; border-left: 4px solid currentColor; border-right: 0; transform: translateX(3px); }
.nav-crumb span { overflow: hidden; text-overflow: ellipsis; opacity: 0.6; min-width: 0; }

/* (série): discreto, na mesma relação do "(home)" */
.serie { font-family: var(--mono); font-size: 11px; font-weight: 400; font-style: normal; letter-spacing: 0; opacity: 0.6; white-space: nowrap; }
.title .serie { font-size: clamp(12px, 1.1vw, 15px); vertical-align: baseline; margin-left: 0.6em; }
.index .c-title .serie { font-size: 11px; margin-left: 4px; }
.index tr.row:hover .serie { color: var(--paper); }
.probe .serie { font-size: 10.5px; margin-left: 4px; }
.link-row .lt { display: block; font-style: normal; }
.link-row .lt b { display: inline; }
.link-row .lt .serie { font-size: 10.5px; color: var(--mute); }
svg .label .serie { font-family: var(--mono); font-size: 9.5px; opacity: 0.55; font-weight: 400; }

/* ficha: falha leve, sem mexer no layout */
.ficha.glitch { animation: titleglitch 0.36s steps(1) both; }

/* frases digitadas */
.wm-sub { min-height: 1.4em; width: 300px; }
.brand .frase { margin-top: 3px; line-height: 1.15; }
.frase { display: flex; gap: 8px; align-items: flex-start; pointer-events: auto; }
.frase > span { cursor: text; }
.term-br .frase { display: none; justify-content: flex-end; }
.tempo span { display: block; }
.aviso { position: fixed; inset: 0; z-index: 30; touch-action: none; transition: opacity 0.3s; }
.aviso p { position: absolute; left: 50%; top: var(--cy); transform: translate(-50%, -50%); display: flex; align-items: center; gap: 14px; margin: 0; padding: 14px 18px; white-space: nowrap; font-family: var(--mono); font-size: 16px; line-height: 1.45; color: var(--paper); background: var(--ink); border: 1px solid var(--green); }
.aviso.off { opacity: 0; }
.aviso svg { flex: none; width: 24px; height: 24px; transform: rotate(-90deg); }
.aviso circle { fill: none; stroke: var(--green); stroke-width: 10; stroke-dasharray: 1; animation: aviso 10s linear forwards; }
@keyframes aviso { to { stroke-dashoffset: 1; } }
.frase-ctl { flex: none; display: flex; gap: 3px; }
/* fora da lâmina: controles das frases embaixo do círculo, ao lado do nome */
body:not([data-route="home"]) .brand .frase-ctl { position: absolute; left: calc(var(--gut) + 17px); top: 62px; transform: translateX(-50%); }
.frase-btn { flex: none; width: 15px; height: 15px; margin-top: -1px; padding: 2px; color: inherit; opacity: 0.55; cursor: pointer; transition: opacity 0.2s; }
.term-br .frase-btn { color: #8a8a8a; margin-top: 1px; }
.frase-btn { -webkit-tap-highlight-color: transparent; }
.frase-btn:hover { opacity: 1; }
.frase-btn svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.frase-btn .i-seta { fill: none; stroke: currentColor; stroke-width: 1.8; }
.frase-btn .i-play, .frase-btn.locked .i-pause { display: none; }
.frase-btn.locked .i-play { display: block; }
.frase-btn.locked { opacity: 1; color: var(--red); }
@media (max-width: 640px) {   /* celular: frases embaixo da lâmina, sem o painel de tempo */
    .term-br { left: var(--gut); bottom: calc(var(--gut) + 24px); }   /* acima de "sem cookies" */
    .wordmark { flex-wrap: nowrap; }
    .term-br .frase { display: flex; }
    #ro-count { flex: 0 1 auto; min-width: 0; }
    .tempo { display: none; }
    .term-br .frase-btn { width: 22px; height: 22px; padding: 5px; margin-top: -3px; }
}
.wm-sub::after, #ro-count::after { content: "_"; animation: blink 1.05s steps(1) infinite; }
#ro-count { display: inline-block; max-width: 340px; min-height: 1.4em; }

/* a amostra sai e volta de foco depois de algumas falhas */
.field.defocus :is(#nodes, #edges) > :not(.on) { animation: defocus 0.95s linear both; }
.field.refocus-q :is(#nodes, #edges) > :not(.on) { animation: quickblur 0.32s ease-out both; }
.field.pulse :is(#nodes, #edges) > .off { animation: quickblur 0.3s ease-out both; }
@keyframes quickblur { 0% { filter: none; } 35% { filter: blur(2.4px); } 100% { filter: none; } }
@keyframes defocus {
    0% { filter: none; } 18% { filter: blur(3px); } 34% { filter: blur(0.4px); }
    52% { filter: blur(2.2px); } 70% { filter: none; } 84% { filter: blur(1px); } 100% { filter: none; }
}

.probe b .serie { display: inline; color: #8a8a8a; }

/* arquivo em construção */
.build { margin-top: 72px; }
.build-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.build-tag { font-size: 15px; font-weight: 600; }
.build-tag::after { content: "_"; color: var(--red); animation: blink 1.05s steps(1) infinite; }
.build-pct { font-family: var(--mono); font-size: 12px; }
.build-ascii { font-family: var(--mono); font-size: 12px; line-height: 1.25; color: #9a9a9a; margin: 22px 0 0; overflow: hidden; white-space: pre; }
.life-wrap { margin-top: 40px; }
.life { display: block; width: 100%; height: 360px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); cursor: crosshair; touch-action: none; }
.life-cap { font-family: var(--mono); font-size: 11.5px; margin-top: 18px; }
@media (max-width: 640px) { .life { height: 260px; } }

.lede.soft { color: #6f6f6f; }

/* =========================================================
   GALERIA DIAGRAMADA (teste v9)
========================================================= */
.cz { position: relative; margin-top: 40px; overflow-x: clip; padding-bottom: 40px; }
.cz-row { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 18px; align-items: start; margin-bottom: 90px; }
.cz-row > * { grid-column: var(--c); grid-row: 1; margin-top: var(--m); }

/* palavras gigantes, atrás das fotos */
.cz-word {
    position: relative; z-index: 1; pointer-events: none; user-select: none;
    font-size: clamp(90px, 19vw, 300px); font-weight: 600; font-stretch: 75%; letter-spacing: -0.04em; line-height: 0.8;
    color: #ececea; white-space: nowrap; margin: 0 0 -0.42em; will-change: transform;
}
.cz-word:nth-of-type(4n+2) { color: transparent; -webkit-text-stroke: 1px var(--red); text-align: right; }

/* foto: inteira, nunca cortada */
.cz-fig { position: relative; }
.cz-img { position: relative; display: block; width: 100%; padding: 0; cursor: zoom-in; background: var(--desk); }
.cz-img img { display: block; width: 100%; height: auto; }
.cz-fig.big:not(.cz-dots) { max-width: 800px; }   /* a caixa, a legenda e os cantos acompanham a foto */
/* marcas de registro nos cantos (fora da imagem) */
.cz-fig::before, .cz-fig::after { content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none; }
.cz-fig::before { left: -9px; top: -9px; border-left: 1px solid var(--ink); border-top: 1px solid var(--ink); }
.cz-fig::after { right: -9px; top: calc(100% - 26px); border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.cz-fig figcaption { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--mute); padding-top: 7px; }
.cz-fig figcaption b { font-weight: 500; color: var(--ink); }
/* anotação vertical na margem */
.cz-side {
    position: absolute; top: 0; left: -8px; transform-origin: 0 0; transform: rotate(90deg) translate(0, 0);
    font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--mute); white-space: nowrap; pointer-events: none;
}
.cz-fig:nth-child(even) .cz-side { left: calc(100% + 22px); }
.cz-fig .cz-side.sl { left: -8px; }
.cz-fig .cz-side.sr { left: calc(100% + 22px); }
.cz-fig .cz-side.g { left: -2px; }   /* cabe no vão de 18px entre duas colunas */
.cz-row:has(.cz-side.over) { z-index: 3; }   /* a legenda passa por cima da foto da linha seguinte */
@media (min-width: 721px) { .cz:has(.cz-side.fit) { margin-left: -24px; padding-left: 24px; } }   /* a legenda da 1ª coluna aparece na margem */

/* retícula + varredura: estado de chegada */
.cz-tone {
    position: absolute; inset: 0; background-size: 100% 100%; pointer-events: none;
    filter: grayscale(1) contrast(1.9) brightness(1.08);
}
.cz-tone::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle, transparent 0 1.05px, var(--paper) 1.45px) 0 0 / 4px 4px;
}
.cz-scan { position: absolute; left: -6px; right: -6px; top: 0; height: 2px; background: var(--red); opacity: 0; pointer-events: none; box-shadow: 0 0 0 1px rgba(255,59,47,0.15); }
.cz-fig.dev .cz-tone { animation: cz-reveal 1.15s cubic-bezier(0.6, 0, 0.35, 1) both; }
.cz-fig.dev .cz-scan { animation: cz-scan 1.15s cubic-bezier(0.6, 0, 0.35, 1) both; }
.cz-fig.done .cz-tone, .cz-fig.done .cz-scan { display: none; }
@keyframes cz-reveal { 0% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(100% 0 0 0); } }
@keyframes cz-scan { 0% { top: 0; opacity: 1; } 96% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.cz-fig.done .cz-img:hover img { animation: split 0.38s steps(2) 1; }

/* marca do detalhe na foto de origem */
.cz-mark { position: absolute; border: 1px solid var(--red); pointer-events: none; opacity: 0.55; transition: opacity 0.2s, box-shadow 0.2s; }
.cz-fig.marked .cz-mark { opacity: 1; box-shadow: 0 0 0 9999px rgba(255, 255, 255, 0.35); }
.cz-fig.done .cz-img, .cz-fig.marked .cz-img { overflow: hidden; }   /* o véu fica só na foto do detalhe */

/* detalhe ampliado: peça separada, assumidamente um recorte */
.cz-det figcaption { font-family: var(--mono); font-size: 10.5px; color: var(--red-d); padding-top: 7px; }
.cz-zoom { display: block; width: 100%; aspect-ratio: 1; background-repeat: no-repeat; border-radius: 50%; border: 1px solid var(--ink); box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--ink); filter: grayscale(1) contrast(1.15); transition: filter 0.3s; }
.cz-det { position: relative; z-index: 2; }   /* fica acima do véu branco da foto */
.cz-det:hover .cz-zoom { filter: none; }
.cz-det.still:hover .cz-zoom { filter: grayscale(1) contrast(1.15); }
.cz-fig.veiled .cz-img::after, .cz-fig.linked.marked .cz-img::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.35); pointer-events: none; }
.cz-in { position: absolute; top: 0; z-index: 2; cursor: zoom-in; aspect-ratio: 1; background-size: cover; background-position: center; border-radius: 50%; border: 1px solid var(--ink); box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--ink); filter: grayscale(1) contrast(1.15); transition: filter 0.3s; }
.cz-in:hover { filter: none; }
.cz-fig.has-in { left: 16%; }
@media (max-width: 720px) { .cz-fig.has-in { left: 0; } .cz-in { margin-left: 2%; } }   /* abre lugar para o círculo que passa da margem esquerda */

/* texto da obra entre as imagens */
.cz-txt { font-family: var(--mono); font-size: 12px; line-height: 1.7; text-align: justify; hyphens: auto; color: #333; border-top: 1px solid var(--ink); padding-top: 10px; }
.cz-txt span { display: block; color: var(--red-d); font-size: 10.5px; margin-bottom: 6px; }

/* número de figura gigante, vazado */
.cz-num { font-size: clamp(80px, 11vw, 170px); font-weight: 600; font-stretch: 75%; line-height: 0.8; color: transparent; -webkit-text-stroke: 1px var(--ink); text-align: right; user-select: none; }

@media (max-width: 720px) {
    .cz-row { grid-template-columns: repeat(6, 1fr); gap: 0 12px; margin-bottom: 56px; }
    .cz-row > * { grid-column: var(--cm); grid-row: auto; margin-top: max(0px, calc(var(--m) * 0.35)); }
    .cz-side { display: none; }
    .cz-word { font-size: 32vw; }
}

/* botão de língua: vermelho, com uma onda que pulsa de tempos em tempos */
.nav .nav-lang {
    position: relative; align-self: center; margin-left: 4px; padding: 2px 8px 3px;
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
    background: var(--red); color: var(--paper); border: 0;
}
/* ondulação contínua: duas ondas defasadas saindo do botão, sem parar */
.nav .nav-lang::before, .nav .nav-lang::after {
    content: ""; position: absolute; inset: 0; border: 1.5px solid var(--red); pointer-events: none;
    animation: lang-ping 2.4s ease-out infinite;
}
.nav .nav-lang::after { animation-delay: 1.2s; }
.nav .nav-lang:hover { background: var(--ink); color: var(--paper); }
body[data-route="home"] .nav .nav-lang:hover { background: var(--paper); color: var(--ink); }
.nav .nav-lang:hover::before, .nav .nav-lang:hover::after { animation-play-state: paused; opacity: 0; }
@keyframes lang-ping {
    0%   { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.45, 2.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .nav .nav-lang::before, .nav .nav-lang::after { animation-duration: 4.8s; } }
.nav .nav-lang .l-short { display: none; }
@media (max-width: 640px) { .nav .nav-lang .l-long { display: none; } .nav .nav-lang .l-short { display: inline; } }

/* =========================================================
   PRIVACIDADE (o polvo) E LINKS PRIVADOS
========================================================= */
.privacy-link { font-family: var(--mono); font-size: 11px; color: var(--mute); text-align: left; text-decoration: underline; text-decoration-color: rgba(0,0,0,0.2); text-underline-offset: 3px; margin-left: 14px; cursor: pointer; }
.privacy-link:hover { color: var(--red-d); text-decoration-color: currentColor; }
.foot .privacy-link { margin: 0; text-align: center; }
@media (max-width: 1180px) { .foot { grid-template-columns: 1fr auto; } .foot .privacy-link { grid-column: 1 / -1; grid-row: 2; justify-self: center; } }
.privacy-chip { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; z-index: 12; pointer-events: auto; color: #8a8a8a; text-decoration-color: rgba(255,255,255,0.25); }
.privacy-chip:hover { color: var(--green); }
body:not([data-route="home"]) .privacy-chip { display: none; }
.privacy { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.55); display: grid; place-items: center; padding: 20px; }
.privacy[hidden] { display: none; }
.privacy-box {
    display: grid; grid-template-columns: auto 1fr; gap: 26px; max-width: 760px; max-height: 88vh; overflow-y: auto;
    background: var(--paper); border: 1px solid var(--ink); box-shadow: 8px 8px 0 var(--red); padding: 28px 30px 26px;
}
.privacy-octo { font-family: var(--mono); font-size: 12px; line-height: 1.2; color: var(--red); margin: 4px 0 0; }
.privacy-box h2 { font-size: 15px; font-weight: 600; padding-bottom: 10px; border-bottom: 1px solid var(--ink); margin-bottom: 14px; }
.privacy-box p { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; margin-bottom: 10px; }
.privacy-close { margin-top: 8px; font-family: var(--mono); font-size: 11.5px; background: var(--red); color: var(--paper); padding: 3px 10px 4px; cursor: pointer; }
.privacy-close:hover { background: var(--ink); }
@media (max-width: 640px) { .privacy-box { grid-template-columns: 1fr; padding: 22px 20px; } .privacy-octo { font-size: 10px; } .foot { grid-template-columns: 1fr; } .foot > :last-child { justify-self: start; grid-row: 2; } .foot .privacy-link { grid-row: 3; } }
.private-note { font-family: var(--mono); font-size: 11.5px; color: var(--red-d); border: 1px dashed var(--red); padding: 6px 10px; display: inline-block; margin-bottom: 26px; }
.private-note .privacy-link { margin-left: 4px; }
.private-work .section-h a { text-decoration: none; }
.private-work .section-h a:hover { color: var(--red-d); }
.private-short { font-size: 15px; color: #444; margin-top: 10px; max-width: 60ch; }

/* =========================================================
   PLAYER PRÓPRIO E DÍPTICO
========================================================= */
.video-own { margin-top: 64px; }
.vp { position: relative; background: var(--ink); aspect-ratio: 16 / 9; overflow: hidden; }
.vp.vertical { aspect-ratio: 9 / 16; }
.vp video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--ink); cursor: pointer; }
.vp-big {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--mono); font-size: 13px; color: var(--paper); background: var(--red); padding: 9px 16px 10px;
    box-shadow: 0 0 0 1px var(--red), 0 0 0 7px rgba(255, 59, 47, 0.25); cursor: pointer; transition: background 0.2s;
}
.vp-big em { font-style: normal; opacity: 0.75; }
.vp-big:hover { background: var(--ink); }
.vp.on .vp-big { display: none; }
.vp-bar {
    position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px;
    padding: 22px 14px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    font-family: var(--mono); font-size: 11.5px; color: var(--paper); transition: opacity 0.3s;
}
.vp.playing:not(:hover) .vp-bar { opacity: 0; }
.vp-bar[hidden] { display: none; }
.vp-bar button { color: var(--paper); font-family: var(--mono); font-size: 11.5px; min-width: 18px; cursor: pointer; }
.vp-bar button:hover { color: var(--green); }
.vp-mute.off { text-decoration: line-through; opacity: 0.6; }
.vp-track { position: relative; flex: 1; height: 14px; cursor: pointer; }
.vp-track::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: rgba(255, 255, 255, 0.25); }
.vp-buf, .vp-pos { position: absolute; left: 0; top: 6px; height: 2px; width: 0; }
.vp-buf { background: rgba(255, 255, 255, 0.45); }
.vp-pos { background: var(--red); }
.vp-pos::after { content: ""; position: absolute; right: -4px; top: -3px; width: 8px; height: 8px; background: var(--red); }
.vp-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp:fullscreen { aspect-ratio: auto; }

.diptych { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: start; gap: 22px; margin-top: 64px; }
.diptych .vp { height: min(82vh, 900px); width: auto; }
.diptych-text { height: min(82vh, 900px); margin: 0; background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.diptych-text img { height: 100%; width: auto; display: block; }
.diptych-cap { grid-column: 1 / -1; font-family: var(--mono); font-size: 11px; color: var(--mute); text-align: center; }
@media (max-width: 720px) {
    .diptych { grid-template-columns: 1fr; }
    .diptych .vp, .diptych-text { height: auto; width: 100%; }
    .diptych-text img { width: 100%; height: auto; }
}
.vp-vol { display: inline-flex; align-items: center; gap: 8px; }
.vp-vtrack { position: relative; width: 64px; height: 14px; cursor: pointer; touch-action: none; }
.vp-vtrack::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: rgba(255, 255, 255, 0.25); }
.vp-vlev { position: absolute; left: 0; top: 6px; height: 2px; width: 100%; background: var(--paper); }
.vp-vlev::after { content: ""; position: absolute; right: -3px; top: -3px; width: 6px; height: 8px; background: var(--paper); }
.vp-vtrack:hover .vp-vlev, .vp-vtrack:hover .vp-vlev::after { background: var(--green); }
@media (max-width: 640px) { .vp-vtrack { width: 44px; } }
.vp-err { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--mono); font-size: 12px; color: var(--paper); background: var(--ink); padding: 6px 10px; border: 1px solid var(--red); }
.vp-missing .vp-bar { display: none; }
.statement .stmt-label { display: block; font-family: var(--mono); font-size: 11px; color: var(--mute); margin-bottom: 8px; }


/* ---------- galeria: desenhos em pontinhos e legenda de prompt ---------- */
.cz-dots .cz-dotbox { position: relative; width: 100%; aspect-ratio: 4 / 3; background: var(--paper); }
.cz-dots[data-dots="olho"] .cz-dotbox { aspect-ratio: 3 / 2; }
.cz-dots[data-dots="joinha"] .cz-dotbox { aspect-ratio: 1; }
.cz-fig.plain::before, .cz-fig.plain::after, .cz-fig.has-in::before { display: none; }
.cz-dots canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cz-prompt { font-family: var(--mono); font-size: 11px; color: var(--ink); margin: 6px 0 0; line-height: 1.5; }
.cz-prompt q { color: var(--red-d); quotes: "“" "”"; }
.cz-fig.linked .cz-img { outline: 1px solid color-mix(in srgb, var(--red) 55%, transparent); outline-offset: 4px; }
.cz-fig.marked-soft .cz-img { outline: 1px solid var(--red); outline-offset: 4px; }
.diptych-zoom { display: block; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.credits-cols { padding-top: 18px; display: grid; grid-template-columns: 1fr 2fr; gap: 0 48px; font-family: var(--mono); font-size: 12px; line-height: 1.75; }
.credits-cols h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--red-d); margin: 0 0 8px; text-transform: lowercase; }
.credits-cols ul { list-style: none; margin: 0; padding: 0; }
.credits-cols div:last-child ul { columns: 2; column-gap: 32px; }
.credits-cols li { break-inside: avoid; }
@media (max-width: 720px) {
    .credits-cols { grid-template-columns: 1fr; gap: 24px; }
    .credits-cols div:last-child ul { columns: 1; }
}

.life-rules { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; margin-top: 12px; }

/* linhas que ligam o retângulo do detalhe ao círculo */
.cz-row > svg.cz-link { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 3; grid-column: auto; margin: 0; }
.cz-link line { stroke: var(--red); stroke-width: 1; opacity: 0.55; transition: opacity 0.2s; vector-effect: non-scaling-stroke; }
.cz-link.on line { opacity: 1; }
