/* Hallmark · shape: instrument map (canvas stage + list panels) · genre: modern-minimal · theme: Console (by request) · job: hire · draw: manual
 * hero: Stage, the canvas is the page and #me its name plate · nav: language chips inside the name plate · footer: none, Contato closes the list · imagery: renders in grayscale · signature: the ship flying a trace-blue bench map · console: graphite
 * axes: dark/grotesk-sans/chromatic-amber · posture: restrained · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S3 R4 V4 · weakest: S, the station drawings carried a dozen greens and oranges; collapsed to the three graphite steps, one amber and one blue */
/* Hallmark · waive 44c · list mode is the second view behind the lista button, the page opens on the canvas map which fills its screen · the name plate is only the header of the list, not a hero */
/* Console is a dark theme by nature (dark-mode.md loads only when both modes are asked for): the old prefers-color-scheme light block is gone, color-scheme is dark. */
:root {
  color-scheme: dark;
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px;
  --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem;
  --text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem);
  --text-section: clamp(2.5rem, 2vw + 1.75rem, 3.5rem); --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem); --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
  --overlay: color-mix(in oklab, var(--color-paper-2) 60%, transparent); --overlay-line: color-mix(in oklab, var(--color-muted) 40%, transparent);
  --container: 68rem; --gutter: 24px;
  --color-paper: oklch(17% 0.008 250); --color-paper-2: oklch(21% 0.009 250); --color-paper-3: oklch(13.5% 0.007 250);
  --color-ink: oklch(95% 0.005 250); --color-ink-2: oklch(83% 0.008 250); --color-muted: oklch(71% 0.01 250);
  --color-rule: oklch(31% 0.01 250); --color-rule-2: oklch(42% 0.012 250);
  --color-accent: oklch(82% 0.15 80); --color-accent-ink: oklch(18% 0.04 75); --color-accent-soft: oklch(29% 0.05 80); --color-focus: oklch(82% 0.15 80);
  --color-cool: oklch(77% 0.12 245); --color-cool-soft: oklch(29% 0.05 245);
  --font-display: "Host Grotesk", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display);
  --font-outlier: "Atkinson Hyperlegible Mono", ui-monospace, monospace;
  --radius-card: 0; --radius-pill: 0; --rule-hair: 1px;
  --tracking-display: -0.03em; --display-weight: 500;
  --kid-bg: #070708; --kid-fg: #f7f7f8; --kid-accent: #e82127; --kid-gray: #393c41; --kid-red: #d91f26; --kid-muted: #9c9fa4; --kid-road: #141414; /* filho mode keeps its own palette */
}
@media (max-width: 40rem) { :root { --gutter: 16px; } }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--color-rule-2) var(--color-paper); scroll-padding-top: var(--space-2xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font: 400 var(--text-md)/1.55 var(--font-body); font-synthesis: none; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 25%, transparent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.04; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h2 { font-size: var(--text-section); margin-bottom: var(--space-lg); }
h3 { font-size: var(--text-title); line-height: 1.2; margin-bottom: var(--space-xs); }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: underline 1px var(--color-rule-2); text-underline-offset: 0.2em; transition: color var(--dur-micro) var(--ease-out), text-decoration-color var(--dur-micro) var(--ease-out); }
a:hover { color: var(--color-accent); text-decoration-color: currentColor; }
a:active { color: var(--color-ink); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; transition: none; }
.m { font-family: var(--font-outlier); font-size: 0.9375em; font-variant-numeric: tabular-nums slashed-zero; color: var(--color-cool); display: inline-block; }

