/* Programa Arquitetura: site modelo
   Mesa de maquete: papel claro, gesso, grafite e um verde-musgo escuro só para o que está escolhido.
   papel #f3f2ee  tinta #1f2421  tinta-2 #5d645f  linha #d8d6cf  musgo #3d5a4c  alerta #a2452e  noite #222a26
   Contraste (WCAG): tinta/papel 15.0, tinta-2/papel 5.9, musgo/papel 7.4, alerta/papel 5.6, papel/noite 13.4 */
:root {
  --papel: #f3f2ee;
  --papel-2: #ebe9e3;
  --tinta: #1f2421;
  --tinta-2: #5d645f;
  --tinta-3: #8b918c;
  --linha: #d8d6cf;
  --musgo: #3d5a4c;
  --alerta: #a2452e;
  --noite: #222a26;
  --margem: clamp(1.1rem, 4vw, 3.6rem);
  --serifa: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --curva: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font-family: var(--sans); font-weight: 400; font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, dl, dd, ol, ul, figure, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
img, svg { display: block; }
img { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--musgo); outline-offset: 3px; }
.num, output, .numero, .legenda b { font-variant-numeric: lining-nums tabular-nums; }

.pular { position: absolute; left: 1rem; top: -4rem; z-index: 20; background: var(--tinta); color: var(--papel); padding: .6rem 1rem; }
.pular:focus { top: 1rem; }

h1, h2.titulo, .projetos h2, .processo h2, .sobre h2, .contato h2 {
  font-family: var(--serifa); font-weight: 300; letter-spacing: -.01em; line-height: 1.02;
}
figcaption { font-size: .78rem; color: var(--tinta-3); padding-top: .45rem; }

