/* =========================================
   1. BACKGROUND LAYERS & ANIMATIONS
   ========================================= */
.bg-layers {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg-primary);
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #03050a, #050a14);
}

.bg-layer-1 {
    position: absolute;
    top: -20%;
    left: -10%;
    width: 150%;
    height: 150%;
    background: #040812;
    transform: rotate(-30deg);
    transform-origin: top left;
    will-change: transform;
}

.bg-layer-2 {
    position: absolute;
    top: -10%;
    right: -50%;
    width: 120%;
    height: 150%;
    background: #060c1d;
    transform: rotate(-30deg);
    box-shadow: -50px 0 100px rgba(0, 0, 0, 0.8);
    will-change: transform;
}

.bg-layer-3 {
    position: absolute;
    top: 20%;
    right: -30%;
    width: 100%;
    height: 120%;
    background: linear-gradient(to bottom right, #081126, #0a0e1a);
    transform: rotate(-30deg);
    box-shadow: -30px -30px 80px rgba(0, 0, 0, 0.6);
    border-left: 1px solid rgba(255, 165, 0, 0.05);
    will-change: transform;
}

.bg-layer-4 {
    position: absolute;
    top: -40%;
    right: 10%;
    width: 80%;
    height: 80%;
    background: linear-gradient(to bottom, #0A1630, #0a1220, #0d0f1a);
    transform: rotate(-30deg);
    opacity: 0.4;
    filter: blur(80px);
    mix-blend-mode: overlay;
    will-change: transform;
}

.bg-glow {
    position: absolute;
    top: 30%;
    left: 20%;
    width: 300px;
    height: 300px;
    background: #FFA500;
    opacity: 0.03;
    filter: blur(100px);
    border-radius: 50%;
}

.glow-trails {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.glow-trail {
    position: absolute;
    width: 2px;
    height: 200px;
    background: linear-gradient(to bottom, rgba(255, 165, 0, 0) 0%, rgba(255, 165, 0, 0.4) 50%, rgba(212, 180, 131, 0.3) 70%, rgba(255, 165, 0, 0) 100%);
    filter: blur(2px);
    transform: rotate(-30deg);
    animation: glowTrailMove 15s linear infinite;
}

.glow-trail-2 {
    left: 20%;
    animation-delay: -5s;
    animation-duration: 18s;
    opacity: 0.6;
}

.glow-trail-3 {
    left: 50%;
    animation-delay: -10s;
    animation-duration: 20s;
    height: 250px;
    opacity: 0.5;
}

.glow-trail-4 {
    left: 75%;
    animation-delay: -2s;
    animation-duration: 16s;
    height: 180px;
    opacity: 0.7;
    background: linear-gradient(to bottom, rgba(212, 180, 131, 0) 0%, rgba(212, 180, 131, 0.3) 50%, rgba(255, 165, 0, 0.2) 70%, rgba(212, 180, 131, 0) 100%);
}

@keyframes glowTrailMove {
    0% {
        top: -250px;
        opacity: 0;
    }

    10%,
    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Circles */
.circles-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 300px;
    pointer-events: none;
    z-index: 0;
}

.circle-1 {
    position: absolute;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    border: 1px solid rgba(212, 180, 131, 0.2);
    border-radius: 50%;
}

.circle-2 {
    position: absolute;
    bottom: -200px;
    left: 10%;
    width: 400px;
    height: 400px;
    border: 1px solid var(--border-secondary);
    border-radius: 50%;
}

.circle-3 {
    position: absolute;
    bottom: -200px;
    right: 10%;
    width: 400px;
    height: 400px;
    border: 1px solid rgba(212, 180, 131, 0.1);
    border-radius: 50%;
}

/* =========================================
   2. HEADER & MENU
   ========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 1rem 1.5rem;
    transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 165, 0, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.header-scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 165, 0, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.header-container {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon-wrapper {
    position: relative;
}

.logo-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, #FFA500, #D4B483);
    border-radius: 0.75rem;
    filter: blur(24px);
    opacity: 0.15;
    transition: opacity 500ms;
}

.logo-icon-wrapper:hover .logo-glow {
    opacity: 0.35;
}

.logo-icon {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.logo-text h1 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.logo-text p {
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 300;
}

.nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.nav a,
.nav a:visited {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 200ms;
}

.nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.menu-btn {
    background: var(--glass-bg);
    border: 1px solid var(--border-secondary);
    padding: 0.75rem;
    border-radius: 0.5rem;
    color: var(--accent-primary);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status Badge */
.status-badge {
    display: none;
    align-items: center;
    gap: 0.75rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-secondary);
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.status-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: rgba(255, 165, 0, 0.5);
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}

.mobile-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 300ms;
}

.mobile-menu-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: #050810;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
    transition: transform 300ms;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    pointer-events: auto;
}

.mobile-menu.active .mobile-menu-overlay {
    opacity: 1;
}

