/* ═══════════════════════════════════════════
   MALAGA PARTNERS — style.css
   Typography: Playfair Display + DM Sans
   Light / Dark system
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ── CSS VARIABLES ──────────────────────── */
:root {
  --brand:       #C8853C;
  --brand-dim:   rgba(200,133,60,0.12);
  --brand-line:  rgba(200,133,60,0.30);

  --bg:          #F9F6F1;
  --bg-alt:      #FFFFFF;
  --bg-deep:     #EDE8E0;
  --surface:     #FFFFFF;
  --surface-alt: #F3EEE6;
  --text:        #1A1612;
  --text-mid:    #3D3530;
  --text-soft:   #7A6F65;
  --text-faint:  #A89E95;
  --border:      rgba(26,22,18,0.10);
  --border-mid:  rgba(26,22,18,0.18);
  --shadow:      rgba(26,22,18,0.08);
  --nav-bg:      rgba(249,246,241,0.92);
  --ticker-text: #F9F6F1;
  --error:       #c0392b;
}

[data-theme="dark"] {
  --bg:          #0F0D0B;
  --bg-alt:      #161310;
  --bg-deep:     #0A0907;
  --surface:     #1C1915;
  --surface-alt: #221F1A;
  --text:        #F2EDE6;
  --text-mid:    #C8C0B5;
  --text-soft:   #8A8075;
  --text-faint:  #5A5248;
  --border:      rgba(242,237,230,0.09);
  --border-mid:  rgba(242,237,230,0.16);
  --shadow:      rgba(0,0,0,0.35);
  --nav-bg:      rgba(15,13,11,0.94);
  --ticker-text: #0F0D0B;
}

/* ── RESET ──────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-weight: 300;
  overflow-x: hidden;
  transition: background 0.35s, color 0.35s;
  line-height: 1.65;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button, a { touch-action: manipulation; }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 1000;
  padding: 10px 14px; background: var(--surface); color: var(--text);
  border: 1px solid var(--brand); transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

/* ── TYPOGRAPHY ─────────────────────────── */
.serif { font-family: 'Playfair Display', Georgia, serif; }

/* ── NAV ────────────────────────────────── */
nav {
  position: fixed; top:0; left:0; right:0; z-index:200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 64px;
  transition: all 0.4s;
}
nav.scrolled {
  padding: 14px 64px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
/* Logo oculto en el hero; aparece más pequeño al hacer scroll */
.nav-logo { transition: opacity 0.4s, transform 0.4s; }
nav.scrolled { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-logo img { height: 36px; }

/* Logo grande en el hero */
.hero-logo-lockup {
  margin-bottom: 28px;
  opacity: 0; animation: fadeUp 0.9s 0.1s forwards;
}
.hero-logo {
  width: 100%;
  max-width: 460px;
  height: auto;
  display: block;
  margin-bottom: 60px;
}

.nav-links {
  display: flex; align-items: center; gap: 36px;
}
.nav-links a {
  font-size: 11px; font-weight: 500; letter-spacing: 0.20em;
  text-transform: uppercase; color: var(--text-soft);
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--brand); }

.nav-controls {
  display: flex; align-items: center; gap: 12px;
}

.lang-toggle {
  font-size: 11px; font-weight: 500; letter-spacing: 0.20em;
  text-transform: uppercase; background: none;
  border: 1px solid var(--brand-line);
  color: var(--brand); padding: 7px 16px;
  min-height: 44px;
  cursor: pointer; transition: all 0.25s;
}
.lang-toggle:hover { background: var(--brand); color: var(--bg); }

.theme-btn {
  width: 44px; height: 44px;
  border: 1px solid var(--border-mid);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s; flex-shrink: 0;
}
.theme-btn:hover { border-color: var(--brand); color: var(--brand); }
.theme-btn svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.6; }

/* ── HAMBURGER ──────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column; justify-content: space-between;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer; padding: 12px 8px;
}
.hamburger span {
  display: block; width: 100%; height: 1.5px;
  background: var(--text-soft); transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(8.25px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8.25px) rotate(-45deg); }

/* ── MOBILE MENU ────────────────────────── */
.mobile-menu {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 190;
  background: var(--bg);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 32px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.mobile-menu.open {
  opacity: 1; pointer-events: auto;
}
.mobile-menu a {
  font-size: 28px; font-weight: 300;
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--text); letter-spacing: 0.02em;
  transition: color 0.2s;
  min-height: 44px; display: flex; align-items: center;
}
.mobile-menu a:hover { color: var(--brand); }

