/* Heron Amaral, portfólio. Design system "arena": tokens e regras em DESIGN-SYSTEM.md. */

@font-face { font-family: "Chakra Petch"; src: url("fonts/chakra-petch-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("fonts/chakra-petch-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #15131D;
  --sheet: #1D1A28;
  --raise: #252236;
  --ink: #F0EDE6;
  --muted: #A8A3B8;
  --line: #3B3652;
  --grid: #221F30;
  --accent: #F2A33A;
  --accent-dim: #7A5524;
  --on-accent: #15131D;

  --tech: "Chakra Petch", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --text: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.85rem;
  --step-3: clamp(2.4rem, 6vw, 4rem);
  --wrap: 72rem;
  --prose: 40rem;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);

  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="light"] {
  --paper: #EEEDF2;
  --sheet: #FFFFFF;
  --raise: #F5F4F8;
  --ink: #1B1826;
  --muted: #5C5870;
  --line: #CBC8D8;
  --grid: #E6E4EE;
  --accent: #A65E00;
  --accent-dim: #D9B88C;
  --on-accent: #FFFFFF;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: inherit; }
html { background: var(--paper); scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--step-0)/1.6 var(--text); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--sheet); padding: .5rem 1rem; font-family: var(--tech); }
.skip:focus { left: 1rem; z-index: 10; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
h1, h2, h3 { font-family: var(--tech); font-weight: 700; line-height: 1.12; margin: 0; }
h2 { font-size: var(--step-2); }
h2::before { content: ""; display: inline-block; width: .5em; height: .5em; background: var(--accent); margin-right: .55em; transform: translateY(-.1em) rotate(45deg); }
p { margin: 0 0 1rem; max-width: var(--prose); }
button { font-family: var(--tech); }

/* botões */
.btn, .car-btn, .replay-controls button, .zoom-actions button, .filters button, .run {
  font: 500 var(--step--1)/1 var(--tech); cursor: pointer;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent);
}
.car-btn:hover:not([disabled]), .replay-controls button:hover:not([disabled]), .zoom-actions button:hover, .filters button:hover { background: var(--accent); color: var(--on-accent); }
[disabled] { opacity: .35; cursor: default !important; }
.cta { font-family: var(--tech); font-weight: 700; color: var(--accent); text-decoration-thickness: 2px; }

/* navegação */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 3.5rem; overflow-x: auto; }
.nav .home { font-family: var(--tech); font-weight: 700; color: var(--accent); text-decoration: none; white-space: nowrap; }
.nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav ul a { font: 500 var(--step--1)/1 var(--tech); color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav ul a:hover { color: var(--ink); }
.theme-btn { position: relative; display: none; align-items: center; gap: .45rem; flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 var(--step--1)/1 var(--tech); padding: .45rem .7rem; cursor: pointer; }
.js .theme-btn { display: inline-flex; }
.theme-btn:hover { color: var(--ink); border-color: var(--ink); }
.theme-btn svg { width: 1rem; height: 1rem; }
.theme-btn circle { fill: none; stroke: currentColor; stroke-width: 1.6; }
.theme-btn path { fill: currentColor; }
@media (max-width: 40rem) {
  .nav .home { display: none; }
  .nav ul { margin-left: 0; gap: 1rem; }
  .theme-label { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* topo */
.hero { padding: clamp(2.5rem, 7vw, 4rem) 0 0; }
.hero h1 { font-size: var(--step-3); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 38rem; margin-top: 1rem; }
.status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1.75rem 0 0; border: 1px solid var(--line); background: var(--sheet); }
.status div { padding: .75rem 1rem; border-left: 1px solid var(--line); min-width: 0; }
.status div:first-child { border-left: 0; }
.status dt { font: 500 .78rem/1.2 var(--tech); color: var(--accent); }
.status dd { margin: .3rem 0 0; font: 500 var(--step-0)/1.35 var(--tech); overflow-wrap: anywhere; }
.status .live::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); margin-right: .45rem; vertical-align: .05em; }
@media (max-width: 56rem) { .status { grid-template-columns: repeat(2, minmax(0, 1fr)); } .status div:nth-child(3) { border-left: 0; } .status div:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 34rem) { .status { grid-template-columns: minmax(0, 1fr); } .status div { border-left: 0; border-top: 1px solid var(--line); } .status div:first-child { border-top: 0; } }

