/* ============================================================
   mpreto.com — remodelagem "Folha de Spec"
   Papel branco · tinta quente · ocre marcador · redlines azuis
   ============================================================ */

:root {
  /* Cor (OKLCH) — contrastes verificados AA/AAA */
  --bg: oklch(1 0 0);
  --surface: oklch(0.965 0.004 78);
  --surface-2: oklch(0.94 0.006 78);
  --ink: oklch(0.235 0.02 75);            /* 16.7:1 vs bg */
  --muted: oklch(0.47 0.022 75);          /* 6.8:1 vs bg */
  --primary: oklch(0.56 0.125 70);        /* ocre profundo — fills, branco 4.8:1 */
  --primary-deep: oklch(0.49 0.12 69);
  --primary-ink: oklch(0.45 0.115 68);    /* ocre para texto sobre branco 7.6:1 */
  --accent: oklch(0.38 0.075 258);        /* azul-tinta redline 10:1 */
  --honey: oklch(0.93 0.05 85);           /* marca-texto */
  --dark: oklch(0.2 0.018 72);
  --dark-ink: oklch(0.93 0.01 80);
  --dark-muted: oklch(0.76 0.02 78);
  --line: oklch(0.235 0.02 75 / 0.14);
  --line-strong: oklch(0.235 0.02 75 / 0.32);

  /* Tipo — escala fluida, razão ~1.28 */
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.22vw, 1.125rem);
  --step-1: clamp(1.3rem, 1.2rem + 0.55vw, 1.6rem);
  --step-2: clamp(1.7rem, 1.5rem + 1.1vw, 2.3rem);
  --step-3: clamp(2.2rem, 1.85rem + 1.9vw, 3.2rem);
  --step-4: clamp(2.9rem, 2rem + 4.6vw, 5.4rem);

  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;

  /* Espaço */
  --s-1: 0.5rem; --s0: 0.75rem; --s1: 1rem; --s2: 1.5rem;
  --s3: 2rem; --s4: 3rem; --s5: 4rem; --s6: 6rem;
  --section: clamp(4.5rem, 9vw, 8.5rem);

  --r-sm: 4px; --r: 10px; --r-lg: 18px;
  --measure: 68ch;
  --wrap: 74rem;

  /* Z-index semântico */
  --z-sticky: 200; --z-backdrop: 300; --z-menu: 400;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* expo-out */
}

/* ---------- Reset básico ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-deep); }
h1, h2, h3, h4 {
  font-weight: 740;
  font-stretch: 116%;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 var(--s2);
}
h1 { font-size: var(--step-4); font-weight: 790; font-stretch: 122%; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.2; }
p { margin: 0 0 var(--s2); max-width: var(--measure); text-wrap: pretty; }
ul, ol { max-width: var(--measure); padding-left: 1.4rem; margin: 0 0 var(--s2); }
li { margin-bottom: 0.45rem; }
li::marker { color: var(--primary-ink); }
strong { font-weight: 640; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--honey); color: var(--ink); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 3rem); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: calc(var(--z-menu) + 1);
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Utilitários de voz ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.01em;
  font-weight: 400;
}
.mark-pen { /* marca-texto ocre — o gesto da caneta do designer */
  background: linear-gradient(104deg, transparent 0.4em, var(--honey) 0.4em 96%, transparent 96%);
  padding-inline: 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Redline — a anotação de spec (azul-tinta, com ticks) */
.redline {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  margin-block: var(--s2);
  max-width: none;
}
.redline::before, .redline::after {
  content: ""; height: 9px; flex: 1; min-width: 1.5rem;
  background: linear-gradient(currentColor, currentColor) 0 50% / 100% 1px no-repeat;
}
.redline::before {
  flex: 0 0 2.4rem;
  border-left: 1px solid currentColor;
}
.redline::after { border-right: 1px solid currentColor; }
.redline i { font-style: normal; }
.redline b { font-weight: 500; }

/* Tag de projeto */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  white-space: nowrap;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 620; font-size: var(--step-0);
  padding: 0.78rem 1.5rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), background-color 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); color: #fff; transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
.btn .arr { transition: transform 0.25s var(--ease-out); }
.btn:hover .arr { transform: translateX(4px); }

