/* ============================================================
   HydroCalculus — estilos globales
   ============================================================ */

:root {
    --color-primary: #083860;
    --color-primary-light: #1a5a8a;
    --color-primary-dark: #04243f;
    --color-accent: #4fb3d9;
    --color-accent-soft: #e6f4fb;
    --color-bg: #ffffff;
    --color-bg-alt: #f4f7fa;
    --color-text: #1a1a1a;
    --color-text-muted: #5a6676;
    --color-border: #e2e8ef;

    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Manrope', system-ui, sans-serif;

    --shadow-sm: 0 1px 2px rgba(8, 56, 96, 0.06), 0 2px 6px rgba(8, 56, 96, 0.04);
    --shadow-md: 0 4px 12px rgba(8, 56, 96, 0.08), 0 10px 30px rgba(8, 56, 96, 0.06);
    --shadow-lg: 0 20px 50px rgba(8, 56, 96, 0.18);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --container: 1180px;
    --transition: 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }

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

section { padding: 100px 0; position: relative; }
section.alt { background: var(--color-bg-alt); }

.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 14px;
}

.section-header { text-align: center; max-width: 780px; margin: 0 auto 60px; }
.section-header p { color: var(--color-text-muted); margin-top: 16px; font-size: 1.05rem; }

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 18px 0;
    transition: background-color var(--transition), backdrop-filter var(--transition),
                box-shadow var(--transition), padding var(--transition);
}
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 1px 0 rgba(8, 56, 96, 0.08), 0 6px 24px rgba(8, 56, 96, 0.06);
    padding: 12px 0;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; color: #fff; font-size: 1.15rem; letter-spacing: 0.01em; }
.nav-logo img { width: 38px; height: 38px; object-fit: contain; }
.navbar.scrolled .nav-logo { color: var(--color-primary); }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute; left: 0; bottom: -6px;
    width: 0; height: 2px;
    background: var(--color-accent);
    transition: width var(--transition);
}
.nav-links a:hover::after { width: 100%; }
.navbar.scrolled .nav-links a { color: var(--color-primary); }

.lang-switch {
    display: flex; align-items: center; gap: 8px;
    padding-left: 16px;
    margin-left: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
}
.navbar.scrolled .lang-switch { border-left-color: var(--color-border); }
.lang-switch a {
    display: inline-flex;
    padding: 0;
    opacity: 0.5;
    transition: opacity var(--transition), transform var(--transition);
}
.lang-switch a:hover { opacity: 1; transform: scale(1.08); }
.lang-switch a.active { opacity: 1; }
.lang-switch a::after { display: none; }
.lang-switch .divider {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1;
}
.navbar.scrolled .lang-switch .divider { color: var(--color-border); }
.lang-switch .flag {
    display: block;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.nav-toggle {
    display: none;
    width: 42px; height: 42px;
    align-items: center; justify-content: center;
    color: #fff;
}
.navbar.scrolled .nav-toggle { color: var(--color-primary); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 26px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 999px;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), color var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: var(--color-accent);
    color: var(--color-primary-dark);
    box-shadow: 0 8px 24px rgba(79, 179, 217, 0.35);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); background: #6ec2e0; color: var(--color-primary-dark); box-shadow: 0 12px 30px rgba(79, 179, 217, 0.45); }
.btn-secondary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(8, 56, 96, 0.25);
}
.btn-secondary:hover { transform: translateY(-2px); background: var(--color-primary-light); color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; transform: translateY(-2px); }
.btn [data-lucide] { width: 20px; height: 20px; }

/* ============================================================
   Hero
   ============================================================ */

.hero {
    position: relative;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(160deg, var(--color-primary-dark) 0%, var(--color-primary) 55%, #0a5084 100%);
    padding: 140px 24px 90px;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 15% 10%, rgba(79, 179, 217, 0.22), transparent 55%),
        radial-gradient(ellipse at 85% 90%, rgba(79, 179, 217, 0.18), transparent 55%);
    pointer-events: none;
}
.hero .container { position: relative; z-index: 2; }