/* ---------- topo ---------- */
.topo { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.2rem var(--margem); border-bottom: 1px solid var(--linha); }
.marca { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; }
.marca svg { width: 22px; height: 22px; align-self: center; fill: none; stroke: var(--tinta); stroke-width: 1.5; }
.marca-nome { font-family: var(--serifa); font-size: 1.55rem; font-weight: 500; line-height: 1; }
.marca-sub { font-size: .85rem; color: var(--tinta-2); font-weight: 300; }
.menu { display: flex; gap: clamp(1rem, 2.6vw, 2.4rem); font-size: .9375rem; }
.menu a { text-decoration: none; color: var(--tinta-2); padding: .3rem 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.menu a:hover { color: var(--tinta); border-color: var(--tinta); }

/* ---------- gerador ---------- */
.gerador { padding: clamp(1.6rem, 3.2vw, 2.8rem) var(--margem) clamp(3.5rem, 7vw, 6rem); }
.gerador-cabeca { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.4rem clamp(2rem, 6vw, 6rem); align-items: end; margin-bottom: clamp(1.4rem, 2.6vw, 2.2rem); }
h1 { font-size: clamp(2.6rem, 4.6vw, 4.3rem); max-width: 13em; }
.gerador-cabeca p { color: var(--tinta-2); font-weight: 300; max-width: 44ch; }

.gerador-corpo { display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 28vw, 410px); gap: clamp(1.6rem, 3.5vw, 3.2rem); align-items: start; }
.palco-wrap { position: sticky; top: 1rem; display: grid; gap: .9rem; }
.palco {
  position: relative; height: min(calc(100vh - 7rem), 760px); min-height: 460px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #f8f7f4 0%, #eeede8 62%, #e4e2db 100%);
  border: 1px solid var(--linha);
}
.palco canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.palco canvas:active { cursor: grabbing; }
.rotulos-3d { position: absolute; inset: 0; pointer-events: none; }
.rotulo-3d {
  font: 400 11px/1.2 var(--sans); letter-spacing: .02em; color: var(--tinta);
  background: rgba(243, 242, 238, .78); padding: 2px 6px; white-space: nowrap;
}
.rotulo-alerta { color: #fff; background: rgba(162, 69, 46, .9); }
.palco-nota {
  position: absolute; left: 1rem; right: 1rem; bottom: .8rem; display: flex; justify-content: space-between; gap: 1rem;
  font-size: .8125rem; color: var(--tinta-2); pointer-events: none;
}
.sem-3d-aviso { display: none; }
.palco.sem-3d .sem-3d-aviso { display: block; position: absolute; inset: auto 1.5rem 50% 1.5rem; text-align: center; color: var(--tinta-2); }

.legenda { display: flex; flex-wrap: wrap; gap: .5rem 1.8rem; font-size: .8125rem; color: var(--tinta-2); }
.legenda li { display: flex; align-items: center; gap: .5rem; }
.legenda img { width: 18px; height: 18px; object-fit: cover; }
.leg-piso { color: var(--tinta); }
.leg-tipos { color: var(--tinta-3); }
.legenda b { font-weight: 500; color: var(--tinta); }
.amostra-fora { width: 18px; height: 18px; background: #b4583f; }
.leg-fora .leg-piso { color: var(--alerta); }

/* painel: controles finos, uma linha por escolha */
.controles { border-top: 1px solid var(--tinta); }
.campo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.1rem; padding: .45rem 0; border-bottom: 1px solid var(--linha); }
.rotulo { font-size: .9688rem; }
.rotulo small { display: block; font-size: .78rem; color: var(--tinta-3); font-weight: 300; line-height: 1.2; }
.passo { display: inline-flex; align-items: stretch; border: 1px solid var(--tinta-3); }
.passo button { width: 32px; height: 30px; display: grid; place-items: center; transition: background .15s; }
.passo button:hover:not(:disabled) { background: var(--papel-2); }
.passo button:disabled { opacity: .3; cursor: default; }
.passo svg { width: 11px; height: 11px; stroke: var(--tinta); stroke-width: 1.2; fill: none; }
.passo output { min-width: 2.4rem; display: grid; place-items: center; border-inline: 1px solid var(--linha); font-size: .9375rem; }

.chave { position: relative; cursor: pointer; }
.chave input { position: absolute; opacity: 0; right: 0; width: 36px; height: 20px; margin: 0; cursor: pointer; }
.chave-trilho { width: 36px; height: 18px; border: 1px solid var(--tinta-3); position: relative; transition: background .2s, border-color .2s; }
.chave-trilho::after { content: ''; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; background: var(--tinta-3); transition: transform .2s var(--curva), background .2s; }
.chave input:checked + .chave-trilho { background: var(--tinta); border-color: var(--tinta); }
.chave input:checked + .chave-trilho::after { transform: translateX(18px); background: var(--papel); }
.chave input:focus-visible + .chave-trilho { outline: 1.5px solid var(--musgo); outline-offset: 3px; }

.segmentos { display: block; }
.segmentos::after { content: ''; display: block; clear: both; }
.segmentos legend { float: left; padding-top: .3rem; }
.opcoes { display: flex; justify-content: flex-end; gap: .2rem 1rem; flex-wrap: wrap; }
.opcoes label { position: relative; cursor: pointer; }
.opcoes input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opcoes span {
  display: block; padding: .3rem 0 .25rem; font-size: .9375rem; color: var(--tinta-3); white-space: nowrap;
  border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; font-variant-numeric: lining-nums tabular-nums;
}
.opcoes label:hover span { color: var(--tinta); }
.opcoes input:checked + span { color: var(--tinta); border-color: var(--musgo); }
.opcoes input:focus-visible + span { outline: 1.5px solid var(--musgo); outline-offset: 2px; }

.resultados { margin-top: 1.6rem; display: grid; }
.res { padding: .9rem 0 1rem; border-top: 1px solid var(--linha); }
.res h2 { font-size: .8125rem; font-weight: 400; color: var(--tinta-2); }
.numero { font-family: var(--serifa); font-weight: 300; font-size: 3.4rem; line-height: 1.05; letter-spacing: -.015em; }
.numero small { font-family: var(--sans); font-size: 1rem; font-weight: 300; color: var(--tinta-2); }
.numero-custo { font-size: 1.85rem; line-height: 1.2; margin-top: .15rem; }
.numero-custo .a { font-size: 1.2rem; color: var(--tinta-2); font-style: italic; }
.obs { font-size: .84rem; color: var(--tinta-2); font-weight: 300; margin-top: .3rem; line-height: 1.5; }
.obs.alerta { color: var(--alerta); font-weight: 400; }
.res-prazo p { font-size: .9375rem; margin-top: .55rem; }
.linha-tempo { display: flex; gap: 3px; height: 2px; margin-top: .7rem; }
.lt-projeto { background: var(--tinta-3); transition: flex-grow .45s var(--curva); }
.lt-obra { background: var(--musgo); transition: flex-grow .45s var(--curva); }
.botao {
  display: block; text-align: center; margin-top: .6rem; padding: .95rem 1.2rem; background: var(--tinta); color: var(--papel);
  text-decoration: none; font-size: .9375rem; font-weight: 500; letter-spacing: .01em; transition: background .2s;
}
.botao:hover { background: var(--musgo); }

/* ---------- projetos ---------- */
.projetos { padding: clamp(4rem, 8vw, 7rem) var(--margem); border-top: 1px solid var(--linha); }
.projetos h2, .processo h2, .sobre h2, .contato h2 { font-size: clamp(2.3rem, 4.4vw, 3.8rem); max-width: 16ch; }
.lista-projetos { margin-top: clamp(2rem, 4vw, 3rem); display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem 1.6rem; align-items: start; }
.projeto img { width: 100%; object-fit: cover; }
.p-largo img { aspect-ratio: 16 / 10; }
.projeto:not(.p-largo) img { aspect-ratio: 4 / 3.2; }
.projeto:not(.p-largo) { margin-top: 18%; }
.projeto-info { margin-top: .7rem; display: grid; gap: .3rem; max-width: 52ch; }
.projeto h3 { font-family: var(--serifa); font-weight: 400; font-size: 1.6rem; line-height: 1.15; }
.programa-tag { font-size: .84rem; color: var(--musgo); }
.projeto-info p:last-child { color: var(--tinta-2); font-weight: 300; font-size: .9375rem; }

/* ---------- processo: é uma sequência, então leva número ---------- */
.processo { padding: clamp(4rem, 8vw, 7rem) var(--margem); background: var(--papel-2); }
.etapas { margin-top: clamp(2rem, 4vw, 3rem); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); counter-reset: e; border-top: 1px solid var(--tinta); }
.etapas li { counter-increment: e; padding: 1rem 1.4rem 0 0; display: grid; gap: .4rem; align-content: start; }
.etapas li + li { padding-left: 1.2rem; border-left: 1px solid var(--linha); }
.etapas li::before { content: counter(e, decimal-leading-zero); font-family: var(--serifa); font-size: 1.1rem; color: var(--tinta-3); font-variant-numeric: lining-nums; }
.etapas h3 { font-family: var(--serifa); font-weight: 400; font-size: 1.45rem; line-height: 1.15; }
.etapas p { color: var(--tinta-2); font-size: .9375rem; font-weight: 300; }
.dur { font-size: .84rem; color: var(--musgo); }

