/* Fontes próprias (SIL OFL): o site fica igual em Mac, Windows e Android */
@font-face { font-family: "Newsreader"; src: url("../assets/fonts/newsreader-latin-opsz-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../assets/fonts/newsreader-latin-opsz-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../assets/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
:root {
  color-scheme: light;
  --paper: #f6f3eb;
  --ink: #22231e;
  --muted: #58594f;
  --line: #c8c8bb;
  --red: #a83520;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Helvetica Neue", Arial, sans-serif;
  /* Motion tokens: strong ease-out para entradas e feedback, ease-in-out para movimento na tela */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.6 var(--sans); }
a { color: inherit; text-decoration: none; }
button, summary { cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
::selection { background: #f4b9a7; color: #181914; }
h1, h2, h3, h4 { text-wrap: balance; }
p, dd, summary small { text-wrap: pretty; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { width: min(1240px, 90%); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -5rem; padding: .6rem; background: white; z-index: 2; }
.skip:focus { top: 1rem; }
.mast-inner, .footline, .actions, nav, .channels { display: flex; align-items: center; }
.mast-inner { min-height: 76px; justify-content: space-between; border-bottom: 1px solid var(--ink); }
.mark { font: bold 2.6rem/.95 var(--serif); letter-spacing: -.045em; }
.mark span, h1 span { color: var(--red); }
nav, .footline div { display: flex; gap: clamp(1rem, 3vw, 2.8rem); }
nav a, .footline a { padding-block: .65rem; font-size: .88rem; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .3em; }
.hero { display: grid; grid-template-columns: 1.12fr 1fr; gap: 5%; align-items: center; padding-block: clamp(2.8rem, 5.5vw, 5.3rem); }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
h1, h2, .work article h3, .archive h3 { font-family: var(--serif); font-weight: 400; }
.label, .date, dt { font: 600 .72rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .085em; }
.role { display: flex; align-items: center; gap: .7rem; }
.role::before { content: ""; width: 1.8rem; height: 2px; background: var(--red); }
h1 { margin: .24em 0; font-size: clamp(3.6rem, 6.65vw, 6.4rem); line-height: .99; letter-spacing: -.03em; }
h1 em { font-weight: normal; }
.lead { max-width: 41ch; font-size: clamp(1rem, 1.45vw, 1.18rem); color: var(--muted); }
.actions { gap: 1.7rem; margin-top: 1.8rem; }
.button, .text-link { font-weight: 600; font-size: .91rem; }
.button { background: var(--ink); color: var(--paper); padding: .82rem 1.2rem; display: inline-flex; gap: 1.3rem; align-items: center; }
.button:active { transform: scale(.97); }
.text-link, .detail a { text-decoration: underline; text-underline-offset: .32em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.cover { background: #d64729; }
.cover svg { width: 100%; height: auto; display: block; }
.work, .chapter, .archive { border-top: 1px solid var(--ink); }
h2 { font-size: clamp(2.3rem, 4.25vw, 4rem); line-height: 1.08; letter-spacing: -.03em; }
.work { margin-top: clamp(3rem, 6vw, 6rem); }
.work > h2 { padding-block: 1.4rem 1.8rem; }
.bj { display: grid; grid-template-columns: 1.2fr 1fr; gap: 9%; align-items: center; padding: clamp(1.6rem, 5vw, 4.4rem); background: #222923; color: #f6f3eb; }
.bj .label { color: #d6d6be; }
.work article h3 { margin: .28em 0; font-size: clamp(2.4rem, 4.7vw, 4.5rem); line-height: 1.02; letter-spacing: -.03em; }
.work article p:not(.label) { max-width: 53ch; }
.bj .text-link, .feature .text-link { display: inline-block; margin-top: 1.25rem; }
.bj aside { border-left: 1px solid #697165; padding-left: 12%; }
.bj h4 { margin-bottom: 1.3rem; font: italic 1.45rem/1.2 var(--serif); }
dt { color: #d6d6be; }
dd { margin: .25rem 0 1rem; }
.pair, .split { display: grid; gap: 6%; }
.pair { grid-template-columns: repeat(2, minmax(0,1fr)); margin-block: 2.4rem; }
.feature { border-top: 1px solid var(--line); padding-block: 1.3rem 1rem; }
.work .feature h3 { font-size: clamp(2rem, 3.4vw, 3rem); }
.feature details { margin-top: .65rem; }
/* Card largo: texto à esquerda, números à direita */
.feature.wide { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 6%; align-items: end; margin-bottom: 2.4rem; }
.numbers { margin-top: 1.3rem; }
.numbers b { font: 400 clamp(2.3rem,4.4vw,4rem)/1.18 var(--serif); color: var(--red); display: block; letter-spacing: -.03em; }
.numbers { display: flex; gap: 2.5rem; }
.split { grid-template-columns: 1fr 2fr; }
.archive { padding-top: 2rem; }
.archive h3 { font-size: 2.2rem; letter-spacing: -.025em; }
details { border-bottom: 1px solid var(--line); }
summary { display: flex; align-items: baseline; gap: 1rem; padding: 1.05rem .15rem; list-style: none; }
summary::-webkit-details-marker { display: none; }
/* Ícone +/− desenhado com duas barras: a vertical recolhe ao abrir (indica estado em vez de trocar o caractere) */
summary::after {
  content: ""; flex: none; align-self: flex-start; width: .8rem; height: .8rem; margin: .5rem 0 0 auto; color: var(--red);
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
}
details[open] > summary::after { background-size: 100% 2px, 2px 0; transform: rotate(180deg); }
summary strong { font-weight: 550; font-size: 1.15rem; }
summary small, .detail, .chapter p { color: var(--muted); }
summary small { display: block; font-size: .94rem; margin-top: .22rem; }
.detail { padding: 0 2rem 1.25rem .15rem; max-width: 65ch; }
.chapter { margin-top: clamp(3rem, 6vw, 6rem); padding-top: 2rem; }
.services { display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem; margin-block: 2rem; }
.services article, .stack > div { border-top: 1px solid var(--line); padding-top: .75rem; }
.services h3, .stack h3 { font-size: 1.12rem; margin-bottom: .35rem; }
.method { max-width: 70ch; font: italic 1.35rem/1.45 var(--serif); }
.date { min-width: 5rem; color: var(--red); font-variant-numeric: tabular-nums; }
#formacao { margin-top: 1rem; }
.stack { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
footer { margin-top: 5rem; padding: clamp(2.5rem,5vw,5rem) 0 1.5rem; background: var(--ink); color: var(--paper); }
footer h2 { margin: .24em 0 .3em; font-size: clamp(3rem,7vw,6rem); }
footer .pitch { max-width: 52ch; margin-bottom: 1.8rem; color: #c9c9bb; font-size: 1.05rem; }
footer h2 span { color: #ed8c71; }
.channels { gap: 2rem; flex-wrap: wrap; }
.channels > div { display: flex; align-items: center; gap: .65rem; }
.channels a { text-decoration: underline; text-underline-offset: .25em; }
/* Alvo de toque de 44px; os dois rótulos ocupam a mesma célula para a troca não mexer no layout */
.channels button { display: inline-grid; place-items: center; min-height: 2.75rem; padding: .55rem .8rem; color: inherit; background: transparent; border: 1px solid #77796e; font: inherit; font-size: .8rem; }
.channels button > span { grid-area: 1 / 1; }
.channels button [data-done], .channels button.is-copied [data-idle] { opacity: 0; filter: blur(2px); }
.channels button.is-copied [data-done] { opacity: 1; filter: none; }
.channels button:active { transform: scale(.97); }
#feedback { min-height: 2.3rem; margin-top: .45rem; font-size: .9rem; }
.footline { border-top: 1px solid #74766c; padding-top: 1rem; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; }

/* Hover só em dispositivos com mouse: no toque o hover "gruda" depois do tap */
@media (hover: hover) and (pointer: fine) {
  nav a:hover, .footline a:hover, .text-link:hover, .detail a:hover { text-decoration-color: currentColor; }
  .button:hover { background: #383a32; }
  .button:hover span { transform: translate(2px, 2px); }
  summary:hover strong { color: var(--red); }
  .channels button:hover { border-color: #c9c9bb; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Feedback de pressão e hover: rápidos, só transform/opacity/cor */
  .button, .channels button { transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease; }
  .button span { transition: transform 160ms var(--ease-out); }
  nav a, .footline a, .text-link, .detail a { transition: text-decoration-color 150ms ease; }
  summary strong { transition: color 150ms ease; }
  .channels button > span { transition: opacity 200ms ease, filter 200ms ease; }

  /* Acordeões: ícone gira e recolhe; conteúdo entra de leve. Fechar é mais rápido que abrir. */
  summary::after { transition: transform 180ms var(--ease-out), background-size 180ms var(--ease-out); }
  details[open] > summary::after { transition-duration: 250ms; }
  details[open] > .detail { animation: enter 250ms var(--ease-out); }
  @keyframes enter { from { opacity: 0; transform: translateY(-4px); } }

  /* Altura animada onde o navegador suporta (Chrome 131+); nos outros abre instantâneo, como antes */
  @supports (interpolate-size: allow-keywords) {
    :root { interpolate-size: allow-keywords; }
    details::details-content { block-size: 0; overflow: hidden; transition: block-size 180ms var(--ease-out), content-visibility 180ms allow-discrete; }
    details[open]::details-content { block-size: auto; transition-duration: 250ms; }
  }

  /* Entrada do hero: o nome lidera, texto e botões acompanham com intervalos decrescentes,
     a capa só aparece (a "edição digital" chega dentro do SVG). Visto uma vez por visita. */
  .hero .role, .hero h1, .hero .lead, .hero .actions {
    animation: rise var(--dur, 600ms) var(--ease-out) var(--delay, 0ms) both;
  }
  .hero h1 { --rise: 18px; --dur: 700ms; }
  .hero .lead { --rise: 10px; --delay: 100ms; }
  .hero .actions { --rise: 6px; --delay: 170ms; }
  .hero .role { --dur: 500ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(var(--rise, 0)); } }

  /* Tipos móveis: o laranja já está lá (fica parado); os blocos caem no componedor na ordem da
     leitura da prova (l, f, b, p, .), com intervalos decrescentes; depois a prova "imprime". */
  .type-block { animation: drop 560ms var(--ease-out) var(--d, 0ms) both; }
  .type-proof { animation: print 650ms var(--ease-in-out) 560ms both; }
  @keyframes drop { from { opacity: 0; transform: translateY(-36px); } }
  @keyframes print { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
}

/* Movimento reduzido: mesma informação, sem deslocamento nem atraso */
@media (prefers-reduced-motion: reduce) {
  .hero .role, .hero h1, .hero .lead, .hero .actions, .type-block, .type-proof { animation: fade 300ms ease both; }
  .channels button > span { transition: opacity 200ms ease; }
  @keyframes fade { from { opacity: 0; } }
}

@media (max-width: 720px) {
  .hero, .bj, .split, .feature.wide { grid-template-columns: 1fr; gap: 1.6rem; }
  .bj aside { border: 0; border-top: 1px solid #697165; padding: 1.2rem 0 0; }
  .services { grid-template-columns: repeat(2,1fr); }
  .mast-inner { min-height: 60px; }
  .channels { gap: 1rem; }
}
@media (max-width: 530px) {
  .pair, .services, .stack { grid-template-columns: 1fr; gap: 1.1rem; }
  .role { font-size: .65rem; }
  h1 { font-size: clamp(2.6rem, 13.4vw, 3.6rem); }
  .mark { font-size: 2.1rem; }
  nav { gap: .8rem; }
  nav a { font-size: .8rem; }
  .date { min-width: 3.8rem; }
  .channels > div { flex-wrap: wrap; }
}