/* Link-seta */
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-weight: 620; text-decoration: none;
}
.link-arrow .arr { transition: transform 0.25s var(--ease-out); }
.link-arrow:hover .arr { transform: translateX(5px); }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: oklch(1 0 0 / 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.site-head.scrolled { border-bottom-color: var(--line); }
.site-head .bar {
  display: flex; align-items: center; gap: var(--s2);
  padding-block: 0.85rem;
}
.brand {
  font-weight: 870; font-stretch: 125%;
  font-size: 1.5rem; line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 0.5rem;
}
.brand:hover { color: var(--ink); }
.brand .dot { color: var(--primary-ink); }
.brand small {
  font-weight: 500; font-stretch: 100%; letter-spacing: 0;
  font-size: var(--step--1); color: var(--muted);
}
.site-nav { margin-left: auto; display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.site-nav a:not(.btn) {
  color: var(--ink); text-decoration: none; font-weight: 540; font-size: var(--step--1);
  border-bottom: 2px solid transparent; padding-block: 0.2rem;
  transition: border-color 0.2s var(--ease-out);
}
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--primary); }
/* Alternador de idioma: não é destino de navegação como os outros itens do menu,
   é um controle que troca a versão da página. Ganha forma de pastilha e um
   marcador do idioma de destino, para não ser lido como "mais uma seção". */
/* precisa de a.lang, e não .lang: .site-nav a:not(.btn) tem especificidade
   maior e o border-bottom transparente dela apagaria a base da pastilha */
.site-nav a.lang {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 400;
  transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.site-nav a.lang::before {
  content: attr(data-code);
  font-weight: 500; letter-spacing: 0.04em;
  color: var(--bg); background: var(--accent);
  border-radius: 3px; padding: 0.05rem 0.3rem; font-size: 0.72em;
}
.site-nav a.lang:hover, .site-nav a.lang:focus-visible { background: var(--surface); border-color: var(--accent); }
.site-nav .btn { padding: 0.5rem 1.05rem; font-size: var(--step--1); }
.menu-btn { display: none; }

/* Menu mobile */
@media (max-width: 800px) {
  /* backdrop-filter criaria containing block e prenderia o menu fixed dentro do header */
  .site-head { backdrop-filter: none; background: var(--bg); }
  .site-nav {
    position: fixed; inset: 0; z-index: var(--z-menu);
    background: var(--bg);
    flex-direction: column; justify-content: center; align-items: flex-start;
    padding: clamp(2rem, 8vw, 4rem);
    gap: 1.6rem;
    transform: translateY(-102%);
    transition: transform 0.45s var(--ease-out);
  }
  body.menu-open .site-nav { transform: translateY(0); }
  body.menu-open { overflow: hidden; }
  .site-nav a:not(.btn) { font-size: var(--step-2); font-weight: 720; font-stretch: 112%; }
  .site-nav .btn { font-size: var(--step-0); padding: 0.78rem 1.5rem; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    margin-left: auto;
    background: none; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    font: inherit; font-size: var(--step--1); font-weight: 600; color: var(--ink);
    padding: 0.45rem 0.9rem; cursor: pointer;
    position: relative; z-index: calc(var(--z-menu) + 1);
  }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(4rem, 10vw, 8rem) var(--section); position: relative; }
.hero .kicker {
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted);
  margin-bottom: var(--s2); display: block;
}
.hero h1 { margin-bottom: var(--s1); max-width: 12ch; }
.hero .role {
  font-size: var(--step-2); font-weight: 480; letter-spacing: -0.01em;
  color: var(--ink); line-height: 1.25; margin-bottom: var(--s2);
}
.hero .lede { color: var(--muted); font-size: var(--step-1); font-weight: 420; max-width: 34ch; line-height: 1.45; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s3); }
.hero-spec {
  position: absolute; right: clamp(1.25rem, 4vw, 3rem); top: clamp(5rem, 12vw, 9rem);
  display: grid; gap: 1.2rem; text-align: right;
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted);
}
.hero-spec span b { color: var(--ink); font-weight: 500; display: block; }
@media (max-width: 900px) { .hero-spec { display: none; } }

/* Entrada orquestrada do hero (só quando .js e sem reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .js .hero [data-rise] {
    opacity: 0; transform: translateY(22px);
    animation: rise 0.9s var(--ease-out) forwards;
  }
  .js .hero [data-rise="1"] { animation-delay: 0.05s; }
  .js .hero [data-rise="2"] { animation-delay: 0.16s; }
  .js .hero [data-rise="3"] { animation-delay: 0.27s; }
  .js .hero [data-rise="4"] { animation-delay: 0.38s; }
  .js .hero [data-rise="5"] { animation-delay: 0.5s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ---------- Seções ---------- */
.section { padding-block: var(--section); }
.section-tight { padding-block: calc(var(--section) * 0.6); }
.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head h2 { margin-bottom: var(--s1); }
.section-head .sub { color: var(--muted); font-size: var(--step-1); font-weight: 420; }

