/* ════════════════════════════════════════════════════════════════════
   FRACTAL FINANCE × ROUSSEAU
   "Le Rêve Financier" — a moonlit jungle reimagining
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Jungle palette (default: emerald + sage) ── */
  --canopy:    #0b1a12;   /* deepest night behind the canopy */
  --jungle:    #11261a;   /* deep section ground */
  --leaf-deep: #173524;
  --leaf:      #2d6a4f;
  --leaf-mid:  #4a8568;
  --sage:      #7ba892;
  --paper:     #f1ead6;   /* sun-bleached cream */
  --paper-2:   #e9e0c7;
  --ink:       #16271c;   /* text on paper */
  --ink-soft:  #41564a;
  --cream-txt: #efe8d4;   /* text on dark */
  --cream-dim: rgba(239,232,212,0.62);
  --gold:      #e0a458;   /* the sun / exotic bloom */
  --gold-soft: #d9b277;
  --bloom:     #cf6a48;   /* coral flower, used sparingly */

  /* ── Type ── */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* ── Foliage controls (driven by Tweaks) ── */
  --foliage-opacity: 1;
  --sway: 1;

  /* ── Layout ── */
  --pad-x: clamp(1.5rem, 5vw, 5rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--jungle);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold); color: var(--canopy); }

/* ────────────────────────────────────────────────────────────────────
   SECTION FOLIAGE (per-section decorative layers, behind content)
   ──────────────────────────────────────────────────────────────────── */
.has-foliage { position: relative; overflow: hidden; }
.has-foliage > :where(:not(.sec-foliage)) { position: relative; z-index: 1; }
.sec-foliage {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden;
  opacity: var(--foliage-opacity);
  transition: opacity .6s ease;
}
.sec-foliage .frond {
  position: absolute;
  transform-origin: var(--origin, 50% 100%);
  will-change: transform;
}
.frond svg { display: block; }

/* a slow ambient sway, scaled by --sway (0 = still) */
@keyframes sway {
  0%, 100% { transform: rotate(calc(-1.6deg * var(--sway))); }
  50%      { transform: rotate(calc( 1.6deg * var(--sway))); }
}
.frond-base { transform-origin: var(--origin, 50% 100%); }
.frond-sway { transform-origin: var(--origin, 50% 100%); }
.frond-sway.living { animation: sway var(--dur, 9s) ease-in-out infinite; }
.frond-sway.living.alt { animation-direction: alternate-reverse; }
@media (prefers-reduced-motion: reduce) {
  .frond-sway.living { animation: none; }
}

/* sections sit above the backdrop */
.page { position: relative; z-index: 1; }

/* ────────────────────────────────────────────────────────────────────
   NAV
   ──────────────────────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem var(--pad-x);
  background: rgba(11,26,18,0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(123,168,146,0.16);
  transition: background .4s ease, box-shadow .4s ease;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--cream-txt); text-decoration: none;
}
.nav-logo .mark { width: 26px; height: 26px; flex: none; }
.nav-logo .mark path { stroke: var(--gold); }
.nav-links { display: flex; gap: 2.2rem; list-style: none; }
.nav-links a {
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--cream-dim); text-decoration: none;
  position: relative; transition: color 0.25s;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: var(--gold); transition: width 0.3s;
}
.nav-links a:hover { color: var(--cream-txt); }
.nav-links a:hover::after { width: 100%; }

.lang-switcher { display: flex; align-items: center; gap: 0.3rem; margin-left: 1.6rem; }
.lang-btn {
  background: none; border: 1px solid rgba(123,168,146,0.3);
  font-family: var(--font-body);
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cream-dim);
  padding: 0.28rem 0.55rem; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.lang-btn:hover { color: var(--cream-txt); border-color: var(--sage); }
.lang-btn.active { background: var(--gold); color: var(--canopy); border-color: var(--gold); }

/* ────────────────────────────────────────────────────────────────────
   HERO — moonlit jungle
   ──────────────────────────────────────────────────────────────────── */
