/* ─────────────────────────────────────────
   Ilha Capital — Website Redesign
   Shared styles · editorial / law-firm aesthetic
   Lead surface: warm off-white #F5F2EC
   Display: Times New Roman · Body: Poppins
   ───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* Palette — lead with warm off-white, navy for type, teal as quiet accent */
  --bg:           #F5F2EC;
  --bg-paper:     #FBF9F4;   /* slightly lighter for layered surfaces */
  --bg-deep:      #1B2A3B;   /* navy section blocks */
  --bg-deeper:    #0F1F2F;   /* deepest navy — footer, hero */
  --ink:          #1B2A3B;   /* primary type */
  --ink-soft:     #4A5868;   /* secondary type */
  --ink-mute:     #8A8579;   /* warm taupe — captions, eyebrows */
  --rule:         #D4D0C8;   /* hairline borders */
  --rule-soft:    #E0DDD6;   /* lighter dividers */
  --teal:         #3DBFAA;   /* quiet accent — hover, single highlights */
  --teal-deep:    #2A9E8A;
  --on-dark:      #F5F2EC;
  --on-dark-mute: #A8A296;

  --serif:  'Times New Roman', 'Georgia', Times, serif;
  --sans:   'Poppins', 'Helvetica Neue', sans-serif;
  --mono:   'DM Mono', 'Courier New', monospace;

  --nav-h:        80px;
  --max:          1440px;
  --gutter:       clamp(24px, 5vw, 80px);
  --ease:         cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms var(--ease);
}

/* ─── Typography ─────────────────────────── */

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--ink-mute);
  display: inline-block;
}
.eyebrow.no-rule::before { display: none; }
.eyebrow.center { justify-content: center; }
.eyebrow .num {
  font-family: var(--mono);
  font-weight: 500;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.02;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1.display, .display-1 {
  font-size: clamp(48px, 7.2vw, 116px);
}
h2.display, .display-2 {
  font-size: clamp(40px, 5.4vw, 84px);
  line-height: 1.05;
}
h3.display, .display-3 {
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.1;
}
h4.display, .display-4 {
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.2;
}

.display em {
  font-style: italic;
  color: var(--ink-soft);
  font-weight: 300;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
  text-wrap: pretty;
  margin: 0;
}

p.body, .body {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink);
  max-width: 64ch;
  text-wrap: pretty;
  margin: 0;
}

.body--soft { color: var(--ink-soft); }

.caption {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  line-height: 1.5;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

/* ─── Layout primitives ───────────────────── */

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(80px, 12vh, 160px) 0;
  position: relative;
}
.section--tight { padding: clamp(56px, 8vh, 96px) 0; }
.section--dark {
  background: var(--bg-deep);
  color: var(--on-dark);
}
.section--dark .display,
.section--dark .body,
.section--dark .lead { color: var(--on-dark); }
.section--dark .lead { color: rgba(245, 242, 236, 0.78); }
.section--dark .eyebrow { color: var(--on-dark-mute); }
.section--dark .eyebrow::before { background: var(--on-dark-mute); }
.section--dark .rule { background: rgba(245, 242, 236, 0.18); }

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

.rule {
  height: 1px;
  background: var(--rule);
  width: 100%;
  border: 0;
}
.rule--dark { background: rgba(245,242,236,0.2); }

/* 12-column grid helper */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 32px;
}
@media (max-width: 900px) {
  .grid-12 { grid-template-columns: 1fr; gap: 24px; }
}

/* ─── Buttons & links ─────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 250ms var(--ease);
}
.btn:hover { background: var(--ink); color: var(--on-dark); }

.btn--filled {
  background: var(--ink);
  color: var(--on-dark);
}
.btn--filled:hover {
  background: var(--bg-deeper);
  border-color: var(--bg-deeper);
}

.btn--light {
  border-color: rgba(245,242,236,0.4);
  color: var(--on-dark);
}
.btn--light:hover {
  background: var(--on-dark);
  border-color: var(--on-dark);
  color: var(--ink);
}

.btn .arrow {
  display: inline-block;
  width: 14px; height: 7px;
  position: relative;
  transition: width 250ms var(--ease);
}
.btn .arrow::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: currentColor;
  transform: translateY(-50%);
}
.btn .arrow::after {
  content: "";
  position: absolute;
  right: 1px; top: 50%;
  width: 6px; height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translate(0, -50%) rotate(45deg);
}
.btn:hover .arrow { width: 22px; }

/* Inline editorial link with reveal underline */
.ilink {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
  color: var(--ink);
  font-weight: 500;
}
.ilink::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  height: 1px; width: 100%;
  background: var(--ink);
  transform-origin: right center;
  transform: scaleX(1);
  transition: transform 350ms var(--ease);
}
.ilink:hover { color: var(--teal-deep); }
.ilink:hover::after {
  transform: scaleX(0);
  transform-origin: right center;
}

