/* ACRC — editorial warmth
   Palette and type system for the institutional site.
   ----------------------------------------------------- */

:root {
  --ink: #0F2630;
  --ink-soft: #1F3D4A;
  --teal: #002D40;
  --teal-700: #00455F;
  --paper: #FFFFFF;
  --paper-warm: #F3F7FB;
  --paper-deep: #E6EEF5;
  --rule: #D8E2EA;
  --terracotta: #B5532A;
  --terracotta-soft: #D9805A;
  --muted: #5C6B72;

  --serif: "Instrument Serif", "Iowan Old Style", "Georgia", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 64ch;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --rail: clamp(1rem, 6vw, 4rem);
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  background:
    radial-gradient(1100px 600px at 110% -10%, rgba(90, 140, 180, 0.10), transparent 60%),
    radial-gradient(900px 700px at -10% 20%, rgba(120, 170, 210, 0.08), transparent 55%),
    var(--paper);
  background-attachment: fixed;
}

/* Subtle paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.35' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.04  0 0 0 0 0.03  0 0 0 0.32 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a {
  color: var(--teal);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .18s ease;
}
a:hover { color: var(--terracotta); text-decoration: underline; }

::selection { background: var(--terracotta); color: var(--paper); }

img { max-width: 100%; display: block; }

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--terracotta);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--terracotta);
}

.lede {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 38ch;
}

/* ---------- Layout primitives ---------- */
.shell {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--rail);
}

section {
  position: relative;
  z-index: 2;
  padding: clamp(4rem, 9vw, 7.5rem) 0;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
  opacity: .7;
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 5;
  padding: 1.25rem var(--rail);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(6px);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }

.brand-mark {
  height: 46px;
  width: auto;
  display: block;
}
@media (max-width: 520px) { .brand-mark { height: 38px; } }

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.75rem);
  font-size: 14px;
  letter-spacing: .04em;
}
.topnav a {
  color: var(--ink);
  position: relative;
  padding: .25rem 0;
}
.topnav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--terracotta);
  transition: right .25s ease;
}
.topnav a:hover { color: var(--ink); text-decoration: none; }
.topnav a:hover::after { right: 0; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: clamp(2rem, 5vw, 4rem);
  row-gap: clamp(1.5rem, 3vw, 2.25rem);
  align-items: start;
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
}

.hero-copy { max-width: 18ch; }

.hero h1,
.hero h2 {
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  line-height: 1.02;
  font-weight: 400;
  margin-top: 1.25rem;
  text-wrap: balance;
}
.hero h1 em,
.hero h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--terracotta);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-left: 1px solid var(--rule);
  padding-left: clamp(1rem, 2.5vw, 2rem);
  align-self: stretch;
  justify-content: end;
}
.hero-meta dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .35rem 1rem;
  font-size: 14px;
}
.hero-meta dt {
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 11px;
  align-self: center;
}
.hero-meta dd { margin: 0; color: var(--ink); }

/* Hero stage — full-bleed sketch used as above-the-fold masthead */
.hero-stage {
  position: relative;
  margin: 0;
  width: 100%;
  height: calc(100svh - 120px);
  min-height: 440px;
  max-height: 760px;
  overflow: hidden;
  background: var(--paper);
}
.hero-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  opacity: .55;
}

/* Nameplate laid over the sky area of the sketch */
.hero-nameplate {
  position: absolute;
  top: clamp(1.25rem, 5vw, 3.5rem);
  left: clamp(1.25rem, 5vw, 4rem);
  max-width: min(68%, 760px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--ink);
  margin: 0;
}
.hero-nameplate-eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--terracotta);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.hero-nameplate-eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--terracotta);
}
.hero-nameplate-main {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7.5vw, 6rem);
  line-height: .96;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.hero-nameplate-main em {
  font-style: italic;
  font-weight: 400;
  color: var(--terracotta);
}
@media (max-width: 720px) {
  .hero-stage { height: auto; aspect-ratio: 4 / 3; min-height: 0; }
  .hero-nameplate { max-width: 82%; gap: .6rem; }
}

/* ---------- Sobre ---------- */
.sobre {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(2rem, 5vw, 5rem);
}
@media (max-width: 820px) { .sobre { grid-template-columns: 1fr; } }

.sobre h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  font-weight: 400;
}
.sobre h2 em { font-style: italic; color: var(--terracotta); }

