/* =========================================================================
   FUSION SPE — Design System
   Conceito: "Blueprint Editorial" — governança e estruturação imobiliária
   tratadas com a precisão de um desenho técnico e a autoridade de um
   relatório institucional impresso.
   ========================================================================= */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500&family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ---- Tokens ---- */
:root {
  /* Dark (default / brand) */
  --ink: #0a0c11;
  --ink-raised: #12151d;
  --ink-panel: #161a24;
  --ink-line: rgba(244, 241, 232, 0.12);
  --ink-line-strong: rgba(244, 241, 232, 0.22);
  --ink-text: #f3f1e9;
  --ink-text-muted: #9ba0ad;
  --ink-text-faint: #6b7180;

  --brass: #c6a15b;
  --brass-strong: #e0bd7c;
  --brass-deep: #8a6b3a;
  --brass-ink: #1a1509;

  --ok: #6fae8f;
  --err: #c9695f;

  --bg: var(--ink);
  --bg-raised: var(--ink-raised);
  --bg-panel: var(--ink-panel);
  --line: var(--ink-line);
  --line-strong: var(--ink-line-strong);
  --text: var(--ink-text);
  --text-muted: var(--ink-text-muted);
  --text-faint: var(--ink-text-faint);
  --accent: var(--brass);
  --accent-strong: var(--brass-strong);
  --on-accent: var(--brass-ink);

  --grid-line: rgba(244, 241, 232, 0.05);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --container: 1240px;
  --radius: 2px;
  --shadow-lift: 0 24px 60px -24px rgba(0,0,0,0.55);
}

:root[data-theme="light"] {
  --bg: #f4f1e8;
  --bg-raised: #ffffff;
  --bg-panel: #ffffff;
  --line: rgba(20, 18, 10, 0.12);
  --line-strong: rgba(20, 18, 10, 0.22);
  --text: #171510;
  --text-muted: #5b5647;
  --text-faint: #8a8570;
  --accent: #96702f;
  --accent-strong: #7a5a24;
  --on-accent: #fbf7ee;
  --grid-line: rgba(20, 18, 10, 0.05);
  --shadow-lift: 0 24px 60px -24px rgba(20,18,10,0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { background: var(--bg); }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
  opacity: 0;
}
body.is-ready { opacity: 1; transition: opacity .25s ease, background-color .3s ease, color .3s ease; }

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 900px) {
  .container { padding: 0 56px; }
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}
h1 { font-size: clamp(2.6rem, 5vw + 1rem, 5rem); font-weight: 500; }
h2 { font-size: clamp(2rem, 3vw + 1rem, 3.2rem); }
h3 { font-size: clamp(1.35rem, 1.4vw + 1rem, 1.8rem); }
p { line-height: 1.7; color: var(--text-muted); margin: 0; }
.lede { font-size: 1.15rem; line-height: 1.65; max-width: 46ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 15px 28px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---- Icon (inline SVG, never a text ligature — avoids translation tools mangling icons) ---- */
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; flex-shrink: 0; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand svg { width: 30px; height: 30px; color: var(--accent); }
.brand-word {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}
.brand-word b { color: var(--accent); font-weight: 500; }

.nav-desktop { display: none; align-items: center; gap: 36px; }
@media (min-width: 980px) { .nav-desktop { display: flex; } }
.nav-link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 4px;
}
.nav-link:hover, .nav-link.is-active { color: var(--text); }
.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--accent);
}

.util-group { display: flex; align-items: center; gap: 18px; }
.util-extras { display: none; align-items: center; gap: 18px; }
@media (min-width: 980px) { .util-extras { display: flex; } }

