/* =========================================================
   Montecastilla — Design System
   ========================================================= */

:root {
  /* Brand palette: deep navy + champagne gold + violet (from logo) */
  --bg: #0a1326;
  --bg-2: #0e1a33;
  --surface: #142244;
  --surface-2: #1a2a52;
  --line: rgba(232, 220, 192, 0.10);
  --line-strong: rgba(232, 220, 192, 0.22);

  --ink: #f5f1e8;        /* warm cream — primary text */
  --ink-2: #c8c2b3;      /* muted */
  --ink-3: #8a8576;      /* very muted */

  --gold: #d4b87a;       /* champagne gold */
  --gold-bright: #e8c989;
  --gold-deep: #a08851;

  --violet: #8b5cf6;     /* logo crown */
  --violet-deep: #6d28d9;

  --blue: #4a9eff;       /* classic corporate blue */
  --blue-deep: #2563eb;

  --success: #4ade80;
  --danger: #f87171;

  /* Density */
  --dens: 1;             /* 0.85 compact, 1 normal, 1.18 airy */
  --pad-section: calc(120px * var(--dens));
  --pad-x: clamp(20px, 5vw, 80px);

  /* Type */
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-sans: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Easing */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light mode override */
[data-mode="light"] {
  --bg: #f7f4ec;
  --bg-2: #efeadd;
  --surface: #ffffff;
  --surface-2: #f3eedf;
  --line: rgba(20, 34, 68, 0.12);
  --line-strong: rgba(20, 34, 68, 0.22);
  --ink: #0e1a33;
  --ink-2: #4b5563;
  --ink-3: #8a8576;
  --gold-deep: #8a6f3a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

/* ---- Type ---- */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.02;
  font-style: normal;
}
.display em { font-style: italic; font-weight: 300; color: var(--gold); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

h1, h2, h3, h4 { margin: 0; font-weight: 400; }

p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* ---- Layout ---- */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.section {
  padding-top: var(--pad-section);
  padding-bottom: var(--pad-section);
  position: relative;
}

.divider-h {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
}
.btn .arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary {
  background: var(--gold);
  color: #1a1408;
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-link {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
  color: var(--ink);
}
.btn-link:hover { color: var(--gold); border-color: var(--gold); }

/* ---- Nav ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
  transition: padding 0.3s var(--ease), background 0.3s var(--ease), min-height 0.3s var(--ease);
  min-height: 120px;
}
.nav.scrolled {
  padding-top: 14px;
  padding-bottom: 14px;
  min-height: 92px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.nav-logo { height: 84px; }
.nav.scrolled .nav-logo { height: 60px; }

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px 0;
  transition: height 0.3s var(--ease);
}
.nav-logo img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 12px rgba(0,0,0,0.15));
}
[data-mode="light"] .nav-logo img { filter: invert(1) brightness(0.15); }

.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}
.nav-link {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--gold); }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 1px;
  background: var(--gold);
}

.nav-right { display: flex; align-items: center; gap: 14px; }

.lang-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}
.lang-toggle button {
  background: transparent;
  border: none;
  color: var(--ink-3);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.2s var(--ease);
}
.lang-toggle button.active {
  background: var(--ink);
  color: var(--bg);
}

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  padding-top: 170px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero h1 {
  font-size: clamp(48px, 7vw, 96px);
}
.hero-sub {
  margin-top: 24px;
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--ink-2);
  max-width: 520px;
  line-height: 1.6;
}
.hero-ctas {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---- Monte Carlo canvas ---- */
.mc-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  position: relative;
}
.mc-canvas-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}
.mc-canvas-wrap canvas { display: block; width: 100%; height: 100%; }

.mc-controls { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .mc-controls { grid-template-columns: 1fr; } }
.mc-ctrl label { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.mc-ctrl-row { display: flex; align-items: center; gap: 10px; }
.mc-ctrl input[type="range"] { flex: 1; accent-color: var(--gold); }
.mc-val { font-family: var(--font-mono); font-size: 13px; color: var(--gold); min-width: 48px; text-align: right; }

.mc-stats { display: flex; gap: 22px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.mc-stat { display: flex; flex-direction: column; gap: 2px; }
.mc-stat-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.mc-stat-val { font-family: var(--font-mono); font-size: 18px; color: var(--ink); }
.mc-stat-val.pos { color: var(--success); }
.mc-stat-val.neg { color: var(--danger); }
.mc-stat-val.gold { color: var(--gold); }

/* Background grid effect for hero */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at 70% 30%, black, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

.bg-glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--violet) 28%, transparent), transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s var(--ease);
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

/* ---- Service rows ---- */
.service-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: calc(40px * var(--dens)) 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: padding-left 0.4s var(--ease);
  position: relative;
}
.service-row:hover { padding-left: 24px; }
.service-row:last-child { border-bottom: 1px solid var(--line); }
.service-row .idx { font-family: var(--font-mono); color: var(--ink-3); font-size: 13px; letter-spacing: 0.1em; }
.service-row .title { font-family: var(--font-display); font-size: clamp(28px, 3vw, 44px); font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; }
.service-row .desc { font-family: var(--font-sans); font-size: 14px; color: var(--ink-2); margin-top: 8px; max-width: 60ch; }
.service-row .meta { font-family: var(--font-mono); font-size: 12px; color: var(--gold); letter-spacing: 0.1em; }
.service-row .meta .arrow { display: inline-block; margin-left: 8px; transition: transform 0.3s var(--ease); }
.service-row:hover .meta .arrow { transform: translateX(4px); }

