/* ============================================================
   TN ADV — Tourinho Nakamura Advogados
   Brutalist-editorial restyle
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg:          #FFFFFF;
  --bg-cool:     #ECEDF2;   /* lavender-tinted section */
  --bg-warm:     #F4F2EB;   /* cream section */
  --surface:     #E7E8EC;   /* card neutral */
  --surface-2:   #DDDEE2;
  --surface-3:   #F6F5F1;

  /* ink */
  --ink:         #0A0A0A;
  --ink-soft:    #1F1F1F;
  --muted:       #6B6B6F;
  --hairline:   #0A0A0A14;
  --hairline-2: #0A0A0A22;

  /* brand & accent */
  --brand:       #0A0A0A;
  --brand-deep:  #000000;
  --accent:      #FF5E1A;   /* orange for stars / micro-accents */
  --on-brand:    #FFFFFF;

  /* type */
  --display: 'Archivo', system-ui, -apple-system, 'Helvetica Neue', Helvetica, sans-serif;
  --sans:    'DM Sans', system-ui, -apple-system, 'Helvetica Neue', Helvetica, sans-serif;
  --serif:   'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 56px);

  --radius-sm: 2px;
  --radius:    2px;
  --radius-lg: 4px;

  --shadow-soft: none;
}

[data-density="airy"] {
  --space-9: 128px;
  --space-10: 176px;
}
[data-density="compact"] {
  --space-7: 32px;
  --space-8: 44px;
  --space-9: 64px;
  --space-10: 88px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  vertical-align: middle;
  margin: 0 10px 2px 0;
}
.h-display {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-wrap: balance;
  font-size: clamp(36px, 4.6vw, 68px);
  margin: 0;
}
.h-display em { font-style: italic; font-weight: 500; }
.h-section {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}
.h-section em { font-style: italic; font-weight: 500; }
.h-card {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}
.lede {
  font-family: var(--sans);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.6;
  color: var(--ink-soft);
  font-weight: 400;
  max-width: 56ch;
  text-wrap: pretty;
}
p { text-wrap: pretty; }
.body-lg { font-size: 17px; line-height: 1.6; color: var(--ink-soft); }
.muted { color: var(--muted); }

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.section {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
}
.section--tight {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.section--cool { background: var(--bg-cool); }
.section--warm { background: var(--bg-warm); }
.section--ink  { background: var(--ink); color: var(--on-brand); }
.divider {
  height: 1px;
  background: var(--hairline-2);
  border: 0;
  margin: 0;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-7);
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  z-index: 50; /* keep the logo above the open .nav__mobile overlay */
}
.brand__logo {
  height: 36px;
  width: auto;
  max-width: 100%;
  display: block;
}
.nav__links {
  display: flex;
  gap: 32px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
  transition: color .2s ease, opacity .2s ease;
  opacity: 0.7;
}
.nav__links a:hover { opacity: 1; }
.nav__links a[aria-current="page"] {
  opacity: 1;
}
.nav__links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--ink);
}
.nav__cta { justify-self: end; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .15s ease, background .2s, color .2s, border-color .2s;
  white-space: nowrap;
  cursor: pointer;
}
.btn--brand {
  background: var(--ink);
  color: var(--on-brand);
}
.btn--brand:hover {
  background: var(--brand-deep);
}
.btn--ghost {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover {
  background: var(--ink);
  color: var(--on-brand);
}
.btn--link {
  padding: 0;
  border-radius: 0;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}
.btn--link:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn--whatsapp .wa-ico {
  width: 14px; height: 14px;
  fill: currentColor;
}

/* ---------- Photo placeholder ---------- */
.photo-slot {
  position: relative;
  background:
    repeating-linear-gradient(135deg, var(--surface-2) 0 14px, var(--surface) 14px 28px);
  border: 1px solid var(--hairline-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
}
.photo-slot::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px dashed var(--hairline-2);
  pointer-events: none;
}
.photo-slot--filled { background: var(--surface); border-color: transparent; }
.photo-slot--filled::after { display: none; }
.photo-slot--filled .photo-slot__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}
.photo-slot__label {
  position: relative;
  background: var(--bg);
  padding: 8px 14px;
  border: 1px solid var(--hairline-2);
}

/* ---------- Icon tile (small black square + glyph) ---------- */
.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--on-brand);
  flex-shrink: 0;
}
.icon-tile svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.85);
  padding-top: var(--space-9);
  padding-bottom: var(--space-7);
}
.footer a { color: inherit; text-decoration: none; }
.footer .brand__logo { filter: brightness(0) invert(1); opacity: 0.9; }
.footer .eyebrow { color: var(--on-brand); }
.footer .eyebrow .dot { background: var(--accent); }

/* ---------- Decorative numerals ---------- */
.numeral {
  font-family: var(--display);
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Stars (testimonials) ---------- */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
}
.stars::before { content: '★★★★★'; letter-spacing: 1px; }

/* ---------- Utility ---------- */
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.stack-2 > * + * { margin-top: var(--space-2); }
.stack-3 > * + * { margin-top: var(--space-3); }
.stack-4 > * + * { margin-top: var(--space-4); }
.stack-5 > * + * { margin-top: var(--space-5); }
.stack-6 > * + * { margin-top: var(--space-6); }
.center { text-align: center; }
.hide { display: none !important; }

/* ---------- Nav hamburger & mobile menu ---------- */
.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 50; /* stay clickable above the .nav__mobile overlay */
}
.nav__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}
.nav--open .nav__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav__burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav--open .nav__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__mobile {
  /* Pinned to the viewport. We rely on explicit dimensions because
     the parent .nav has backdrop-filter, which creates a containing
     block for position: fixed descendants — so top/right/bottom/left
     would otherwise resolve against the header, not the viewport. */
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 40;
  background: var(--bg);
  padding: 76px var(--gutter) calc(var(--space-6) + env(safe-area-inset-bottom));
  overflow-y: auto;
  flex-direction: column;
  gap: var(--space-5);
}
.nav--open .nav__mobile { display: flex; }

.nav__mobile-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.nav__mobile-links li { border-bottom: 1px solid var(--hairline-2); }
.nav__mobile-links li:first-child { border-top: 1px solid var(--hairline-2); }
.nav__mobile-links a {
  display: block;
  padding: 13px 0;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.2s ease;
}
.nav__mobile-links a[aria-current="page"] { color: var(--accent); }
.nav__mobile-links a:hover { color: var(--accent); }
.nav__mobile-cta { padding-top: var(--space-4); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  /* Hide the desktop <nav> wrapper itself, not just its child .nav__links, 
     so it stops occupying a grid cell and pushing .nav__burger to a 2nd row. */
  .nav__inner > nav { display: none; }
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .nav__inner {
    grid-template-columns: 1fr auto;
    gap: var(--space-4);
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .brand__logo { height: 32px; }
  .section { padding-top: var(--space-8); padding-bottom: var(--space-8); }
}

@media (max-width: 480px) {
  .brand__logo { height: 28px; }
  .nav__inner { padding-top: 12px; padding-bottom: 12px; }
  .nav__burger { width: 36px; height: 36px; }
  .nav__mobile { padding-top: 76px; }
  .nav__mobile-links a { font-size: 14px; padding: 12px 0; }
  .nav__mobile-cta .btn { width: 100%; justify-content: center; }
  .btn { padding: 12px 18px; font-size: 11px; letter-spacing: 0.12em; }
}

/* ---------- Selection ---------- */
::selection { background: var(--ink); color: var(--on-brand); }
