/* =========================================================
   Diego Souza Engenharia — estilos
   Cores da marca (extraídas dos arquivos oficiais do logotipo)
   ========================================================= */

@font-face {
  font-family: "Jost";
  src: url("../fonts/jost-latin.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin.woff") format("woff");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --navy: #0E2A4A;        /* marinho — cor principal da marca */
  --stone: #A4BAD2;       /* azul-pedra — cor de apoio da marca */
  --ice: #DCE3ED;         /* azul-gelo — cor clara da marca */
  --paper: #F5F7FA;       /* fundo frio de seção */
  --white: #FFFFFF;
  --ink-2: #44566C;       /* texto secundário (contraste AA sobre branco) */
  --line: #D3DCE7;
  --error: #A3261E;
  --ok: #1E6B45;

  --font-display: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --section: clamp(72px, 10vw, 136px);
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--navy);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 3.6vw, 2.875rem); }
h3 { font-size: 1.3rem; font-weight: 500; line-height: 1.3; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--navy); color: var(--white); padding: 12px 18px; border-radius: 6px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
.site-footer :focus-visible, .principles :focus-visible, .lightbox :focus-visible { outline-color: var(--ice); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; letter-spacing: 0.01em;
  text-decoration: none; border-radius: 999px; border: 1.5px solid var(--navy);
  cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: #1B3D63; border-color: #1B3D63; }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--white); }
.btn-sm { min-height: 44px; padding: 0 22px; font-size: 0.98rem; }
.btn-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.text-link {
  font-family: var(--font-display); font-weight: 500; font-size: 1.05rem;
  text-decoration: underline; text-decoration-color: var(--stone); text-decoration-thickness: 2px; text-underline-offset: 6px;
}
.text-link:hover { text-decoration-color: var(--navy); }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; line-height: 1.05; letter-spacing: 0.01em; }
.brand-name span { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.95rem; letter-spacing: 0.04em; }

.main-nav { display: flex; align-items: center; gap: 36px; }
.main-nav ul { display: flex; gap: 28px; }
.main-nav ul a {
  font-family: var(--font-display); font-size: 1rem; text-decoration: none;
  padding-block: 6px; background: linear-gradient(var(--navy), var(--navy)) left bottom / 0 1.5px no-repeat;
  transition: background-size .25s;
}
.main-nav ul a:hover, .main-nav ul a[aria-current="true"] { background-size: 100% 1.5px; }

.nav-toggle { display: none; }

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border: 0; background: transparent; color: var(--navy); cursor: pointer; border-radius: 8px;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 24px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .25s, background-color .25s;
  }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -7px; }
  .nav-toggle-bars::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 24px;
    padding: 24px var(--gutter) 32px; background: var(--white); border-bottom: 1px solid var(--line);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility 0s .2s;
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .main-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav ul a { display: block; padding-block: 14px; font-size: 1.25rem; border-bottom: 1px solid var(--line); background: none; }
  .main-nav .btn { width: 100%; min-height: 52px; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(32px, 5vw, 72px) clamp(64px, 8vw, 112px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero-kicker { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink-2); margin-bottom: 20px; display: flex; align-items: center; gap: 14px; }
.hero-kicker::before { content: ""; width: 40px; height: 2px; border-radius: 2px; background: var(--stone); }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1.04; letter-spacing: -0.02em; margin-bottom: 28px; max-width: 13ch; }
.hero-lead { font-size: 1.15rem; color: var(--ink-2); max-width: 46ch; margin-bottom: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* O recorte da foto segue o "D" do monograma: lado reto à esquerda, curva à direita */
.hero-media { margin: 0; position: relative; isolation: isolate; }
.hero-media img {
  width: 100%; aspect-ratio: 1440 / 1300; object-fit: cover;
  border-radius: 0 50% 50% 0 / 0 50% 50% 0;
  animation: d-reveal 1.1s cubic-bezier(.2, .7, .1, 1) both;
}
.hero-media::before {
  /* traço do "D" do logo, deslocado atrás da foto */
  content: ""; position: absolute; inset: 18px -18px -18px 18px;
  border: 2px solid var(--stone); border-left: 0;
  border-radius: 0 50% 50% 0 / 0 50% 50% 0;
  z-index: -1;
}
@keyframes d-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) { .hero-media img { animation: none; } }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; margin-right: calc(var(--gutter) * -1 + 18px); }
  .hero-media img { aspect-ratio: 4 / 3.2; }
  .hero h1 { max-width: 16ch; }
}

