/* ==========================================================================
   CIVIC HORIZON PREMIUM DESIGN SYSTEM
   Rediseño de Alta Fidelidad para JACS - Jaume Alonso-Cuevillas
   ========================================================================== */

/* --- Custom Variables (Design Tokens) --- */
:root {
    /* Color Palette - Premium High Contrast */
    --surface: #fcf9f8;                       /* Soft Cloud (warm light off-white) */
    --surface-white: #ffffff;                 /* Pure White for card components */
    --surface-container-low: #f5f2f1;
    --surface-container: #ebe8e7;
    --surface-container-high: #dedada;
    
    --primary: #006b5e;                       /* Vibrant Teal (Main brand action) */
    --primary-light: #00b39f;                 /* Active/Accent Teal */
    --primary-dark: #004d44;                  /* Deep Teal */
    
    --secondary: #4a626d;                     /* Slate Gray */
    --navy-dark: #041e28;                     /* Slate Dark Navy (Maximum depth/contrast) */
    --navy-light: #102e3c;
    
    --on-surface: #1b1c1c;                    /* Charcoal Dark (High contrast text) */
    --on-surface-muted: #4e5654;              /* Soft Charcoal for body text */
    
    --outline: #bbcac5;                       /* Low-contrast container borders */
    --outline-focus: #006b5e;
    
    /* Typography Scales */
    --font-display: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Border Radius (Strict 4px professional rounding as per DESIGN.md) */
    --rounded-sm: 0.125rem; /* 2px */
    --rounded-default: 0.25rem; /* 4px */
    --rounded-md: 0.375rem; /* 6px */
    --rounded-lg: 0.5rem; /* 8px */
    --rounded-xl: 0.75rem; /* 12px */
    --rounded-full: 9999px;

    /* Spacing & Layout */
    --spacing-unit: 8px;
    --container-max: 1200px;
    --gutter: 24px;
    --margin-desktop: 80px;
    --margin-mobile: 24px;
    
    /* Transitions */
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-quick: all 0.15s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-display);
    background-color: var(--surface);
    color: var(--on-surface);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Watermark background: Subtle tactile urban texture */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('assets/rajola.png');
    background-repeat: repeat;
    background-size: 320px 320px;
    background-position: center top;
    opacity: 0.05;
    pointer-events: none;
}

/* --- Glassmorphic Navigation --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background-color: rgba(4, 30, 40, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(252, 249, 248, 0.12);
    transition: var(--transition-smooth);
}

/* Scrolled state for header */
.site-header.scrolled {
    background-color: rgba(4, 30, 40, 0.98);
    box-shadow: 0 10px 30px rgba(4, 30, 40, 0.2);
    border-bottom-color: rgba(252, 249, 248, 0.06);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 20px var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.site-header.scrolled .header-container {
    padding: 12px var(--gutter);
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-square {
    background-color: var(--primary);
    color: var(--surface-white);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rounded-default);
    letter-spacing: 0.05em;
}

.logo-text {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--surface-white);
    text-decoration: none;
    transition: var(--transition-quick);
}

.logo-text:hover {
    color: var(--primary-light);
}

.logo-text span {
    color: var(--primary-light);
    font-weight: 400;
}

.header-badge {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 400;
    color: var(--primary-light);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pillars-cta {
    margin-top: 48px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.pillars-cta .cta-group {
    align-items: center;
}

/* --- Main Content Layout --- */
.main-content {
    flex: 1;
    width: 100%;
}

/* --- Hero Section (Split Layout) --- */
.hero-section {
    padding: var(--margin-desktop) 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-grid {
    max-width: var(--container-max);
    width: 100%;
    padding: 0 var(--gutter);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: center;
}

/* Hero Content Column */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.category-badge-wrapper {
    margin-bottom: 24px;
}

.category-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background-color: var(--navy-dark);
    color: var(--surface);
    padding: 8px 14px;
    border-radius: var(--rounded-sm);
    display: inline-block;
    box-shadow: 0 4px 12px rgba(4, 30, 40, 0.1);
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--navy-dark);
    margin-bottom: 24px;
}

.highlight-text {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.hero-subtitle {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--on-surface-muted);
    margin-bottom: 40px;
}

/* Call to Action Container */
.cta-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 420px;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    background-color: var(--primary);
    color: var(--surface-white);
    padding: 20px 36px;
    border-radius: var(--rounded-default); /* Strict 4px corners */
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 8px 24px rgba(0, 107, 94, 0.2);
    position: relative;
    overflow: hidden;
}

