/* ============================================
   INTELLIGENCE INTERSECTION - HYBRID THEME
   Bonestell cosmic grandeur + Nagaoka warm chrome
   Dark mode only - space-age sophistication
   ============================================ */

:root {
    /* Core Cosmic Palette */
    --void-black: #050510;
    --deep-space: #0a1628;
    --horizon-blue: #1a3a5f;
    --nebula-purple: #2d1b4e;

    /* Chrome Accents */
    --chrome-gold: #d4a84b;
    --warm-gold: #c9a227;
    --sunset-orange: #e8683f;
    --magenta-glow: #c94277;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* Legacy compatibility aliases */
    --primary-accent: var(--chrome-gold);
    --secondary-accent: var(--sunset-orange);
    --tertiary-accent: var(--magenta-glow);
    --light-bg: var(--deep-space);
    --dark-text: var(--text-primary);

    /* Gradient variables for scroll animation */
    --grad-start: #2d1b4e;
    --grad-end: #0a1628;

    /* Card geometry */
    --card-slant: 30px;

    /* Animation timing */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background-color: var(--void-black);
    color: var(--text-primary);
    line-height: 1.6;
}

.font-display {
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.02em;
}

/* ============================================
   COSMIC BACKGROUND
   ============================================ */

#fixed-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#fixed-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* Nebula glows */
        radial-gradient(ellipse 120% 60% at 80% 20%, rgba(45, 27, 78, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse 80% 40% at 20% 80%, rgba(26, 58, 95, 0.5) 0%, transparent 50%),
        /* Horizon gradient */
        linear-gradient(180deg,
            var(--void-black) 0%,
            var(--deep-space) 40%,
            var(--horizon-blue) 70%,
            #2a4a6f 85%,
            var(--grad-start) 95%,
            var(--grad-end) 100%
        );
}

/* Starfield */
#fixed-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 15%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 40% 25%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 60% 10%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 80% 30%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 15% 45%, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 90% 5%, rgba(212,168,75,0.8), transparent),
        radial-gradient(1px 1px at 35% 55%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 70% 45%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 50% 35%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 25% 65%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 10% 75%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 55% 80%, rgba(212,168,75,0.5), transparent),
        radial-gradient(1px 1px at 75% 70%, rgba(255,255,255,0.5), transparent);
    animation: starTwinkle 8s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* ============================================
   GLASS CARD COMPONENT
   ============================================ */

.glass-card {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.08) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    /* Parallelogram with vertical sides, slanted top/bottom */
    clip-path: polygon(
        0 var(--card-slant),
        100% 0,
        100% calc(100% - var(--card-slant)),
        0 100%
    );
    transition: all 0.5s var(--ease-out-expo);
    padding: calc(3rem + var(--card-slant)) 3rem;
}