/* controls: the quiet pair; amber fill is #pcta only */
button { font: 500 var(--text-sm)/1 var(--font-body); color: var(--color-ink); background: var(--color-paper-2); border: 1px solid var(--color-rule-2); border-radius: var(--radius-pill); min-height: 44px; padding: 0 var(--space-md); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
button:hover { background: var(--color-rule); }
button:active { background: var(--color-paper-3); border-color: var(--color-ink-2); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button[aria-pressed=true] { background: var(--color-cool-soft); border-color: var(--color-cool); color: var(--color-cool); }
#pcta { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
#pcta:hover { background: color-mix(in oklab, var(--color-accent) 86%, var(--color-ink)); }
#pcta:active { background: color-mix(in oklab, var(--color-accent) 78%, var(--color-paper-3)); }
#pcta:disabled { background: var(--color-rule); border-color: var(--color-rule); color: var(--color-muted); }

/* the name plate and the language chips */
.lang { display: flex; flex-wrap: nowrap; gap: var(--space-xs); }
.lang a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 var(--space-sm); font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); text-decoration: none; background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-pill); }
.lang a:hover { color: var(--color-ink); border-color: var(--color-rule-2); }
.lang a:active { background: var(--color-paper-3); }
.lang a[aria-current=page] { background: var(--color-cool-soft); border-color: var(--color-cool); color: var(--color-cool); }
#me { width: calc(100% - 2 * var(--gutter)); max-width: var(--container); margin: var(--space-lg) auto 0; padding: var(--space-lg); background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-card); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-sm) var(--space-lg); }
#me h1 { font-size: var(--text-display-s); }
#me .role { grid-column: 1; color: var(--color-muted); }
#me .lang { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 40rem) { #me { grid-template-columns: minmax(0, 1fr); } #me .lang { grid-column: 1; grid-row: auto; } }
.skip { position: fixed; left: var(--space-xs); top: -80px; z-index: 20; background: var(--color-paper-3); color: var(--color-accent); border: 1px solid var(--color-accent); border-radius: var(--radius-pill); padding: 0 var(--space-md); min-height: 44px; display: inline-flex; align-items: center; }
.skip:focus { top: var(--space-xs); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* list mode: panels cut from one surface, seams of 1px */
.sec { width: 100%; max-width: var(--container); margin: 0 auto; padding: var(--space-3xl) var(--gutter); }
.sec ul { list-style: none; margin: 0; padding: 0; }
.cards, .parts, .list ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); border-top: 1px solid var(--color-rule); border-left: 1px solid var(--color-rule); }
.card, .part, .list li { min-width: 0; color: var(--color-ink); padding: var(--space-lg); background: var(--color-paper-2); border-right: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); }
.parts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
#bordado .cards, .list ul { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.card a, .part a { overflow-wrap: anywhere; }
.card p, .part p { color: var(--color-muted); margin-bottom: var(--space-sm); }
.card p:last-child, .part p:last-child { margin-bottom: 0; }
.pics { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); margin-top: var(--space-sm); background: var(--color-paper-3); border: 1px solid var(--color-rule); }
.pics img, .lab img { width: 100%; background: var(--color-paper-3); filter: grayscale(1) brightness(.88) contrast(1.05); }
.lab img { border: 1px solid var(--color-rule); }
.ph { padding: var(--space-md) 0; text-align: center; font-size: var(--text-sm); border: 1px dashed var(--color-rule-2); }
.soon { margin-top: var(--space-md); font-size: var(--text-sm); color: var(--color-muted); }
.list { margin-top: var(--space-xl); }
.list li { padding: var(--space-sm) var(--space-md); }
.lab { margin: var(--space-xl) 0 0; }
.lab figcaption { font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-xs); }
.intro { max-width: 44rem; margin: 0 0 var(--space-lg); color: var(--color-ink-2); }
.board { max-width: none; padding-inline: var(--gutter); background: var(--color-paper-3); border-block: 1px solid var(--color-rule); }
.sec.board > * { max-width: var(--container); margin-inline: auto; }
.part a { display: block; margin-bottom: var(--space-xs); font-size: var(--text-lg); font-weight: 500; text-decoration: none; }
.part a strong { font-weight: 500; text-decoration: underline 1px var(--color-rule-2); text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.part a:hover strong { text-decoration-color: currentColor; }
.part > strong { display: block; margin-bottom: var(--space-xs); font-size: var(--text-lg); font-weight: 500; }
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); column-gap: var(--space-xl); border-left: 1px solid var(--color-rule-2); }
#trabalho .notes { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.notes li { max-width: 60ch; padding: var(--space-2xs) 0 var(--space-2xs) var(--space-md); margin-bottom: var(--space-md); color: var(--color-ink-2); }
.notes strong { font-weight: 500; color: var(--color-ink); }
.ptouch { max-width: 52rem; background: var(--color-paper-2); border: 1px solid var(--color-rule); }
.ptouch li { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-md); padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--color-rule); overflow-wrap: anywhere; }
.ptouch li:last-child { border-bottom: 0; }
.ptouch li > span:first-child { min-width: 6rem; color: var(--color-muted); }
.sug { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); justify-content: space-between; padding: var(--space-xs) var(--space-md); background: var(--color-paper-2); border-bottom: 1px solid var(--color-rule-2); }
.sug a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--text-xs); white-space: nowrap; }
.sug button { min-width: 44px; }

