/* ── Fonts ─────────────────────────────────────────────────────────────────── */
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope_regular.ttf'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope_medium.ttf');  font-weight: 500; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope_semibold.ttf'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope_bold.ttf');    font-weight: 700; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope_extrabold.ttf'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/fonts/work_sans_regular.ttf');  font-weight: 400; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/fonts/work_sans_medium.ttf');   font-weight: 500; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/fonts/work_sans_semibold.ttf'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('/fonts/work_sans_bold.ttf');     font-weight: 700; font-display: swap; }

/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --color-cilantro:      #0E6E4F;
  --color-cilantro-dark: #0A5A40;
  --color-cilantro-tint: rgba(14,110,79,.07);
  --color-crema:         #FAF7F0;
  --color-mostaza:       #E89B3D;
  --color-surface:       #F3F1EB;
  --color-surface-high:  #EDEAE3;
  --color-on-surface:    #1A1C1C;
  --color-on-surface-v:  #44483B;
  --color-white:         #FFFFFF;

  --radius-xl:   1.5rem;
  --radius-md:   0.75rem;
  --radius-sm:   0.5rem;
  --radius-pill: 9999px;

  --shadow-ambient: 0 8px 40px -4px rgba(26,28,28,.07);
  --shadow-lifted:  0 16px 48px -8px rgba(26,28,28,.12);

  --ease-spring: cubic-bezier(0.16,1,0.3,1);

  --sidebar-w: 260px;
  --content-max: 780px;
  --nav-h: 68px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1.5rem); overflow-x: hidden; }
body {
  font-family: 'Work Sans', system-ui, sans-serif;
  background: var(--color-crema);
  color: var(--color-on-surface);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  background: rgba(250,247,240,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease;
}
#navbar.scrolled {
  border-color: var(--color-surface-high);
  box-shadow: 0 1px 24px -4px rgba(26,28,28,.08);
}
.nav-brand { display: flex; align-items: center; gap: .5rem; }
.nav-logo   { height: 32px; width: auto; }
.nav-right  { display: flex; align-items: center; gap: .75rem; }
.btn-ghost {
  display: inline-flex; align-items: center;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: 'Work Sans', sans-serif; font-weight: 600; font-size: .9375rem;
  color: var(--color-cilantro);
  background: transparent;
  border: none; cursor: pointer;
  transition: background .15s ease;
}
.btn-ghost:hover { background: var(--color-cilantro-tint); }
.btn-primary {
  display: inline-flex; align-items: center;
  padding: .5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Work Sans', sans-serif; font-weight: 600; font-size: .9375rem;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-cilantro), var(--color-cilantro-dark));
  border: none; cursor: pointer;
  box-shadow: var(--shadow-ambient);
  transition: box-shadow .2s ease, transform .15s ease;
}
.btn-primary:hover { box-shadow: var(--shadow-lifted); transform: scale(1.02); }

/* ── Hero header ───────────────────────────────────────────────────────────── */
.legal-hero {
  background: linear-gradient(160deg, var(--color-cilantro) 0%, var(--color-cilantro-dark) 100%);
  padding: calc(var(--nav-h) + 3.5rem) 3rem 3.5rem;
  text-align: center;
  color: var(--color-white);
}
.legal-hero-eyebrow {
  display: inline-block;
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-pill);
  padding: .3rem .9rem;
  margin-bottom: 1.25rem;
}
.legal-hero h1 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: .75rem;
}
.legal-hero-sub {
  font-size: 1rem;
  opacity: .75;
  max-width: 480px;
  margin: 0 auto 1.5rem;
}
.legal-hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.legal-hero-meta-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  opacity: .7;
}
.legal-hero-meta-item svg { flex-shrink: 0; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.legal-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  max-width: calc(var(--sidebar-w) + var(--content-max) + 8rem);
  margin: 0 auto;
  padding: 3rem 3rem 6rem;
  gap: 3rem;
  align-items: start;
}

/* ── Sidebar TOC ───────────────────────────────────────────────────────────── */
.legal-toc {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-ambient);
}
.toc-title {
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-on-surface-v);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--color-surface-high);
}
.toc-list { list-style: none; display: flex; flex-direction: column; gap: .125rem; }
.toc-list a {
  display: block;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--color-on-surface-v);
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
  line-height: 1.4;
}
.toc-list a:hover { background: var(--color-cilantro-tint); color: var(--color-cilantro); }
.toc-list a.active { background: var(--color-cilantro-tint); color: var(--color-cilantro); font-weight: 600; }

/* ── Mobile TOC ────────────────────────────────────────────────────────────── */
.toc-mobile {
  display: none;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-ambient);
}
.toc-mobile-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: .9375rem;
  color: var(--color-cilantro);
}
.toc-mobile-toggle svg { transition: transform .25s ease; }
.toc-mobile.open .toc-mobile-toggle svg { transform: rotate(180deg); }
.toc-mobile-panel {
  display: none;
  border-top: 1px solid var(--color-surface-high);
  padding: .75rem 1rem;
}
.toc-mobile.open .toc-mobile-panel { display: block; }
.toc-mobile-panel .toc-list a { padding: .5rem .75rem; }