.hero-split {
    display: grid;
    grid-template-columns: minmax(220px, 340px) 1fr;
    gap: 72px;
    align-items: center;
}
.hero-logo-col { display: flex; justify-content: center; }
.hero-logo {
    width: 100%;
    max-width: 320px;
    height: auto;
    animation: fadeUp 900ms cubic-bezier(0.4, 0, 0.2, 1) 100ms both;
}

.hero-content { animation: fadeUp 900ms cubic-bezier(0.4, 0, 0.2, 1) 250ms both; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 14px;
}
.hero h1 {
    color: #fff;
    font-size: clamp(2.6rem, 5.5vw, 4rem);
    line-height: 1.05;
    margin-bottom: 10px;
}
.hero-tagline {
    font-style: italic;
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    margin-bottom: 24px;
}
.hero-desc {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.02rem;
    line-height: 1.7;
    max-width: 620px;
    margin-bottom: 26px;
}
.hero-content .about-badges { margin-bottom: 32px; }
.hero-content .badge { background: rgba(255, 255, 255, 0.1); color: #fff; }
.hero-content .badge [data-lucide] { color: var(--color-accent); }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ============================================================
   Badges (usados en el hero)
   ============================================================ */

.about-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--color-accent-soft);
    color: var(--color-primary);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
}
.badge [data-lucide] { width: 16px; height: 16px; color: var(--color-accent); }

/* ============================================================
   Funcionalidades
   ============================================================ */

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
    gap: 28px;
}
.feature-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex; flex-direction: column;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--color-accent); }
.feature-icon {
    width: 64px; height: 64px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 22px;
    box-shadow: 0 10px 24px rgba(8, 56, 96, 0.25);
}
.feature-icon [data-lucide] { width: 32px; height: 32px; stroke-width: 1.8; }
.feature-card h3 { margin-bottom: 10px; }
.feature-card > p { color: var(--color-text-muted); margin-bottom: 20px; }

.feature-list { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.feature-list li {
    display: flex; align-items: center; gap: 10px;
    font-weight: 500;
    padding: 10px 14px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
}
.feature-list li [data-lucide] { width: 18px; height: 18px; color: var(--color-accent); flex-shrink: 0; }

.subsections { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.subsection h4 {
    font-family: var(--font-body);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-accent);
    margin-bottom: 10px;
    font-weight: 700;
}
.subsection ul { display: flex; flex-direction: column; gap: 5px; font-size: 0.92rem; color: var(--color-text-muted); }
.subsection li { padding: 4px 0; border-bottom: 1px dashed var(--color-border); }
.subsection li:last-child { border-bottom: none; }

/* ============================================================
   Descarga
   ============================================================ */

.download {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: #fff;
    text-align: center;
    overflow: hidden;
}
.download::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(79, 179, 217, 0.25), transparent 60%);
    pointer-events: none;
}
.download .container { position: relative; z-index: 1; }
.download h2 { color: #fff; }
.download p { color: rgba(255, 255, 255, 0.82); max-width: 620px; margin: 18px auto 36px; font-size: 1.05rem; }
.download .btn-primary { padding: 18px 36px; font-size: 1.1rem; }
.download-note {
    margin-top: 22px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    display: inline-flex; align-items: center; gap: 8px;
}
.download-note [data-lucide] { width: 16px; height: 16px; }

/* ============================================================
   Documentación
   ============================================================ */

.docs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.doc-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.doc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-accent); }
.doc-icon {
    flex-shrink: 0;
    width: 72px; height: 92px;
    border-radius: 8px;
    background: linear-gradient(160deg, var(--color-accent-soft), #fff);
    border: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-primary);
    position: relative;
}
.doc-icon::after {
    content: ''; position: absolute;
    top: 0; right: 0;
    border-width: 0 18px 18px 0;
    border-style: solid;
    border-color: transparent var(--color-border) transparent transparent;
}
.doc-icon [data-lucide] { width: 32px; height: 32px; stroke-width: 1.6; }
.doc-info { flex: 1; }
.doc-info h3 { margin-bottom: 6px; }
.doc-info p { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 18px; }