/* cantoneiras */
.panel, .portrait, .contact-box { position: relative; }
.panel::before, .panel::after, .portrait::before, .portrait::after, .contact-box::before, .contact-box::after {
  content: ""; position: absolute; width: 22px; height: 22px; border: 0 solid var(--accent); pointer-events: none;
}
.panel::before, .portrait::before, .contact-box::before { top: -1px; left: -1px; border-top-width: 3px; border-left-width: 3px; }
.panel::after, .portrait::after, .contact-box::after { bottom: -1px; right: -1px; border-bottom-width: 3px; border-right-width: 3px; }

/* painel ao vivo */
.panel { margin-top: 1.25rem; border: 1px solid var(--line); background: var(--sheet); display: grid; grid-template-columns: minmax(0, 1fr) 19rem; }
.stage { padding: 1rem; min-width: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; }
.log { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 20rem; }
.log-head { display: flex; justify-content: space-between; gap: .5rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); font: 500 .85rem/1.2 var(--tech); color: var(--muted); }
.log ol { list-style: none; margin: 0; padding: .6rem 1rem; flex: 1; overflow: auto; max-height: 24rem; font-size: .95rem; }
.log li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .4rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.log li span { font-family: var(--tech); color: var(--accent); }
.log li.empty { display: block; border: 0; color: var(--muted); }
.run { display: none; margin: 1rem; padding: .85rem 1rem; font-weight: 700; background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.js .run { display: block; }
@media (max-width: 52rem) { .panel { grid-template-columns: minmax(0, 1fr); } .log { border-left: 0; border-top: 1px solid var(--line); min-height: 0; } }

.drawing { display: block; width: 100%; height: auto; font-family: var(--tech); }
.drawing-hero-m { display: none; max-width: 26rem; margin: 0 auto; }
@media (max-width: 40rem) { .drawing-hero { display: none; } .drawing-hero-m { display: block; } }
.d-box { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.2; transition: stroke .25s, fill .25s; }
.d-dash { stroke-dasharray: 6 5; }
.d-t { fill: var(--ink); font-size: 15px; font-weight: 700; }
.d-s { fill: var(--muted); font-size: 12.5px; }
.d-arrow { fill: none; stroke: var(--muted); stroke-width: 1.5; transition: stroke .25s; }
.d-head { fill: var(--muted); }
.d-head-red { fill: var(--accent); }
.d-zone { fill: none; stroke: var(--accent-dim); stroke-width: 1.2; stroke-dasharray: 2 5; }
.d-zl { fill: var(--accent); font-size: 12.5px; }
.d-n, .d-lead, .d-dot { display: none; }
.d-node.hot .d-box { stroke: var(--accent); stroke-width: 2.5; fill: var(--raise); }
.d-node.done .d-box { stroke: var(--accent-dim); }
.d-arrow.lit { stroke: var(--accent); }
.packet { fill: var(--accent); }

/* seções */
.section { padding: clamp(3.5rem, 8vw, 5rem) 0 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.intro { color: var(--muted); margin-top: .9rem; margin-bottom: 1.5rem; }

/* sobre */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 19rem); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.about h2 { margin-bottom: 1.25rem; }
.portrait { margin: .3rem 0 0; border: 1px solid var(--line); background: var(--sheet); }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.portrait figcaption { border-top: 1px solid var(--line); padding: .55rem .8rem; font: 500 var(--step--1)/1.3 var(--tech); color: var(--muted); }
@media (max-width: 44rem) { .about { grid-template-columns: minmax(0, 1fr); } .portrait { max-width: 18rem; } }

/* carrossel */
.car-ctrl { display: none; align-items: center; gap: .5rem; font: 500 var(--step--1)/1 var(--tech); color: var(--muted); }
.js .car-ctrl { display: flex; }
.car-btn { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; padding: 0; }
.car-btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.car-count { min-width: 3.5rem; text-align: center; }
.car-tabs { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.car-tabs li + li { border-left: 1px solid var(--line); }
.car-tabs a { display: block; padding: .5rem .9rem; font: 500 var(--step--1)/1.2 var(--tech); text-decoration: none; color: var(--muted); }
.car-tabs a:hover { color: var(--ink); }
.car-tabs a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; align-items: start; gap: 1.5rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel:focus-visible, .strip:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 48rem) {
  .carousel { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .car-tabs, .js #casos .car-ctrl { display: none; }
}

/* replay */
.replay { min-width: 0; scroll-snap-align: start; border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--sheet); padding: clamp(1.1rem, 3vw, 1.75rem); }
.replay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.replay h3 { font-size: var(--step-1); }
.meta { font: 500 var(--step--1)/1.3 var(--tech); color: var(--muted); margin: .4rem 0 0; }
.zoom-btn { display: none; flex: none; font: 500 var(--step--1)/1 var(--tech); padding: .5rem .75rem; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.js .zoom-btn { display: inline-block; }
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); }
.replay-fig { margin: 1rem 0 .75rem; }
.replay-svg { display: block; width: 100%; height: auto; font-family: var(--tech); }
.r-box { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; transition: stroke .3s; }
.r-t { fill: var(--ink); font-size: 18px; font-weight: 700; }
.r-s { fill: var(--muted); font-size: 15px; }
.r-num { fill: var(--accent); font-weight: 700; }
.r-arrow { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.r-dash { stroke-dasharray: 7 6; }
.r-ev { fill: var(--accent); font-size: 15px; font-style: italic; }
[data-show], [data-dim] { transition: opacity .35s; }
.off { opacity: 0; }
.dim { opacity: .28; }
.state-1 .n-prob .r-box { stroke: var(--accent); stroke-width: 2.6; }
.state-2 .n-new .r-box { stroke-dasharray: 7 6; stroke: var(--accent); }
.state-3 .n-new .r-box, .state-3 .n-hot .r-box, .state-2 .n-ok .r-box, .state-3 .n-ok .r-box { stroke: var(--accent); stroke-width: 2.6; }

.timeline { display: none; position: relative; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.js .timeline { display: grid; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: var(--line); }
.timeline .fill { position: absolute; left: 0; top: 14px; height: 2px; width: 0; background: var(--accent); transition: width .35s; }
.timeline > div { position: relative; }
.timeline button { display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; width: 100%; padding: 0 .5rem 0 0; border: 0; background: none; color: var(--muted); font: 500 .9rem/1.2 var(--tech); text-align: left; cursor: pointer; }
.timeline button::before { content: ""; width: 16px; height: 16px; margin: 7px 0 0 0; background: var(--sheet); border: 2px solid var(--line); transform: rotate(45deg); }
.timeline button[aria-current="step"] { color: var(--ink); }
.timeline button[aria-current="step"]::before, .timeline button.past::before { background: var(--accent); border-color: var(--accent); }
.narr-src { margin: 0; padding-left: 1.2rem; max-width: var(--prose); color: var(--ink); }
.js .narr-src { display: none; }
.narr-src li { margin-bottom: .4rem; }
.narration { display: none; min-height: 3.4rem; margin: 1.1rem 0 0; max-width: 46rem; font-size: 1.1rem; }
.js .narration { display: block; }
.replay-controls { display: none; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.js .replay-controls { display: flex; }
.replay-controls button { padding: .65rem .9rem; }
.replay-controls .play { background: var(--accent); color: var(--on-accent); }
.summary { border-top: 1px solid var(--line); margin: 1.4rem 0 0; padding-top: 1rem; color: var(--muted); font-size: .95rem; max-width: 46rem; }
@media (max-width: 40rem) {
  .timeline button { font-size: .78rem; }
  .replay-head { flex-direction: column; }
  .replay-fig { overflow-x: auto; margin-left: -.5rem; margin-right: -.5rem; padding: 0 .5rem; }
  .replay-svg { min-width: 620px; }
}

/* projetos como lista de servidores */
.filters { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; padding: 0; }
.filters li { display: none; }
.js .filters li { display: block; }
.filters button { padding: .5rem .8rem; border-color: var(--line); color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.servers-head, .server { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 13rem 4rem; gap: 1.25rem; align-items: start; }
.servers-head { padding: 0 1.25rem .5rem; font: 500 .78rem/1 var(--tech); color: var(--accent); }
.servers { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); background: var(--sheet); }
.server { padding: 1.1rem 1.25rem; border-top: 1px solid var(--line); }
.server:first-child { border-top: 0; }
.server:hover { background: var(--raise); }
.server[hidden] { display: none; }
.server p { margin: 0; }
.s-name a { font: 700 var(--step-0)/1.3 var(--tech); overflow-wrap: anywhere; }
.s-kind { display: block; margin-top: .3rem; font: 500 .8rem/1.2 var(--tech); color: var(--muted); }
.s-desc { font-size: .98rem; }
.s-origin { display: block; margin-top: .35rem; color: var(--muted); font-size: .92rem; }
.s-stack { font: 500 .85rem/1.45 var(--tech); color: var(--muted); }
.s-year { font: 500 .9rem/1.3 var(--tech); color: var(--accent); }
.servers-empty { color: var(--muted); margin-top: 1rem; }
@media (max-width: 56rem) {
  .servers-head { display: none; }
  .server { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; }
  .s-name { grid-column: 1; } .s-year { grid-column: 2; grid-row: 1; }
  .s-desc, .s-stack { grid-column: 1 / -1; }
}

/* experiência em faixa horizontal */
.strip { list-style: none; margin: 1.25rem 0 0; padding: 0 0 .75rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(18rem, 25rem); gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.season { scroll-snap-align: start; border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--sheet); padding: 1.25rem 1.35rem; }
.season .when { font: 500 var(--step--1)/1.2 var(--tech); color: var(--accent); margin: 0 0 .5rem; }
.season h3 { font-size: var(--step-1); }
.season .org { font: 500 var(--step--1)/1.35 var(--tech); color: var(--muted); margin: .4rem 0 .8rem; }
.season ul { margin: 0; padding-left: 1.05rem; list-style: square; font-size: .97rem; }
.season li { margin-bottom: .4rem; }
.season li::marker { color: var(--accent); }

/* habilidades */
.skills { margin: 1.25rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--sheet); }
.skills div { padding: .9rem 1.2rem; border-top: 1px solid var(--line); }
.skills div:nth-child(-n+2) { border-top: 0; }
.skills div:nth-child(2n) { border-left: 1px solid var(--line); }
.skills dt { font: 500 .8rem/1.2 var(--tech); color: var(--accent); }
.skills dd { margin: .3rem 0 0; }
@media (max-width: 44rem) { .skills { grid-template-columns: minmax(0, 1fr); } .skills div:nth-child(2) { border-top: 1px solid var(--line); } .skills div:nth-child(2n) { border-left: 0; } }

/* contato */
.contact { padding-bottom: 4rem; }
.contact-box { border: 1px solid var(--line); background: var(--sheet); padding: clamp(1.5rem, 4vw, 2.5rem); }
.contact-box h2 { margin-bottom: 1rem; }
.cta-big { font-size: clamp(1.25rem, 4vw, 1.9rem); overflow-wrap: anywhere; }
.links { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 2rem; font: 500 var(--step--1)/1.4 var(--tech); }

.footer { border-top: 1px solid var(--line); padding: 1.25rem 0 2rem; font: 500 var(--step--1)/1.4 var(--tech); color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.footer p { margin: 0; max-width: none; }

/* ampliar */
dialog.zoom { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
dialog.zoom::backdrop { background: rgba(10, 8, 16, .7); }
.zoom-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: calc(.75rem + env(safe-area-inset-top, 0px)) var(--gutter) .75rem; border-bottom: 1px solid var(--line); }
.zoom-title { margin: 0; font: 700 var(--step--1)/1.3 var(--tech); }
.zoom-actions { display: flex; gap: .5rem; }
.zoom-actions button { min-width: 2.5rem; height: 2.5rem; padding: 0 .8rem; }
.zoom-body { display: flex; height: calc(100dvh - 4.2rem - env(safe-area-inset-top, 0px)); overflow: auto; padding: 1.25rem var(--gutter) calc(1.25rem + env(safe-area-inset-bottom, 0px)); background-color: var(--sheet); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; }
.zoom-body svg { display: block; flex: none; max-width: none; height: auto; margin: auto; }

.notfound { padding-top: clamp(4rem, 15vh, 9rem); padding-bottom: 4rem; }
.notfound h1 { font-size: var(--step-3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print { .nav, .skip, .run, .car-ctrl, .replay-controls, .zoom-btn { display: none !important; } }