/* ===== NAVE (stage; the canvas is the map) ===== */
body.nave main { display: none; }
body.nave .lang a { position: relative; min-height: 32px; min-width: 32px; padding: 0 var(--space-xs); border-color: var(--overlay-line); background: transparent; }
body.nave .lang a::after { content: ""; position: absolute; inset: -6px; }
body.nave .lang a[aria-current=page] { color: var(--color-accent); border-color: var(--color-accent); background: transparent; }
body.nave { overflow: clip; overscroll-behavior: none; }
html:has(body.nave) { overscroll-behavior: none; }
#stage { position: fixed; inset: 0; background: var(--color-paper-3); touch-action: none; overscroll-behavior: none; overflow: clip; }
#cv { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#cv:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
#hud, #hint, #prog, #pdone, #kidp, #kidb, #kidback, #toggle, #mute, #score, body.nave #me { position: fixed; z-index: 3; font-size: var(--text-sm); line-height: 1.4; background: var(--overlay); border: 1px solid var(--overlay-line); border-radius: var(--radius-card); color: var(--color-ink); }
#hud, #hint, #prog, #pdone, #kidp, #kidb { padding: var(--space-xs) var(--space-sm); margin: 0; }
#kidback { min-height: 44px; padding: 0 var(--space-md); }
#hudstack { position: fixed; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-xs); pointer-events: none; top: calc(var(--space-sm) + env(safe-area-inset-top)); left: calc(var(--space-sm) + env(safe-area-inset-left)); max-width: calc(100% - 190px); }
#hudstack > * { position: static; pointer-events: auto; max-width: 100%; }
#hud[hidden] ~ * { display: none; }
#pdone { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); }
#hud, #hint, #prog, #pdone, #kidp, #kidb, #kidback, #toggle, #mute, #score, #joy, #fire { transition: opacity var(--dur-long) var(--ease-out); }
body.introing :is(#hud, #hint, #prog, #pdone, #kidp, #kidb, #kidback, #toggle, #mute, #score, #joy, #fire) { opacity: 0; pointer-events: none; }
body.introing #me { animation: plate var(--dur-long) var(--ease-out) both; }
@keyframes plate { from { opacity: 0; } }
#toggle { z-index: 7; bottom: calc(var(--space-sm) + env(safe-area-inset-bottom)); right: calc(var(--space-sm) + env(safe-area-inset-right)); }
#score { z-index: 7; margin: 0; top: calc(var(--space-sm) + env(safe-area-inset-top)); right: calc(var(--space-sm) + env(safe-area-inset-right)); display: flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: 0 var(--space-sm); white-space: nowrap; pointer-events: none; }
#mute { z-index: 7; top: calc(64px + env(safe-area-inset-top)); right: calc(var(--space-sm) + env(safe-area-inset-right)); }
#hudstack > #hint { position: fixed; left: 50%; right: auto; transform: translateX(calc(-50% + 60px)); width: max-content; bottom: calc(var(--space-sm) + env(safe-area-inset-bottom)); max-width: 46ch; text-align: center; }
body.nave #me.dim { opacity: 0.35; }
body.nave #me { display: block; transition: opacity var(--dur-short) var(--ease-out); background: color-mix(in oklab, var(--color-paper-2) 80%, transparent); left: max(calc(var(--space-sm) + env(safe-area-inset-left)), calc((100% - var(--container)) / 2 + var(--gutter))); bottom: calc(var(--space-sm) + env(safe-area-inset-bottom)); width: auto; max-width: 22rem; margin: 0; padding: var(--space-sm); }
body.nave #me h1 { font-size: var(--text-lg); line-height: 1.2; }
body.nave #me .role { font-size: var(--text-xs); margin: var(--space-3xs) 0 var(--space-xs); }
body.touch #toggle { bottom: calc(124px + env(safe-area-inset-bottom)); right: calc(var(--space-md) + env(safe-area-inset-right)); }
body.touch .kb, body:not(.touch) .tc { display: none; }
#joy, #fire { position: fixed; z-index: 3; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 50%; }
#joy { left: calc(var(--space-md) + env(safe-area-inset-left)); bottom: calc(var(--space-md) + env(safe-area-inset-bottom)); width: 128px; height: 128px; border: 1px solid var(--overlay-line); background: var(--overlay); }
#knob { position: absolute; left: 36px; top: 36px; width: 56px; height: 56px; border-radius: 50%; background: color-mix(in oklab, var(--color-accent) 40%, transparent); border: 1px solid var(--color-accent); pointer-events: none; }
#fire { right: calc(var(--space-md) + env(safe-area-inset-right)); bottom: calc(var(--space-lg) + env(safe-area-inset-bottom)); width: 80px; height: 80px; padding: 0; border: 1px solid var(--overlay-line); background: var(--overlay); }
@media (max-width: 700px), (pointer: coarse) {
  body.nave #me { background: var(--overlay); top: 0; bottom: auto; left: 0; right: 0; max-width: none; border-width: 0 0 1px; padding: calc(var(--space-xs) + env(safe-area-inset-top)) var(--space-sm) var(--space-xs); }
  body.nave #me h1 { min-height: 52px; display: flex; align-items: center; }
  body.nave #me .role { margin: 0 0 var(--space-2xs); }
  body.nave #mute { top: auto; right: auto; left: calc(var(--space-sm) + env(safe-area-inset-left)); bottom: calc(var(--space-sm) + env(safe-area-inset-bottom)); }
  body.touch #mute { bottom: calc(160px + env(safe-area-inset-bottom)); }
  #score { top: var(--meb, 150px); }
  #hudstack > :not(#hint) { max-width: calc(100% - 140px); }
  #hudstack { top: var(--meb, 150px); left: var(--space-sm); width: calc(100% - 2 * var(--space-lg)); max-width: none; }
  #hudstack > * { align-self: stretch; }
  #hudstack > #hint { position: static; transform: none; width: auto; max-width: none; text-align: center; }
}
@media (max-height: 480px) and (max-width: 700px), (max-height: 480px) and (pointer: coarse) {
  body.nave #me { display: flex; align-items: center; gap: 0 var(--space-md); }
  body.nave #me .role { display: none; }
  body.nave #me .lang { flex-wrap: nowrap; }
  body.nave #mute { top: calc(var(--meb, 64px) + 52px); bottom: auto; left: auto; right: calc(var(--space-sm) + env(safe-area-inset-right)); }
  #hudstack { width: calc(100% - 150px); align-items: flex-start; }
  #hudstack > :not(#hint) { max-width: 100%; }
  #hudstack > * { align-self: flex-start; }
}
@media (max-width: 600px) { /* compact HUD: nearest + progress on one line, completion card as a bar above the controls */
  #hudstack { flex-direction: row; flex-wrap: nowrap; align-items: flex-start; gap: var(--space-2xs); width: calc(100% - 140px); }
  #hudstack > #hud, #hudstack > #prog { max-width: none; flex: 0 1 auto; min-width: 0; align-self: flex-start; font-size: var(--text-xs); padding: var(--space-3xs) var(--space-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #hudstack > #kidp, #hudstack > #kidb, #hudstack > #kidback { align-self: flex-start; }
  #hudstack > #pdone { position: fixed; left: var(--space-sm); right: var(--space-sm); bottom: calc(64px + env(safe-area-inset-bottom)); max-width: none; z-index: 6; font-size: var(--text-xs); }
  body.touch #hudstack > #pdone { bottom: calc(212px + env(safe-area-inset-bottom)); }
}
body.nave .sug { position: fixed; top: 0; left: 0; right: 0; z-index: 6; }
@media (max-width: 700px), (pointer: coarse) { /* small overlays: the game keeps the middle of the screen */
  body.nave #me { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-3xs) var(--space-sm); padding-top: calc(var(--space-3xs) + env(safe-area-inset-top)); }
  body.nave #me h1 { min-height: 0; font-size: 14px; }
  body.nave #me .role { display: none; }
  body.nave .lang { gap: var(--space-2xs); }
  body.nave .lang a { border-color: transparent; font-size: var(--text-xs); }
  body.nave .lang a[aria-current=page] { border-color: transparent; }
  #hudstack > #hud, #hudstack > #prog, #hudstack > #hint, #score { font-size: 12px; line-height: 1.3; padding: var(--space-2xs) var(--space-xs); min-height: 0; }
  #hudstack { flex-direction: row; flex-wrap: wrap; gap: var(--space-3xs) 0; }
  #hudstack > #hud { border-right: 0; } /* HUD + N/8 read as one line: "Mais próxima: X · 0/8" */
  #hudstack > #prog { border-left: 0; padding-left: 0; }
  #hudstack > #prog::before { content: "\00b7\00a0"; color: var(--color-muted); }
  #ptxt { font-size: 0; } #ptxt .m { font-size: 12px; } /* the visited label stays for screen readers, only the count shows */
  #hudstack > #hint { text-align: left; flex: 1 1 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #toggle, #mute { position: fixed; min-height: 36px; min-width: 36px; padding: 0 var(--space-xs); font-size: 12px; }
  #toggle::after, #mute::after { content: ""; position: absolute; inset: -4px; }
  #mute { top: auto; right: auto; left: calc(var(--space-sm) + env(safe-area-inset-left)); bottom: calc(var(--space-sm) + env(safe-area-inset-bottom)); }
  body.touch #mute { bottom: calc(120px + env(safe-area-inset-bottom)); }
  body.touch #toggle { bottom: calc(104px + env(safe-area-inset-bottom)); right: calc(var(--space-md) + env(safe-area-inset-right)); }
  #joy { width: 96px; height: 96px; }
  #knob { width: 40px; height: 40px; left: 28px; top: 28px; }
  #fire { width: 64px; height: 64px; font-size: 12px; }
  #hudstack > #pdone { bottom: calc(56px + env(safe-area-inset-bottom)); }
  body.touch #hudstack > #pdone { bottom: calc(150px + env(safe-area-inset-bottom)); }
}
@media (max-height: 480px) and (max-width: 700px), (max-height: 480px) and (pointer: coarse) {
  #hudstack > #hint { flex: 0 1 auto; max-width: 60%; }
  body.nave #mute, body.touch #mute { top: calc(var(--meb, 40px) + 44px); bottom: auto; left: auto; right: calc(var(--space-sm) + env(safe-area-inset-right)); }
}
dialog { max-width: min(44rem, calc(100vw - 2 * var(--space-sm))); width: 100%; max-height: 85dvh; overflow: auto; padding: 0; background: var(--color-paper); color: var(--color-ink); border: 1px solid var(--color-rule-2); border-radius: var(--radius-card); }
dialog::backdrop { background: color-mix(in oklab, var(--color-paper-3) 80%, transparent); }
dialog[open] { animation: fade var(--dur-short) var(--ease-out); }
dialog[open]::backdrop { animation: fade var(--dur-short) var(--ease-out); }
@keyframes fade { from { opacity: 0; } }
dialog [tabindex="-1"] { outline: none; }
#dbody { padding: var(--space-lg); }
dialog .sec { padding: 0; max-width: none; }
dialog .board { padding: var(--space-md); }
#dclose { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: flex-end; width: 100%; margin: 0; background: var(--color-paper-3); border: 0; border-bottom: 1px solid var(--color-rule-2); }
/* ===== FIM NAVE ===== */

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