@media (max-width: 720px) {
  .service-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ---- Stat tiles ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-cell {
  padding: calc(36px * var(--dens)) 24px;
  border-right: 1px solid var(--line);
  position: relative;
}
.stat-cell:last-child { border-right: none; }
@media (max-width: 800px) {
  .stat-cell:nth-child(2) { border-right: none; }
  .stat-cell:nth-child(1), .stat-cell:nth-child(2) { border-bottom: 1px solid var(--line); }
}
.stat-num { font-family: var(--font-display); font-size: clamp(48px, 6vw, 88px); font-weight: 300; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.stat-num em { color: var(--gold); font-style: italic; }
.stat-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-top: 12px; }

/* ---- Industry chips / cards ---- */
.industries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
@media (max-width: 780px) { .industries { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .industries { grid-template-columns: 1fr; } }
.industry {
  background: var(--surface);
  padding: calc(36px * var(--dens)) 24px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s var(--ease);
}
.industry:hover { background: var(--surface-2); }
.industry .ind-num { font-family: var(--font-mono); font-size: 11px; color: var(--gold); letter-spacing: 0.14em; }
.industry .ind-name { font-family: var(--font-display); font-size: 26px; font-weight: 400; margin-top: 12px; line-height: 1.1; }
.industry .ind-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 8px; letter-spacing: 0.08em; }
.industry .ind-projects { position: absolute; top: 22px; right: 22px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

/* ---- Team cards ---- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 1100px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .team-grid { grid-template-columns: 1fr; } }
.member-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
  display: flex;
  flex-direction: column;
}
.member-photo {
  aspect-ratio: 1 / 1;
  width: 120px;
  border-radius: 50%;
  background:
    repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 6px, color-mix(in srgb, var(--surface-2) 70%, var(--gold)) 6px, color-mix(in srgb, var(--surface-2) 70%, var(--gold)) 7px),
    var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 56px;
  color: var(--gold);
  border: 1px solid var(--line);
  flex-shrink: 0;
  overflow: hidden;
}
.member-photo--img {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}
.member-photo--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(1) contrast(1.02);
}
.member-name { font-family: var(--font-display); font-size: clamp(28px, 2.4vw, 38px); line-height: 1.05; margin-top: 24px; font-weight: 400; }
.member-role { font-family: var(--font-mono); color: var(--gold); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 8px; }
.member-bio { color: var(--ink-2); font-size: 14px; line-height: 1.7; margin-top: 16px; }
.member-creds {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cred { display: flex; align-items: baseline; gap: 12px; font-size: 13px; }
.cred-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); min-width: 64px; }
.cred-val { color: var(--ink); }

/* ---- Blog ---- */
.post-list { display: flex; flex-direction: column; }
.post {
  display: grid;
  grid-template-columns: 100px 1fr 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: padding-left 0.3s var(--ease);
}
.post:hover { padding-left: 16px; }
.post:last-child { border-bottom: 1px solid var(--line); }
.post .date { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; }
.post .post-title { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 32px); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }
.post .post-tag { font-family: var(--font-mono); font-size: 11px; color: var(--gold); letter-spacing: 0.14em; text-transform: uppercase; }
.post .post-read { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; }
@media (max-width: 800px) {
  .post { grid-template-columns: 1fr; gap: 8px; }
}

/* ---- Map / Region ---- */
.region-map {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}
.region-map svg { width: 100%; height: 100%; display: block; }

.region-pin {
  position: absolute;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
}
.region-pin .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); position: absolute; top: 2px; left: 2px; z-index: 2; box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 30%, transparent); }
.region-pin .pulse {
  position: absolute; inset: 0;
  border-radius: 50%; background: var(--gold);
  animation: pulse 2.4s ease-out infinite;
  opacity: 0.6;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(3.4); opacity: 0; }
}
.region-pin .label {
  position: absolute;
  top: -24px;
  left: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink);
  white-space: nowrap;
  background: var(--bg);
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