/* ---------- Sobre ---------- */
.about { background: var(--paper); }
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 7vw, 112px); align-items: center; }
.about-media { position: relative; max-width: 460px; }
.about-media > img:first-child { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.about-seal { position: absolute; width: clamp(110px, 12vw, 150px); right: -36px; bottom: -36px; background: var(--white); border-radius: 50%; padding: 6px; }
.about-text h2 { margin-bottom: 28px; }
.about-text .lead { font-family: var(--font-display); font-size: clamp(1.3rem, 2vw, 1.55rem); line-height: 1.4; }
.about-text p { color: var(--ink-2); max-width: 58ch; }
.about-text .lead { color: var(--navy); }
.about-text .text-link { display: inline-block; margin-top: 12px; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-media { max-width: 420px; margin-right: 36px; }
}

/* ---------- Cabeçalhos de seção ---------- */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px 48px; flex-wrap: wrap; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head p { color: var(--ink-2); margin: 0; max-width: 40ch; }

/* ---------- Serviços ---------- */
.service-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.service-list li { padding: 40px 36px 44px 0; border-bottom: 1px solid var(--line); }
.service-list li:not(:nth-child(3n + 1)) { padding-left: 36px; border-left: 1px solid var(--line); }
.icon { width: 44px; height: 44px; fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 24px; }
.service-list h3 { margin-bottom: 12px; }
.service-list p { color: var(--ink-2); font-size: 1rem; margin: 0; }
.note { margin-top: 32px; font-size: 0.92rem; color: var(--ink-2); max-width: 70ch; }
@media (max-width: 980px) {
  .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-list li:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .service-list li:nth-child(even) { padding-left: 32px; border-left: 1px solid var(--line); }
}
@media (max-width: 620px) {
  .service-list { grid-template-columns: 1fr; }
  .service-list li, .service-list li:nth-child(even) { padding: 32px 0; border-left: 0; }
}

/* ---------- Obras ---------- */
.works { background: var(--paper); }
.works-head { align-items: end; }
.works-head p { margin-top: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  font: 500 0.98rem/1 var(--font-display); color: var(--navy);
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--white); cursor: pointer; transition: border-color .2s, background-color .2s, color .2s;
}
.filter:hover { border-color: var(--navy); }
.filter.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); }

.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.work[hidden] { display: none; }
.work-open { display: block; width: 100%; padding: 0; border: 0; background: var(--ice); cursor: zoom-in; overflow: hidden; border-radius: 4px; }
.work-open img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .1, 1); }
.work-open:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .work-open img { transition: none; } .work-open:hover img { transform: none; } }
.work-caption { margin: 12px 0 0; font-size: 0.95rem; color: var(--ink-2); }
@media (max-width: 900px) { .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .work-grid { gap: 12px; } .work-caption { font-size: 0.85rem; line-height: 1.4; } }