/* ---------- Cards de projeto recente ---------- */
.card-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
}
.card-spec {
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  transition: border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.card-spec:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card-media {
  display: block; /* usado como <a> no carrossel, e <a> e inline por padrao */
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 16 / 10;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.plate-empty {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--muted);
  letter-spacing: 0.04em;
}
.card-meta { font-family: var(--font-mono); font-size: var(--step--1); color: var(--accent); }
.card-spec h3 { font-size: var(--step-1); }
.card-spec > p { color: var(--muted); }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.card-spec > .link-arrow { margin-top: auto; }

/* ---------- Carrossel de projetos anteriores ---------- */
.rail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.rail-nav { display: none; gap: 0.5rem; flex-shrink: 0; }
.js .rail-nav { display: flex; }
.rail-btn {
  width: 2.6rem; height: 2.6rem;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg); color: var(--ink);
  font-size: var(--step-0); cursor: pointer;
  transition: background 0.3s var(--ease-out);
}
.rail-btn:hover { background: var(--surface); }
.rail-btn[aria-disabled="true"] { opacity: 0.3; cursor: default; }
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15rem, 21rem);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s1);
}
.rail > * { scroll-snap-align: start; }
.rail:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .rail { scroll-behavior: smooth; }
}
.card-mini { display: flex; flex-direction: column; gap: var(--s0); }
.card-mini .card-media { aspect-ratio: 4 / 3; }
.card-mini h3 { font-size: var(--step-0); font-weight: 640; }
.card-mini .tag { align-self: flex-start; }

/* ---------- Rodapé ---------- */
.site-foot {
  background: var(--dark); color: var(--dark-ink);
  padding-block: var(--section) var(--s4);
  margin-top: var(--section);
}
.site-foot h2 { color: #fff; max-width: 16ch; }
.site-foot a { color: var(--dark-ink); }
.site-foot a:hover { color: #fff; }
.foot-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s4);
  margin-bottom: var(--s5);
}
.foot-grid .mono { color: var(--dark-muted); display: block; margin-bottom: var(--s1); }
.foot-list { list-style: none; padding: 0; margin: 0; }
.foot-list li { margin-bottom: 0.6rem; }
.foot-list a { text-decoration: none; font-weight: 540; }
.foot-list a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-mail {
  font-size: var(--step-1); font-weight: 640; text-decoration: none;
  border-bottom: 2px solid var(--primary); padding-bottom: 0.15rem;
}
.foot-base {
  border-top: 1px solid oklch(1 0 0 / 0.14);
  padding-top: var(--s2);
  display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3);
  justify-content: space-between;
  color: var(--dark-muted); font-family: var(--font-mono); font-size: var(--step--1);
}
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr; gap: var(--s3); } }

/* ---------- Página Sobre ---------- */
.about-grid {
  display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.about-photo {
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line);
  position: sticky; top: 6rem;
}
.about-photo img { filter: grayscale(1) contrast(1.04); width: 100%; }
.about-photo figcaption {
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted);
  padding: 0.8rem 1rem; border-top: 1px solid var(--line); background: var(--surface);
}
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { position: static; max-width: 26rem; }
}
.skills { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; margin: 0 0 var(--s3); list-style: none; max-width: none; }
.skills li {
  margin: 0; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0.42rem 1rem; font-weight: 540; font-size: var(--step--1);
}
.skills li:nth-child(3n+1) { background: var(--surface); }
.social-row { display: flex; flex-wrap: wrap; gap: var(--s1); margin-bottom: var(--s3); }

/* ---------- Estudo de caso ---------- */
.case-hero { padding-block: clamp(3rem, 7vw, 5.5rem) 0; }
.case-hero .back {
  font-family: var(--font-mono); font-size: var(--step--1);
  text-decoration: none; color: var(--muted); display: inline-flex; gap: 0.4rem;
}
.case-hero .back:hover { color: var(--primary-ink); }
.case-hero h1 { font-size: var(--step-3); max-width: 22ch; margin-top: var(--s2); }
.case-hero .place { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); margin-bottom: var(--s2); }
.case-hero .summary { font-size: var(--step-1); font-weight: 430; color: var(--ink); max-width: 46ch; line-height: 1.5; }

/* faixa de spec: Função / Prazo / Equipe */
.spec-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  border-block: 1px solid var(--line);
  margin-block: var(--s4);
}
.spec-strip > div { padding: 1.1rem 0; border-left: 1px solid var(--line); padding-left: var(--s2); }
.spec-strip > div:first-child { border-left: 0; padding-left: 0; }
.spec-strip .mono { color: var(--accent); display: block; margin-bottom: 0.3rem; }
.spec-strip strong { font-size: var(--step-1); font-weight: 700; font-stretch: 112%; letter-spacing: -0.01em; }
@media (max-width: 640px) {
  .spec-strip { grid-template-columns: 1fr; border: 0; border-top: 1px solid var(--line); }
  .spec-strip > div { border-left: 0; padding-left: 0; border-bottom: 1px solid var(--line); }
}