#inicio {
  position: relative; min-height: 100vh;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  background:
    radial-gradient(120% 90% at 78% 18%, rgba(224,164,88,0.10) 0%, transparent 45%),
    linear-gradient(180deg, var(--canopy) 0%, var(--jungle) 62%, var(--leaf-deep) 100%);
  overflow: hidden;
}
.hero-content {
  display: flex; flex-direction: column; justify-content: center;
  padding: 8rem var(--pad-x) 6rem; position: relative; z-index: 3;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1.6rem;
}
.hero-tag::before { content: ''; width: 1.8rem; height: 1px; background: var(--gold); opacity: 0.7; }
.hero-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(3rem, 6vw, 6rem); line-height: 1.0;
  color: var(--cream-txt); margin-bottom: 1.4rem; letter-spacing: -0.01em;
}
.hero-title em { font-style: italic; font-weight: 500; color: var(--gold); }
.hero-subtitle {
  font-size: clamp(1rem, 1.3vw, 1.18rem); font-weight: 400;
  color: var(--sage); line-height: 1.6; margin-bottom: 1.4rem; max-width: 38ch;
}
.hero-body {
  font-size: 0.95rem; color: var(--cream-dim); line-height: 1.8;
  max-width: 46ch; margin-bottom: 2.6rem;
}
.btn-leaf {
  display: inline-flex; align-items: center; gap: 0.8rem; width: fit-content;
  background: var(--gold); color: var(--canopy); text-decoration: none;
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 1.05rem 2.1rem; border-radius: 2px; white-space: nowrap;
  transition: background 0.3s, gap 0.3s, transform 0.3s;
}
.btn-leaf:hover { background: var(--gold-soft); gap: 1.2rem; }
.btn-leaf svg { transition: transform 0.3s; }
.btn-leaf:hover svg { transform: translateX(4px); }
.btn-leaf.ghost {
  background: transparent; color: var(--cream-txt);
  border: 1px solid rgba(123,168,146,0.4);
}
.btn-leaf.ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(224,164,88,0.06); }

/* right visual column: moon + fractal fern */
.hero-visual { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; }
.hero-moon {
  position: absolute; top: 16%; right: 16%;
  width: clamp(120px, 16vw, 220px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fbf3dc 0%, #f3e4bd 48%, #e7cf9a 100%);
  box-shadow: 0 0 60px rgba(247,232,193,0.35), 0 0 140px rgba(224,164,88,0.25);
}
.hero-moon::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 64% 60%, rgba(123,168,146,0.18) 0%, transparent 30%),
              radial-gradient(circle at 40% 70%, rgba(123,168,146,0.14) 0%, transparent 22%);
}
#fern-canvas {
  position: relative; z-index: 3;
  width: min(92%, 560px); height: 78%;
  filter: drop-shadow(0 8px 30px rgba(0,0,0,0.4));
}
.hero-whisper {
  position: absolute; left: var(--pad-x); bottom: 2.6rem; z-index: 3;
  max-width: 30ch;
}
.hero-whisper p {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.15rem; color: rgba(239,232,212,0.7); line-height: 1.5;
}
.hero-whisper span {
  display: block; font-family: var(--font-body); font-style: normal;
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-top: 0.6rem;
}
.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  color: var(--cream-dim); font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase;
}
.scroll-hint .line { width: 1px; height: 2.4rem; background: linear-gradient(var(--gold), transparent); animation: drip 2.4s ease-in-out infinite; }
@keyframes drip { 0%,100% { opacity: .3; transform: scaleY(.6); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }

/* ────────────────────────────────────────────────────────────────────
   SECTION SHARED
   ──────────────────────────────────────────────────────────────────── */
section { padding: clamp(4.5rem, 9vw, 8rem) var(--pad-x); position: relative; }
.section-label {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1.1rem;
}
.section-label::before { content: ''; width: 1.5rem; height: 1px; background: currentColor; opacity: 0.7; }
.section-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.1rem, 4vw, 3.6rem); line-height: 1.08;
  color: var(--ink); margin-bottom: 1.4rem; letter-spacing: -0.01em;
}
.section-title em { font-style: italic; color: var(--leaf); }
.divider { width: 3rem; height: 1px; background: var(--gold); margin-bottom: 1.8rem; }