.primary-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%) rotate(45deg);
    transition: var(--transition-smooth);
    z-index: 1;
}

.primary-button:hover::after {
    height: 300%;
}

.check-icon {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 2;
}

.btn-label {
    position: relative;
    z-index: 2;
}

.primary-button:hover {
    background-color: var(--navy-dark);
    box-shadow: 0 12px 28px rgba(4, 30, 40, 0.25);
    transform: translateY(-3px);
}

.primary-button:hover .check-icon {
    transform: scale(1.2) rotate(8deg);
}

.primary-button:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(4, 30, 40, 0.2);
}

.cta-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--on-surface-muted);
    letter-spacing: 0.01em;
}

.clock-icon {
    color: var(--primary);
}

/* Hero Media Column (Video Container) */
.hero-media {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

/* Decorative frame behind the video to anchor spacing and geometry */
.hero-media::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: -15px;
    bottom: -15px;
    border: 2px solid var(--navy-dark);
    border-radius: var(--rounded-lg);
    z-index: 0;
    pointer-events: none;
}

.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: var(--navy-dark);
    border-radius: var(--rounded-lg);
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 20px 40px rgba(4, 30, 40, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.video-frame:hover {
    transform: translate(-4px, -4px);
    box-shadow: 0 25px 50px rgba(4, 30, 40, 0.2);
}

.video-placeholder {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

/* Rich Dark Gradient overlay for contrast */
.video-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(4, 30, 40, 0.4) 0%, rgba(4, 30, 40, 0.1) 100%);
    transition: var(--transition-smooth);
}

.video-placeholder:hover::before {
    background: linear-gradient(135deg, rgba(4, 30, 40, 0.5) 0%, rgba(4, 30, 40, 0.2) 100%);
}

/* Custom Play Button design */
.play-button-outer {
    background-color: var(--primary);
    color: var(--surface-white);
    width: 72px;
    height: 72px;
    border-radius: var(--rounded-full);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 8px 24px rgba(0, 107, 94, 0.4);
    border: none;
}

.play-svg {
    fill: currentColor;
    margin-left: 4px;
    transition: var(--transition-quick);
}

.video-placeholder:hover .play-button-outer {
    background-color: var(--surface-white);
    color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.video-placeholder:hover .play-svg {
    transform: scale(1.05);
}

.video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* --- Section: Pillars of the Candidacy --- */
.pillars-section {
    padding: 80px 0 100px 0;
    background-color: var(--surface-container-low);
    border-top: 1px solid rgba(4, 30, 40, 0.05);
    border-bottom: 1px solid rgba(4, 30, 40, 0.05);
    position: relative;
}

/* Subtly reuse Panot in the background of this section */
.pillars-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/rajola.png');
    background-repeat: no-repeat;
    background-position: -100px -100px;
    background-size: 400px 400px;
    opacity: 0.03;
    pointer-events: none;
}

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

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 56px auto;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: inline-block;
}

.section-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--navy-dark);
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.pillar-card {
    background-color: var(--surface-white);
    border: 1px solid rgba(4, 30, 40, 0.08);
    padding: 40px;
    border-radius: var(--rounded-default); /* Strict 4px corners */
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pillar-number {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--outline);
    margin-bottom: 24px;
    display: inline-block;
}

.pillar-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pillar-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: var(--rounded-full);
}

.pillar-description {
    font-size: 16px;
    color: var(--on-surface-muted);
    line-height: 1.6;
}

/* Card Hover States */
.pillar-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 3px;
    background-color: var(--primary);
    border-radius: var(--rounded-default) var(--rounded-default) 0 0;
    opacity: 0;
    transition: var(--transition-quick);
}

