/* Raíces del Bosque, shared stylesheet. Tokens first, then layout, then components. */

:root {
  --c-paper: #ffffff;
  --c-paper-2: #f1f5ef;
  --c-surface: #ffffff;
  --c-dark: #1e4d2b;
  --c-dark-deep: #143520;
  --c-accent: #3e8e4e;
  --c-accent-deep: #2f7340;
  --c-link: #1b7268;
  --c-ink: #22301f;
  --c-ink-60: #55644f;
  --c-line: rgba(30, 77, 43, 0.18);
  --c-on-accent: #ffffff;
  --c-wa: #25d366;
  --font-head: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;
  --head-weight: 500;
  --nav-h: 70px;
  --radius: 14px;
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--font-body);
  line-height: 1.7;
  padding-top: var(--nav-h);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--c-link); }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  color: var(--c-dark-deep);
  line-height: 1.15;
  text-wrap: balance;
}

h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

section { padding-block: clamp(3rem, 7vw, 5.5rem); }

.intro {
  max-width: 44rem;
  color: var(--c-ink-60);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  text-wrap: balance;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-link);
  margin-bottom: 0.75rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  background: var(--c-accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Nav */
nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(20, 53, 32, 0.97);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}
.nav-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: #fff; flex-shrink: 0; }
.nav-logo img { height: 44px; width: 44px; display: block; }
.nav-logo span { font-family: var(--font-head); font-size: 1.15rem; letter-spacing: 0.01em; white-space: nowrap; }
.nav-links { display: flex; gap: 1.6rem; list-style: none; align-items: center; }
.nav-links a {
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a:focus-visible { color: #bfe6c5; }
.nav-links a:focus-visible { outline: 2px solid #bfe6c5; outline-offset: 3px; border-radius: 2px; }
.nav-cta {
  background: var(--c-accent);
  color: #fff !important;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--c-accent-deep); color: #fff !important; }
.lang-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.8) !important;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem !important;
  letter-spacing: 0.1em;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.lang-toggle:hover { border-color: #bfe6c5; color: #bfe6c5 !important; }
.nav-mobile { display: none; align-items: center; gap: 0.6rem; }
.nav-mobile-cta {
  background: var(--c-accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
}
.nav-hamburger {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-hamburger svg { width: 22px; height: 22px; }
.nav-hamburger .icon-close { display: none; }
.nav-hamburger[aria-expanded="true"] .icon-open { display: none; }
.nav-hamburger[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1180px) {
  nav.site-nav { padding: 0 3%; }
  .nav-links { gap: 0.9rem; }
  .nav-links a { font-size: 0.72rem; letter-spacing: 0.06em; }
  .nav-cta { padding: 0.5rem 1rem; }
  .nav-logo span { display: none; }
}

@media (max-width: 940px) {
  .nav-logo span { display: none; }
  .nav-mobile { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--c-dark-deep);
    padding: 0.5rem 5% 1.25rem;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
  .nav-links a { display: block; padding: 0.9rem 0; font-size: 0.9rem; }
  .nav-links .nav-cta, .nav-links .lang-toggle { display: none; }
}

/* Hero */
.hero { text-align: center; padding-top: clamp(1.5rem, 5vw, 3.5rem); }
.hero img.hero-logo {
  width: min(24rem, 78vw);
  margin-inline: auto;
  margin-bottom: 1.25rem;
}
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); }
.hero .lede {
  max-width: 44rem;
  margin: 1.25rem auto 0;
  color: var(--c-ink-60);
  font-size: clamp(1.02rem, 2.1vw, 1.2rem);
  text-wrap: balance;
}
.hero .lede span { display: block; }
.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.roots-divider { display: block; width: min(26rem, 74vw); margin: clamp(2rem, 5vw, 3rem) auto 0; }
.roots-divider path {
  fill: none;
  opacity: 0.75;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: grow 2.4s ease-out forwards;
}
.roots-morph circle { fill: var(--c-link); }
@keyframes grow { to { stroke-dashoffset: 0; } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--c-dark);
  color: var(--c-on-accent);
  text-decoration: none;
  font-weight: 600;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  min-height: 44px;
  transition: background 0.25s ease, transform 0.25s ease;
}
.btn:hover { background: var(--c-dark-deep); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--c-dark); border: 1.5px solid var(--c-dark); }
.btn-ghost:hover { background: rgba(30, 77, 43, 0.08); }
.btn-wa { background: #128c4a; }
.btn-wa:hover { background: #0e7a3f; }
.btn svg { width: 18px; height: 18px; }

/* Facts strip */
.facts { background: var(--c-paper-2); border-block: 1px solid var(--c-line); padding-block: 2.25rem; }
.facts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.fact strong { display: block; font-family: var(--font-head); font-weight: 500; font-size: 1.15rem; color: var(--c-dark-deep); margin-bottom: 0.25rem; }
.fact p { font-size: 0.92rem; color: var(--c-ink-60); }

/* How we think */
.thinking { background: var(--c-dark-deep); color: rgba(255, 255, 255, 0.86); }
.thinking .eyebrow { color: #bfe6c5; }
.thinking h2 { color: #fff; margin-bottom: 2rem; }
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 3rem; }
.rule { position: relative; padding-left: 4rem; }
.rule-n { position: absolute; left: 0; top: 0.1rem; font-family: var(--font-head); font-size: 2rem; color: #bfe6c5; opacity: 0.85; line-height: 1; }
.rule h3 { color: #fff; font-size: 1.35rem; margin-bottom: 0.5rem; }
.rule p { font-size: 0.98rem; color: rgba(255, 255, 255, 0.78); }

/* Proof strip */
.proof { padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.proof-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-top: 1.5rem; }
.stat strong { display: block; font-family: var(--font-head); font-weight: 500; font-size: clamp(2.4rem, 5vw, 3.4rem); line-height: 1; color: var(--c-dark); margin-bottom: 0.5rem; }
.stat p { font-size: 0.95rem; color: var(--c-ink-60); }

/* Audience */
.audience { background: var(--c-paper-2); border-block: 1px solid var(--c-line); }
.audience-grid { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; margin-top: 1.75rem; }
.audience-grid li { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.audience-grid strong { display: block; font-family: var(--font-head); font-weight: 500; font-size: 1.15rem; color: var(--c-dark-deep); margin-bottom: 0.25rem; }
.audience-grid span { font-size: 0.93rem; color: var(--c-ink-60); }

/* Service cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-top: 3px solid var(--c-accent);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(20, 53, 32, 0.12); }
.card svg { width: 30px; height: 30px; color: var(--c-accent); margin-bottom: 0.9rem; }
.card h3 { color: var(--c-dark); margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; color: var(--c-ink-60); margin-bottom: 0.9rem; flex: 1; }
.card a { font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.card a:hover { text-decoration: underline; }

/* Work grid */
.work { background: var(--c-paper-2); border-block: 1px solid var(--c-line); }
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.work-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.work-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(20, 53, 32, 0.14); }
.work-card .shot { aspect-ratio: 2 / 1; overflow: hidden; background: var(--c-dark-deep); }
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.work-card:hover img { transform: scale(1.03); }
.work-body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.tag { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-link); margin-bottom: 0.35rem; }
.work-card h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.work-card p { font-size: 0.92rem; color: var(--c-ink-60); flex: 1; margin-bottom: 0.75rem; }
.work-link { font-size: 0.85rem; font-weight: 600; color: var(--c-link); display: inline-flex; align-items: center; gap: 0.35rem; }
.work-link svg { width: 14px; height: 14px; }

/* Brands */
.brands-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.brand {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.brand .shot { aspect-ratio: 2 / 1; overflow: hidden; background: var(--c-dark-deep); }
.brand .shot img { width: 100%; height: 100%; object-fit: cover; }
.brand-body { padding: 1.4rem 1.5rem 1.5rem; }
.brand-body p { color: var(--c-ink-60); font-size: 0.97rem; margin: 0.5rem 0 1rem; }

/* About */
.about { background: var(--c-dark-deep); color: rgba(255, 255, 255, 0.86); }
.about h2 { color: #fff; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.about p { margin-bottom: 1rem; font-size: 1.02rem; }
.about p:last-child { margin-bottom: 0; }
.about a { color: #bfe6c5; }
.about-logo { width: min(22rem, 70vw); margin-inline: auto; }

/* FAQ */
.faq-list { max-width: 48rem; }
.faq-list details { border-top: 1px solid var(--c-line); }
.faq-list details:last-child { border-bottom: 1px solid var(--c-line); }
.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 2.5rem 1.1rem 0;
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: var(--c-dark);
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  position: absolute; right: 0.25rem; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 1.4rem;
  color: var(--c-accent);
}
.faq-list details[open] summary::after { content: '\2212'; }
.faq-list details p { padding: 0 0 1.25rem; color: var(--c-ink-60); max-width: 44rem; }

/* Contact */
.contact { text-align: center; }
.contact-form { max-width: 36rem; margin: 0 auto 2rem; text-align: left; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; color: var(--c-dark-deep); }
.field small { display: block; font-size: 0.82rem; color: var(--c-ink-60); margin-top: 0.3rem; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1.5px solid rgba(30, 77, 43, 0.45);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  min-height: 44px;
}
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-color: var(--c-dark); }
.field textarea { resize: vertical; }
.contact-form .btn { width: 100%; justify-content: center; border: 0; cursor: pointer; font-size: 1rem; }
.gotcha { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 1rem; font-weight: 500; color: var(--c-dark); text-align: center; }
.form-status:empty { display: none; }
.form-status.is-error { color: #9b2c2c; }
.contact-form.is-sent .field, .contact-form.is-sent .btn { display: none; }
.or-line { color: var(--c-ink-60); font-size: 0.92rem; margin-bottom: 1rem; }
.contact .intro { margin-inline: auto; }
.contact-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.trust { margin-top: 1.1rem; font-size: 0.88rem; color: var(--c-ink-60); }

/* Footer */
footer.site-footer { background: var(--c-dark-deep); color: rgba(255, 255, 255, 0.78); padding: 3.5rem 0 2rem; font-size: 0.92rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-grid img { width: 11rem; }
.footer-grid h3 { color: #fff; font-family: var(--font-body); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.9rem; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-grid a, .footer-bottom a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.footer-grid a:hover, .footer-bottom a:hover { color: #bfe6c5; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; }

/* Floating WhatsApp */
.wa-float {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  z-index: 90;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--c-wa);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: pulse 2.4s ease-in-out infinite;
}
.wa-float svg { width: 30px; height: 30px; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 14px rgba(37, 211, 102, 0); }
}

/* Consent banner (master §24, reference/consent-banner.md) */
.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem clamp(1rem, 4vw, 2rem) calc(1rem + env(safe-area-inset-bottom));
  background: var(--c-paper); color: var(--c-ink);
  border-top: 1px solid var(--c-line); box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
  font-size: 0.92rem; line-height: 1.5;
}
.consent-banner[hidden] { display: none; }
.consent-banner p { margin: 0; max-width: 60ch; }
.consent-banner a { color: var(--c-link); }
body:has(.consent-banner:not([hidden])) .wa-float { bottom: calc(1.25rem + 7.5rem); }
.consent-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.consent-actions .btn { min-height: 44px; padding: 0.6rem 1.2rem; cursor: pointer; font: inherit; font-weight: 600; }
.consent-actions .btn-ghost { border: 1.5px solid var(--c-dark); }
@media (max-width: 640px) { .consent-banner { flex-direction: column; align-items: stretch; } .consent-actions .btn { flex: 1; justify-content: center; } }

/* Inner pages (accessibility, 404) */
.page { max-width: 46rem; }
.page h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
.page h2 { font-size: 1.5rem; margin-top: 2.25rem; }
.page p, .page li { color: var(--c-ink); margin-bottom: 0.9rem; }
.page ul { padding-left: 1.25rem; }
.page .lede { font-size: 1.1rem; color: var(--c-ink-60); }

/* Scroll-driven reveals. Progressive: browsers without animation-timeline just show content. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
    .roots-scroll path {
      stroke-dasharray: 700;
      stroke-dashoffset: 700;
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 70%;
    }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.roots-scroll { display: block; width: min(22rem, 64vw); margin: 0 0 1.5rem; }
.roots-scroll path { fill: none; opacity: 0.75; }

/* Responsive */
@media (max-width: 980px) {
  .cards, .work-grid, .audience-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: 1fr; }
  .about-logo { order: -1; width: min(16rem, 60vw); }
}
@media (max-width: 640px) {
  .rules { grid-template-columns: 1fr; gap: 1.75rem; }
  .audience-grid { grid-template-columns: 1fr; }
  .cards, .work-grid, .brands-grid, .facts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .wa-float { right: 1rem; bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .roots-divider path, .roots-scroll path { stroke-dashoffset: 0; }
}
