/* EPUKOYAM — design system
   ponytail: palette is a placeholder derived from the "restauración de bosque nativo"
   brief (forest green + clay/soil accent). Swap the variables below once the
   client's real logo file is available and colors are extracted from it. */

:root {
    --forest-dark: #14261c;
    --forest: #1f4230;
    --moss: #4f7a5c;
    --moss-light: #a9c4a8;
    --clay: #c1633a;
    --clay-dark: #a34e2b;
    --cream: #f6f3ea;
    --paper: #fffdf8;
    --ink: #1c2019;
    --ink-soft: #4a4f45;

    --font-display: 'Lora', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    --container: 1180px;
    --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--forest-dark);
    line-height: 1.15;
    margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 600; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }

/* Dark-background contexts need light headings — the base h1-h4 rule above
   defaults to a dark color meant for light sections only. */
.hero h1, .hero h2, .hero h3,
.page-hero h1, .page-hero h2, .page-hero h3,
.section-dark h1 {
    color: var(--paper);
}

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--forest); }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease;
}
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-dark); transform: translateY(-2px); }
.btn-outline { background: transparent; border-color: var(--paper); color: var(--paper); }
.btn-outline:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }
.btn-outline-dark { background: transparent; border-color: var(--forest); color: var(--forest); }
.btn-outline-dark:hover { background: var(--forest); color: #fff; }

/* ---- Header ---- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 20px 0;
    transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled {
    background: rgba(246, 243, 234, 0.94);
    backdrop-filter: blur(6px);
    padding: 12px 0;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }

.brand {
    display: flex; align-items: center; text-decoration: none;
    padding: 8px 16px; border-radius: 10px; background: var(--cream);
    transition: padding 0.3s ease;
}
.site-header.is-scrolled .brand { padding: 6px 14px; }
.brand img { height: 72px; width: auto; display: block; transition: height 0.3s ease; }
.site-header.is-scrolled .brand img { height: 50px; }

.main-nav { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
    color: var(--paper);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease, opacity 0.2s ease;
    opacity: 0.9;
}
.main-nav a:hover { opacity: 1; }
.site-header.is-scrolled .main-nav a { color: var(--ink); }
.main-nav a.active { color: var(--clay) !important; }

.nav-toggle { display: none; }

@media (max-width: 860px) {
    .main-nav { position: fixed; top: 0; right: -100%; height: 100vh; width: min(320px, 80%);
        background: var(--forest-dark); flex-direction: column; padding: 100px 32px; gap: 24px;
        transition: right 0.35s ease; }
    .main-nav.is-open { right: 0; }
    .main-nav a { color: var(--paper) !important; font-size: 1.1rem; }
    .nav-toggle {
        display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer;
        padding: 8px; z-index: 200;
    }
    .nav-toggle span { width: 24px; height: 2px; background: var(--paper); }
    .site-header.is-scrolled .nav-toggle span { background: var(--ink); }
}

/* ---- Hero ---- */
.hero {
    position: relative;
    height: 100vh;
    min-height: 560px;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: var(--paper);
}
.hero video, .hero .hero-fallback {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    animation: hero-kenburns 18s ease-in-out infinite alternate;
}
@keyframes hero-kenburns {
    from { transform: scale(1); }
    to   { transform: scale(1.12); }
}
.hero::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,38,28,0.55) 0%, rgba(20,38,28,0.75) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 720px; }
.hero-content p { color: rgba(255,255,255,0.88); font-size: 1.15rem; max-width: 560px; }
.hero-actions { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.scroll-cue {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    z-index: 2; color: var(--paper); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
    display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0.8;
}
.scroll-cue::after { content: ''; width: 2px; height: 40px; background: var(--moss-light); }

/* ---- Page (interior) header banner ---- */
.page-hero {
    padding: 180px 0 80px;
    background: var(--forest-dark);
    color: var(--paper);
}
.page-hero p { color: rgba(255,255,255,0.8); max-width: 640px; }

/* ---- Sections ---- */
section { padding: 100px 0; }
.section-tight { padding: 60px 0; }
.section-alt { background: var(--paper); }
.section-dark { background: var(--forest-dark); color: var(--paper); }
.section-dark h2, .section-dark h3 { color: var(--paper); }
.section-dark p { color: rgba(255,255,255,0.75); }

.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---- Grids / cards ---- */
.grid { display: grid; gap: 32px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
    background: var(--paper);
    border: 1px solid rgba(20,38,28,0.08);
    border-radius: var(--radius);
    padding: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(20,38,28,0.1); }
.card .icon { display: block; width: 28px; height: 28px; margin-bottom: 16px; color: var(--clay); }
.card .icon svg { display: block; }
.card .tag {
    display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--moss); font-weight: 700; margin-bottom: 10px;
}

