/* ================================================
   Valxyria — Industrial Dark (Precision Engineering)
   ================================================ */

/* --- Custom Properties --- */

:root {
    --color-bg: #0a0a0a;
    --color-bg-alt: #111111;
    --color-surface: rgba(255, 255, 255, 0.04);
    --color-surface-hover: rgba(255, 255, 255, 0.07);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.14);
    --color-text: #f5f5f7;
    --color-text-secondary: rgba(245, 245, 247, 0.6);
    --color-text-muted: rgba(245, 245, 247, 0.4);
    --color-accent: #00d4ff;
    --color-accent-dark: #00b8d9;
    --color-success: #00e676;
    --max-width: 1120px;
}

/* --- Reset & Base --- */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
        Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

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

/* --- Layout --- */

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

/* --- Header --- */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
}

.header__logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-text);
    transition: opacity 0.2s ease;
}

.header__logo:hover {
    opacity: 0.8;
}

/* Navigation */

.header__nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header__nav-list {
    display: flex;
    gap: 32px;
}

.header__nav-link {
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(245, 245, 247, 0.7);
    transition: color 0.2s ease;
    letter-spacing: 0.01em;
    position: relative;
    padding-bottom: 2px;
}

.header__nav-link:hover {
    color: var(--color-text);
}

.header__nav-link--active {
    color: var(--color-accent);
    font-weight: 500;
}

.header__nav-link--active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-accent);
    border-radius: 1px;
}

/* Header Actions (cart, account) */

.header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header__icon {
    color: rgba(245, 245, 247, 0.7);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.header__icon:hover {
    color: var(--color-text);
}

/* Hamburger Toggle */

.header__menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
}

.header__menu-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.header__menu-toggle--active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.header__menu-toggle--active span:nth-child(2) {
    opacity: 0;
}

.header__menu-toggle--active span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* --- Hero --- */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 120px 0 80px;
    background-image: url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-color: var(--color-bg);
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.88) 0%,
        rgba(0, 0, 0, 0.65) 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 560px;
}

.hero__badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--color-bg);
    background-color: var(--color-accent);
    border-radius: 4px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: var(--color-text);
}

.hero__title--accent {
    color: var(--color-accent);
}

.hero__subtitle {
    margin-top: 24px;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 480px;
}

.hero__cta {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 36px;
}

.hero__btn {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.hero__btn:active {
    transform: scale(0.97);
}

.hero__btn--primary {
    display: inline-block;
    padding: 12px 28px;
    color: var(--color-bg);
    background-color: var(--color-accent);
    border-radius: 8px;
}

.hero__btn--primary:hover {
    background-color: var(--color-accent-dark);
}

.hero__btn--secondary {
    color: var(--color-accent);
}

.hero__btn--secondary:hover {
    opacity: 0.8;
}

/* Hero Status Indicator */

.hero__status {
    position: absolute;
    bottom: 32px;
    right: 40px;
    z-index: 1;
    text-align: right;
}

.hero__status-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.hero__status-value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-success);
}

.hero__status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--color-success);
    border-radius: 50%;
}

/* --- Sections --- */

.section {
    padding: 120px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.section--alt {
    background-color: var(--color-bg-alt);
}

.section__title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 48px;
    color: var(--color-text);
}

.section__text {
    max-width: 640px;
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* --- Vision Section --- */

.vision {
    display: flex;
    align-items: flex-start;
    gap: 64px;
}

.vision__content {
    flex: 1;
    min-width: 0;
}

.vision__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    color: var(--color-text);
}

.vision__text {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.75;
    margin-bottom: 20px;
}

.vision__text:last-child {
    margin-bottom: 0;
}

.vision__image-wrapper {
    flex-shrink: 0;
    width: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.vision__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Stack Tecnológico --- */

.stack__header {
    text-align: center;
    margin-bottom: 48px;
}

.stack__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 12px;
}

.stack__underline {
    display: inline-block;
    width: 40px;
    height: 3px;
    background-color: var(--color-accent);
    border-radius: 2px;
}

/* Stack Bento Grid */

.stack-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 16px;
}

.stack-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 28px 24px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.stack-card:hover {
    background-color: var(--color-surface-hover);
    border-color: var(--color-border-hover);
}

