/* =============================================
   SISTEMA DE DISEÑO — Fundación Planeta Portalito
   Tierra patagónica · Espiral viva · Tecnología sutil
   ============================================= */

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

:root {
    /* ---- Paleta: tierra, mar, vida ---- */
    --c-earth:       #2C1810;   /* tierra oscura — texto principal */
    --c-ocean:       #1D4E5F;   /* azul océano patagónico */
    --c-ocean-deep:  #122F3A;   /* profundidad */
    --c-teal:        #3AADA8;   /* turquesa acuarela del logo */
    --c-teal-pale:   #D4EDEC;   /* turquesa muy suave */
    --c-moss:        #5C7A4E;   /* verde musgo húmedo */
    --c-moss-pale:   #EAF0E6;   /* verde muy suave */
    --c-sand:        #F0EBE1;   /* arena patagónica — fondo base */
    --c-sand-dark:   #E3DAC9;   /* arena más oscura */
    --c-sand-deep:   #C9BA9E;   /* arena profunda — separadores */
    --c-rust:        #9E4F2A;   /* óxido de tierra */
    --c-paper:       #FAF8F4;   /* papel casi blanco */
    --c-ink:         #1A2830;   /* tinta oscura */
    --c-muted:       #566551;   /* texto secundario verdoso */
    --c-border:      #D8D0C0;   /* borde suave */

    /* ---- Tipografía ---- */
    /* Display: serif delicado para títulos grandes */
    --f-display: 'Cormorant Garamond', 'Palatino Linotype', Georgia, serif;
    /* Texto: sin serifa para legibilidad */
    --f-body:    'Inter', 'Helvetica Neue', sans-serif;
    /* Utilitaria: etiquetas, badges, navegación */
    --f-ui:      'Nunito', sans-serif;

    /* ---- Layout ---- */
    --max-w:    1160px;
    --max-w-sm: 740px;
    --pad-x:    clamp(20px, 4vw, 40px);
    --pad-sec:  clamp(64px, 8vw, 96px);

    /* ---- Profundidad ---- */
    --sh-sm:  0 1px 4px rgba(44,24,16,0.06), 0 2px 12px rgba(44,24,16,0.04);
    --sh-md:  0 4px 20px rgba(44,24,16,0.09), 0 1px 4px rgba(44,24,16,0.05);
    --sh-lg:  0 12px 48px rgba(44,24,16,0.12), 0 4px 16px rgba(44,24,16,0.07);

    /* ---- Radios: medidos, no exagerados ---- */
    --r-sm:   6px;
    --r-md:   12px;
    --r-lg:   20px;
    --r-pill: 999px;

    /* ---- Transición de tema ---- */
    --theme-transition: background-color 0.45s cubic-bezier(0.4,0,0.2,1), border-color 0.45s cubic-bezier(0.4,0,0.2,1), color 0.45s cubic-bezier(0.4,0,0.2,1);
}

/* =============================================
   MODO OSCURO — Noche patagónica
   Ancla: el mismo océano-profundo que ya usan
   hero/footer/CTA, no una paleta gris genérica.
   ============================================= */
[data-theme="dark"] {
    --c-earth:       #EFE9DD;
    --c-ocean:       #4FC3D9;
    --c-ocean-deep:  #0A1E27;
    --c-teal:        #4FCFC9;
    --c-teal-pale:   rgba(79,207,201,0.14);
    --c-moss:        #8FBA7A;
    --c-moss-pale:   rgba(143,186,122,0.14);
    --c-sand:        #14181A;
    --c-sand-dark:   #1E2427;
    --c-sand-deep:   #2A3235;
    --c-rust:        #E08A5C;
    --c-paper:       #1A2023;
    --c-ink:         #F5F1E8;
    --c-muted:       #9AA69A;
    --c-border:      #2C3436;
}

/* ===== Base ===== */
html { scroll-behavior: smooth; }

body {
    font-family: var(--f-body);
    background: var(--c-sand);
    color: var(--c-earth);
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    transition: var(--theme-transition);
}

/* ---- Tipografía base ---- */
h1, h2, h3, h4, h5 {
    font-family: var(--f-ui);
    font-weight: 800;
    line-height: 1.18;
    color: var(--c-earth);
}

/* Los h1 de hero/page-hero usan la display */
.hero h1,
.page-hero h1,
.display { font-family: var(--f-display); font-weight: 600; font-style: italic; }

p { max-width: 68ch; }

a { color: var(--c-teal); text-decoration: none; }
a:hover { color: var(--c-ocean); text-decoration: underline; }

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

/* ===== Layout utils ===== */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad-x);
}
.container--sm,
.container--narrow {
    max-width: var(--max-w-sm);
    margin: 0 auto;
    padding: 0 var(--pad-x);
}

/* Secciones */
.section { padding: var(--pad-sec) 0; }
.section--alt { background: var(--c-paper); }
.section--ocean { background: var(--c-ocean); color: rgba(255,255,255,0.9); }
.section--ocean h1,
.section--ocean h2,
.section--ocean h3 { color: #fff; }

/* ---- Section label (signature element) ----
   Etiqueta de naturalista rotada verticalmente.
   Marca cada sección como si fuera una muestra de campo. */
.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.section-label span {
    font-family: var(--f-display);
    font-style: italic;
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--c-teal);
}
.section-label::after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: var(--c-teal);
    opacity: 0.55;
    max-width: 44px;
}