/* ── HERO ───────────────────────────────── */
.hero {
  min-height: 100vh; position: relative;
  display: grid; grid-template-columns: 52% 48%;
  overflow: hidden;
}
.hero-left {
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 160px 72px 108px 64px; position: relative; z-index: 2;
  background: linear-gradient(150deg, var(--bg) 0%, var(--bg) 80%, transparent 100%);
}
[data-theme="dark"] .hero-left {
  background: linear-gradient(150deg, var(--bg) 0%, var(--bg) 75%, transparent 100%);
}
.hero-right { position: relative; overflow: hidden; }
.hero-right img {
  width: 100%; height: 100%; object-fit: cover;
  filter: brightness(0.48) saturate(0.75);
  transition: transform 8s ease;
}
.hero:hover .hero-right img { transform: scale(1.04); }
.hero-right::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, var(--bg) 0%, transparent 50%);
}

.hero-eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.38em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 24px;
  opacity: 0; animation: fadeUp 0.9s 0.2s forwards;
}
.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(50px, 5.4vw, 86px);
  font-weight: 400; line-height: 1.05;
  letter-spacing: -0.01em; margin-bottom: 36px;
  opacity: 0; animation: fadeUp 0.9s 0.4s forwards;
  color: var(--text);
}
.hero-title em { font-style: italic; color: var(--brand); }

.hero-desc {
  font-size: 15px; font-weight: 300; line-height: 2.0;
  color: var(--text-soft); max-width: 460px; margin-bottom: 44px;
  opacity: 0; animation: fadeUp 0.9s 0.6s forwards;
}

/* ── HERO CTA BUTTONS ───────────────────── */
.hero-cta {
  display: flex; gap: 16px; flex-wrap: wrap;
  opacity: 0; animation: fadeUp 0.9s 0.8s forwards;
}
.btn-primary {
  display: inline-block;
  background: var(--brand); color: var(--bg);
  font-size: 10px; font-weight: 500; letter-spacing: 0.26em;
  text-transform: uppercase; padding: 14px 36px;
  min-height: 44px;
  transition: all 0.25s; border: 1px solid var(--brand);
}
.btn-primary:hover { background: transparent; color: var(--brand); }
.btn-secondary {
  display: inline-block;
  background: transparent; color: var(--text-soft);
  font-size: 10px; font-weight: 500; letter-spacing: 0.26em;
  text-transform: uppercase; padding: 14px 36px;
  min-height: 44px;
  border: 1px solid var(--border-mid); transition: all 0.25s;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

.hero-scroll {
  position: absolute; bottom: 48px; right: 48px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  opacity: 0; animation: fadeIn 1s 1.4s forwards;
}
.hero-scroll span {
  font-size: 8px; letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--text-faint); writing-mode: vertical-rl;
}
.scroll-line {
  width: 1px; height: 52px;
  background: linear-gradient(to bottom, var(--brand), transparent);
  animation: scrollPulse 2.5s infinite;
}

/* ── TICKER ─────────────────────────────── */
.ticker { background: var(--brand); padding: 12px 0; overflow: hidden; white-space: nowrap; }
.ticker-inner { display: inline-block; animation: marquee 30s linear infinite; }
.ticker-inner span {
  font-size: 9px; font-weight: 600; letter-spacing: 0.30em;
  text-transform: uppercase; color: var(--ticker-text); margin: 0 28px; opacity: 0.92;
}
.ticker-inner span::before { content:"·"; margin-right:28px; opacity:0.5; }

/* ── SHARED SECTION ─────────────────────── */
section { padding: 120px 64px; }

.section-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.40em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 16px;
}
.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(34px, 3.8vw, 56px); font-weight: 400;
  line-height: 1.08; margin-bottom: 24px; color: var(--text);
}
.section-title em { font-style: italic; color: var(--brand); }
.divider { width:32px; height:1px; background:var(--brand); margin-bottom:40px; }
.body-text {
  font-size: 15.5px; font-weight: 300; line-height: 2.05;
  color: var(--text-soft); max-width: 580px;
}