/* Navigation arrow link (e.g. "Read more →") */
.nlink {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  transition: gap 250ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.nlink:hover { gap: 20px; color: var(--teal-deep); border-color: var(--teal-deep); }
.section--dark .nlink { color: var(--on-dark); border-color: rgba(245,242,236,0.6); }
.section--dark .nlink:hover { color: var(--teal); border-color: var(--teal); }

/* ─── Navigation ──────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: background 300ms var(--ease), border-color 300ms var(--ease), color 300ms var(--ease);
}
.nav.scrolled {
  background: rgba(245, 242, 236, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--rule);
}
.nav.invert {
  background: transparent;
  color: var(--on-dark);
}
.nav.invert .nav__links > a,
.nav.invert .nav__item > a,
.nav.invert .nav__menubtn,
.nav.invert .nav__brand { color: var(--on-dark); }
.nav.invert .nav__menubtn .bar { background: var(--on-dark); }
.nav.invert .nav__caret { color: var(--on-dark); }

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  gap: 32px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav__brand img { height: 40px; width: auto; display: block; }
.nav__brand img.nav__brand-light { display: none; }
.nav.invert .nav__brand img.nav__brand-dark { display: none; }
.nav.invert .nav__brand img.nav__brand-light { display: block; }
.nav__brand .sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 40px;
}
/* Direct child anchor (used for simple links: Panorama M&A, Contato) */
.nav__links > a,
.nav__item > a {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.nav__links > a::after,
.nav__item > a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 350ms var(--ease);
}
.nav__links > a:hover::after,
.nav__item:hover > a::after,
.nav__links > a.active::after,
.nav__item.active > a::after { transform: scaleX(1); }
.nav__links > a.active,
.nav__item.active > a { color: var(--teal-deep); }

/* Dropdown trigger */
.nav__item {
  position: relative;
  display: flex;
  align-items: center;
}
.nav__caret {
  display: inline-block;
  width: 5px; height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0.55;
  margin-bottom: 2px;
  transition: transform 250ms var(--ease), opacity 200ms var(--ease);
}
.nav__item:hover .nav__caret { opacity: 1; }

/* Floating dropdown */
.nav__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: -20px;
  padding: 16px 4px;
  background: var(--bg);
  border: 1px solid var(--rule);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 0s 220ms;
  z-index: 110;
  box-shadow: 0 18px 40px rgba(15,31,47,0.10);
}
.nav__item:hover .nav__dropdown,
.nav__item:focus-within .nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.nav__dropdown a {
  display: block;
  padding: 10px 20px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  transition: color 200ms var(--ease), padding-left 250ms var(--ease);
}
.nav__dropdown a:hover { color: var(--teal-deep); padding-left: 28px; }