/* ── Content ───────────────────────────────────────────────────────────────── */
.legal-content { min-width: 0; }

.legal-section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-surface);
}
.legal-section:last-child { border-bottom: none; margin-bottom: 0; }

.legal-section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--color-cilantro-tint);
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: .8125rem;
  color: var(--color-cilantro);
  margin-bottom: 1rem;
}

.legal-section h2 {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--color-on-surface);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.legal-section h3 {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-on-surface);
  margin-top: 1.5rem;
  margin-bottom: .5rem;
}

.legal-section p {
  font-size: .9375rem;
  color: var(--color-on-surface-v);
  margin-bottom: .875rem;
  line-height: 1.75;
}
.legal-section p:last-child { margin-bottom: 0; }

.legal-section ul,
.legal-section ol {
  padding-left: 1.25rem;
  margin-bottom: .875rem;
  display: flex;
  flex-direction: column;
  gap: .375rem;
}
.legal-section li {
  font-size: .9375rem;
  color: var(--color-on-surface-v);
  line-height: 1.65;
}
.legal-section ul { list-style: none; padding-left: 0; }
.legal-section ul li { padding-left: 1.25rem; position: relative; }
.legal-section ul li::before {
  content: '';
  position: absolute;
  left: 0; top: .65em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--color-cilantro);
  opacity: .6;
}

/* ── Info box ──────────────────────────────────────────────────────────────── */
.legal-box {
  background: var(--color-cilantro-tint);
  border-left: 3px solid var(--color-cilantro);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.legal-box p {
  font-size: .9rem;
  margin-bottom: 0 !important;
  color: var(--color-on-surface) !important;
}
.legal-box strong { color: var(--color-cilantro); }

/* ── Third-party table ─────────────────────────────────────────────────────── */
.legal-table-wrap { overflow-x: auto; margin: 1.25rem 0; border-radius: var(--radius-md); }
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-ambient);
}
.legal-table th {
  background: var(--color-surface);
  font-family: 'Work Sans', sans-serif;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-on-surface-v);
  padding: .75rem 1rem;
  text-align: left;
}
.legal-table td {
  padding: .75rem 1rem;
  border-top: 1px solid var(--color-surface);
  color: var(--color-on-surface-v);
  vertical-align: top;
}
.legal-table tr:last-child td { border-bottom: none; }
.legal-table td:first-child { font-weight: 600; color: var(--color-on-surface); }

/* ── Contact card ──────────────────────────────────────────────────────────── */
.legal-contact-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-ambient);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-row {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
}
.contact-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: var(--color-cilantro-tint);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-cilantro);
}
.contact-detail { display: flex; flex-direction: column; gap: .125rem; }
.contact-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--color-on-surface-v); }
.contact-value { font-size: .9375rem; font-weight: 600; color: var(--color-on-surface); }
.contact-value a { color: var(--color-cilantro); }
.contact-value a:hover { text-decoration: underline; }

/* ── Cross-link banner ─────────────────────────────────────────────────────── */
.legal-crosslink {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-ambient);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.legal-crosslink p { font-size: .9375rem; color: var(--color-on-surface-v); margin: 0; }
.legal-crosslink strong { color: var(--color-on-surface); }
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  color: var(--color-cilantro);
  background: var(--color-cilantro-tint);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease;
}
.btn-link:hover { background: rgba(14,110,79,.13); }
.btn-link svg { transition: transform .15s ease; }
.btn-link:hover svg { transform: translateX(3px); }

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer {
  background: var(--color-on-surface);
  color: rgba(255,255,255,.65);
  padding: 3rem 3rem 2.5rem;
}
.footer-inner {
  max-width: calc(var(--sidebar-w) + var(--content-max) + 8rem);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-logo { height: 27px; width: auto; max-width: 140px; opacity: .8; }
.footer-tagline { font-size: .875rem; margin-top: .75rem; }
.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  align-items: center;
}
.footer-links a {
  font-size: .875rem;
  transition: color .15s ease;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
  max-width: calc(var(--sidebar-w) + var(--content-max) + 8rem);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .8125rem;
  text-align: center;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .legal-layout {
    grid-template-columns: 1fr;
    padding: 2rem 2rem 5rem;
    gap: 0;
  }
  .legal-toc { display: none; }
  .toc-mobile { display: block; }
  #navbar { padding: 0 1.5rem; }
  footer { padding: 2.5rem 1.5rem 2rem; }
}

@media (max-width: 640px) {
  .legal-hero { padding-left: 1.5rem; padding-right: 1.5rem; }
  .legal-hero h1 { font-size: 1.75rem; }
  .legal-layout { padding: 1.5rem 1.25rem 4rem; }
  .legal-section h2 { font-size: 1.2rem; }
  .legal-contact-card { padding: 1.25rem; }
  .legal-crosslink { flex-direction: column; align-items: flex-start; }
  footer { padding: 2rem 1.25rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
