/**
 * SovereignAI.im - Styles
 * Enterprise AI infrastructure - professional, secure, trustworthy
 * Color palette: Manx Red primary, Gold accent, Dark navy text
 */

/* ==================== CSS Variables ==================== */
:root {
    /* Primary Colors - Manx Pride */
    --manx-red: #C41E3A;
    --manx-red-dark: #A01830;
    --manx-red-light: #E85A72;
    --manx-gold: #F4C430;
    --manx-gold-dark: #D4A520;

    /* Neutrals - Professional (WCAG AA compliant) */
    --navy: #1A1F36;
    --navy-light: #2D3350;
    --slate: #475569;      /* Darker for better contrast - 7:1 on white */
    --gray: #64748B;       /* Darker for WCAG AA - 5.3:1 on white */
    --gray-light: #94A3B8; /* For secondary text - 4.5:1 on white */
    --gray-lighter: #CBD5E1; /* For borders/decorative only */
    --off-white: #F7F8FA;
    --white: #FFFFFF;

    /* Semantic */
    --success: #10B981;
    --error: #EF4444;

    /* Typography */
    --font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(26, 31, 54, 0.05);
    --shadow-md: 0 4px 6px rgba(26, 31, 54, 0.07);
    --shadow-lg: 0 10px 25px rgba(26, 31, 54, 0.1);
    --shadow-xl: 0 20px 40px rgba(26, 31, 54, 0.15);

    /* Container */
    --container-max: 1200px;
    --container-padding: 1.5rem;
}

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

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

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--navy);
    background-color: var(--white);
}

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

a {
    color: var(--manx-red);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--manx-red-dark);
}

ul, ol {
    list-style: none;
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--navy);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h4 {
    font-size: 1.125rem;
}

p {
    color: var(--slate);
}

.highlight {
    color: var(--manx-red);
}

/* ==================== Layout ==================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

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

.section-light {
    background-color: var(--off-white);
}

.section-dark {
    background-color: var(--navy);
    color: var(--white);
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: var(--white);
}

.section-dark p {
    color: var(--gray-light);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--slate);
    margin-top: var(--space-sm);
}

.section-dark .section-subtitle {
    color: var(--gray-light);
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--manx-red);
    color: var(--white);
    border-color: var(--manx-red);
}

.btn-primary:hover {
    background-color: var(--manx-red-dark);
    border-color: var(--manx-red-dark);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--navy);
    border-color: var(--gray-lighter);
}

.btn-outline:hover {
    background-color: var(--off-white);
    border-color: var(--navy);
    color: var(--navy);
}

.btn-outline-light {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline-light:hover {
    background-color: var(--white);
    border-color: var(--white);
    color: var(--navy);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-nav {
    padding: 0.75rem 1.75rem;
    font-size: 0.875rem;
}

/* ==================== Header ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--navy);
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--manx-red);
}

.logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-img-sm {
    height: 32px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray);
    margin-right: auto;
}

.lema-link {
    color: var(--navy);
    font-weight: 600;
}

.lema-link:hover {
    color: var(--manx-red);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-menu a {
    color: var(--slate);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: var(--navy);
}

/* Nav CTA button - must come after .nav-menu a to override */
.nav-menu a.btn.btn-primary {
    background-color: var(--manx-red) !important;
    color: var(--white) !important;
    border-color: var(--manx-red) !important;
    padding: 0.75rem 1.75rem;
}

.nav-menu a.btn.btn-primary:hover {
    background-color: var(--manx-red-dark) !important;
    border-color: var(--manx-red-dark) !important;
    color: var(--white) !important;
}

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

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--navy);
    transition: all 0.3s ease;
}

/* ==================== Hero ==================== */
.hero {
    position: relative;
    padding: 160px 0 100px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 720px;
    position: relative;
    z-index: 2;
}

.hero-code {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(196, 30, 58, 0.1);
    color: var(--manx-red);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 50px;
    margin-bottom: var(--space-lg);
}

.hero h1 {
    margin-bottom: var(--space-lg);
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--slate);
    margin-bottom: var(--space-xl);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--slate);
    font-size: 0.875rem;
}

.trust-item svg {
    color: var(--manx-gold);
}

.hero-background {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    overflow: hidden;
    z-index: 1;
}

.hero-gradient {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 100%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(196, 30, 58, 0.08) 0%, transparent 60%);
}

/* ==================== Problems Grid ==================== */
.problems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.problem-card {
    background: var(--white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.problem-icon {
    color: var(--manx-red);
    margin-bottom: var(--space-md);
}

.problem-card h3 {
    margin-bottom: var(--space-sm);
}

/* ==================== Features Subheader ==================== */
.features-subheader {
    text-align: center;
    font-size: 1.75rem;
    color: var(--navy);
    margin-bottom: var(--space-xl);
    margin-top: var(--space-2xl);
}

/* ==================== Platform Grid ==================== */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.platform-feature {
    display: flex;
    gap: var(--space-lg);
}

.feature-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--manx-red);
    line-height: 1;
    opacity: 0.3;
}

.feature-content h3 {
    margin-bottom: var(--space-sm);
}

/* ==================== Sovereignty Section ==================== */
.sovereignty-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.sovereignty-visual {
    display: flex;
    justify-content: center;
}

.island-diagram {
    position: relative;
    width: 300px;
    height: 300px;
}