/* Wide dropdown for Services — 2-col grid with Casos sub-link per item */
.nav__dropdown--wide {
  min-width: 560px;
  padding: 20px 24px;
}
.nav__dropdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 40px;
}
.nav__service {
  padding: 12px 4px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav__service:nth-last-child(-n+2) { border-bottom: 0; }
.nav__service > a {
  padding: 0;
  white-space: nowrap;
}
.nav__service > a:hover { padding-left: 0; }
.nav__service .nav__sub {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 0;
  white-space: nowrap;
  transition: color 200ms var(--ease), letter-spacing 250ms var(--ease);
}
.nav__service .nav__sub::after { content: "  →"; opacity: 0.6; }
.nav__service:hover .nav__sub { color: var(--teal-deep); }
.nav__service .nav__sub:hover { padding-left: 0; letter-spacing: 0.26em; }

/* Dark/invert variant: dropdown matches inverted nav */
.nav.invert .nav__dropdown,
.nav.scrolled .nav__dropdown { /* scrolled state: solid panel either way */ }
.nav.invert .nav__dropdown {
  background: rgba(15,31,47,0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: rgba(245,242,236,0.14);
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
}
.nav.invert .nav__dropdown a { color: var(--on-dark); }
.nav.invert .nav__dropdown a:hover { color: var(--teal); }
.nav.invert .nav__service { border-bottom-color: rgba(245,242,236,0.12); }
.nav.invert .nav__service .nav__sub { color: var(--on-dark-mute); }
.nav.invert .nav__service:hover .nav__sub { color: var(--teal); }

.nav__right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav__lang {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav__lang button {
  background: none; border: 0; padding: 2px 4px;
  font: inherit; color: inherit; cursor: pointer;
}
.nav__lang button.active { color: var(--ink); border-bottom: 1px solid var(--ink); }
.nav.invert .nav__lang { color: rgba(245,242,236,0.6); }
.nav.invert .nav__lang button.active { color: var(--on-dark); border-bottom-color: var(--on-dark); }

.nav__menubtn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 0;
}
.nav__menubtn .bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.nav__menubtn .bar {
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: all 250ms var(--ease);
}
.nav.menuopen .nav__menubtn .bar:nth-child(1) { transform: translateY(2.5px) rotate(45deg); }
.nav.menuopen .nav__menubtn .bar:nth-child(2) { transform: translateY(-2.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav__links { display: none; }
}

/* Mega menu / overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-deeper);
  color: var(--on-dark);
  z-index: 90;
  padding: calc(var(--nav-h) + 64px) var(--gutter) 64px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease);
  overflow-y: auto;
}
.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.menu-overlay__grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 64px;
}
@media (max-width: 900px) {
  .menu-overlay__grid { grid-template-columns: 1fr; gap: 40px; }
}
.menu-overlay h6 {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-dark-mute);
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(245,242,236,0.2);
}
.menu-overlay__primary a {
  display: block;
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.15;
  color: var(--on-dark);
  padding: 10px 0;
  letter-spacing: -0.01em;
  transition: color 250ms var(--ease), padding-left 350ms var(--ease);
  border-bottom: 1px solid rgba(245,242,236,0.12);
}
.menu-overlay__primary a:hover {
  color: var(--teal);
  padding-left: 16px;
}
.menu-overlay__primary a .num {
  font-family: var(--mono);
  font-size: 11px;
  vertical-align: super;
  margin-right: 16px;
  color: var(--on-dark-mute);
}
.menu-overlay__col a {
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  color: rgba(245,242,236,0.8);
  padding: 8px 0;
  transition: color 200ms var(--ease);
}
.menu-overlay__col a:hover { color: var(--teal); }
.menu-overlay__col p {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(245,242,236,0.7);
  margin: 0 0 12px;
}

/* ─── Footer ──────────────────────────────── */

.footer {
  background: var(--bg-deeper);
  color: var(--on-dark);
  padding: 96px 0 32px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(245,242,236,0.15);
}
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
.footer h6 {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-dark-mute);
  margin: 0 0 20px;
}
.footer a {
  display: block;
  font-size: 14px;
  color: rgba(245,242,236,0.78);
  padding: 6px 0;
  transition: color 200ms var(--ease);
}
.footer a:hover { color: var(--teal); }
.footer__brand img { height: 36px; margin-bottom: 20px; }
.footer__brand p {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  line-height: 1.5;
  color: rgba(245,242,236,0.7);
  max-width: 32ch;
  margin: 0;
}
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--on-dark-mute);
  letter-spacing: 0.08em;
}
@media (max-width: 700px) {
  .footer__bottom { flex-direction: column; gap: 12px; }
}

/* ─── Reusable cards / blocks ─────────────── */

.imgbox {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(27,42,59,0.05) 0px, rgba(27,42,59,0.05) 1px,
      transparent 1px, transparent 14px),
    linear-gradient(180deg, #DCD6CB 0%, #C9C2B5 100%);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.imgbox::after {
  content: attr(data-label);
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(27,42,59,0.5);
  background: rgba(245,242,236,0.7);
  padding: 4px 8px;
}
.imgbox--dark {
  background:
    repeating-linear-gradient(135deg,
      rgba(245,242,236,0.04) 0px, rgba(245,242,236,0.04) 1px,
      transparent 1px, transparent 14px),
    linear-gradient(180deg, #2A3B4E 0%, #14202E 100%);
  border-color: rgba(245,242,236,0.1);
}
.imgbox--dark::after {
  color: rgba(245,242,236,0.55);
  background: rgba(15,31,47,0.6);
}

/* Headshot frame */
.portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--bg-deep);
  overflow: hidden;
}
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(15%) contrast(1.02);
  transition: filter 600ms var(--ease), transform 800ms var(--ease);
}
.portrait:hover img {
  filter: grayscale(0%) contrast(1);
  transform: scale(1.03);
}

/* Tabular numeric data */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat {
  padding: 40px 32px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stat:last-child { border-right: 0; }
@media (max-width: 900px) {
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
.stat__num {
  font-family: var(--serif);
  font-size: clamp(48px, 5.4vw, 76px);
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stat__num sup { font-size: 0.4em; vertical-align: super; font-weight: 400; }
.stat__label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  line-height: 1.5;
}
.section--dark .stat { border-right-color: rgba(245,242,236,0.15); }
.section--dark .stat-grid { border-color: rgba(245,242,236,0.15); }
.section--dark .stat__num { color: var(--on-dark); }
.section--dark .stat__label { color: var(--on-dark-mute); }

/* ─── Animation: reveal on scroll ─────────── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Capture / print fallback: ensure all content is visible when there's no
   IntersectionObserver to trigger reveals (PDF export, screenshots, etc.) */
@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
}

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