/* ── ABOUT ──────────────────────────────── */
#about { background: var(--bg-alt); }
.about-inner { display:grid; grid-template-columns:1fr 1fr; gap:88px; align-items:center; }
.about-image { position:relative; height:580px; overflow:hidden; }
.about-image::before {
  content:""; position:absolute;
  top:-16px; left:-16px; right:16px; bottom:16px;
  border:1px solid var(--brand-line); z-index:0;
}
.about-image img { width:100%; height:100%; object-fit:cover; position:relative; z-index:1; }

.about-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px; margin-top: 48px;
}
.stat-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 40px; font-weight: 400; color: var(--text);
  line-height: 1; margin-bottom: 8px;
}
.stat-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.20em;
  text-transform: uppercase; color: var(--text-soft); line-height: 1.5;
}

/* ── QUOTE ──────────────────────────────── */
.quote-section {
  padding: 100px 64px; background: var(--bg-deep); position: relative; overflow: hidden;
}
.quote-section::before {
  content: "\201C";
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 300px; font-weight: 400;
  color: var(--brand-dim);
  position: absolute; top: -80px; left: 32px;
  line-height: 1; pointer-events: none; user-select: none;
}
.quote-inner { max-width: 860px; margin: 0 auto; text-align: center; }
.quote-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(20px, 2.6vw, 36px);
  font-weight: 400; font-style: italic;
  line-height: 1.6; color: var(--text);
}
.quote-text em { font-style: normal; color: var(--brand); font-weight: 500; }
.quote-rule { width:32px; height:1px; background:var(--brand); margin:36px auto 0; opacity:0.6; }

/* ── IMAGE BREAK ────────────────────────── */
.image-break {
  height: 480px; overflow: hidden; position: relative;
}
.image-break-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.image-break-overlay h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(32px, 4vw, 60px); font-weight: 400;
  line-height: 1.1; color: #F2EDE6;
}
.image-break-overlay h2 em { font-style: italic; color: var(--brand); }
.image-break-overlay .section-label { color: var(--brand); margin-bottom: 20px; }

/* ── STRATEGY ───────────────────────────── */
#strategy { background: var(--bg); }
.strategy-intro { max-width: 680px; margin-bottom: 60px; }
.strategy-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border); border: 1px solid var(--border);
}
.strategy-item {
  background: var(--bg); padding: 52px 44px;
  position: relative; overflow: hidden; transition: background 0.35s;
}
.strategy-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--brand); transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.5s;
}
.strategy-item:hover::before { transform: scaleY(1); }
.strategy-item:hover { background: var(--brand-dim); }
.strategy-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 48px; font-weight: 400;
  color: var(--brand-line); line-height: 1; margin-bottom: 20px;
}
.strategy-item h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px; font-weight: 400;
  color: var(--text); margin-bottom: 14px;
}
.strategy-item p {
  font-size: 14.5px; font-weight: 300; line-height: 2.0;
  color: var(--text-soft);
}

/* ── TEAM ───────────────────────────────── */
#team { background: var(--bg-alt); }
.team-intro { max-width: 680px; margin-bottom: 68px; }
.team-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border); border: 1px solid var(--border);
}
/* FIX: 4-column modifier */
.team-grid--4 { grid-template-columns: repeat(4, 1fr); }

.team-card {
  background: var(--bg-alt); padding: 48px 36px 52px;
  position: relative; overflow: hidden; transition: background 0.35s;
  display: flex; flex-direction: column;
}
.team-card::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--brand);
  transform: scaleX(0); transition: transform 0.4s;
  transform-origin: left;
}
.team-card:hover::after { transform: scaleX(1); }
.team-card:hover { background: var(--brand-dim); }

.team-monogram {
  width: 62px; height: 62px;
  border: 1.5px solid var(--brand-line);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px; flex-shrink: 0; position: relative;
}
.team-monogram::before {
  content: ""; position: absolute;
  top: 5px; left: 5px; right: -5px; bottom: -5px;
  border: 1px solid var(--brand-dim);
}
.team-monogram span {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px; font-weight: 400; font-style: italic;
  color: var(--brand); line-height: 1; letter-spacing: -0.02em;
}
.team-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px; font-weight: 400;
  color: var(--text); margin-bottom: 4px;
}
.team-role {
  font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 18px;
}
.team-bio {
  font-size: 13.5px; line-height: 1.9; color: var(--text-soft);
  margin-bottom: 24px; flex: 1;
}
.linkedin-link {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brand); transition: gap 0.3s; margin-top: auto;
  min-height: 44px;
}
.linkedin-link:hover { gap: 14px; }
.linkedin-link svg { width: 13px; height: 13px; fill: currentColor; }