.stack-card__icon {
    color: var(--color-accent);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.stack-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.stack-card__description {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.stack-card__label {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: auto;
    text-align: center;
    letter-spacing: 0.05em;
}

.stack-card__content-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
}

/* Bento card positions */

.stack-card--pcb {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    justify-content: space-between;
}

.stack-card--embedded {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
}

.stack-card--empty {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

.stack-card--iot {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
}

.stack-card--integration {
    grid-column: 1 / 3;
    grid-row: 3 / 4;
}

.stack-card--prototipado {
    grid-column: 3 / 5;
    grid-row: 3 / 4;
}

/* --- Footer --- */

.footer {
    padding: 48px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background-color: var(--color-bg-alt);
}

.footer__container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    padding-bottom: 40px;
}

.footer__brand {
    max-width: 280px;
}

.footer__logo {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
}

.footer__description {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.footer__social {
    display: flex;
    gap: 12px;
}

.footer__social-link {
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.footer__social-link:hover {
    color: var(--color-text);
}

.footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.footer__link {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.footer__link:hover {
    color: var(--color-text);
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 20px;
    padding-bottom: 20px;
    text-align: right;
}

.footer__text {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- Cookie Consent Banner --- */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 200;
    background-color: rgba(28, 28, 30, 0.97);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner__content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.cookie-banner__text {
    flex: 1;
    font-size: 0.8125rem;
    color: rgba(245, 245, 247, 0.65);
    line-height: 1.6;
}

.cookie-banner__link {
    color: rgba(245, 245, 247, 0.85);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.cookie-banner__link:hover {
    color: #f5f5f7;
}

.cookie-banner__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-banner__btn {
    padding: 10px 24px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: 980px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.cookie-banner__btn:hover {
    opacity: 0.85;
}

.cookie-banner__btn:active {
    transform: scale(0.97);
}

.cookie-banner__btn--accept {
    color: #000000;
    background-color: #f5f5f7;
}

.cookie-banner__btn--reject {
    color: #f5f5f7;
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- Legal Pages --- */

.legal {
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 24px 80px;
    line-height: 1.75;
}

.legal__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #f5f5f7;
    margin-bottom: 12px;
}

.legal__updated {
    font-size: 0.875rem;
    color: rgba(245, 245, 247, 0.35);
    margin-bottom: 56px;
}

.legal__section-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #f5f5f7;
    margin-top: 48px;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.legal__text {
    font-size: 1rem;
    color: rgba(245, 245, 247, 0.6);
    margin-bottom: 16px;
    line-height: 1.75;
}

.legal__list {
    list-style: disc;
    padding-left: 24px;
    margin-bottom: 16px;
}

.legal__list li {
    font-size: 1rem;
    color: rgba(245, 245, 247, 0.6);
    margin-bottom: 8px;
    line-height: 1.7;
}

.legal__link {
    color: rgba(245, 245, 247, 0.8);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.legal__link:hover {
    color: #f5f5f7;
}

.legal__table-wrapper {
    overflow-x: auto;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.legal__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 600px;
}

.legal__table th,
.legal__table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(245, 245, 247, 0.6);
    vertical-align: top;
}

.legal__table th {
    font-weight: 600;
    color: #f5f5f7;
    white-space: nowrap;
}

.legal__back {
    display: inline-block;
    margin-top: 48px;
    font-size: 0.9375rem;
    color: rgba(245, 245, 247, 0.5);
    transition: color 0.2s ease;
}

.legal__back:hover {
    color: #f5f5f7;
}

.legal__back::before {
    content: "← ";
}

/* Footer compact variant for legal pages */

.footer--compact {
    padding: 20px 0;
    text-align: center;
}

.footer--compact .footer__legal-links {
    font-size: 0.75rem;
    color: rgba(245, 245, 247, 0.3);
}

.footer--compact .footer__legal-links a {
    color: rgba(245, 245, 247, 0.4);
    transition: color 0.2s ease;
}

.footer--compact .footer__legal-links a:hover {
    color: rgba(245, 245, 247, 0.7);
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .header__menu-toggle {
        display: flex;
    }

    .header__nav {
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        transform: none;
        background-color: rgba(10, 10, 10, 0.95);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
    }

    .header__nav--open {
        max-height: 320px;
        padding: 24px 0;
    }

    .header__nav-list {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .header__nav-link {
        font-size: 1rem;
    }

    .hero {
        min-height: 80vh;
        padding: 100px 24px 60px;
    }

    .hero__overlay {
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.6) 100%
        );
    }

    .hero__status {
        bottom: 16px;
        right: 24px;
    }

    .section {
        padding: 80px 0;
    }

    .section__title {
        margin-bottom: 32px;
    }

    .vision {
        flex-direction: column;
        gap: 40px;
    }

    .vision__image-wrapper {
        width: 100%;
    }

    .stack-grid {
        grid-template-columns: 1fr;
    }

    .stack-card--pcb,
    .stack-card--embedded,
    .stack-card--empty,
    .stack-card--iot,
    .stack-card--integration,
    .stack-card--prototipado {
        grid-column: auto;
        grid-row: auto;
    }

    .stack-card--empty {
        display: none;
    }

    .footer__container {
        flex-direction: column;
        gap: 32px;
    }

    .footer__nav {
        flex-direction: column;
        gap: 12px;
    }

    .footer__bottom {
        text-align: center;
    }

    .cookie-banner__content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-banner__actions {
        width: 100%;
        justify-content: center;
    }

    .legal {
        padding: 100px 24px 60px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .stack-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stack-card--pcb {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
    }

    .stack-card--embedded {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }

    .stack-card--empty {
        display: none;
    }

    .stack-card--iot {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }

    .stack-card--integration {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }

    .stack-card--prototipado {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
    }

    .vision__image-wrapper {
        width: 300px;
    }
}