.glass-card:hover {
    border-color: rgba(212, 168, 75, 0.3);
    transform: translateY(-5px);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Responsive card padding */
@media (max-width: 768px) {
    .glass-card {
        --card-slant: 20px;
        padding: calc(2rem + var(--card-slant)) 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .glass-card {
        padding: calc(2.5rem + var(--card-slant)) 2rem;
    }
}

/* ============================================
   NAVIGATION STYLES
   ============================================ */

.nav-link {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.625rem 1.25rem;
    border-radius: 100px;
    transition: all 0.3s var(--ease-out-expo);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-link:hover {
    color: var(--chrome-gold);
    background: rgba(212, 168, 75, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--chrome-gold), var(--sunset-orange));
    color: var(--void-black);
}

/* Nav link underline effect (for non-capsule nav) */
.nav-link::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(90deg, var(--chrome-gold), var(--sunset-orange));
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Mobile navigation */
.mobile-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.mobile-nav-link:hover {
    color: var(--chrome-gold);
    background: rgba(212, 168, 75, 0.1);
    transform: translateX(4px);
}

/* ============================================
   BUTTON STYLES
   ============================================ */

.oval-button {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(212, 168, 75, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    padding: 1rem 2rem;
    color: white;
    text-decoration: none;
    display: inline-block;
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.oval-button:hover {
    background: linear-gradient(135deg, var(--chrome-gold), var(--sunset-orange));
    border-color: transparent;
    color: var(--void-black);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(212, 168, 75, 0.3);
}

/* Active state for pagination */
.oval-button.active {
    background: linear-gradient(135deg, var(--chrome-gold), var(--sunset-orange));
    color: var(--void-black);
    border-color: transparent;
}

.oval-button.active:hover {
    background: linear-gradient(135deg, var(--sunset-orange), var(--magenta-glow));
}

/* ============================================
   TEXT EFFECTS
   ============================================ */

.text-glow {
    text-shadow:
        0 0 20px rgba(212, 168, 75, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Chrome gradient text effect */
.chrome-text {
    background: linear-gradient(
        135deg,
        var(--chrome-gold) 0%,
        #fff8e0 25%,
        var(--sunset-orange) 50%,
        var(--magenta-glow) 75%,
        var(--chrome-gold) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: chromeShift 6s linear infinite;
}

@keyframes chromeShift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ============================================
   PROSE / CONTENT TYPOGRAPHY
   ============================================ */

.prose-custom h1 {
    font-family: 'Orbitron', monospace;
    color: var(--chrome-gold);
    font-size: 2.25rem;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 1em;
    text-shadow: 0 0 30px rgba(212, 168, 75, 0.3);
}

.prose-custom h2 {
    font-family: 'Orbitron', monospace;
    color: var(--chrome-gold);
    font-size: 1.75rem;
    font-weight: bold;
    margin-top: 2em;
    margin-bottom: 1em;
}

.prose-custom h3 {
    font-family: 'Orbitron', monospace;
    color: var(--chrome-gold);
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 1.75em;
    margin-bottom: 0.75em;
}

.prose-custom h4,
.prose-custom h5,
.prose-custom h6 {
    font-family: 'Orbitron', monospace;
    color: var(--chrome-gold);
    font-size: 1.25rem;
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.prose-custom p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.25em;
}

.prose-custom ul,
.prose-custom ol {
    color: var(--text-secondary);
    margin: 1.25em 0;
    padding-left: 1.5em;
}

.prose-custom ul ul,
.prose-custom ol ol {
    margin: 0.5em 0;
    padding-left: 1.25em;
}

.prose-custom li {
    margin: 0.5em 0;
    line-height: 1.7;
}

.prose-custom ul li {
    list-style-type: disc;
}

.prose-custom ol li {
    list-style-type: decimal;
}

.prose-custom strong {
    font-weight: 600;
    color: var(--text-primary);
}

.prose-custom em {
    font-style: italic;
    color: var(--text-secondary);
}

.prose-custom hr {
    border: none;
    border-top: 1px solid rgba(212, 168, 75, 0.3);
    margin: 2.5em 0;
    width: 50%;
    margin-left: auto;
    margin-right: auto;
}

.prose-custom a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    border-bottom: 1px solid transparent;
}

.prose-custom a:hover {
    color: var(--chrome-gold);
    border-bottom-color: var(--chrome-gold);
}

.prose-custom blockquote {
    font-family: 'Orbitron', monospace;
    font-style: normal;
    font-size: 1.1rem;
    border-left: 3px solid var(--sunset-orange);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--chrome-gold);
    background: rgba(212, 168, 75, 0.05);
    padding: 1rem 1.5rem;
}

/* ============================================
   DIVIDER SVG
   ============================================ */

.divider-svg {
    stroke: var(--chrome-gold);
    filter: drop-shadow(0 0 10px rgba(212, 168, 75, 0.3));
    stroke-width: 2;
}

.divider-svg .wing-left,
.divider-svg .wing-right {
    fill: var(--horizon-blue);
    opacity: 0.8;
}

.divider-svg .center-star {
    fill: var(--sunset-orange);
    animation: starPulse 3s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

/* ============================================
   SYNTAX HIGHLIGHTING
   ============================================ */

.highlight {
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid rgba(212, 168, 75, 0.2);
}

.highlight pre {
    margin: 0;
    padding: 1rem;
    background: rgba(5, 5, 16, 0.8) !important;
    border-radius: 8px;
}

.highlight code {
    background: transparent !important;
    color: #e6edf3;
    font-size: 0.9em;
    line-height: 1.5;
}

.highlight .lntd {
    vertical-align: top;
    padding: 0;
    margin: 0;
    border: 0;
}

.highlight .lnt {
    margin-right: 0.8em;
    padding: 0 0.4em;
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
}

/* ============================================
   LOGO SYSTEM
   ============================================ */

.intelligence-logo {
    display: block;
    margin: 0 auto;
}

.intelligence-logo.size-large { width: 192px; height: 192px; }
.intelligence-logo.size-medium { width: 128px; height: 128px; }
.intelligence-logo.size-small { width: 64px; height: 64px; }
.intelligence-logo.size-favicon { width: 32px; height: 32px; }
.intelligence-logo.size-hero { width: 256px; height: 256px; }

@keyframes star-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.intelligence-logo.animated .star-element {
    animation: star-pulse 5s ease-in-out infinite;
}

/* ============================================
   UTILITY OVERRIDES FOR TAILWIND
   ============================================ */

/* Ensure text colors work on dark background */
.text-gray-800 { color: var(--text-primary) !important; }
.text-gray-700 { color: var(--text-primary) !important; }
.text-gray-600 { color: var(--text-secondary) !important; }
.text-gray-500 { color: var(--text-secondary) !important; }
.text-gray-400 { color: var(--text-muted) !important; }

/* Border colors */
.border-gray-300 { border-color: rgba(212, 168, 75, 0.2) !important; }

/* ============================================
   NEWSLETTER SIGNUP FORM
   ============================================ */

.text-chrome-gold {
    color: var(--chrome-gold);
}

/* Compact Newsletter Form - derived from full form */
.newsletter-compact-wrap {
    position: relative;
}

.newsletter-compact {
    position: relative;
    background: linear-gradient(135deg, rgba(5, 5, 16, 0.95) 0%, rgba(45, 27, 78, 0.3) 50%, rgba(26, 58, 95, 0.4) 100%);
    border: 1px solid rgba(212, 168, 75, 0.2);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    overflow: hidden;
}

.newsletter-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 168, 75, 0.5) 30%,
        rgba(255, 248, 224, 0.7) 50%,
        rgba(212, 168, 75, 0.5) 70%,
        transparent 100%
    );
}

.newsletter-compact-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.4;
}

.newsletter-compact-rings .ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(212, 168, 75, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.newsletter-compact-rings .ring-1 {
    width: 80px;
    height: 80px;
    animation: ringPulseNewsletter 4s ease-in-out infinite;
}

.newsletter-compact-rings .ring-2 {
    width: 160px;
    height: 160px;
    animation: ringPulseNewsletter 4s ease-in-out infinite 0.5s;
}

.newsletter-compact-rings .ring-3 {
    width: 260px;
    height: 260px;
    animation: ringPulseNewsletter 4s ease-in-out infinite 1s;
}

.newsletter-compact-content {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.newsletter-compact-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--chrome-gold);
    text-shadow: 0 0 20px rgba(212, 168, 75, 0.3);
    margin: 0;
}

.newsletter-compact-form {
    display: flex;
    gap: 0.5rem;
    margin: 0;
}

.newsletter-compact-form .newsletter-full-input {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    min-width: 200px;
}

.newsletter-compact-form .newsletter-full-btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.75rem;
}

@media (max-width: 640px) {
    .newsletter-compact {
        padding: 1.5rem 1.25rem;
    }

    .newsletter-compact-content {
        flex-direction: column;
        gap: 1rem;
    }

    .newsletter-compact-form {
        width: 100%;
        flex-direction: column;
    }

    .newsletter-compact-form .newsletter-full-input {
        width: 100%;
        min-width: unset;
    }

    .newsletter-compact-form .newsletter-full-btn {
        width: 100%;
        padding: 0.75rem 1.5rem;
    }
}

/* Full Newsletter Form */
.newsletter-full-wrap {
    position: relative;
}

.newsletter-full {
    position: relative;
    background: linear-gradient(135deg, rgba(5, 5, 16, 0.95) 0%, rgba(45, 27, 78, 0.3) 50%, rgba(26, 58, 95, 0.4) 100%);
    border: 1px solid rgba(212, 168, 75, 0.2);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    overflow: hidden;
    text-align: center;
}

.newsletter-full::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 168, 75, 0.5) 30%,
        rgba(255, 248, 224, 0.7) 50%,
        rgba(212, 168, 75, 0.5) 70%,
        transparent 100%
    );
}