.island-outer {
    position: absolute;
    inset: 0;
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.island-inner {
    width: 70%;
    height: 70%;
    background: rgba(196, 30, 58, 0.2);
    border: 2px solid var(--manx-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.island-core {
    width: 60%;
    height: 60%;
    background: var(--manx-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
}

.island-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gray-light);
    font-size: 0.875rem;
}

.data-flow {
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--error);
}

.flow-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.sovereignty-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.detail-item {
    display: flex;
    gap: var(--space-md);
}

.detail-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(196, 30, 58, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--manx-red);
}

.detail-text h4 {
    color: var(--white);
    margin-bottom: var(--space-xs);
}

/* ==================== Sectors Grid ==================== */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.sector-card {
    background: var(--white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-lighter);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sector-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.sector-icon {
    color: var(--manx-red);
    margin-bottom: var(--space-md);
}

.sector-card h3 {
    margin-bottom: var(--space-sm);
}

.sector-card p {
    margin-bottom: var(--space-md);
}

.sector-list {
    border-top: 1px solid var(--gray-lighter);
    padding-top: var(--space-md);
}

.sector-list li {
    position: relative;
    padding-left: var(--space-md);
    font-size: 0.875rem;
    color: var(--slate);
    margin-bottom: var(--space-xs);
}

.sector-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 6px;
    height: 6px;
    background: var(--manx-gold);
    border-radius: 50%;
}

/* ==================== Comparison Table ==================== */
.comparison-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.comparison-table th,
.comparison-table td {
    padding: var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--gray-lighter);
}

.comparison-table th {
    background: var(--navy);
    color: var(--white);
    font-weight: 600;
}

.comparison-table th.highlight-col {
    background: var(--manx-red);
}

.comparison-table td:first-child {
    font-weight: 600;
    color: var(--navy);
}

.comparison-table td.highlight-col {
    background: rgba(196, 30, 58, 0.05);
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.check {
    color: var(--success);
}

.check::before {
    content: '✓ ';
    font-weight: 700;
}

.cross {
    color: var(--gray);
}

.cross::before {
    content: '✗ ';
    font-weight: 700;
}

/* ==================== Ecosystem Grid ==================== */
.ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.ecosystem-card {
    background: var(--white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-lighter);
    transition: transform 0.2s ease;
}

.ecosystem-card:hover {
    transform: translateY(-4px);
}

.ecosystem-primary {
    background: var(--navy);
    border-color: var(--navy);
}

.ecosystem-primary h3,
.ecosystem-primary p {
    color: var(--white);
}

.ecosystem-primary p {
    color: var(--gray-light);
}

.ecosystem-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(196, 30, 58, 0.1);
    color: var(--manx-red);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
}

.ecosystem-primary .ecosystem-badge {
    background: var(--manx-red);
    color: var(--white);
}

.ecosystem-card h3 {
    margin-bottom: var(--space-sm);
}

.ecosystem-status {
    display: inline-block;
    margin-top: var(--space-md);
    color: var(--manx-gold);
    font-size: 0.875rem;
    font-weight: 600;
}

.ecosystem-link {
    display: inline-block;
    margin-top: var(--space-md);
    font-weight: 600;
}

/* ==================== FAQ ==================== */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--gray-lighter);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--space-lg) 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--navy);
    text-align: left;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: var(--manx-red);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--gray);
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer p {
    padding-bottom: var(--space-lg);
    line-height: 1.7;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

/* ==================== CTA Section ==================== */
.section-cta {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-content h2 {
    color: var(--white);
    margin-bottom: var(--space-md);
}

.cta-content > p {
    color: var(--gray-light);
    font-size: 1.125rem;
    margin-bottom: var(--space-xl);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.cta-note {
    font-size: 0.875rem;
    color: var(--gray);
}

.cta-note a {
    color: var(--white);
}

/* ==================== Footer ==================== */
.footer {
    background: var(--navy);
    color: var(--gray-light);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: var(--space-md);
}

.footer-brand p {
    color: var(--gray);
    margin-bottom: var(--space-md);
}

.footer-lema {
    font-size: 0.875rem;
    color: var(--gray);
}

.footer-lema a {
    color: var(--white);
    font-weight: 600;
}

.footer-links h4 {
    color: var(--white);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links a {
    color: var(--gray);
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

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

.mt-1 {
    margin-top: var(--space-lg);
}

.footer-bottom {
    border-top: 1px solid var(--navy-light);
    padding-top: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--gray);
}

.footer-bottom a {
    color: var(--white);
}

.footer-location {
    font-weight: 600;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .sovereignty-content {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

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

@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
    }

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

    /* Mobile Nav */
    .nav-toggle {
        display: flex;
    }

    .nav-brand {
        font-size: 0.75rem;
    }

    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: var(--space-lg);
        gap: var(--space-md);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

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

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

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

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Hero */
    .hero {
        padding: 120px 0 60px;
    }

    .hero-background {
        display: none;
    }

    .hero-trust {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .hero-code {
        order: -1;
    }

    /* Tables */
    .comparison-table th,
    .comparison-table td {
        padding: var(--space-md);
        font-size: 0.875rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        font-size: 0.7rem;
        gap: 0.25rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    .island-diagram {
        width: 240px;
        height: 240px;
    }
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ==================== Pricing Grid Responsive ==================== */
@media (max-width: 900px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr !important;
    }
}