.case-body { display: grid; gap: var(--s3); }
.case-body h2 { font-size: var(--step-2); margin: var(--s4) 0 var(--s1); scroll-margin-top: 6rem; }
.case-body h3 { font-size: var(--step-1); margin: var(--s2) 0 var(--s0); }
.case-figure { margin: var(--s2) 0; max-width: none; }
.case-figure img {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); width: 100%; object-fit: contain;
}
.case-figure figcaption {
  font-family: var(--font-mono); font-size: var(--step--1);
  color: var(--muted); margin-top: 0.6rem;
}
.figure-row { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: var(--s2) 0; }
.figure-row figure { margin: 0; }
/* pranchas uniformes: imagens de proporções variadas em células iguais */
.figure-row.plates img {
  aspect-ratio: 3 / 4; width: 100%; object-fit: contain;
  background: var(--surface); padding: 0.75rem;
}
/* screenshots de sites: recorte uniforme pelo topo */
.figure-row.uniform img {
  aspect-ratio: 16 / 10; width: 100%; object-fit: cover; object-position: top;
}
.figure-pair { display: grid; gap: var(--s2); grid-template-columns: 1fr 1fr; align-items: start; margin: var(--s2) 0; }
@media (max-width: 640px) { .figure-pair { grid-template-columns: 1fr; } }

/* Antes / Depois */
.ba-label {
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--accent);
  display: block; margin-bottom: 0.5rem;
}

/* Resultados */
.results { border-top: 1px solid var(--line); margin-top: var(--s4); }
.results li { margin-bottom: 0.8rem; }
.note {
  font-size: var(--step--1); color: var(--muted); font-style: italic;
  border-top: 1px solid var(--line); padding-top: var(--s2); margin-top: var(--s4);
  max-width: var(--measure);
}

/* Navegação entre projetos */
.case-nav {
  display: flex; justify-content: space-between; gap: var(--s2);
  border-top: 1px solid var(--line); margin-top: var(--s5); padding-top: var(--s3);
}
.case-nav a { text-decoration: none; max-width: 45%; }
.case-nav .mono { color: var(--muted); display: block; margin-bottom: 0.3rem; }
.case-nav strong { font-size: var(--step-1); font-weight: 700; font-stretch: 112%; letter-spacing: -0.01em; }
.case-nav .next { text-align: right; margin-left: auto; }
.case-nav strong { overflow-wrap: anywhere; }
@media (max-width: 640px) { .case-nav strong { font-size: var(--step-0); } }

/* ---------- Reveal on scroll (progressivo: base visível) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
  .js [data-reveal].in { opacity: 1; transform: none; }
}

/* ---------- Ampliar imagem ----------
   O <a> aponta para o arquivo da imagem: sem JavaScript, clicar abre a imagem
   em tamanho real. Com JavaScript, o main.js intercepta e abre no <dialog>. */
.zoom { display: block; position: relative; cursor: zoom-in; }
.zoom::after {
  content: "⤢";
  position: absolute; right: 0.6rem; bottom: 0.6rem;
  width: 1.9rem; height: 1.9rem;
  display: grid; place-items: center;
  background: var(--dark); color: var(--dark-ink);
  border-radius: 999px; font-size: 0.85rem; line-height: 1;
  opacity: 0; transition: opacity 0.25s var(--ease-out);
}
.zoom:hover::after, .zoom:focus-visible::after { opacity: 0.9; }
.zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.lightbox {
  border: 0; padding: 0; background: transparent;
  max-width: min(94vw, 62rem); max-height: 94vh;
  overflow: visible;
}
/* ::backdrop não herda as custom properties do :root em todos os navegadores */
.lightbox::backdrop { background: rgb(27 21 13 / 0.9); }
.lightbox img {
  display: block; width: 100%; height: auto; max-height: 88vh;
  object-fit: contain;
  background: var(--bg); border-radius: var(--r);
}
.lightbox-close {
  position: absolute; top: -0.9rem; right: -0.9rem;
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--bg); color: var(--ink);
  font-size: var(--step-0); cursor: pointer;
}
.lightbox-close:hover { background: var(--surface); }
@media (max-width: 600px) {
  .lightbox-close { top: -0.7rem; right: -0.2rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lightbox-in 0.28s var(--ease-out); }
  @keyframes lightbox-in { from { opacity: 0; transform: scale(0.97); } }
}

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

@media print {
  .site-head, .site-foot, .cta-row { display: none; }
}