.project-card { display: block; position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 4/5; }
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.project-card:hover img { transform: scale(1.06); }
.project-card .overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
    padding: 24px; background: linear-gradient(0deg, rgba(20,38,28,0.9) 0%, rgba(20,38,28,0) 55%);
    color: var(--paper);
}
.project-card .overlay .tag { color: var(--moss-light); }
.project-card .overlay h3 { color: var(--paper); margin-bottom: 4px; }
.project-card .overlay small { opacity: 0.8; }

.empty-state {
    border: 1px dashed rgba(20,38,28,0.25); border-radius: var(--radius); padding: 60px 32px;
    text-align: center; color: var(--ink-soft);
}

/* ---- Stats ---- */
.stat { text-align: center; }
.stat .num { font-family: var(--font-display); font-size: 2.6rem; color: var(--clay); font-weight: 700; }
.stat .label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }

/* ---- Forms ---- */
.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-field input, .form-field textarea {
    width: 100%; padding: 12px 14px; border: 1px solid rgba(20,38,28,0.2); border-radius: var(--radius);
    font-family: var(--font-body); font-size: 1rem; background: var(--paper);
}
.form-field textarea { min-height: 140px; resize: vertical; }
.form-alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 24px; font-size: 0.95rem; }
.form-alert.ok { background: #e5f0e6; color: var(--forest-dark); }
.form-alert.err { background: #fbe7e0; color: var(--clay-dark); }

/* ---- Footer ---- */
.site-footer { background: var(--forest-dark); color: rgba(255,255,255,0.7); padding: 64px 0 32px; }
.site-footer h4 { color: var(--paper); font-size: 1rem; }
.footer-logo { height: 48px; width: auto; margin-bottom: 14px; padding: 6px 12px; border-radius: 8px; background: var(--paper); }
.site-footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.site-footer a:hover { color: var(--paper); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12); padding-top: 24px; font-size: 0.82rem;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ---- Reveal animation hook (GSAP targets these) ---- */
.reveal { opacity: 0; transform: translateY(28px); }

/* ---- Headline word-reveal (see main.js splitWords) ---- */
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; }
.word-inner { display: inline-block; }

/* ---- Before / after comparison slider ---- */
.ba-slider {
    position: relative;
    aspect-ratio: 16/10;
    border-radius: var(--radius);
    overflow: hidden;
    user-select: none;
}
.ba-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-slider .ba-after { clip-path: inset(0 0 0 0); }
.ba-slider .ba-label { position: absolute; top: 16px; z-index: 2; background: rgba(20,38,28,0.7); color: #fff;
    font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 12px; border-radius: 3px; }
.ba-slider .ba-label.before { left: 16px; }
.ba-slider .ba-label.after { right: 16px; }
.ba-range {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    width: 80%; z-index: 3; accent-color: var(--clay);
}

/* ---- Market ticker marquee ---- */
.marquee { overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: inline-flex; gap: 48px; animation: marquee-scroll 26s linear infinite; }
.marquee-track span {
    font-family: var(--font-display); font-size: 1.3rem; color: rgba(255,255,255,0.55); white-space: nowrap;
}
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- Growth parallax (semilla -> árbol) ---- */
.tree-parallax { position: relative; height: 300vh; padding: 0; background: var(--paper); }
.tree-parallax-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.tree-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.tree-parallax-text {
    position: absolute; top: 12%; left: 50%; transform: translateX(-50%); text-align: center; z-index: 2;
    max-width: 560px; padding: 32px 28px 40px; border-radius: 8px;
    background: radial-gradient(closest-side, rgba(244,241,231,0.9), rgba(244,241,231,0));
}
.tree-parallax-text .eyebrow { color: var(--clay-dark); }
.tree-parallax-fade {
    position: absolute; left: 0; right: 0; bottom: 0; height: 30vh; z-index: 1; pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,253,248,0) 0%, var(--paper) 90%);
}
@media (max-width: 720px) {
    .tree-parallax { height: 260vh; }
    .tree-parallax-text { top: 8%; }
}

/* ---- Photo banner (servicios, quienes-somos) ---- */
.photo-banner {
    display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover;
    border-radius: var(--radius); margin-top: 40px;
}
@media (max-width: 720px) {
    .photo-banner { aspect-ratio: 4 / 3; }
}

/* ---- Contact map ---- */
.contact-map {
    display: block; width: 100%; aspect-ratio: 4 / 3; border: 0;
    border-radius: var(--radius); margin-top: 24px;
}

/* ---- Project detail page ---- */
.project-hero {
    position: relative; background-size: cover; background-position: center;
}
.project-hero::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,38,28,0.75) 0%, rgba(20,38,28,0.88) 100%);
}
.project-hero .container { position: relative; z-index: 1; }
.back-link { display: inline-block; color: var(--moss-light); text-decoration: none; font-size: 0.9rem; margin-bottom: 20px; }
.back-link:hover { color: var(--paper); }

/* Muted, minimal-looking map to match the site's editorial tone instead of a raw Google Maps embed. */
.project-map { filter: grayscale(0.55) sepia(0.25) contrast(0.92) brightness(1.05); }

.gallery-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.gallery-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 720px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