/* light sections sit on paper */
.on-paper { background: var(--paper); color: var(--ink); }
.on-paper .section-title { color: var(--ink); }
/* dark sections on jungle */
.on-jungle { background: var(--jungle); color: var(--cream-txt); }
.on-jungle .section-title { color: var(--cream-txt); }
.on-jungle .section-title em { color: var(--gold); }

/* ── VISIÓN — daylight clearing ── */
#vision {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2.5rem,5vw,6rem); align-items: center;
}
#vision .vision-text p { font-size: 0.98rem; line-height: 1.9; color: var(--ink-soft); margin-bottom: 1rem; }
#vision .vision-text strong { color: var(--leaf); font-weight: 600; }
.vision-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.stat-card {
  background: var(--paper-2); padding: 1.8rem 1.6rem; position: relative;
  border-radius: 2px; overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease;
}
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--gold);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(22,39,28,0.12); }
.stat-number {
  font-family: var(--font-display); font-size: 2.7rem; font-weight: 500;
  color: var(--leaf); line-height: 1;
}
.stat-label { font-size: 0.76rem; color: var(--ink-soft); margin-top: 0.5rem; line-height: 1.45; }

/* ── FRACTIONAL CFO — deep night ── */
#fractional-cfo { background: var(--canopy); color: var(--cream-txt); overflow: hidden; }
.fcfo-wrap {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem,5vw,5rem); align-items: center;
}
.fcfo-wrap .section-title { color: var(--cream-txt); }
.fcfo-wrap .section-title em { color: var(--gold); }
.fcfo-wrap p.lede { font-size: 0.98rem; line-height: 1.9; color: var(--cream-dim); margin-bottom: 1rem; }
.fcfo-wrap p.lede strong { color: var(--gold); font-weight: 600; }
.fcfo-cards { display: flex; flex-direction: column; gap: 1.1rem; }
.fcfo-card {
  padding: 1.6rem 1.8rem; border-left: 2px solid var(--gold);
  background: rgba(123,168,146,0.06); border-radius: 0 2px 2px 0;
  transition: background .3s ease, transform .3s ease;
}
.fcfo-card:hover { background: rgba(123,168,146,0.11); transform: translateX(4px); }
.fcfo-card .k { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.5rem; }
.fcfo-card p { font-size: 0.86rem; color: var(--cream-dim); line-height: 1.7; }

/* ── SERVICIOS — daylight, botanical cards ── */
#servicios { background: var(--paper); }
.servicios-header { margin-bottom: 3rem; }
.servicios-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(45,106,79,0.16); }
.servicio-card {
  background: var(--paper); padding: clamp(2rem,3.5vw,3rem) clamp(1.6rem,2.5vw,2.5rem);
  position: relative; transition: background 0.4s ease, color .4s ease; overflow: hidden;
}
.servicio-card .leaf-ico { width: 3.2rem; height: 3.2rem; margin-bottom: 1.4rem; }
.servicio-card .leaf-ico path,
.servicio-card .leaf-ico line { stroke: var(--leaf); transition: stroke .4s ease; }
.servicio-card .leaf-ico .fill { fill: var(--leaf); transition: fill .4s ease; }
.servicio-num {
  position: absolute; top: 1.6rem; right: 1.8rem;
  font-family: var(--font-display); font-size: 1.1rem; font-style: italic; color: var(--sage);
  transition: color .4s ease;
}
.servicio-card h3 {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 500;
  color: var(--ink); margin-bottom: 0.9rem; transition: color 0.4s;
}
.servicio-card p { font-size: 0.87rem; line-height: 1.8; color: var(--ink-soft); transition: color 0.4s; }
.servicio-card:hover { background: var(--leaf-deep); }
.servicio-card:hover h3 { color: var(--cream-txt); }
.servicio-card:hover p { color: var(--cream-dim); }
.servicio-card:hover .servicio-num { color: var(--gold); }
.servicio-card:hover .leaf-ico path,
.servicio-card:hover .leaf-ico line { stroke: var(--gold); }
.servicio-card:hover .leaf-ico .fill { fill: var(--gold); }