.newsletter-full-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212, 168, 75, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(232, 104, 63, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.newsletter-full-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.3;
}

.newsletter-full .ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(212, 168, 75, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.newsletter-full .ring-1 {
    width: 150px;
    height: 150px;
    animation: ringPulseNewsletter 4s ease-in-out infinite;
}

.newsletter-full .ring-2 {
    width: 250px;
    height: 250px;
    animation: ringPulseNewsletter 4s ease-in-out infinite 0.5s;
}

.newsletter-full .ring-3 {
    width: 350px;
    height: 350px;
    animation: ringPulseNewsletter 4s ease-in-out infinite 1s;
}

@keyframes ringPulseNewsletter {
    0%, 100% { opacity: 0.2; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.05); }
}

.newsletter-full-content {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-full-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--chrome-gold);
    margin: 0 0 0.75rem;
    text-shadow: 0 0 30px rgba(212, 168, 75, 0.4);
}

.newsletter-full-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.newsletter-full-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
}

@media (min-width: 480px) {
    .newsletter-full-form {
        flex-direction: row;
    }
}

.newsletter-full-input-wrap {
    flex: 1;
    position: relative;
}

.newsletter-full-input {
    width: 100%;
    background: rgba(5, 5, 16, 0.8);
    border: 1px solid rgba(212, 168, 75, 0.3);
    border-radius: 50px;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    color: white;
    outline: none;
    transition: all 0.3s var(--ease-out-expo);
}

.newsletter-full-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.newsletter-full-input:focus {
    border-color: var(--chrome-gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.15), 0 0 30px rgba(212, 168, 75, 0.15);
}

.newsletter-full-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--chrome-gold) 0%, var(--sunset-orange) 100%);
    border: none;
    border-radius: 50px;
    padding: 0.875rem 2rem;
    color: var(--void-black);
    cursor: pointer;
    transition: all 0.4s var(--ease-out-expo);
    white-space: nowrap;
}

.newsletter-full-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(212, 168, 75, 0.4);
}

.newsletter-full-btn .btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.newsletter-full-btn:hover .btn-arrow {
    transform: translateX(4px);
}

.newsletter-full-privacy {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 1rem 0 0;
}