.lang-switch { position: relative; display: flex; align-items: center; gap: 6px; }
.lang-switch select {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 4px 18px 4px 0;
  cursor: pointer;
}
.lang-switch svg { width: 16px; height: 16px; color: var(--text-faint); }
.lang-switch::after {
  content: '▾';
  position: absolute;
  right: 0;
  font-size: 0.65rem;
  color: var(--text-faint);
  pointer-events: none;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

.menu-toggle {
  display: flex;
  background: none;
  border: 1px solid var(--line);
  width: 44px; height: 44px;
  border-radius: var(--radius);
  align-items: center; justify-content: center;
  color: var(--text);
  cursor: pointer;
}
@media (min-width: 980px) { .menu-toggle { display: none; } }

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 20px 24px 32px;
}
.mobile-panel.is-open { display: block; }
.mobile-panel .nav-link { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.mobile-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); }
.mobile-row .lang-switch select { font-size: 0.85rem; }
@media (min-width: 980px) { .mobile-panel { display: none !important; } }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 80px 0 40px;
  margin-top: 120px;
}
.footer-grid {
  display: grid;
  gap: 48px;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
}
.footer-brand p { max-width: 38ch; margin-top: 18px; }
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 20px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { text-decoration: none; color: var(--text-muted); font-size: 0.92rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding-top: 28px;
  font-size: 0.8rem;
  color: var(--text-faint);
}
@media (min-width: 700px) { .footer-bottom { flex-direction: row; align-items: center; } }
.footer-bottom .legal-links { display: flex; gap: 24px; }
.footer-bottom a { text-decoration: none; color: var(--text-faint); }
.footer-bottom a:hover { color: var(--text); }

/* ---- Sections / layout helpers ---- */
section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 56px; display: flex; flex-direction: column; gap: 18px; }
.divider { border: none; border-top: 1px solid var(--line); margin: 0; }

.bracket {
  position: relative;
}
.bracket::before, .bracket::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--line-strong);
}
.bracket::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.bracket::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* ---- Hero ---- */
.hero {
  padding: 72px 0 40px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  gap: 56px;
  align-items: center;
}
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 40px; }
}
.hero-copy { display: flex; flex-direction: column; gap: 26px; }
.hero-copy .btn-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 48px;
}
.hero-stats div {
  background: var(--bg);
  padding: 20px 18px;
}
.hero-stats .num { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--text); margin-bottom: 4px; }
.hero-stats .lbl { font-size: 0.72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- Cards / grids ---- */
.grid-3 { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); grid-template-columns: 1fr; }
@media (min-width: 800px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); grid-template-columns: 1fr; }
@media (min-width: 800px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

.panel {
  background: var(--bg);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel .icon-box {
  width: 48px; height: 48px;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.panel h3 { margin-top: 4px; }

/* ---- Methodology / editorial rows ---- */
.method-row {
  display: grid;
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.method-row:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 800px) { .method-row { grid-template-columns: 100px 1fr 1.2fr; } }
.method-row .num { font-family: var(--font-display); font-size: 1.6rem; color: var(--text-faint); }

/* ---- Portfolio ---- */
.portfolio-filter { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
}
.filter-btn.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.project-grid { display: grid; gap: 32px; margin-top: 48px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .project-grid { grid-template-columns: 1fr 1fr; } }
.project-card {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: border-color .2s ease;
}
.project-card:hover { border-color: var(--accent); }
.project-card .art { aspect-ratio: 4/3; border-bottom: 1px solid var(--line); overflow: hidden; }
.project-card .art svg { width: 100%; height: 100%; transition: transform .6s ease; }
.project-card:hover .art svg { transform: scale(1.04); }
.project-card .body { padding: 26px 26px 30px; display: flex; flex-direction: column; gap: 10px; }
.project-card .tag { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.project-card .loc { color: var(--text-faint); font-size: 0.85rem; }

/* ---- CTA band ---- */
.cta-band {
  border: 1px solid var(--line);
  padding: 64px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ---- Project detail page ---- */
.project-hero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.project-hero .art { border: 1px solid var(--line); aspect-ratio: 21/9; overflow: hidden; margin-top: 32px; }
.project-hero .art svg { width: 100%; height: 100%; }
.project-meta { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 24px; }
.project-meta div { display: flex; flex-direction: column; gap: 4px; }
.project-meta .lbl { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }

.detail-grid { display: grid; gap: 56px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .detail-grid { grid-template-columns: 1.6fr 1fr; } }
.stat-card { border: 1px solid var(--line); padding: 32px; background: var(--bg-raised); }
.stat-card .row { display: flex; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); }
.stat-card .row:last-child { border-bottom: none; }
.stat-card .row .v { font-family: var(--font-display); font-size: 1.2rem; }
.team-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 700px) { .team-list { grid-template-columns: 1fr 1fr; } }
.team-item { background: var(--bg); padding: 20px; display: flex; align-items: center; gap: 16px; }
.avatar { width: 46px; height: 46px; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); color: var(--accent); flex-shrink: 0; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ok); border: 1px solid var(--line); padding: 8px 14px; }
.status-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* ---- Services page ---- */
.stats-strip { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 800px) { .stats-strip { grid-template-columns: repeat(4,1fr); } }
.stats-strip div { background: var(--bg); padding: 32px 24px; }
.stats-strip .num { font-family: var(--font-display); font-size: 2rem; color: var(--accent); display:block; margin-bottom: 6px; }
.stats-strip .lbl { font-size: 0.78rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }

.pillar { display: grid; gap: 44px; align-items: center; padding: 72px 0; border-top: 1px solid var(--line); grid-template-columns: 1fr; }
@media (min-width: 980px) { .pillar { grid-template-columns: 1fr 1fr; } }
.pillar-art { border: 1px solid var(--line); aspect-ratio: 4/3; }
.pillar-art svg { width: 100%; height: 100%; }
.pillar-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 8px; }
.pillar-list div { background: var(--bg); padding: 20px 22px; }

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.82rem; font-weight: 600; }
.field .hint { font-size: 0.76rem; color: var(--text-faint); }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: var(--radius);
  width: 100%;
  outline: none;
  transition: border-color .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