/* ── CONTACT ────────────────────────────── */
#contact { background: var(--bg-deep); }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 88px; }
#contact h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 3.2vw, 48px); font-weight: 400;
  line-height: 1.15; margin-bottom: 40px; color: var(--text);
}
#contact h2 em { font-style: italic; color: var(--brand); }
.contact-detail {
  display: flex; align-items: baseline; gap: 18px;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.contact-label {
  font-size: 8.5px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--text-faint); min-width: 64px;
}
.contact-detail a { font-size: 14px; color: var(--text); transition: color 0.25s; }
.contact-detail a:hover { color: var(--brand); }

/* Form */
.form-group { margin-bottom: 28px; position: relative; }
.form-group label {
  display: block; font-size: 9px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--text); margin-bottom: 10px;
}
.form-group input, .form-group textarea {
  width: 100%; background: transparent;
  border: none; border-bottom: 1px solid var(--border-mid);
  color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 300; padding: 12px 0;
  outline: none; transition: border-color 0.25s;
}
.form-group input:focus, .form-group textarea:focus { border-bottom-color: var(--brand); }
.form-group input.invalid, .form-group textarea.invalid { border-bottom-color: var(--error); }
.form-group textarea { height: 90px; resize: none; }
.form-error {
  display: none; font-size: 10px; color: var(--error);
  letter-spacing: 0.12em; margin-top: 6px; position: absolute;
}
.form-group.has-error .form-error { display: block; }

.btn-submit {
  background: transparent; border: 1px solid var(--brand);
  color: var(--brand); font-family: 'DM Sans', sans-serif;
  font-size: 10px; font-weight: 500; letter-spacing: 0.26em;
  text-transform: uppercase; padding: 14px 44px;
  min-height: 44px;
  cursor: pointer; transition: all 0.25s;
}
.btn-submit:hover { background: var(--brand); color: var(--bg); }
.btn-submit:disabled { opacity: 0.5; cursor: default; }

/* ── FOOTER ─────────────────────────────── */
footer {
  padding: 36px 64px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  display: flex; justify-content: space-between; align-items: center;
}
footer img { height: 50px; opacity: 0.5; }
[data-theme="dark"] footer img { filter: invert(1); }
footer p { font-size: 10px; color: var(--text-faint); letter-spacing: 0.10em; }

/* ── ANIMATIONS ─────────────────────────── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(28px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; } to { opacity:1; }
}
@keyframes scrollPulse {
  0%,100% { opacity:1; } 50% { opacity:0.2; }
}
@keyframes marquee {
  from { transform:translateX(0); }
  to   { transform:translateX(-50%); }
}
.reveal {
  opacity:0; transform:translateY(32px);
  transition: opacity 0.85s ease, transform 0.85s ease;
}
.reveal.visible { opacity:1; transform:translateY(0); }
.d1 { transition-delay:0.10s; }
.d2 { transition-delay:0.22s; }
.d3 { transition-delay:0.34s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero:hover .hero-right img { transform: none; }
}

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 1200px) {
  .team-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .about-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  nav, nav.scrolled { padding: 18px 32px; }
  section { padding: 100px 32px; }
  .hero-left { padding: 140px 40px 90px 32px; }
  .about-inner { grid-template-columns: 1fr; gap: 48px; }
  .about-image { height: 440px; }
  .contact-inner { grid-template-columns: 1fr; gap: 56px; }
  .quote-section { padding: 80px 32px; }
}

@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .hero-left { padding: 140px 24px 80px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: flex; }
  nav, nav.scrolled { padding: 16px 24px; }
  section { padding: 80px 24px; }
  .strategy-grid { grid-template-columns: 1fr; }
  .team-grid, .team-grid--4 { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 12px; text-align: center; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .image-break { height: 320px; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 40px; }
  .nav-controls { gap: 8px; }
  .lang-toggle { padding: 6px 12px; font-size: 10px; }
  .about-stats { grid-template-columns: 1fr; }
}
