/*
  NÓRDICA
  Leitura do briefing: portfólio de escritório de arquitetura, linguagem calma e minimalista,
  o portfólio é o protagonista. Dials: variância 6, movimento 4, densidade 2.
  Sistema: CSS nativo, cantos retos (raio 0), um único acento (verde floresta), tema claro e escuro.
*/
:root {
  --bg: #edefec;
  --surface: #e2e5e1;
  --ink: #141816;
  --muted: #59615c;
  --line: #ccd1cb;
  --accent: #2e4a3d;
  --on-accent: #edefec;
  --danger: #9b2f2f;

  --display: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --sans: "Geist", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 4vw, 64px);
  --max: 1440px;
  --nav-h: 72px;
  --section: clamp(80px, 11vw, 176px);

  /* Curvas de Emil Kowalski: entradas em ease-out forte, movimento em tela em ease-in-out */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1211; --surface: #171b19; --ink: #e8ece8; --muted: #9aa39d; --line: #2a302d;
    --accent: #9dc0ab; --on-accent: #0f1211; --danger: #e08a8a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1211; --surface: #171b19; --ink: #e8ece8; --muted: #9aa39d; --line: #2a302d;
  --accent: #9dc0ab; --on-accent: #0f1211; --danger: #e08a8a; color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; font-weight: 400; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { text-wrap: balance; font-weight: 300; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; transition: top 200ms var(--ease-out); }
.skip:focus { top: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.display { font-family: var(--display); letter-spacing: -0.025em; line-height: 1.04; }
.t-hero { font-size: clamp(40px, 4.8vw, 76px); font-weight: 300; }
.t-page { font-size: clamp(44px, 7vw, 112px); font-weight: 200; }
.t-h2 { font-size: clamp(32px, 4vw, 60px); font-weight: 300; }
.t-h3 { font-size: clamp(24px, 2.4vw, 34px); font-weight: 300; line-height: 1.15; }
.lead { font-size: clamp(17px, 1.4vw, 19px); color: var(--muted); max-width: 44ch; line-height: 1.7; }
.label { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
section { padding: var(--section) 0; }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.site-header.solid { background: var(--bg); border-color: var(--line); }
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: flex; flex-direction: column; gap: 4px; line-height: 1; }
.logo b { font-family: var(--display); font-weight: 300; font-size: 24px; letter-spacing: 0.32em; }
.logo small { font-size: 9px; letter-spacing: 0.46em; text-transform: uppercase; color: var(--muted); }
.nav ul { display: flex; gap: clamp(24px, 3.4vw, 48px); }
.nav ul a { position: relative; font-size: 15px; padding: 6px 0; color: var(--muted); transition: color 200ms ease; }
.nav ul a[aria-current="page"] { color: var(--ink); }
.nav ul a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 250ms var(--ease-out); }
.nav ul a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .nav ul a:hover { color: var(--ink); }
  .nav ul a:hover::after { transform: scaleX(1); }
}
.burger { display: none; width: 44px; height: 44px; position: relative; }
.burger i { position: absolute; left: 11px; right: 11px; height: 1px; background: var(--ink); transition: transform 250ms var(--ease-out), top 250ms var(--ease-out); }
.burger i:nth-child(1) { top: 18px; } .burger i:nth-child(2) { top: 26px; }
.menu-open .burger i:nth-child(1) { top: 22px; transform: rotate(45deg); }
.menu-open .burger i:nth-child(2) { top: 22px; transform: rotate(-45deg); }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  background: var(--ink); color: var(--bg); padding: 17px 32px; font-size: 15px; font-weight: 500; letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } }
.link { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: 4px; transition: gap 250ms var(--ease-out), color 200ms ease; }
.link::after { content: "\2192"; }
.link:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .link:hover { gap: 16px; color: var(--accent); } }

/* Hero */
.hero { padding: calc(var(--nav-h) + 24px) 0 var(--section); }
.hero-grid { display: grid; gap: 40px; align-items: end; }
.hero-text { display: grid; gap: 28px; justify-items: start; align-self: end; }
.hero-text .lead { max-width: 30ch; }
.hero-media { display: block; aspect-ratio: 4 / 3; background: var(--surface); overflow: hidden; }
.hero-cap { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; font-size: 14px; color: var(--muted); }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 88px); min-height: calc(100dvh - var(--nav-h) - 24px - 48px); }
  .hero-text { padding-bottom: 44px; }
}

