/* =========================================================================
   Rodovalho Advogados — Base + Layout + Components
   ========================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "ss01", "ss02", "cv11";
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(201, 166, 107, 0.32);
  color: var(--ink-900);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---------- typography utility ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-h);
  text-wrap: balance;
  color: var(--ink-800);
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
  text-wrap: pretty;
  max-width: 68ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--gold-700);
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.eyebrow-light { color: var(--gold-400); }
.eyebrow-mark::before { display: none; }

.display {
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: normal;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-tight);
  text-wrap: balance;
}

.display-italic {
  font-style: italic;
  font-weight: 300;
}

/* ---------- container / layout primitives ---------- */
.container {
  width: min(100% - calc(var(--gutter) * 2), var(--container-w));
  margin-inline: auto;
}

.container-narrow {
  width: min(100% - calc(var(--gutter) * 2), var(--container-narrow));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}

.section-tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.section-dark {
  background: var(--bg-deep);
  color: var(--text-on-dark);
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 {
  color: var(--text-on-dark);
}

.section-soft {
  background: var(--bg-soft);
}

.section-paper {
  background:
    radial-gradient(1200px 600px at 80% -20%, rgba(201, 166, 107, 0.10), transparent 60%),
    var(--paper-100);
}

/* Hairline rule */
.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: 0;
}
.rule-strong { background: var(--rule-strong); }
.rule-on-dark { background: var(--rule-on-dark); }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--ink-800);
  --btn-fg: var(--text-on-dark);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  transition:
    background var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn .arrow {
  display: inline-block;
  transition: transform var(--dur-2) var(--ease-out);
}
.btn:hover .arrow { transform: translateX(4px); }

.btn-primary {
  --btn-bg: var(--gold-600);
  --btn-fg: var(--ink-900);
}
.btn-primary:hover { --btn-bg: var(--gold-500); }

.btn-dark {
  --btn-bg: var(--ink-800);
  --btn-fg: var(--text-on-dark);
}
.btn-dark:hover { --btn-bg: var(--ink-700); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink-800);
  --btn-bd: var(--rule-strong);
}
.btn-ghost:hover { --btn-bd: var(--ink-800); }

.btn-ghost-light {
  --btn-bg: transparent;
  --btn-fg: var(--text-on-dark);
  --btn-bd: var(--rule-on-dark-strong);
}
.btn-ghost-light:hover {
  --btn-bd: var(--text-on-dark);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-800);
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.btn-link:hover {
  border-color: var(--gold-600);
  color: var(--ink-900);
}
.btn-link.on-dark {
  color: var(--text-on-dark);
  border-color: var(--rule-on-dark-strong);
}
.btn-link.on-dark:hover {
  color: var(--gold-400);
  border-color: var(--gold-400);
}
.btn-link .arrow {
  transition: transform var(--dur-2) var(--ease-out);
}
.btn-link:hover .arrow { transform: translateX(4px); }

/* ---------- header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(6, 26, 40, 0.55), rgba(6, 26, 40, 0));
  color: var(--text-on-dark);
  transition: background var(--dur-2) var(--ease-out),
              color var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out),
              transform var(--dur-2) var(--ease-out);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(6, 26, 40, 0.94);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--rule-on-dark);
}

.site-header.is-light {
  background: rgba(251, 248, 242, 0.94);
  color: var(--ink-800);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--rule);
}
.site-header.is-light .nav-links a { color: var(--ink-700); }

.site-header.is-hidden { transform: translateY(-100%); }

.header-shell {
  width: min(100% - calc(var(--gutter) * 2), var(--container-w));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Official logo — navy bg + white wordmark + gold "25 ANOS" seal */
.brand-mark {
  display: inline-flex;
  align-items: center;
  height: 100px;
}
.brand-mark img {
  height: 100%;
  width: auto;
  display: block;
}
/* On light headers, the logo's own navy background visually dominates;
   wrap it in a subtle bordered container so it reads as a contained mark. */
.site-header.is-light .brand-mark {
  height: 100px;
}
@media (max-width: 560px) {
  .brand-mark { height: 100px; }
}

/* nav links */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(243, 236, 224, 0.78);
  border-radius: var(--r-pill);
  transition: color var(--dur-1), background var(--dur-1);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text-on-dark);
}

.site-header.is-light .nav-links a:hover,
.site-header.is-light .nav-links a.is-active {
  color: var(--ink-900);
}

.nav-cta {
  margin-left: 8px;
  background: var(--gold-600);
  color: var(--ink-900) !important;
  padding: 0 18px !important;
  height: 40px !important;
  border-radius: var(--r-pill) !important;
}

.nav-cta:hover {
  background: var(--gold-500);
}

.site-header.is-light .nav-cta {
  background: var(--ink-800);
  color: var(--text-on-dark) !important;
}
.site-header.is-light .nav-cta:hover { background: var(--ink-700); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--rule-on-dark-strong);
  border-radius: var(--r-sm);
}
.nav-toggle span {
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur-2), opacity var(--dur-2);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink-900);
  color: var(--text-on-dark-soft);
  padding-block: var(--space-20) var(--space-8);
}

.footer-shell {
  width: min(100% - calc(var(--gutter) * 2), var(--container-w));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: var(--space-12);
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer-brand .mark {
  display: inline-block;
  width: fit-content;
}
.footer-brand .mark img {
  height: 100px;
  width: auto;
  display: block;
}

.footer-brand p {
  font-size: 0.95rem;
  color: var(--text-on-dark-soft);
  max-width: 38ch;
}

.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 18px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 0.95rem;
  color: var(--text-on-dark-soft);
  transition: color var(--dur-1);
}
.footer-col a:hover {
  color: var(--text-on-dark);
}

.footer-meta {
  width: min(100% - calc(var(--gutter) * 2), var(--container-w));
  margin: var(--space-16) auto 0;
  padding-top: var(--space-6);
  border-top: 1px solid var(--rule-on-dark);
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  font-size: 0.84rem;
  color: var(--text-on-dark-faint);
}

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- responsive helpers ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links.is-open {
    display: flex;
    position: fixed;
    inset: var(--header-h) var(--gutter) auto;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    background: var(--ink-900);
    border: 1px solid var(--rule-on-dark);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
  }
  .nav-links.is-open a {
    height: 44px;
    color: var(--text-on-dark-soft);
    width: 100%;
  }
  .footer-shell {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
  }
  .footer-meta { flex-direction: column; gap: 8px; }
}

@media (max-width: 560px) {
  .footer-shell { grid-template-columns: 1fr; }
}