/* ============================================================
   Autor
   ============================================================ */

.author-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 56px;
    align-items: center;
}
.author-photo {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbe3ec, #f4f7fa);
    border: 4px solid #fff;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-muted);
}
.author-photo [data-lucide] { width: 55%; height: 55%; stroke-width: 1.1; }
.author-info h2 { margin-bottom: 6px; }
.author-title { color: var(--color-accent); font-weight: 600; margin-bottom: 20px; }
.author-info p { color: var(--color-text-muted); margin-bottom: 14px; }
.author-meta { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.author-meta span { display: inline-flex; align-items: center; gap: 10px; color: var(--color-text); font-size: 0.95rem; }
.author-meta [data-lucide] { width: 18px; height: 18px; color: var(--color-accent); }

/* ============================================================
   Contacto
   ============================================================ */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    justify-content: center;
    gap: 24px;
}
.contact-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}
.contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.contact-card .icon-circle {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--color-accent-soft);
    color: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.contact-card .icon-circle [data-lucide] { width: 26px; height: 26px; }
.contact-card h4 { font-family: var(--font-body); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--color-text-muted); margin-bottom: 10px; font-weight: 700; }
.contact-card p { color: var(--color-primary); font-weight: 500; }
.contact-card a { font-weight: 600; }

/* ============================================================
   Licencia / License
   ============================================================ */
.license-content {
    max-width: 960px;
    margin: 0 auto;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    box-shadow: var(--shadow-sm);
}
.license-content p { color: var(--color-text); margin-bottom: 14px; line-height: 1.7; }
.license-content p:last-child { margin-bottom: 0; }
.license-content .license-reg {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--color-border);
    display: flex; align-items: center; gap: 10px;
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.92rem;
}
.license-content .license-reg [data-lucide] { width: 18px; height: 18px; }
@media (max-width: 640px) {
    .license-content { padding: 28px 22px; }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.72);
    padding: 70px 0 30px;
}
.footer-top {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-brand img { width: 120px; margin-bottom: 18px; }
.footer-brand p { font-size: 0.95rem; max-width: 380px; }
.footer-col h5 { color: #fff; font-family: var(--font-body); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 16px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: rgba(255, 255, 255, 0.72); font-size: 0.95rem; }
.footer-col a:hover { color: var(--color-accent); }

.footer-bottom {
    display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    padding-top: 26px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}
.footer-bottom span { display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   Scroll reveal
   ============================================================ */

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 900ms ease, transform 900ms cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 120ms; }
.reveal.delay-2 { transition-delay: 240ms; }
.reveal.delay-3 { transition-delay: 360ms; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 960px) {
    .features-grid, .docs-grid, .author-grid, .contact-grid, .footer-top {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .hero-split {
        grid-template-columns: 1fr;
        gap: 36px;
        text-align: center;
    }
    .hero-logo { max-width: 200px; }
    .hero-content .about-badges, .hero-actions { justify-content: center; }
    .hero-desc { margin-left: auto; margin-right: auto; }
    .author-photo { max-width: 240px; margin: 0 auto; }
    section { padding: 80px 0; }
}

@media (max-width: 768px) {
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: fixed;
        top: 70px; right: 16px; left: 16px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(14px);
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        gap: 14px;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: transform var(--transition), opacity var(--transition);
    }
    .nav-links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-links a, .navbar.scrolled .nav-links a { color: var(--color-primary); }
    .nav-links .lang-switch { margin-top: 6px; border-left: none; padding-left: 0; justify-content: center; }

    .subsections { grid-template-columns: 1fr; }
    .feature-card, .doc-card { padding: 28px; }
    .doc-card { flex-direction: column; }
    h1 { font-size: 2.3rem; }
    .hero { padding: 110px 20px 70px; }
    .hero-logo { max-width: 160px; }
    .hero h1 { font-size: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
}
