/* ===== CSS Variables & Design Tokens ===== */
:root {
    interpolate-size: allow-keywords; /* necesario para el despliegue suave de detalles */
    /* Colors */
    --bg-color: #0f172a;
    --bg-color-light: #1e293b;

    /* Brand Colors */
    --color-azul: #38bdf8;
    --color-verde: #00b150;
    --color-amarillo: #ffc026;
    --color-rojo: #ff0c19;
    --color-rosado: #f60f55;

    --primary-color: var(--color-azul);
    --primary-color-hover: #0ea5e9;

    --text-color: #f8fafc;
    --text-muted: #94a3b8;

    /* Glassmorphism */
    --glass-bg: rgba(21, 27, 43, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --glass-shadow-short: 0 8px 16px 0 rgba(0, 0, 0, 0.3);

    /* Spacing */
    --container-width: 1200px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Fonts */
    --font-main:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

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

.section {
    padding: var(--spacing-xl) 0;
}

.highlight {
    color: var(--primary-color);
}

/* ===== Utilities ===== */
.blur-bg {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow-short);
}

/* ===== Typography ===== */
h1,
h2,
h3 {
    line-height: 1.2;
    font-weight: 700;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.section-desc {
    color: var(--text-muted);
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
    font-size: 1.125rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-color-hover);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== Header & Nav ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-size: 0.875rem;
    color: var(--text-color);
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--primary-color);
}

.github-nav-icon svg {
    transition: stroke 0.3s;
}

.github-nav-icon:hover svg {
    stroke: var(--primary-color);
}

/* ===== Dropdown specific ===== */
.btn-group {
    display: inline-flex;
    position: relative;
    align-items: stretch;
}

.dropdown {
    display: flex;
}

.btn-group > .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.dropdown-toggle {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 0.875rem 0.75rem;
}

.icon-chevron {
    transition: transform 0.3s ease;
}

.dropdown.active .icon-chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-color-light);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-size: 0.875rem;
    transition: background 0.2s;
    width: 100%;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
}

.dropdown-item-icon {
    font-size: 1.2rem;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px; /* Offset for fixed header */
    position: relative;
    overflow: hidden;
}

/* Background grid effect */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    max-width: 90%;
}

.download-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* Battery Animation Graphic */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-laptop-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

.laptop-outline {
    width: 100%;
    height: auto;
    filter: opacity(0.05);
    pointer-events: none;
}

.battery-wrapper {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    max-width: 40%;
    max-height: 40%;
    z-index: 10;
}

.battery-image-base {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.3) brightness(1.5);
}

.battery-image-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    clip-path: inset(100% 0 0 0);
    transition: clip-path 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.battery-wrapper.full .battery-image-fill {
    clip-path: inset(0 0 0 0);
}

/* --- Animated Glow Feature for Battery --- */
@property --rotation {
    syntax: "<angle>";
    initial-value: 0turn;
    inherits: false;
}

@keyframes rotarHue {
    from { --rotation: 0turn; }
    to { --rotation: 1turn; }
}

@keyframes breathe {
    0%, 100% { transform: scale(1.05); filter: blur(1rem); opacity: 0.8; }
    50% { transform: scale(1.15); filter: blur(1.5rem); opacity: 1; }
}

.battery-glow {
    position: absolute;
    inset: 0;
    z-index: -1;
    animation: breathe 4s infinite ease-in-out;
}

.battery-glow-inner {
    width: 100%;
    height: 100%;
    background-image: conic-gradient(from var(--rotation), var(--color-rojo), var(--color-rosado), var(--color-azul), var(--color-verde), var(--color-amarillo), var(--color-rojo));
    animation: rotarHue 8s infinite linear;
    -webkit-mask-image: url('icon.png');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url('icon.png');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

/* ===== Features Section ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.feature-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition:
        transform 0.3s,
        box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
    border-color: rgba(56, 189, 248, 0.3);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(
        135deg,
        var(--bg-color-light),
        rgba(56, 189, 248, 0.1)
    );
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.feature-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.feature-text {
    color: var(--text-muted);
}

/* ===== Feature Images ===== */
.feature-image-container {
    margin-top: auto;
    padding-top: var(--spacing-lg);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.feature-card:hover .feature-image {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ===== Info Section ===== */
.info-section {
    background: linear-gradient(
        to bottom,
        var(--bg-color),
        var(--bg-color-light)
    );
    border-top: 1px solid var(--glass-border);
}

.info-content {
    max-width: 800px;
    margin: 0 auto;
}

.info-list li {
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 2rem;
}

.info-list li::before {
    content: "⚡";
    position: absolute;
    left: 0;
    top: 2px;
}

/* ===== FAQ Section ===== */
.faq {
    background: var(--bg-color-light);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    transition: all 0.3s ease;
    border-radius: 12px;
    margin-bottom: 0;
    overflow: hidden; /* necesario para el despliegue suave */
}

/* Transiciones para el despliegue suave */
.faq-item::details-content {
    block-size: 0;
    transition: 
        block-size 0.5s ease-out,
        content-visibility 0.5s ease-out;
    transition-behavior: allow-discrete;
}

.faq-item[open]::details-content {
    block-size: auto;
}

.faq-item:hover {
    border-color: rgba(56, 189, 248, 0.3);
}

.faq-question {
    padding: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    list-style: none; /* remove default triangle */
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
    transition: all ease-in-out;
}

.faq-item:not([open]) .faq-question {
    transition-delay: 0.4s;
    transition-duration: 0.3s;
}

.faq-item[open] .faq-question {
    transition-delay: 0s;
    transition-duration: 0.1s;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: "+";
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    font-weight: 300;
}

details[open] .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FAQ CTA */
.faq-cta {
    margin-top: 2.5rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.faq-cta p {
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 500;
}

/* ===== Footer ===== */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-color-light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    transition: color 0.3s;
}

.social-link:hover {
    color: var(--primary-color);
}

/* ===== Animations ===== */
.animate-up {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s ease,
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle {
        margin: 0 auto 2rem;
    }

    .btn-group {
        margin: 0 auto;
    }

    .hero-visual {
        margin-top: var(--spacing-xl);
    }

    .dropdown-menu {
        right: 50%;
        transform: translateX(50%) translateY(-10px);
    }

    .dropdown.active .dropdown-menu {
        transform: translateX(50%) translateY(0);
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    /* Keep nav functional to show GitHub, hide text */
    .nav-link:not(.github-nav-icon),
    .nav-cta {
        display: none;
    }

    /* Center feature card contents */
    .feature-card {
        align-items: center;
        text-align: center;
    }

    /* Center footer and logo */
    .footer-left {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin: 0 auto;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ===== OS Icons ===== */
.os-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

.primary-btn .btn-icon .os-icon {
    width: 24px;
    height: 24px;
}

.dropdown-item-icon .os-icon {
    width: 20px;
    height: 20px;
}