/* ---- FAQ ---- */
.faq-item {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  cursor: pointer;
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.faq-q { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.3; flex: 1; }
.faq-toggle { font-family: var(--font-mono); color: var(--gold); font-size: 18px; transition: transform 0.3s var(--ease); flex-shrink: 0; }
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.7;
  transition: max-height 0.4s var(--ease), margin 0.4s var(--ease);
}
.faq-item.open .faq-a { max-height: 400px; margin-top: 16px; }

/* ---------- Clients marquee ---------- */
.clients-section {
  padding: calc(72px * var(--dens)) 0 0;
  position: relative;
}
.clients-marquee {
  margin-top: 12px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  padding: 36px 0;
  --marquee-mask: linear-gradient(90deg, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
  -webkit-mask-image: var(--marquee-mask);
  mask-image: var(--marquee-mask);
}
.clients-track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  animation: clients-scroll 90s linear infinite;
}
.clients-marquee:hover .clients-track { animation-play-state: paused; }

.client-cell {
  flex: 0 0 auto;
  width: 200px;
  height: 100px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.client-cell img {
  max-width: 100%;
  max-height: 78%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  /* Subtle desaturation so a heterogeneous color set still reads as a coherent strip;
     hover restores full color. */
  filter: grayscale(0.35) opacity(0.85);
  transition: filter 0.3s var(--ease);
}
.client-cell:hover img { filter: grayscale(0) opacity(1); }

@keyframes clients-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (max-width: 720px) {
  .client-cell { width: 150px; height: 80px; padding: 0 12px; }
  .clients-track { animation-duration: 70s; }
}

/* Light mode: same white strip with light borders looks fine; just ensure mask works */
[data-mode="light"] .clients-marquee { background: #ffffff; }

/* The old fallback (in case some place still references) */
.logo-strip { display: none; }

/* ---- Testimonial ---- */
.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 44px;
  position: relative;
}
.testimonial-card .quote-mark {
  position: absolute;
  top: 18px; right: 28px;
  font-family: var(--font-display);
  font-size: 100px;
  color: var(--gold);
  line-height: 1;
  opacity: 0.4;
}
.testimonial-text { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 30px); font-weight: 400; line-height: 1.35; }
.testimonial-author { margin-top: 24px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--ink-3); }
.testimonial-author strong { color: var(--ink); font-weight: 500; }

/* ---- Footer ---- */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 80px 0 30px;
  position: relative;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