/* ---------- sobre ---------- */
.sobre { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; padding: clamp(4rem, 8vw, 7rem) var(--margem); }
.sobre img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.sobre p { margin-top: 1.1rem; max-width: 48ch; color: var(--tinta-2); font-weight: 300; }

/* ---------- contato ---------- */
.contato { background: var(--noite); color: #ecebe6; padding: clamp(4rem, 8vw, 6.5rem) var(--margem); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.2rem clamp(2rem, 6vw, 6rem); align-items: end; }
.contato h2 { grid-row: 1 / span 3; max-width: 14ch; }
.contato p { color: #b8bfba; font-weight: 300; max-width: 44ch; }
.botao-claro { justify-self: start; background: transparent; border: 1px solid #ecebe6; color: #ecebe6; margin: 0; }
.botao-claro:hover { background: #ecebe6; color: var(--noite); }
.contato-extra { font-size: .9375rem; }
.contato :focus-visible, .rodape :focus-visible { outline-color: #ecebe6; }

/* ---------- rodapé ---------- */
.rodape { background: #1a201d; color: #ecebe6; padding: 2.2rem var(--margem); display: grid; gap: 1.1rem; }
.rodape-aviso { font-size: .875rem; color: #a3aaa5; font-weight: 300; max-width: 72ch; }
.voltar { justify-self: start; font-size: .9375rem; color: #ecebe6; text-underline-offset: 4px; }
.vetor { display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; align-items: center; padding-top: 1.1rem; border-top: 1px solid rgba(236, 235, 230, .16); font-size: .875rem; }
.vetor a { color: #ecebe6; text-underline-offset: 3px; }
.vetor-marca { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 500; }

/* ---------- telas menores ---------- */
@media (max-width: 1100px) {
  .etapas { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 1.6rem; }
  .etapas li:nth-child(4) { padding-left: 0; border-left: 0; }
}
@media (max-width: 860px) {
  .menu a:not(:last-child) { display: none; }
  .gerador-cabeca, .sobre, .contato { grid-template-columns: 1fr; }
  .contato h2 { grid-row: auto; }
  .gerador-corpo { grid-template-columns: 1fr; gap: 1rem; }
  /* no celular a maquete fica presa no topo enquanto se mexe nos controles */
  .palco-wrap { position: sticky; top: 0; z-index: 5; margin-inline: calc(var(--margem) * -1); background: var(--papel); padding: 0 0 .2rem; border-bottom: 1px solid var(--linha); }
  .palco { height: 40vh; height: 40svh; min-height: 250px; border: 0; }
  .legenda { display: none; }
  .rotulo-3d { font-size: 10px; padding: 1px 4px; }
  .palco-nota { left: var(--margem); right: var(--margem); bottom: .5rem; font-size: .75rem; }
  .lista-projetos { grid-template-columns: 1fr; gap: 2.4rem; }
  .projeto:not(.p-largo) { margin-top: 0; }
  .etapas { grid-template-columns: 1fr; }
  .etapas li, .etapas li + li { padding: 1rem 0 1.1rem; border-left: 0; border-bottom: 1px solid var(--linha); }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  h1 { font-size: clamp(2.5rem, 11.5vw, 3.1rem); }
  .numero { font-size: 2.9rem; }
  .numero-custo { font-size: 1.6rem; }
  .opcoes { gap: .2rem .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lt-projeto, .lt-obra, .chave-trilho, .chave-trilho::after { transition: none; }
}