/* ── CASOS — twilight ── */
#casos { background: var(--leaf-deep); color: var(--cream-txt); }
#casos .section-title { color: var(--cream-txt); }
.casos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(123,168,146,0.16); }
.caso-card {
  background: var(--leaf-deep); padding: clamp(1.8rem,2.6vw,2.4rem) clamp(1.4rem,2.2vw,2rem);
  transition: background 0.35s ease, transform .35s ease;
}
.caso-card:hover { background: var(--jungle); }
.caso-card .section-label { color: var(--gold); margin-bottom: 0.9rem; }
.caso-card h3 {
  font-family: var(--font-display); font-size: 1.32rem; font-weight: 500;
  color: var(--cream-txt); margin-bottom: 0.7rem; line-height: 1.2;
}
.caso-card p { font-size: 0.84rem; line-height: 1.75; color: var(--cream-dim); }
.caso-card.wide { grid-column: span 2; }

/* ── CITA — moonlit ── */
#cita {
  text-align: center; padding: clamp(5rem,9vw,8.5rem) var(--pad-x);
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(224,164,88,0.10) 0%, transparent 50%),
    var(--canopy);
  color: var(--cream-txt); position: relative; overflow: hidden;
}
.quote-mark {
  font-family: var(--font-display); font-size: 7rem; color: var(--gold);
  line-height: 0.5; margin-bottom: 1.2rem; opacity: 0.5;
}
.quote-text {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(1.6rem, 3.2vw, 2.9rem); color: var(--cream-txt);
  max-width: 20em; margin: 0 auto 1.8rem; line-height: 1.42;
}
.quote-author { font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }

/* ── CONTACTO — daylight clearing ── */
#contacto {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem,5vw,6rem); align-items: center;
  background: var(--paper);
}
.contact-info p.body { font-size: 0.98rem; line-height: 1.9; color: var(--ink-soft); margin-bottom: 2.2rem; }
.contact-detail { display: flex; flex-direction: column; gap: 0.9rem; }
.contact-detail a, .contact-detail span {
  font-size: 0.9rem; color: var(--ink); text-decoration: none;
  display: flex; align-items: center; gap: 0.7rem;
}
.contact-detail svg { color: var(--leaf); flex: none; }
.contact-detail a:hover { color: var(--gold); }
.contact-card {
  background: var(--paper-2); padding: clamp(2rem,3vw,2.8rem); border-radius: 2px;
  position: relative; overflow: hidden;
}
.contact-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--gold); }
.contact-card p { font-size: 0.92rem; line-height: 1.8; color: var(--ink-soft); margin-bottom: 1.8rem; }

/* ── FOOTER — deep canopy ── */
footer {
  background: var(--canopy); color: var(--cream-dim);
  padding: 2.6rem var(--pad-x); position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  border-top: 1px solid rgba(123,168,146,0.14);
}
.footer-logo { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--cream-txt); }
.footer-copy { font-size: 0.74rem; }

/* ────────────────────────────────────────────────────────────────────
   REVEAL
   ──────────────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  #inicio { grid-template-columns: 1fr; min-height: auto; }
  .hero-visual { min-height: 60vh; order: -1; }
  .hero-content { padding-top: 6rem; }
  .hero-whisper { position: static; margin-top: 2rem; max-width: none; }
  #vision, #contacto { grid-template-columns: 1fr; }
  .fcfo-wrap { grid-template-columns: 1fr; }
  .servicios-grid { grid-template-columns: 1fr; }
  .casos-grid { grid-template-columns: 1fr; }
  .caso-card.wide { grid-column: span 1; }
  .scroll-hint { display: none; }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .vision-stats { grid-template-columns: 1fr; }
  footer { flex-direction: column; text-align: center; }
}