.section-title {
    font-family: var(--f-display);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(2.3rem, 5vw, 3.7rem);
    line-height: 1.04;
    letter-spacing: -0.012em;
    margin-bottom: 14px;
}
.section-sub {
    font-family: var(--f-body);
    font-size: 16px;
    font-weight: 400;
    color: var(--c-muted);
    line-height: 1.65;
    margin-bottom: 0;
    max-width: 52ch;
}
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-header .left { max-width: 560px; }
.section-more {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--f-ui);
    color: var(--c-teal);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    transition: color 0.15s, gap 0.15s;
}
.section-more:hover { color: var(--c-ocean); gap: 9px; text-decoration: none; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--r-pill);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--f-ui);
    letter-spacing: 0.03em;
    border: none;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--c-teal);
    color: #fff;
    box-shadow: 0 3px 14px rgba(58,173,168,0.35);
}
.btn-primary:hover {
    background: var(--c-ocean);
    color: #fff;
    box-shadow: 0 5px 18px rgba(29,78,95,0.35);
}

.btn-outline {
    background: transparent;
    color: var(--c-teal);
    border: 1.5px solid var(--c-teal);
}
.btn-outline:hover { background: var(--c-teal-pale); color: var(--c-ocean); }

.btn-ghost-white {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.92);
    border: 1.5px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(4px);
}
.btn-ghost-white:hover {
    background: rgba(255,255,255,0.22);
    color: #fff;
    border-color: rgba(255,255,255,0.7);
}

.btn-moss {
    background: var(--c-moss);
    color: #fff;
    box-shadow: 0 3px 14px rgba(92,122,78,0.3);
}
.btn-moss:hover { background: #4a6640; color: #fff; }

.btn-earth {
    background: var(--c-earth);
    color: rgba(255,255,255,0.9);
}
.btn-earth:hover { background: var(--c-ink); color: #fff; }

.btn-sm  { padding: 8px 18px; font-size: 13px; }
.btn-lg  { padding: 15px 36px; font-size: 16px; }
.btn-xl  { padding: 18px 48px; font-size: 17px; }

/* ===== Flash messages ===== */
.flash {
    padding: 13px 24px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--f-ui);
    text-align: center;
}
.flash-success { background: var(--c-moss-pale); color: var(--c-moss); border-bottom: 2px solid #b5d4a4; }
.flash-error   { background: #fde8e4; color: #9e2a13; border-bottom: 2px solid #f4b5a5; }
.flash-warning { background: #fef4e2; color: #7a5a10; border-bottom: 2px solid #f4d98a; }
.flash-info    { background: var(--c-teal-pale); color: var(--c-ocean); border-bottom: 2px solid #a4d4d2; }

/* ===== Form base ===== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--f-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 7px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    font-size: 15px;
    font-family: var(--f-body);
    background: var(--c-paper);
    color: var(--c-earth);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    appearance: none;
}
.form-control:focus {
    border-color: var(--c-teal);
    box-shadow: 0 0 0 3px rgba(58,173,168,0.14);
    background: #fff;
}
.form-control::placeholder { color: rgba(107,122,106,0.45); }
textarea.form-control { resize: vertical; min-height: 96px; line-height: 1.55; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236B7A6A' stroke-width='1.5'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer; }
.form-hint  { font-size: 12px; color: var(--c-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--c-rust); margin-top: 5px; font-weight: 600; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: flex-start; gap: 10px; }
.form-check input[type="checkbox"] { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; accent-color: var(--c-teal); cursor: pointer; }
.form-check label { font-size: 14px; color: var(--c-muted); cursor: pointer; line-height: 1.5; }

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ===== Scroll reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.cards-grid .reveal:nth-child(2),
.pillars-grid .reveal:nth-child(2),
.values-grid .reveal:nth-child(2),
.ways-grid .reveal:nth-child(2),
.shop-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.cards-grid .reveal:nth-child(3),
.pillars-grid .reveal:nth-child(3),
.values-grid .reveal:nth-child(3),
.ways-grid .reveal:nth-child(3),
.shop-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.cards-grid .reveal:nth-child(4),
.shop-grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.cards-grid .reveal:nth-child(5),
.shop-grid .reveal:nth-child(5) { transition-delay: 0.24s; }
.cards-grid .reveal:nth-child(6),
.shop-grid .reveal:nth-child(6) { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ===== Theme toggle ===== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--c-border);
    background: transparent;
    color: var(--c-earth);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.theme-toggle:hover { border-color: var(--c-teal); transform: rotate(-8deg); }
.theme-toggle svg {
    width: 17px;
    height: 17px;
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: var(--c-rust);
}
.theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.4);
    color: var(--c-teal);
}
[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.4);
}
[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}
@media (prefers-reduced-motion: reduce) {
    .theme-toggle:hover { transform: none; }
    .theme-toggle .icon-sun,
    .theme-toggle .icon-moon { transition: opacity 0.2s ease; }
}