.prose p {
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}
.prose p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 4em;
  float: left;
  line-height: .9;
  padding: .12em .12em 0 0;
  color: var(--teal);
  font-weight: 400;
}

.figures {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
}
@media (max-width: 640px) { .figures { grid-template-columns: 1fr 1fr; } }

.fig-num {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  color: var(--teal);
  line-height: 1;
}
.fig-label {
  display: block;
  margin-top: .4rem;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Serviços ---------- */
.servicos { background: linear-gradient(180deg, transparent, var(--paper-warm) 30%, var(--paper-warm) 70%, transparent); }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 400;
}
.section-head .eyebrow { margin-bottom: .5rem; }

.servico-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}
@media (max-width: 880px) { .servico-grid { grid-template-columns: 1fr; } }

.servico {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}
.servico:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -28px rgba(0,45,64,.35);
}
.servico-num {
  position: absolute;
  top: 1rem; right: 1.25rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--terracotta);
  font-size: 1.1rem;
}
.servico-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--teal);
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-warm);
}
.servico h3 {
  font-size: 1.5rem;
  font-weight: 400;
}
.servico .servico-sub {
  margin: -.75rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: .95rem;
  color: var(--terracotta);
}
.servico p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .98rem;
  line-height: 1.65;
}
.servico ul {
  list-style: none;
  padding: 0;
  margin: .25rem 0 0;
  font-size: .9rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
}
.servico ul li::before {
  content: "—";
  margin-right: .4rem;
  color: var(--terracotta);
}

/* ---------- Galeria ---------- */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 140px;
  gap: 12px;
}
@media (max-width: 900px) { .galeria-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .galeria-grid { grid-template-columns: repeat(2, 1fr); } }

.gal {
  border: 1px solid var(--rule);
  background: var(--paper-deep);
  position: relative;
  overflow: hidden;
  display: block;
}
.gal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .4s ease;
  filter: saturate(1.02);
}
.gal:hover img { transform: scale(1.04); filter: saturate(1.08) contrast(1.03); }
.gal::after {
  content: attr(data-label);
  position: absolute;
  inset: auto 10px 8px 10px;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--paper);
  font-family: var(--sans);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  z-index: 2;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s ease, transform .3s ease;
}
.gal:hover::after { opacity: 1; transform: translateY(0); }
.gal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .55));
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 1;
  pointer-events: none;
}
.gal:hover::before { opacity: 1; }
.gal-1 { grid-column: span 3; grid-row: span 2; }
.gal-2 { grid-column: span 2; grid-row: span 1; }
.gal-3 { grid-column: span 1; grid-row: span 1; }
.gal-4 { grid-column: span 2; grid-row: span 2; }
.gal-5 { grid-column: span 1; grid-row: span 1; }
.gal-6 { grid-column: span 3; grid-row: span 1; }

@media (max-width: 900px) {
  .gal-1, .gal-2, .gal-3, .gal-4, .gal-5, .gal-6 { grid-column: span 1; grid-row: span 1; }
  .gal-1 { grid-column: span 3; grid-row: span 2; }
}
@media (max-width: 520px) {
  .gal-1 { grid-column: span 2; grid-row: span 2; }
}

/* ---------- Contactos ---------- */
.contactos {
  background:
    radial-gradient(700px 400px at 90% 10%, rgba(181, 83, 42, .12), transparent 60%),
    var(--teal);
  color: #E9DFCB;
  position: relative;
  overflow: hidden;
}
.contactos::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(transparent 0 calc(100% - 1px), rgba(255,255,255,.04) calc(100% - 1px) 100%);
  background-size: 100% 64px;
  opacity: .8;
}
.contactos .eyebrow { color: var(--terracotta-soft); }
.contactos .eyebrow::before { background: var(--terracotta-soft); }
.contactos h2 {
  color: var(--paper);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.5rem);
  max-width: 18ch;
}
.contactos h2 em { font-style: italic; color: var(--terracotta-soft); }

.contact-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .contact-grid { grid-template-columns: 1fr; } }

.contact {
  border-top: 1px solid rgba(233, 223, 203, .25);
  padding-top: 1rem;
}
.contact dt {
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(233, 223, 203, .65);
  margin-bottom: .5rem;
}
.contact dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--paper);
}
.contact dd a { color: var(--paper); border-bottom: 1px solid rgba(255,255,255,.4); }
.contact dd a:hover { color: var(--terracotta-soft); border-color: var(--terracotta-soft); text-decoration: none; }

