﻿/* Replace the current global transition rule with this */
*, *::before, *::after {
    transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease, opacity .3s ease;
}

/* ── THEME TOKENS ── */
:root {
    /* Light mode (default) */
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface2: #e8eaed;
    --border: rgba(0,0,0,.09);
    --text: #111318;
    --muted: rgba(17,19,24,.45);
    --accent: #2c4a8a;
    --accent2: #4a6ba8;
    --gold: #5a6a8a;
    --glow: rgba(44,74,138,.12);
    /* Toggle */
    --toggle-bg: #dde1e8;
    --toggle-knob: #ffffff;
    --toggle-icon: #2c4a8a;
}

[data-theme="dark"] {
    --bg: #0c1018;
    --surface: #131a27;
    --surface2: #1a2436;
    --border: rgba(255,255,255,.07);
    --text: #e8ecf4;
    --muted: rgba(232,236,244,.4);
    --accent: #5a82d4;
    --accent2: #7aa0e8;
    --gold: #e8c870;
    --glow: rgba(90,130,212,.22);
    --toggle-bg: #1e2d48;
    --toggle-knob: #5a82d4;
    --toggle-icon: #e8ecf4;
}

/* Smooth global transition on theme switch */
*, *::before, *::after {
    transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;
}

html {
    scroll-behavior: smooth
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    cursor: none;
}

/* ── CURSOR ── */
#cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: normal;
    transition: transform .15s ease, opacity .3s ease !important;
}

#cursor-ring {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1.5px solid rgba(74,125,255,.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: transform .35s cubic-bezier(.23,1,.32,1), width .3s, height .3s, opacity .3s ease !important;
}

body:has(a:hover) #cursor-ring,
body:has(button:hover) #cursor-ring {
    width: 60px;
    height: 60px;
    border-color: var(--accent2);
}

/* ── CANVAS BG ── */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: .45;
    pointer-events: none;
}

/* ── NAV ── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6%;
    height: 68px;
    border-bottom: 1px solid var(--border);
    background: rgba(240,242,245,.88);
    backdrop-filter: blur(24px);
}

[data-theme="dark"] nav {
    background: rgba(12,16,24,.8);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.logo-glyph {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
}

.logo-name {
    font-family: 'Instrument Serif', serif;
    font-size: 1.2rem;
    letter-spacing: -.01em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .02em;
    transition: color .2s;
}

    .nav-link:hover {
        color: var(--text);
    }

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(44,74,138,.4);
    color: var(--accent);
    font-family: 'Outfit', sans-serif;
    font-size: .84rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
    cursor: none;
}

    .nav-btn:hover {
        background: rgba(44,74,138,.1);
        border-color: var(--accent);
        color: var(--text);
    }

/* ── THEME TOGGLE ── */
.theme-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--toggle-bg);
    border-radius: 100px;
    border: 1px solid var(--border);
    cursor: none;
    transition: background .3s, border-color .3s;
    flex-shrink: 0;
}

.theme-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--toggle-knob);
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), background .3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .theme-toggle-knob {
    transform: translateX(24px);
}

.theme-toggle-icon {
    width: 11px;
    height: 11px;
    color: var(--toggle-icon);
    transition: opacity .2s;
}

.icon-sun {
    opacity: 1;
    position: absolute;
}

.icon-moon {
    opacity: 0;
    position: absolute;
}

[data-theme="dark"] .icon-sun {
    opacity: 0;
}

[data-theme="dark"] .icon-moon {
    opacity: 1;
}

/* ── FOOTER ── */
footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 32px 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    font-family: 'Instrument Serif', serif;
    font-size: 1rem;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}

    .footer-logo:hover {
        color: var(--text);
    }

.footer-copy {
    font-size: .78rem;
    color: var(--muted);
}

.footer-link {
    font-size: .78rem;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}

    .footer-link:hover {
        color: var(--text);
    }

/* ── ANIMATIONS ── */
@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: .5;
        transform: scale(.7)
    }
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s ease, transform .7s ease;
}

    .reveal.visible {
        opacity: 1;
        transform: none;
    }

.reveal-delay-1 {
    transition-delay: .1s;
}

.reveal-delay-2 {
    transition-delay: .2s;
}

.reveal-delay-3 {
    transition-delay: .3s;
}

.reveal-delay-4 {
    transition-delay: .4s;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    nav .nav-link {
        display: none;
    }

    footer {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