.footer-col h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; font-weight: 500; }
.footer-col a, .footer-col p { display: block; color: var(--ink-2); font-size: 14px; line-height: 1.9; cursor: pointer; transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

/* ---- Forms ---- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field textarea, .field select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 10px 0;
  outline: none;
  transition: border-color 0.2s var(--ease);
  border-radius: 0;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 100px; }

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.8s var(--ease) both; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ---- Page transitions ---- */
.page { animation: fadeUp 0.6s var(--ease) both; }

/* ---- Section header ---- */
.section-head { margin-bottom: calc(56px * var(--dens)); display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(40px, 5vw, 64px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.05; max-width: 18ch; }
.section-head h2 em { font-style: italic; color: var(--gold); }
.section-head .lead { font-size: 15px; color: var(--ink-2); max-width: 40ch; }

/* ---- Process steps ---- */
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
@media (max-width: 800px) { .process-steps { grid-template-columns: repeat(2, 1fr); } }
.step {
  background: var(--surface);
  padding: 32px 24px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.step-num { font-family: var(--font-display); font-size: 56px; line-height: 1; color: var(--gold); font-weight: 300; }
.step h4 { font-family: var(--font-display); font-size: 22px; font-weight: 400; margin-top: 16px; }
.step p { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.6; }

/* ---- Subtle utility ---- */
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.gold { color: var(--gold); }
.serif { font-family: var(--font-display); }
.mono { font-family: var(--font-mono); }

/* Reduce motion: shorten most animations, but keep the clients marquee at its real
   speed — the marquee is informational, not decorative, and a 0.01ms infinite loop
   spins it into illegibility. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .clients-track {
    animation: clients-scroll 90s linear infinite !important;
  }
}
@media (prefers-reduced-motion: reduce) and (max-width: 720px) {
  .clients-track {
    animation: clients-scroll 70s linear infinite !important;
  }
}

/* ===========================================
   MOBILE NAVIGATION — Hamburguesa para iPhone
   =========================================== */

/* Botón hamburguesa: oculto por defecto en desktop */
.nav-burger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  margin-left: 4px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: all 0.3s var(--ease);
  border-radius: 2px;
}
.nav.mobile-open .nav-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav.mobile-open .nav-burger span:nth-child(2) {
  opacity: 0;
}
.nav.mobile-open .nav-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Menú móvil desplegable: oculto por defecto */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 24px var(--pad-x) 32px;
  flex-direction: column;
  gap: 4px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease);
}
.mobile-menu.open {
  max-height: 600px;
}
.mobile-link {
  padding: 14px 4px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s var(--ease);
}
.mobile-link.active {
  color: var(--gold);
}
.mobile-cta {
  margin-top: 20px;
  width: 100%;
  padding: 14px !important;
  font-size: 14px !important;
  text-align: center;
  justify-content: center;
}

/* En pantallas < 900px: ocultar nav desktop, mostrar hamburguesa */
@media (max-width: 900px) {
  .nav {
    min-height: 80px;
    padding: 12px var(--pad-x);
    position: relative;
  }
  .nav.scrolled {
    min-height: 70px;
  }
  .nav-logo {
    height: 56px;
  }
  .nav.scrolled .nav-logo {
    height: 48px;
  }
  .nav-links {
    display: none;
  }
  .nav-cta-desktop {
    display: none;
  }
  .nav-burger {
    display: flex;
  }
  .mobile-menu {
    display: flex;
  }
  .lang-toggle {
    font-size: 10px;
  }
  .lang-toggle button {
    padding: 4px 8px;
  }
  /* Fix: la nav debe quedar fixed para que el menú móvil se vea bien */
  .nav {
    position: fixed;
  }
}

/* Ajustes extra para móvil pequeño */
@media (max-width: 480px) {
  .nav {
    padding: 10px 16px;
    gap: 10px;
  }
  .nav-logo {
    height: 48px;
  }
  .nav.scrolled .nav-logo {
    height: 42px;
  }
  .nav-right {
    gap: 8px;
  }
}

/* Prevenir scroll horizontal en todo el body en móvil */
@media (max-width: 900px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
}