/* ---------- Footer ---------- */
.foot {
  background: #08222C;
  color: #B6AC97;
  padding: clamp(2.5rem, 5vw, 4rem) var(--rail) 1.5rem;
  font-size: 14px;
  position: relative;
  z-index: 2;
}
.foot-row {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-bottom: 1.5rem;
}
@media (max-width: 640px) { .foot-row { grid-template-columns: 1fr; } }

.foot-mark {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--paper);
  letter-spacing: -.01em;
}
.foot-mark span {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-top: .25rem;
  font-variation-settings: normal;
}

.foot-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  flex-wrap: wrap;
}
.foot-links a {
  color: #D9CFB9;
  border-bottom: 1px solid rgba(217,207,185,.25);
  padding-bottom: 2px;
}
.foot-links a:hover { color: var(--terracotta-soft); border-color: var(--terracotta-soft); text-decoration: none; }

.foot-bottom {
  max-width: 1280px;
  margin: 1.25rem auto 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 12px;
  color: rgba(255,255,255,.4);
  letter-spacing: .04em;
}

/* ---------- Page header (subpages) ---------- */
.page-head {
  padding: clamp(3.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2rem;
  align-items: end;
}
@media (max-width: 820px) { .page-head { grid-template-columns: 1fr; } }

.page-head h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 400;
  line-height: 1;
}
.page-head .lede { margin-top: 1rem; max-width: 36ch; }

.crumbs {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--terracotta); }

/* ---------- Relatórios (contas page) ---------- */
.years {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.year {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 4fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(1.75rem, 3vw, 2.5rem) 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
@media (max-width: 720px) {
  .year { grid-template-columns: 1fr; gap: 1rem; }
}

.year-label {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 400;
  line-height: .9;
  color: var(--teal);
  font-feature-settings: "tnum";
  position: sticky;
  top: 1rem;
}
.year:hover .year-label { color: var(--terracotta); }

.docs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--paper-deep);
}
@media (max-width: 720px) { .docs { grid-template-columns: 1fr; } }

.doc {
  border-bottom: 1px solid var(--paper-deep);
  border-right: 1px solid var(--paper-deep);
}
.doc:nth-child(2n) { border-right: 0; }
@media (max-width: 720px) { .doc { border-right: 0; } }

.doc a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem .25rem;
  color: var(--ink);
  font-size: .98rem;
  position: relative;
  transition: padding .25s ease, color .2s ease, background .2s ease;
}
.doc a:hover {
  color: var(--terracotta);
  padding-left: 1rem;
  background: linear-gradient(90deg, rgba(181,83,42,.07), transparent 80%);
  text-decoration: none;
}
.doc-icon {
  flex: none;
  width: 28px; height: 36px;
  border: 1px solid var(--rule);
  position: relative;
  background: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--teal);
}
.doc-icon::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 8px; height: 8px;
  background: linear-gradient(225deg, var(--paper-deep) 50%, transparent 50%);
}
.doc-arrow {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .25s ease, transform .25s ease;
  color: var(--terracotta);
}
.doc a:hover .doc-arrow { opacity: 1; transform: translateX(0); }

/* ---------- Reveal-on-load animation ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-stage, .hero-nameplate,
  .hero-copy, .hero-meta,
  .sobre > *, .servico, .gal, .contact-grid > *,
  .page-head > *, .year {
    animation: rise .9s cubic-bezier(.2,.7,.2,1) both;
  }
  .hero-nameplate { animation-delay: .1s; }
  .hero-copy { animation-delay: .2s; }
  .hero-meta { animation-delay: .3s; }
  .servico:nth-child(1) { animation-delay: .1s; }
  .servico:nth-child(2) { animation-delay: .2s; }
  .servico:nth-child(3) { animation-delay: .3s; }
  .gal:nth-child(1) { animation-delay: .05s; }
  .gal:nth-child(2) { animation-delay: .12s; }
  .gal:nth-child(3) { animation-delay: .19s; }
  .gal:nth-child(4) { animation-delay: .26s; }
  .gal:nth-child(5) { animation-delay: .33s; }
  .gal:nth-child(6) { animation-delay: .40s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 2px;
}