/* ---------- Princípios ---------- */
.principles { background: var(--navy); color: var(--white); }
.principles .section-head p { color: var(--stone); }
.principle-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 56px; }
.principle-list li { padding-top: 24px; border-top: 2px solid rgba(164, 186, 210, 0.45); }
.principle-list h3 { margin-bottom: 10px; }
.principle-list p { color: var(--ice); opacity: 0.88; margin: 0; font-size: 1rem; }
@media (max-width: 900px) { .principle-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .principle-list { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Chamada ---------- */
.cta { background: var(--ice); padding-block: clamp(56px, 7vw, 96px); }
.cta-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) auto; gap: 32px 64px; align-items: center; }
.cta h2 { margin-bottom: 16px; max-width: 18ch; }
.cta p { margin: 0; max-width: 54ch; color: var(--ink-2); }
.cta-actions { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 860px) {
  .cta-inner { grid-template-columns: 1fr; }
  .cta-actions { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 480px) { .cta-actions .btn { width: 100%; } }

/* ---------- Contato ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: clamp(40px, 7vw, 112px); align-items: start; }
.contact-info h2 { margin-bottom: 20px; }
.contact-info > p { color: var(--ink-2); max-width: 36ch; }
.contact-list { margin: 40px 0 0; display: grid; gap: 28px; }
.contact-list dt { font-size: 0.9rem; color: var(--ink-2); margin-bottom: 4px; }
.contact-list dd { margin: 0; font-family: var(--font-display); font-size: 1.3rem; overflow-wrap: anywhere; }
.contact-list a { text-decoration: none; background: linear-gradient(var(--stone), var(--stone)) left bottom / 100% 2px no-repeat; padding-bottom: 2px; }
.contact-list a:hover { background-image: linear-gradient(var(--navy), var(--navy)); }

.contact-form { display: grid; gap: 22px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--navy);
  padding: 14px 16px; border: 1.5px solid #B9C7D8; border-radius: 6px; background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field select {
  appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E2A4A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
}
.field input::placeholder { color: #7D8DA1; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--ice); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error { margin: 6px 0 0; font-size: 0.9rem; color: var(--error); min-height: 0; }
.field-error:empty { display: none; }
.btn-submit { justify-self: start; min-width: 220px; }
.btn-submit[disabled] { opacity: 0.6; cursor: progress; }
.form-privacy { font-size: 0.88rem; color: var(--ink-2); margin: -6px 0 0; }
.form-status { padding: 16px 18px; border-radius: 6px; font-weight: 500; border-left: 4px solid; }
.form-status.is-ok { background: #E7F3EC; color: var(--ok); }
.form-status.is-error { background: #F8E8E6; color: var(--error); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } .btn-submit { width: 100%; } }

/* ---------- Rodapé ---------- */
.site-footer { background: var(--navy); color: var(--ice); padding-top: clamp(64px, 8vw, 96px); font-size: 0.97rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr 1.3fr; gap: 48px; padding-bottom: 56px; }
.footer-brand img { width: 150px; margin-bottom: 24px; }
.footer-brand p { max-width: 32ch; opacity: 0.88; }
.footer-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; color: var(--white); margin-bottom: 16px; }
.site-footer ul { display: grid; gap: 10px; }
.site-footer a { text-decoration: none; overflow-wrap: anywhere; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom { padding-bottom: 32px; }
.footer-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; border-top: 1px solid rgba(164, 186, 210, 0.3); padding-top: 24px; }
.footer-legal span { margin-inline: 8px; opacity: 0.5; }
.footer-bottom p { margin: 0; font-size: 0.9rem; opacity: 0.8; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- Visualizador de fotos ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0A1E35; color: var(--white);
}
.lightbox::backdrop { background: rgba(8, 24, 43, 0.6); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 14px; padding: 64px 72px 32px; }
.lightbox img { max-width: min(92vw, 1100px); max-height: calc(100dvh - 140px); width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.lightbox figcaption { font-family: var(--font-display); color: var(--ice); text-align: center; }
.lb-btn {
  position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid rgba(220, 227, 237, 0.4);
  background: rgba(14, 42, 74, 0.6); color: var(--white); cursor: pointer; display: grid; place-items: center;
}
.lb-btn:hover { border-color: var(--ice); }
.lb-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox figure { padding: 72px 12px 96px; }
  .lb-prev, .lb-next { top: auto; bottom: 24px; transform: none; }
  .lb-prev { left: calc(50% - 64px); }
  .lb-next { right: calc(50% - 64px); }
}

/* ---------- Página 404 ---------- */
.notfound { max-width: 720px; }
.notfound img { width: 64px; margin-bottom: 32px; }
.notfound h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 20px; }
.notfound p { color: var(--ink-2); margin-bottom: 32px; }