/* Projects */
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(40px, 6vw, 88px); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2vw, 32px); row-gap: clamp(56px, 7vw, 112px); }
.card { grid-column: span 12; display: block; }
.card .media { overflow: hidden; background: var(--surface); aspect-ratio: 4 / 3; }
.card .media img { transition: transform 500ms var(--ease-out); }
.card .info { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding-top: 20px; }
.card h3 { font-family: var(--display); font-size: clamp(26px, 2.4vw, 36px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; }
.card .desc { color: var(--muted); font-size: 15px; max-width: 42ch; margin-top: 8px; }
.card .meta { font-size: 14px; color: var(--muted); text-align: right; white-space: nowrap; }
.card[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .card:hover .media img { transform: scale(1.025); } }
@media (min-width: 800px) {
  .card.w7 { grid-column: span 7; } .card.w5 { grid-column: span 5; } .card.w6 { grid-column: span 6; }
  .card.w7 .media { aspect-ratio: 3 / 2; } .card.w5 .media { aspect-ratio: 1 / 1; } .card.w6 .media { aspect-ratio: 4 / 3; }
  .card.offset { margin-top: clamp(48px, 9vw, 144px); }
}
@media (max-width: 799px) { .card .info { flex-direction: column; gap: 6px; } .card .meta { text-align: left; } }

/* Statement */
.statement { background: var(--surface); }
.statement-grid { display: grid; gap: 56px; }
.statement .big { font-family: var(--display); font-weight: 300; letter-spacing: -0.02em; font-size: clamp(28px, 3.6vw, 54px); line-height: 1.16; max-width: 22ch; }
.facts { display: grid; gap: 28px; align-content: end; }
.facts b { display: block; font-family: var(--display); font-weight: 200; font-size: clamp(40px, 4.4vw, 68px); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.facts span { font-size: 15px; color: var(--muted); }
@media (min-width: 900px) { .statement-grid { grid-template-columns: 7fr 4fr; gap: clamp(48px, 8vw, 128px); } }

/* Service groups */
.svc-layout { display: grid; gap: 48px; }
.svc { display: grid; gap: 14px; padding: 32px 0; border-top: 1px solid var(--line); }
.svc:last-child { border-bottom: 1px solid var(--line); }
.svc h3 { font-family: var(--display); font-weight: 300; font-size: clamp(24px, 2.4vw, 34px); letter-spacing: -0.02em; }
.svc p { color: var(--muted); max-width: 52ch; }
@media (min-width: 900px) {
  .svc-layout { grid-template-columns: 4fr 8fr; gap: clamp(48px, 8vw, 128px); }
  .svc-layout > .sticky { position: sticky; top: calc(var(--nav-h) + 40px); align-self: start; }
  .svc { grid-template-columns: 1fr 1.4fr; gap: 32px; }
}

/* Differentials */
.diffs { display: grid; gap: 44px 64px; }
.diffs h4 { font-family: var(--display); font-weight: 300; font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.015em; margin-bottom: 8px; }
.diffs p { color: var(--muted); max-width: 40ch; }
@media (min-width: 700px) { .diffs { grid-template-columns: 1fr 1fr; } }

/* CTA */
.cta { border-top: 1px solid var(--line); }
.cta .t-page { max-width: 13ch; margin-bottom: 44px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 72px 0 32px; font-size: 15px; color: var(--muted); }
.site-footer .top { display: grid; gap: 44px; padding-bottom: 56px; }
@media (min-width: 900px) { .site-footer .top { grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 56px; } }
.site-footer .logo b { color: var(--ink); }
.site-footer .slogan { font-family: var(--display); font-weight: 300; font-size: 24px; letter-spacing: -0.02em; color: var(--ink); margin-top: 24px; }
.site-footer h5 { font-size: 13px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; }
.site-footer li { padding: 3px 0; }
.site-footer a { transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .site-footer a:hover { color: var(--accent); } }
.site-footer .bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }

/* Inner page heads */
.page-head { padding: calc(var(--nav-h) + clamp(56px, 9vw, 128px)) 0 clamp(48px, 6vw, 88px); }
.page-head .lead { margin-top: 28px; }

/* Filters */
.filters { display: flex; gap: clamp(20px, 3vw, 40px); flex-wrap: wrap; align-items: center; padding: 18px 0; margin-bottom: clamp(48px, 6vw, 88px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.filters button { font-size: 15px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid transparent; transition: color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out); }
.filters button:active { transform: scale(0.97); }
.filters button[aria-pressed="true"] { color: var(--ink); border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .filters button:hover { color: var(--ink); } }
.filters .count { margin-left: auto; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Project page */
.p-head { padding: calc(var(--nav-h) + clamp(40px, 6vw, 88px)) 0 clamp(36px, 5vw, 64px); }
.back { display: inline-block; font-size: 15px; color: var(--muted); margin-bottom: 32px; transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .back:hover { color: var(--accent); } }
.p-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: clamp(32px, 5vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }
@media (min-width: 800px) { .p-facts { grid-template-columns: repeat(4, 1fr); } }
.p-facts dt { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.p-facts dd { font-family: var(--display); font-weight: 300; font-size: 24px; letter-spacing: -0.01em; }
.p-hero { aspect-ratio: 3 / 2; max-height: 86vh; width: 100%; background: var(--surface); overflow: hidden; }
.p-body { display: grid; gap: 40px; padding: clamp(64px, 9vw, 144px) 0; }
.p-body .big { font-family: var(--display); font-weight: 300; letter-spacing: -0.02em; font-size: clamp(26px, 3vw, 44px); line-height: 1.18; max-width: 20ch; }
.p-body .text p { color: var(--muted); margin-bottom: 20px; max-width: 58ch; }
.spec { display: grid; gap: 22px; margin-top: 40px; }
.spec dt { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.spec dd { font-size: 17px; }
@media (min-width: 900px) { .p-body { grid-template-columns: 5fr 7fr; gap: clamp(48px, 8vw, 128px); } .spec { grid-template-columns: repeat(3, 1fr); } }
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(16px, 2vw, 32px); }
.gallery figure { grid-column: span 12; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
.gallery figure img { transform: scale(var(--z, 1)); transform-origin: var(--o, center); }
@media (min-width: 800px) { .gallery .a { grid-column: span 5; aspect-ratio: 1 / 1; } .gallery .b { grid-column: span 7; aspect-ratio: 3 / 2; margin-top: clamp(48px, 8vw, 120px); } }
.next { display: block; margin-top: var(--section); padding: clamp(48px, 7vw, 104px) 0 var(--section); border-top: 1px solid var(--line); }
.next .display { margin-top: 12px; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .next:hover .display { transform: translateX(14px); } }

/* Team */
.team { display: grid; }
.member { display: grid; grid-template-columns: 88px 1fr; gap: 12px 24px; padding: 32px 0; border-top: 1px solid var(--line); align-items: start; }
.member:last-child { border-bottom: 1px solid var(--line); }
.member .mono { grid-row: span 2; width: 88px; aspect-ratio: 1 / 1; background: var(--surface); display: grid; place-items: center; font-family: var(--display); font-weight: 300; font-size: 28px; letter-spacing: 0.06em; color: var(--accent); }
.member h3 { font-family: var(--display); font-weight: 300; font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -0.02em; line-height: 1.1; }
.member .role { color: var(--muted); font-size: 15px; }
.member .about { grid-column: 2; color: var(--muted); max-width: 46ch; }
@media (min-width: 900px) {
  .member { grid-template-columns: 88px 1fr 1fr; gap: 32px; align-items: center; }
  .member .mono { grid-row: auto; } .member .about { grid-column: auto; }
}

/* Contact */
.contact-grid { display: grid; gap: 64px; padding-bottom: var(--section); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 5fr 7fr; gap: clamp(64px, 9vw, 144px); } }
.info-list { display: grid; gap: 28px; align-content: start; }
.info-list dt { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.info-list dd { font-family: var(--display); font-weight: 300; font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
.info-list a { transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .info-list a:hover { color: var(--accent); } }
form { display: grid; gap: 28px; }
.field { display: grid; gap: 6px; }
label { font-size: 14px; color: var(--muted); }
input, select, textarea { font-size: 17px; background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 10px 0; width: 100%; outline: none; transition: border-color 200ms ease; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 12px) 50%, calc(100% - 6px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 28px; }
select option { background: var(--bg); color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; box-shadow: 0 1px 0 0 var(--accent); }
textarea { resize: vertical; min-height: 128px; }
.field[data-invalid] input, .field[data-invalid] textarea { border-color: var(--danger); }
.err { display: none; font-size: 14px; color: var(--danger); }
.field[data-invalid] .err { display: block; }
.two { display: grid; gap: 28px; }
@media (min-width: 600px) { .two { grid-template-columns: 1fr 1fr; } }
.form-note { font-size: 14px; color: var(--muted); max-width: 52ch; }
.form-note a { text-decoration: underline; text-underline-offset: 3px; }

/* Motion: entradas curtas, uma vez, sempre visíveis sem JS */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero-media { clip-path: inset(0 0 100% 0); transition: clip-path 700ms var(--ease-in-out); }
.js .hero-media img { transform: scale(1.06); transition: transform 900ms var(--ease-out); }
.js.loaded .hero-media { clip-path: inset(0 0 0 0); }
.js.loaded .hero-media img { transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity 200ms ease; transition-delay: 0ms; }
  .js .hero-media { clip-path: none; transition: none; }
  .js .hero-media img { transform: none; transition: none; }
  .card .media img, .next .display { transition: none; }
}

/* 404 */
.nf { min-height: 100dvh; display: grid; align-content: center; gap: 28px; justify-items: start; padding: calc(var(--nav-h) + 40px) 0 80px; }

/* Mobile */
@media (max-width: 800px) {
  .burger { display: block; }
  .nav ul { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; gap: 0; background: var(--bg); padding: 8px var(--gutter) 28px; border-bottom: 1px solid var(--line); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 200ms ease, transform 250ms var(--ease-out), visibility 0s linear 250ms; }
  .menu-open .nav ul { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav ul a { display: block; font-family: var(--display); font-weight: 300; font-size: 30px; letter-spacing: -0.02em; color: var(--ink); padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav ul a::after { display: none; }
  .menu-open .site-header { background: var(--bg); }
  .hero-media { aspect-ratio: 4 / 3; }
  .member { grid-template-columns: 72px 1fr; } .member .mono { width: 72px; }
}