.checkbox-row { display: flex; align-items: flex-start; gap: 12px; }
.checkbox-row input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; }
.checkbox-row span { font-size: 0.88rem; color: var(--text-muted); }

/* ---- Portal layout ---- */
.portal-shell { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 84px); }
@media (min-width: 980px) { .portal-shell { grid-template-columns: 320px 1fr; } }
.portal-side {
  border-right: 1px solid var(--line);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.portal-steps { display: flex; flex-direction: column; gap: 2px; }
.portal-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  text-align: left;
  cursor: default;
  font-size: 0.88rem;
  border-radius: var(--radius);
}
.portal-step .step-idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  width: 22px; height: 22px;
  border: 1px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
}
.portal-step.is-active { color: var(--text); border-color: var(--line-strong); background: var(--bg-raised); }
.portal-step.is-active .step-idx { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.portal-step.is-done { color: var(--accent); cursor: pointer; }
.portal-step.is-done .step-idx { border-color: var(--accent); }
.progress-track { height: 3px; background: var(--line); position: relative; overflow: hidden; }
.progress-fill { position: absolute; inset: 0; width: 25%; background: var(--accent); transition: width .4s ease; }
.portal-main { padding: 56px 24px; }
@media (min-width: 700px) { .portal-main { padding: 64px 56px; } }
.portal-main-inner { max-width: 720px; }
.form-grid { display: grid; gap: 24px; grid-template-columns: 1fr; margin-top: 40px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.upload-box {
  border: 1px dashed var(--line-strong);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.upload-box:hover { border-color: var(--accent); }
.upload-box .icon { width: 34px; height: 34px; color: var(--accent); }
.form-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); gap: 16px; }
.review-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); grid-template-columns: 1fr; margin-top: 32px; }
@media (min-width: 800px) { .review-grid { grid-template-columns: repeat(3,1fr); } }
.review-grid .col { background: var(--bg); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.review-grid .col h4 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.review-grid .kv { display: flex; justify-content: space-between; gap: 12px; font-size: 0.86rem; }
.review-grid .kv .k { color: var(--text-faint); }
.success-panel { text-align: center; padding: 80px 0; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.success-panel .icon-ring { width: 84px; height: 84px; border: 1px solid var(--ok); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ok); }
.form-error {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--err); color: var(--err);
  padding: 12px 14px; font-size: 0.85rem; border-radius: var(--radius);
}
.saved-flag { font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-mono); opacity: 0; transition: opacity .3s ease; }
.saved-flag.is-visible { opacity: 1; }

/* ---- Legal pages ---- */
.legal-body { max-width: 72ch; display: flex; flex-direction: column; gap: 24px; }
.legal-body h2 { margin-top: 32px; font-size: 1.4rem; }
.legal-note {
  border-left: 2px solid var(--accent);
  padding: 14px 20px;
  background: var(--bg-raised);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ---- Reveal on scroll ---- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ---- Utility ---- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.flex-center { display: flex; align-items: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
