:root {
  --bg: #0C0D10;
  --ink: #E3DECF;
  --ink-strong: #F0E9D8;
  --ink-dim: rgba(227, 222, 207, 0.62);
  --gold: #D4AF5E;
  --gold-soft: rgba(212, 175, 94, 0.75);
  --hairline: rgba(212, 175, 94, 0.16);
  --container: 1180px;
  --pad: clamp(20px, 5vw, 48px);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--gold); }
::selection { background: rgba(212, 175, 94, 0.25); color: var(--ink-strong); }

body.lang-en [data-es] { display: none !important; }
body.lang-es [data-en] { display: none !important; }

@keyframes bch-rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.rise { animation: bch-rise 1.1s var(--ease) both; }

#progress { position: fixed; top: 0; left: 0; height: 1px; width: 0%; background: var(--gold); z-index: 200; }

#bg3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
  position: relative;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px var(--pad);
  background: rgba(12, 13, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink-strong); min-width: 0; }
.brand svg { flex-shrink: 0; }
.brand-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(12px, 1.5vw, 17px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-right { display: flex; align-items: center; gap: clamp(20px, 3.2vw, 40px); flex-shrink: 0; }
.lang-switch { display: flex; align-items: center; gap: 10px; }
.lang-sep { color: rgba(227, 222, 207, 0.25); font-family: var(--mono); font-size: 13px; }
.lang-btn {
  background: none; border: none; cursor: pointer;
  padding: 6px 4px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em;
  color: rgba(227, 222, 207, 0.6);
  transition: color 250ms;
}
.lang-btn.active { color: var(--gold); }
.nav-link {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.2em;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: all 300ms;
}
.nav-link:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  z-index: 1;
}
.hero-inner { padding-top: 140px; padding-bottom: 100px; width: 100%; }
.hero-kicker {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: clamp(36px, 5vh, 52px);
  font-family: var(--mono);
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.38em;
  color: var(--gold);
  text-transform: uppercase;
}
.hero-kicker svg { flex-shrink: 0; }
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.2rem, 11vw, 9.5rem);
  line-height: 0.98;
  letter-spacing: 0.04em;
  color: var(--ink-strong);
  text-transform: uppercase;
}
.hero-sub-row { display: flex; align-items: center; gap: 24px; margin-top: 16px; }
.hero-subtitle {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.4rem, 3.8vw, 3.2rem);
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
}
.hero-sub-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212,175,94,0.5), rgba(212,175,94,0)); min-width: 30px; }
.hero-lede { margin-top: clamp(40px, 6vh, 60px); max-width: 58ch; }
.hero-lede h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(1.05rem, 1.55vw, 1.3rem);
  line-height: 1.9;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: pretty;
  text-shadow: 0 2px 24px rgba(12, 13, 16, 0.9);
}
.hero-foot {
  display: flex; align-items: center; gap: 20px;
  margin-top: clamp(44px, 7vh, 64px);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.36em;
  color: rgba(227, 222, 207, 0.5);
}
.hero-foot-line { width: 72px; height: 1px; background: var(--gold); }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding-top: clamp(110px, 13vw, 170px);
  padding-bottom: clamp(110px, 13vw, 170px);
  z-index: 1;
}
.section-border { border-top: 1px solid rgba(212, 175, 94, 0.1); }
.section-veil { background: linear-gradient(180deg, rgba(12,13,16,0) 0%, rgba(12,13,16,0.55) 12%, rgba(12,13,16,0.55) 88%, rgba(12,13,16,0) 100%); }
.rule-row { display: flex; align-items: center; gap: 24px; margin-bottom: clamp(40px, 5vw, 56px); }
.rule-row-lg { margin-bottom: clamp(56px, 7vw, 76px); }
.rule-row .num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.3em; color: var(--gold); }
.rule-row .line { flex: 1; height: 1px; background: rgba(212, 175, 94, 0.18); }
.h2 {
  margin: 0 0 clamp(32px, 4vw, 44px);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 4.4vw, 4rem);
  color: var(--ink-strong);
  letter-spacing: 0.02em;
}
.h2-lg { margin-bottom: clamp(60px, 8vw, 90px); }
.body-p {
  margin: 0;
  max-width: 70ch;
  font-size: clamp(16.5px, 1.35vw, 18px);
  line-height: 2.05;
  color: var(--ink);
  text-wrap: pretty;
  text-shadow: 0 2px 20px rgba(12, 13, 16, 0.9);
}