.pillar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(4, 30, 40, 0.08);
    border-color: rgba(4, 30, 40, 0.15);
}

.pillar-card:hover::before {
    opacity: 1;
}

.pillar-card:hover .pillar-number {
    color: var(--primary);
}

/* --- Decorative Panot Grid Divider --- */
.panot-grid-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 48px 0;
    background-color: var(--surface);
}

.panot-grid-divider span {
    width: 12px;
    height: 12px;
    border: 2px solid var(--outline);
    border-radius: var(--rounded-sm);
    transform: rotate(45deg);
    opacity: 0.5;
}

.panot-grid-divider span.active {
    background-color: var(--primary);
    border-color: var(--primary);
    opacity: 1;
}


/* --- Footer in Slate Dark Navy --- */
.site-footer {
    background-color: var(--navy-dark);
    color: rgba(252, 249, 248, 0.7);
    width: 100%;
    padding: 80px 0 48px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Abstract watermark inside footer */
.site-footer::after {
    content: '';
    position: absolute;
    right: -50px;
    bottom: -50px;
    width: 250px;
    height: 250px;
    background-image: url('assets/rajola.png');
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.02;
    pointer-events: none;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    align-items: center;
    gap: 64px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo-box {
    background-color: var(--primary);
    color: var(--surface-white);
    font-weight: 900;
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rounded-default);
}

.footer-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--surface-white);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.copyright-text {
    font-size: 14px;
    color: rgba(252, 249, 248, 0.45);
    max-width: 400px;
}

.footer-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 24px;
}

/* Social Buttons */
.social-links {
    display: flex;
    gap: 12px;
}

.social-icon-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    color: var(--surface-white);
    border: 1px solid rgba(252, 249, 248, 0.15);
    border-radius: var(--rounded-default); /* Strict 4px corners */
    text-decoration: none;
    transition: var(--transition-smooth);
    background-color: rgba(252, 249, 248, 0.03);
}

.social-icon-btn:hover {
    color: var(--surface-white);
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 107, 94, 0.4);
}

.social-icon-btn:active {
    transform: translateY(-1px);
}

.footer-links {
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(252, 249, 248, 0.4);
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-quick);
}

.footer-links a:hover {
    color: var(--primary-light);
}

/* --- Responsive Adaptations --- */

/* Tablet & Smaller Devices (max-width: 1024px) */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 48px;
        text-align: center;
    }

    .hero-content {
        align-items: center;
        text-align: center;
    }

    .hero-title {
        font-size: 52px;
    }

    .hero-subtitle {
        max-width: 650px;
    }

    .cta-group {
        align-items: center;
        margin: 0 auto;
    }

    .cta-note {
        justify-content: center;
    }

    .hero-media {
        max-width: 700px;
        margin: 0 auto;
    }
    
    .pillars-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    /* Span 3rd pillar card full width in tablet if odd */
    .pillar-card:nth-child(3) {
        grid-column: span 2;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-actions {
        align-items: center;
    }
}

/* Mobile Devices (max-width: 767px) */
@media (max-width: 767px) {
    :root {
        --margin-desktop: 48px;
    }

    body::before {
        background-size: 240px 240px;
    }

    .header-container {
        padding: 16px var(--margin-mobile);
    }
    
    .logo-text {
        font-size: 14px;
    }
    
    .logo-square {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .header-badge {
        font-size: 14px;
    }

    .hero-section {
        padding: var(--margin-desktop) 0;
    }
    
    .hero-title {
        font-size: 38px;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 17px;
        line-height: 1.5;
        margin-bottom: 32px;
    }

    .primary-button {
        width: 100%;
        font-size: 17px;
        padding: 18px 24px;
    }

    .hero-media::before {
        display: none; /* Hide background grid box on mobile to save space */
    }
    
    .pillars-section {
        padding: 60px 0;
    }

    .pillars-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pillar-card:nth-child(3) {
        grid-column: span 1;
    }

    .pillar-card {
        padding: 32px 24px;
    }

    .site-footer {
        padding: 60px 0 40px 0;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
}