.mobile-menu.active .mobile-menu-sidebar {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.menu-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 200ms;
}

.menu-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.menu-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-footer button {
    width: 100%;
    background: linear-gradient(to bottom, #FFA500, #FF8C00);
    color: var(--text-primary);
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
}

/* =========================================
   3. HERO & MAIN
   ========================================= */
.main {
    position: relative;
    z-index: 10;
    padding-top: 7rem;
    padding-bottom: 2rem;
    max-width: 980px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.hero {
    background: var(--bg-card);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-secondary);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease-out;
}

.hero h2 {
    font-size: clamp(24px, 5vw, 32px);
    margin: 0 0 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hero p {
    margin: 0;
    color: var(--text-secondary);
    font-size: clamp(14px, 3vw, 16px);
    line-height: 1.5;
}

/* =========================================
   4. FOOTER
   ========================================= */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(4, 8, 18, 0.5);
    backdrop-filter: blur(4px);
    margin-top: 6rem;
}

.footer-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h5 {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section svg,
.footer-brand svg,
.social-link svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    display: block;
    stroke-width: 2;
}

.footer-section h5 svg {
    color: var(--accent-primary);
}

.footer-links a,
.footer-links a:visited {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 200ms;
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

/* Sticky Hub Button (Mobile) */
.sticky-hub-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: none;
}

.sticky-hub-btn a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #FFA500, #D4B483);
    color: #0a0e1a;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(255, 165, 0, 0.4);
}

/* Responsive */
@media (min-width: 640px) {
    .logo-text p {
        display: block;
    }

    .status-badge {
        display: flex;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (min-width: 768px) {
    .sticky-hub-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    .sticky-hub-btn {
        display: block;
    }
}

@media (min-width: 1024px) {
    .menu-btn:not(#themeToggle) {
        display: none;
    }

    .nav {
        display: flex;
    }

    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   5. SPECIFIC COMPONENT OVERRIDES
   ========================================= */

/* Footer Social Buttons (Styles link tags as squares) */
.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-decoration: none;
}

.social-links a:hover {
    background: rgba(255, 165, 0, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.social-links svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* =========================================
   6. LIGHT MODE FIXES
   ======================================== */

/* Body text readability */
[data-theme="light"] body {
    line-height: 1.7;
    color: #555555;
}

[data-theme="light"] h1,
[data-theme="light"] h2 {
    color: #111827;
}

[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5 {
    color: #111827;
}

[data-theme="light"] p,
[data-theme="light"] label,
[data-theme="light"] .helper,
[data-theme="light"] small {
    color: #485563;
    line-height: 1.7;
}

/* Cards — one clear border, light shadow */
[data-theme="light"] .card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

/* Raycast grids — tighter border gap colour */
[data-theme="light"] .blog-grid,
[data-theme="light"] .calc-grid,
[data-theme="light"] .values-grid,
[data-theme="light"] .roadmap-grid,
[data-theme="light"] .contact-grid,
[data-theme="light"] .cookie-grid,
[data-theme="light"] .legal-grid {
    background: #E5E7EB;
    border-color: #E5E7EB;
}

/* Section headings — more space above */
[data-theme="light"] h2,
[data-theme="light"] h3 {
    margin-top: 0;
    letter-spacing: -0.01em;
}

[data-theme="light"] .bg-layers,
[data-theme="light"] .bg-gradient,
[data-theme="light"] .bg-layer-1,
[data-theme="light"] .bg-layer-2,
[data-theme="light"] .bg-layer-3,
[data-theme="light"] .bg-layer-4,
[data-theme="light"] .bg-glow,
[data-theme="light"] .glow-trails,
[data-theme="light"] .glow-trail,
[data-theme="light"] .circles-container {
    display: none !important;
}

/* Light mode footer - Clean White */
[data-theme="light"] .footer {
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
}

[data-theme="light"] .footer-links a,
[data-theme="light"] .footer-section h5,
[data-theme="light"] .footer-bottom {
    color: #555555;
}

[data-theme="light"] .footer-links a:hover {
    color: var(--accent-primary);
}

/* Light mode Header */
[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #E2E8F0;
}

[data-theme="light"] .logo-text h1 {
    color: #111111;
}

[data-theme="light"] .logo-text p {
    color: #777777;
}

/* LIGHT MODE: Hamburger Menu Fix */
[data-theme="light"] .mobile-menu-sidebar {
    background: #FFFFFF;
    /* Endre fra mørk til hvit */
    border-right: 1px solid #E2E8F0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .menu-header,
[data-theme="light"] .menu-footer {
    border-color: #E2E8F0;
    /* Lysere linjer */
}

[data-theme="light"] .menu-nav a {
    color: #475569;
    /* Mørk tekst på lenker */
}

[data-theme="light"] .menu-nav a:hover {
    background: #F1F5F9;
    /* Lys grå hover-effekt */
    color: #1E293B;
}