/* ---------- Engine (3D scrollytelling) ---------- */
#engine { position: relative; height: 300vh; z-index: 1; }
#firm { padding-bottom: clamp(40px, 5vw, 64px); }
#approach { padding-top: clamp(40px, 5vw, 64px); }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.engine-head {
  position: absolute;
  top: clamp(90px, 13vh, 130px);
  left: 0;
  right: 0;
  opacity: 0;
}
.engine-head .h2 { margin-bottom: 0; }
.engine-labels {
  position: absolute;
  right: clamp(20px, 7vw, 120px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(280px, 32vw, 440px);
  height: clamp(180px, 30vh, 260px);
  pointer-events: none;
}
.lbl {
  position: absolute;
  inset: 0;
  opacity: 0;
  display: flex;
  align-items: baseline;
  gap: 20px;
  border-left: 1px solid rgba(212, 175, 94, 0.4);
  padding-left: 22px;
}
.lbl .n { font-family: var(--mono); font-size: clamp(13px, 1.3vw, 15px); letter-spacing: 0.2em; color: var(--gold); }
.lbl .lt { display: flex; flex-direction: column; gap: 14px; }
.lbl .t {
  font-family: var(--mono);
  font-size: clamp(15px, 1.6vw, 19px);
  letter-spacing: 0.24em;
  color: var(--ink-strong);
  text-shadow: 0 1px 14px rgba(12, 13, 16, 0.95);
}
.lbl .d {
  margin: 0;
  font-size: clamp(14.5px, 1.25vw, 16.5px);
  line-height: 1.9;
  color: rgba(227, 222, 207, 0.85);
  text-wrap: pretty;
  text-shadow: 0 1px 16px rgba(12, 13, 16, 0.95);
}

/* ---------- Approach cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(36px, 4vw, 56px);
}
.card { border-top: 1px solid rgba(212, 175, 94, 0.22); padding-top: 36px; }
.card canvas { width: 100%; height: 170px; display: block; margin-bottom: 32px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.card-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; color: var(--gold-soft); }
.card-idx { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: rgba(227, 222, 207, 0.35); }
.card h3 { margin: 0 0 22px; font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.4vw, 30px); color: var(--ink-strong); }
.card p { margin: 0; font-size: clamp(15px, 1.2vw, 15.5px); line-height: 1.95; color: rgba(227, 222, 207, 0.88); text-wrap: pretty; }

/* ---------- Contact ---------- */
.contact-center { text-align: center; }
.h2-contact { margin-bottom: 32px; }
.contact-p { margin: 0 0 48px; font-size: 16px; line-height: 1.9; color: rgba(227, 222, 207, 0.85); }
.mail-link {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  color: var(--ink-strong);
  border-bottom: 1px solid rgba(212, 175, 94, 0.35);
  padding-bottom: 8px;
  transition: all 350ms;
  overflow-wrap: break-word;
}
.mail-link:hover { color: var(--gold); border-bottom-color: var(--gold); }
.contact-loc { margin-top: 52px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.32em; color: rgba(227, 222, 207, 0.55); }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  padding: 56px var(--pad);
  border-top: 1px solid rgba(212, 175, 94, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: rgba(12, 13, 16, 0.7);
}
.footer-copy { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: rgba(227, 222, 207, 0.5); }
.legal-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: rgba(227, 222, 207, 0.7);
  border-bottom: 1px solid transparent;
  padding: 0 0 3px;
  transition: all 250ms;
}
.legal-btn:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- Legal overlay ---------- */
.legal-overlay { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(12, 13, 16, 0.97); overflow-y: auto; }
.legal-overlay.open { display: block; }
.legal-inner { max-width: 760px; margin: 0 auto; padding: 120px var(--pad); }
.legal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 48px; }
.legal-tag { font-family: var(--mono); font-size: 12px; letter-spacing: 0.4em; color: var(--gold); }
.legal-p { margin: 0; font-size: 15px; line-height: 2.1; color: var(--ink); text-wrap: pretty; }
.legal-rule { margin-top: 64px; width: 48px; height: 1px; background: rgba(212, 175, 94, 0.4); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  #engine { height: 260vh; }
  .engine-labels {
    right: var(--pad);
    left: var(--pad);
    top: auto;
    bottom: clamp(32px, 8vh, 72px);
    transform: none;
    width: auto;
    height: clamp(150px, 24vh, 200px);
  }
  .lbl { gap: 14px; padding-left: 16px; }
  .lbl .t { font-size: 13.5px; letter-spacing: 0.2em; }
  .lbl .d { font-size: 14px; line-height: 1.8; }
  .engine-head { top: 88px; }
  .cards { grid-template-columns: 1fr; }
  .hero-lede h1 { font-size: 1.02rem; }
}

@media (max-width: 480px) {
  .brand-name { letter-spacing: 0.22em; }
  .hero-sub-row { gap: 14px; }
  .lbl .lt { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { animation: none; }
}
