/* betoandrade.com — celular primeiro (390px), computador a partir de 768/1024px.
   Fundo = cor mediana da parede nas fotos (#c0bfb8), para a obra parecer estar na página,
   não num recorte. Um tema só: no escuro, a parede das fotos virava moldura clara. */
:root {
  --paper: #c2c0b9;
  --ink: #171614;        /* 10:1 sobre --paper */
  --muted: #45433e;      /* 5,4:1 sobre --paper */
  --line: #a9a79f;
  --accent: #d9561f;     /* só detalhes, nunca texto */
  --btn: #171614;
  --btn-ink: #ecebe6;
  --gutter: 16px;
  --max: 1440px;
  color-scheme: light;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1200px) { :root { --gutter: 48px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga";
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; padding: 12px 16px; background: var(--btn); color: var(--btn-ink); z-index: 10; }
.skip:focus { top: 8px; }
.small { font-size: .875rem; color: var(--muted); }

/* ---------- topo ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  min-height: 56px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.name { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; margin-left: -2px; transition: opacity 150ms ease; }
.name:active { opacity: .6; }
.sig { display: block; height: 34px; width: auto; aspect-ratio: 80.5 / 30.5; }
@media (min-width: 1024px) { .sig { height: 40px; } }
.top nav { display: flex; gap: 4px; margin-right: -10px; }
.top nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  text-decoration: none; font-size: .9375rem; color: var(--muted);
  transition: color 150ms ease;
}
.top nav a[aria-current] { color: var(--ink); }
.top nav a:active { color: var(--ink); opacity: .6; }
@media (hover: hover) { .top nav a:hover { color: var(--ink); } }

main { display: block; }

/* ---------- abertura ---------- */
.intro { padding: 32px var(--gutter) 40px; max-width: var(--max); margin: 0 auto; }
.lead {
  margin: 0; max-width: 16ch;
  font-size: clamp(2.25rem, 9.5vw, 5.5rem); line-height: 1; letter-spacing: -.035em; font-weight: 500;
}
.lead-rest { margin: 20px 0 0; max-width: 38ch; font-size: 1.125rem; line-height: 1.45; color: var(--muted); }
.more { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; white-space: nowrap; }
@media (min-width: 768px) {
  .intro { padding-top: 72px; padding-bottom: 96px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px; align-items: end; }
  .lead-rest { margin: 0; font-size: 1.1875rem; }
}

/* ---------- grades ---------- */
.works { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 64px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid var(--ink); padding: 12px 0 24px; }
.sec-head h2 { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: .01em; }
.sec-head p { margin: 0; font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: dense; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
.grid-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 12px; }
@media (min-width: 768px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 32px; } .grid-sm { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 72px 40px; } .grid-sm { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* Par ocupa duas colunas: as duas peças lado a lado, do mesmo tamanho que as vizinhas. */
.tile.pair { grid-column: span 2; }
.grid-sm .tile.pair { grid-column: span 2; }
.tile a { display: block; text-decoration: none; -webkit-tap-highlight-color: transparent; }
/* Cada obra pousa no fundo de uma caixa de mesma proporção: as legendas ficam alinhadas
   e o tamanho relativo entre papel e tela aparece. */
.pics { display: flex; gap: 16px; align-items: flex-end; }
.pic { flex: 1 1 0; min-width: 0; aspect-ratio: 4 / 5; display: flex; align-items: flex-end; justify-content: center; }
.grid-sm .pic { aspect-ratio: 1; }
.pic img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: opacity 200ms ease, transform 200ms ease; }
.tile a:active .pic img { opacity: .8; transform: scale(.99); }
@media (hover: hover) { .tile a:hover .pic img { opacity: .88; } .tile a:hover .t-main { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; } }
@media (prefers-reduced-motion: reduce) { .pic img { transition: none; } .tile a:active .pic img { transform: none; } }

.cap { display: block; padding-top: 10px; font-size: .875rem; line-height: 1.3; }
.cap-title { display: block; }
.cap-title + .cap-title { margin-top: 4px; }
.cap-meta { display: block; margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.grid-sm .cap { font-size: .8125rem; }

/* O parêntese do título é a letra miúda. */
.t-fine { color: var(--muted); }

/* ---------- obra ---------- */
.work { max-width: var(--max); margin: 0 auto; padding: 8px var(--gutter) 48px; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-size: .9375rem; color: var(--muted); text-decoration: none; }
.back:active { color: var(--ink); }
@media (hover: hover) { .back:hover { color: var(--ink); } }

.fronts { display: flex; gap: 8px; align-items: flex-end; margin: 8px calc(-1 * var(--gutter)) 0; }
.fronts .front { margin: 0; flex: 1 1 0; min-width: 0; }
.fronts.n1 .front img { margin: 0 auto; max-height: 82svh; width: auto; }
.zoom { display: block; cursor: zoom-in; }

.info { padding-top: 24px; }
.kicker { margin: 0 0 8px; font-size: .875rem; color: var(--muted); }
.pair-title { margin: 0 0 24px; font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em; font-weight: 500; }
.pair-title span { display: block; }
.pair-title > span + span { margin-top: 6px; }
.facts + .facts { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.facts-title { margin: 0 0 16px; font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em; font-weight: 500; }
h1.facts-title { font-size: clamp(1.875rem, 7vw, 2.75rem); }
.is-pair .facts-title { font-size: 1.5rem; }
.facts-title .t-fine { display: block; margin-top: 4px; }
.facts dl { margin: 0; }
.facts dl div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9375rem; }
.facts dl div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 28px; margin-top: 20px;
  background: var(--btn); color: var(--btn-ink); text-decoration: none; font-weight: 500; border-radius: 2px;
  transition: opacity 150ms ease, transform 150ms ease;
}
.btn:active { opacity: .75; transform: translateY(1px); }
@media (hover: hover) { .btn:hover { opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }

.views { margin-top: 56px; }
.views-note { margin: 0 0 16px; max-width: 40ch; font-size: 1.125rem; line-height: 1.4; }
.strip {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 8px; scroll-padding: 0 var(--gutter);
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
/* As vistas laterais nunca são cortadas: mesma altura, largura natural. */
.strip figure { margin: 0; flex: 0 0 auto; scroll-snap-align: start; }
.strip img { height: min(62svh, 520px); width: auto; max-width: 86vw; object-fit: contain; }
.strip figcaption { padding-top: 8px; font-size: .8125rem; color: var(--muted); }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; border-top: 1px solid var(--ink); }
.pn a { display: block; padding: 14px 0; text-decoration: none; font-size: .875rem; line-height: 1.3; min-height: 44px; }
.pn a[rel=next] { text-align: right; }
.pn .small { display: block; margin-bottom: 4px; }
.pn a:active { opacity: .6; }
@media (hover: hover) { .pn a:hover .t-main { text-decoration: underline; text-underline-offset: 3px; } }

@media (min-width: 1024px) {
  .work-main { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 56px; align-items: end; }
  .fronts { margin: 8px 0 0; gap: 16px; }
  .fronts.n1 .front img { max-height: calc(100svh - 140px); margin: 0; }
  .info { padding: 0 0 8px; }
  .strip { margin: 0; padding: 0 0 8px; flex-wrap: wrap; gap: 24px; overflow: visible; }
  .strip img { height: min(56svh, 560px); max-width: 100%; }
}

/* ---------- sobre ---------- */
.about { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 64px; }
.about section { border-top: 1px solid var(--ink); padding: 12px 0 48px; }
.label { margin: 0 0 20px; font-size: 1rem; font-weight: 600; }
.prose { max-width: 36em; }
.prose p { margin: 0 0 1em; }
.prose .lead { max-width: 20ch; margin-bottom: 32px; font-size: clamp(1.875rem, 7vw, 3.5rem); line-height: 1.05; }
.prose a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (min-width: 1024px) {
  .about section { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 32px; }
  .prose { font-size: 1.1875rem; }
}

/* ---------- rodapé ---------- */
.foot { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) calc(32px + env(safe-area-inset-bottom)); }
.contact { list-style: none; margin: 0 0 24px; padding: 0; }
.contact li { border-top: 1px solid var(--ink); }
.contact li:last-child { border-bottom: 1px solid var(--line); }
.contact a { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; text-decoration: none; overflow-wrap: anywhere; }
.contact a span { color: var(--muted); font-size: .875rem; flex: none; }
.contact a:active { opacity: .6; }
@media (hover: hover) { .contact a:hover { text-decoration: underline; text-underline-offset: 3px; } }
@media (min-width: 768px) {
  .contact { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
  .contact li:last-child { border-bottom: 0; }
}

.nf { max-width: var(--max); margin: 0 auto; padding: 64px var(--gutter) 96px; }
.nf h1 { margin: 0 0 12px; font-size: clamp(2.25rem, 9vw, 4rem); letter-spacing: -.03em; font-weight: 500; }

/* A borda de cada foto se dissolve no fundo: as paredes variam de tom de uma foto para outra
   (#9c9997 a #dddddc) e a margem do recorte some em vez de virar moldura. */
.pic img, .fronts img, .strip img {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect;
}

/* =================== página-história (início) =================== */
/* Troca de página suave entre documentos (Chrome/Safari recentes); sem suporte, troca normal. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 220ms; }

/* Cabeçalho flutua sobre a capa e ganha fundo depois dela. */
.story .top { position: fixed; left: 0; right: 0; transition: background-color 200ms ease, backdrop-filter 200ms ease; }
.story .top.on-cover { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (prefers-reduced-motion: reduce) { .story .top { transition: none; } }

.bleed, .bleed img { display: block; width: 100%; height: 100%; }
.bleed img { object-fit: cover; max-width: none; }

/* ---- capa ---- */
.cover { position: relative; height: 100svh; min-height: 560px; overflow: hidden; }
.cover .bleed { position: absolute; inset: 0; }
.cover-text {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 96px var(--gutter) calc(72px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, color-mix(in srgb, var(--paper) 92%, transparent) 30%, transparent);
}
.eyebrow { margin: 0 0 12px; font-size: .875rem; color: var(--muted); }
.cover h1 {
  margin: 0; max-width: 13ch;
  font-size: clamp(2.5rem, 11vw, 7.5rem); line-height: .95; letter-spacing: -.045em; font-weight: 500;
}
.cue {
  position: absolute; left: var(--gutter); bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; color: var(--muted); text-decoration: none;
}
@media (min-width: 768px) and (min-aspect-ratio: 4/5) {
  /* O título fica na parede, à esquerda da moldura (a obra começa em ~30% da largura). */
  .cover-text { right: auto; width: 29vw; background: none; padding-bottom: 88px; }
  .cover h1 { font-size: clamp(2.5rem, 4.6vw, 5rem); }
  .cover::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; pointer-events: none;
    background: linear-gradient(to top, color-mix(in srgb, var(--paper) 70%, transparent), transparent); }
  .cover-text, .cue { z-index: 1; }
}

/* ---- statement ---- */
.thesis { max-width: var(--max); margin: 0 auto; padding: 120px var(--gutter) 160px; }
.thesis p { margin: 0; }
.thesis .big { font-size: clamp(1.875rem, 7.4vw, 4.75rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 500; max-width: 20ch; }
.thesis .big + .big { margin-top: .6em; }
.thesis .mid { margin-top: 64px; max-width: 30ch; font-size: clamp(1.25rem, 4.6vw, 2.25rem); line-height: 1.2; letter-spacing: -.02em; }
.thesis .mid + .mid { margin-top: 32px; }
@media (min-width: 1024px) { .thesis .mid { margin-left: 41.6%; } }

/* ---- capítulos: imagem presa na tela, texto passa por cima ---- */
.chapter { position: relative; }
.ch-media { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.ch-media .bleed img { will-change: transform; }
.ch-text {
  position: relative; z-index: 1;
  margin: -28svh var(--gutter) 0; padding: 28px 24px 32px;
  background: var(--paper);
  max-width: 34rem;
}
.chapter + .chapter, .chapter + .squircle, .squircle + .chapter, .chapter + .sides, .sides + .chapter { margin-top: 0; }
.chapter { padding-bottom: 18svh; }
.ch-num { margin: 0 0 20px; font-size: .875rem; color: var(--muted); display: flex; gap: 12px; align-items: baseline; }
.ch-num span { font-variant-numeric: tabular-nums; color: var(--ink); }
.ch-q { margin: 0; font-size: clamp(1.875rem, 7.4vw, 3.5rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 500; }
.ch-body { margin: 20px 0 0; font-size: 1.0625rem; line-height: 1.5; color: var(--ink); max-width: 36ch; }
.ch-link, .side-end {
  display: inline-flex; align-items: center; gap: .35em; min-height: 44px; margin-top: 12px;
  font-size: .9375rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.ch-link:active, .side-end:active { opacity: .6; }
.enter {
  display: flex; align-items: center; justify-content: space-between; min-height: 64px; margin-top: 28px; padding: 0 20px;
  background: var(--btn); color: var(--btn-ink); text-decoration: none; font-size: 1.25rem; font-weight: 500; border-radius: 2px;
  transition: opacity 150ms ease, transform 150ms ease;
}
.enter:active { opacity: .75; transform: translateY(1px); }
@media (hover: hover) { .enter:hover { opacity: .88; } .ch-link:hover, .side-end:hover { text-decoration-thickness: 2px; } }
@media (prefers-reduced-motion: reduce) { .enter { transition: none; } .enter:active { transform: none; } }
.closing .enter + .ch-link { margin-top: 8px; }
@media (min-width: 1024px) {
  .ch-text { margin: -24svh 0 0 var(--gutter); padding: 36px 40px 40px; max-width: 34rem; }
  .chapter:nth-of-type(even) .ch-text { margin-left: auto; margin-right: var(--gutter); }
  .ch-body { font-size: 1.1875rem; }
}

/* ---- squircle ---- */
.squircle { position: relative; }
.sq-stage { height: 100svh; display: grid; place-items: center; padding: 0 var(--gutter); position: relative; }
.sq-svg { width: min(72vmin, 520px); height: auto; overflow: visible; }
.sq-path { fill: none; stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.sq-text {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(40px + env(safe-area-inset-bottom));
  margin: 0 auto; max-width: 30ch; text-align: center; font-size: clamp(1.125rem, 4.4vw, 1.625rem); line-height: 1.25; letter-spacing: -.015em;
}

/* ---- laterais ---- */
.sides { padding: 96px 0 72px; overflow: hidden; }
.sides-head { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 40px; }
.sides-head .ch-q { max-width: 16ch; }
.sides-track {
  display: flex; align-items: flex-end; gap: 24px; width: max-content;
  padding: 0 var(--gutter);
}
html:not(.anim) .sides { overflow: visible; }
html:not(.anim) .sides-track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.side-fig { margin: 0; flex: none; scroll-snap-align: start; }
.side-fig img { height: min(58svh, 620px); width: auto; max-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect; }
.side-fig figcaption { padding-top: 8px; font-size: .8125rem; color: var(--muted); }
.side-end { flex: none; align-self: center; margin: 0 var(--gutter) 0 24px; font-size: 1.25rem; }
@media (min-width: 1024px) {
  .sides-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: end; }
  .sides-head .ch-num { grid-column: 1 / -1; margin: 0; }
  .sides-head .ch-body { margin: 0; }
}
/* Com animação, a seção fica presa e a faixa corre de lado; precisa caber na altura da tela. */
html.anim .sides { height: 100svh; padding: 72px 0 32px; display: flex; flex-direction: column; justify-content: center; }
html.anim .sides-head { padding-bottom: 24px; }
html.anim .side-fig img { height: min(48svh, 560px); }

/* Tela em pé (celular): a imagem fica no alto, na proporção dela, e se dissolve no fundo.
   Esticar a foto até a altura da tela cortaria a obra. */
.bleed { position: relative; }
@media (max-aspect-ratio: 4/5) {
  .bleed, .bleed img { height: auto; }
  .bleed img { object-fit: contain; }
  .bleed::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; pointer-events: none;
    background: linear-gradient(to top, var(--paper), transparent); }
  .cover { height: auto; min-height: 100svh; display: flex; flex-direction: column; }
  .cover .bleed { position: relative; inset: auto; }
  .cover-text { position: relative; background: none; padding: 0 var(--gutter) 88px; margin-top: -24px; }
  /* No celular a imagem não fica presa: a obra aparece inteira e o texto vem logo abaixo. */
  .ch-media { position: relative; height: auto; }
  .ch-text { margin: -32px 0 0; padding: 0 var(--gutter) 8px; max-width: none; background: none; }
  .chapter { padding-bottom: 72px; }
  .cover-text { flex: 1; }
}
/* Transição de CSS no mesmo atributo que o GSAP anima trava a entrada do botão. */
html.anim .enter { transition: none; }

/* ---------- obras anteriores (2018–2022) ---------- */
.earlier-note { max-width: 36rem; margin: -8px 0 32px; color: var(--muted); font-size: .9375rem; }
.grid-old .old a { display: block; border-radius: 2px; transition: opacity 150ms ease; }
.grid-old .old a:active { opacity: .7; }
.grid-old .old a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.grid-old .old img { display: block; width: 100%; height: auto; }
.grid-old .old.wide { grid-column: span 2; }
.grid-old .cap { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 0; font-size: .875rem; }
.grid-old .cap-title { font-weight: 500; }
.grid-old .cap-meta { color: var(--muted); }
.chapter .ch-link + .ch-link { margin-left: 20px; }

/* ---------- tons de fundo da página-história ----------
   Só cores da paleta: paper #c2c0b9, ink #171614, branco quente #ecebe6 (--btn-ink), cinza #a9a79f (--line).
   Sem animação: cada seção pinta o próprio fundo. Com animação: o fundo da página inteira
   muda suavemente para o tom do capítulo que está na tela. */
@property --paper { syntax: "<color>"; inherits: true; initial-value: #c2c0b9; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #171614; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #45433e; }
.tone-ink, html:not(.anim) .story [data-tone="ink"] { --paper: #171614; --ink: #ecebe6; --muted: #a9a79f; --line: #45433e; }
.tone-white, html:not(.anim) .story [data-tone="white"] { --paper: #ecebe6; --ink: #171614; --muted: #45433e; }
html:not(.anim) .story [data-tone] { background: var(--paper); color: var(--ink); }
html.anim body.story { transition: --paper 700ms ease, --ink 700ms ease, --muted 700ms ease; }
@media (prefers-reduced-motion: reduce) { body.story { transition: none; } }
.story .ch-text { transition: none; }

/* SplitText corta as linhas com uma máscara: folga embaixo para g, y, p, j, q */
.split > div { padding-bottom: .16em; margin-bottom: -.16em; }

/* ---------- adornos: colchetes, chaves e fórmulas de equilíbrio ----------
   Traço fino na cor de apoio, sempre atrás do conteúdo. Nunca mais forte que o texto. */
.ch-num { align-items: center; }
.ch-num .n { display: inline-flex; align-items: center; gap: 3px; }
.ch-num .n-d { font-variant-numeric: tabular-nums; color: var(--ink); }
.brk { width: .55em; height: 1.6em; overflow: visible; }
.brk.r { transform: scaleX(-1); }
.brk path, .brace path, .lever path, .lever circle {
  fill: none; stroke: var(--muted); stroke-width: 1.4; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-linejoin: round;
}
.thesis { position: relative; }
.brace { display: none; }
.formula {
  position: absolute; margin: 0; pointer-events: none; white-space: nowrap;
  font: italic 400 clamp(1.25rem, 2vw, 1.75rem)/1 "Iowan Old Style", "Palatino", Georgia, serif; letter-spacing: .02em;
  color: var(--muted); opacity: .85;
}
.formula i { font-style: italic; }
.thesis .formula { display: none; }
.thesis .f1 { display: block; top: 56px; right: var(--gutter); }
.sq-stage .formula { font-size: clamp(1.25rem, 3.4vw, 1.75rem); }
.sq-stage .c1 { top: 24%; left: var(--gutter); }
.sq-stage .c2 { top: 74%; right: var(--gutter); }
@media (min-width: 1024px) { .sq-stage .c1 { left: 18%; } .sq-stage .c2 { right: 18%; } }
.lever { margin: 104px 0 0; width: min(380px, 86vw); }
.lever svg { display: block; width: 100%; height: auto; overflow: visible; }
.lever figcaption {
  margin-top: 14px; text-align: center; color: var(--muted); opacity: .9;
  font: italic 400 1.25rem/1 "Iowan Old Style", "Palatino", Georgia, serif; letter-spacing: .02em;
}
@media (min-width: 1024px) {
  .brace { display: block; position: absolute; top: 104px; height: min(720px, 76svh); width: 40px; left: 4px; opacity: .85; }
  .brace.r { left: auto; right: 4px; transform: scaleX(-1); }
  .thesis .formula { display: block; }
  .thesis .f1 { top: 22%; right: 7%; }
  .thesis .f2 { top: 58%; right: 16%; }
  .lever { margin: 112px 0 0 41.6%; }
}

/* ---------- filtro por material (/work/) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: -12px 0 28px; }
.filters button {
  appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 6px; min-height: 44px; align-items: center;
  font: inherit; font-size: .9375rem; color: var(--muted);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; text-decoration-thickness: 1px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
.filters .f-n { font-size: .75rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.filters button[aria-pressed="true"] { color: var(--ink); text-decoration-color: var(--ink); }
.filters button:active { opacity: .6; }
.filters button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) { .filters button:hover { color: var(--ink); } }
.grid > li[hidden] { display: none; }
.grid > li.in { animation: tile-in 220ms ease both; }
@keyframes tile-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .filters button { transition: none; } .grid > li.in { animation: none; } }
.filters[hidden] { display: none; }

/* fórmula do artista no fechamento: x < {∞} > 0 */
.xf {
  display: flex; align-items: baseline; gap: .12em; margin: 0 0 28px;
  font: 400 clamp(2.25rem, 9vw, 3.5rem)/1 "Iowan Old Style", "Palatino", Georgia, serif;
  color: var(--muted); letter-spacing: 0;
}
.xf span { display: inline-block; }
.xf-x { font-style: italic; }
.xf-l, .xf-r { font-weight: 300; transform: scaleY(1.15); }
.xf-inf { color: var(--ink); padding: 0 .04em; }

/* aviso: moldura das obras em papel é ilustrativa */
.frame-note { margin: -16px 0 32px; max-width: 40rem; font-size: .8125rem; line-height: 1.4; color: var(--muted); }
.filters[hidden] + .frame-note { margin-top: 0; }

/* ---------- página da obra: barra do topo com Anterior / Próxima ---------- */
.work-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.steps { display: flex; gap: 4px; margin-right: -10px; }
.step { display: inline-flex; align-items: center; gap: .35em; min-height: 44px; padding: 0 10px; font-size: .9375rem; color: var(--ink); text-decoration: none; transition: opacity 150ms ease; }
.step:active { opacity: .6; }
.step.off { color: var(--line); }
@media (hover: hover) { .step:not(.off):hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; } }

/* parágrafo sobre o tema da obra */
.about-work { margin: 0 0 24px; max-width: 38ch; font-size: 1.0625rem; line-height: 1.55; }
@media (min-width: 1024px) { .about-work { font-size: 1.125rem; } }

/* ---------- imagem ampliada ---------- */
html.viewer-open { overflow: hidden; }
.viewer {
  position: fixed; inset: 0; width: 100vw; height: 100svh; max-width: none; max-height: none;
  margin: 0; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); border: 0;
  background: var(--paper); color: var(--ink);
  display: grid; grid-template-rows: auto 1fr auto;
}
.viewer:not([open]) { display: none; }
.viewer::backdrop { background: var(--paper); }
.viewer[open] { animation: v-in 180ms ease both; }
@keyframes v-in { from { opacity: 0; } to { opacity: 1; } }
.v-top, .v-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 var(--gutter); min-height: 56px; }
.v-count { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.viewer button {
  appearance: none; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 44px; min-width: 44px; padding: 0 10px;
  transition: opacity 150ms ease;
}
.viewer button:active { opacity: .6; }
.viewer button:disabled { color: var(--line); cursor: default; }
.viewer button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.v-close { margin-right: -10px; font-size: .9375rem; }
.v-prev, .v-next { font-size: 1.375rem; }
.v-prev { margin-left: -10px; } .v-next { margin-right: -10px; }
.v-fig { margin: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 var(--gutter); }
.v-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; touch-action: pan-y; user-select: none; -webkit-user-drag: none; }
.v-cap { margin: 0; flex: 1; text-align: center; font-size: .875rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .viewer[open] { animation: none; } .viewer button, .step { transition: none; } }

/* janelas médias deitadas (768–1023px): puxa a moldura para a direita para o título caber na parede */
@media (min-width: 768px) and (max-width: 1023px) and (min-aspect-ratio: 4/5) {
  .cover .bleed img { object-position: 22% 50% !important; }
  .cover-text { width: 31vw; }
  .cover h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
}
