/* ===== Reset & Variables ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #08080c;
    --surface: #0e0e16;
    --surface-2: #15151f;
    --surface-3: #1c1c2a;
    --border: #252536;
    --text: #e8e6e0;
    --text-muted: #6e6c7e;
    --text-dim: #3a3848;
    --noise-opacity: 0.04;
    --t-shadow: none;
}

:root.light {
    --bg: #f4f2ed;
    --surface: #ffffff;
    --surface-2: #eeece6;
    --surface-3: #e4e1d9;
    --border: #d4d0c6;
    --text: #1a1a2e;
    --text-muted: #6b6880;
    --text-dim: #a09baf;
    --noise-opacity: 0.025;
    --t-shadow: 0 1px 0 rgba(255,255,255,.8);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Mono', monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    transition: background .4s ease, color .4s ease;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: var(--noise-opacity);
    pointer-events: none;
    z-index: 9999;
    transition: opacity .4s ease;
}

a { color: #6bcb77; text-decoration: none; }

/* ===== Theme Toggle ===== */
.theme-toggle {
    position: fixed; top: 20px; right: 24px; z-index: 10000;
    width: 52px; height: 28px; border-radius: 14px;
    border: 1.5px solid var(--border); background: var(--surface-2);
    cursor: pointer; display: flex; align-items: center;
    padding: 0 3px; transition: background .3s, border-color .3s, box-shadow .3s;
    outline: none;
}
.theme-toggle:hover { border-color: #4a4a60; box-shadow: 0 0 14px rgba(107,203,119,.12); }
.theme-toggle:active .toggle-thumb { width: 20px; }
.toggle-thumb {
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(135deg, #e8e6e0, #c8c4bc);
    position: relative; transition: transform .35s cubic-bezier(.68,-.3,.32,1.3), background .35s;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.3); flex-shrink: 0;
}
.toggle-thumb::before {
    content: ''; position: absolute; width: 10px; height: 10px;
    border-radius: 50%; background: rgba(0,0,0,.15); transition: all .35s;
}
:root.light .toggle-thumb {
    transform: translateX(24px);
    background: linear-gradient(135deg, #ffd93d, #ffb347);
    box-shadow: 0 1px 6px rgba(255,179,71,.45);
}
:root.light .toggle-thumb::before {
    width: 7px; height: 7px; background: rgba(255,255,255,.6);
    top: 3px; right: 4px;
}
.toggle-icons {
    position: absolute; width: 100%; display: flex;
    justify-content: space-between; padding: 0 6px;
    pointer-events: none; font-size: 11px;
}
.icon-moon, .icon-sun { transition: opacity .3s, transform .3s; line-height: 1; }
.icon-moon { opacity: .5; } .icon-sun { opacity: .25; transform: scale(.85); }
:root.light .icon-moon { opacity: .2; transform: scale(.85); }
:root.light .icon-sun  { opacity: .7; transform: scale(1); }

/* ===== Site Nav ===== */
.site-nav {
    width: 100%; position: sticky; top: 0; z-index: 100;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 24px; transition: background .4s, border-color .4s;
    backdrop-filter: blur(12px);
}
:root:not(.light) .site-nav { background: rgba(14,14,22,.85); }
:root.light .site-nav { background: rgba(255,255,255,.85); }
.nav-inner {
    max-width: 1360px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 52px;
}
.nav-brand {
    font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px;
    background: linear-gradient(135deg, var(--text) 30%, #6bcb77);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; text-decoration: none; letter-spacing: -0.03em;
}
.nav-links { display: flex; gap: 6px; }
.nav-links a {
    padding: 6px 14px; border-radius: 6px; font-size: 11px;
    color: var(--text-muted); text-decoration: none;
    transition: all .2s; letter-spacing: .03em;
}
.nav-links a:hover { color: var(--text); background: var(--surface-3); }
.nav-links a.active { color: #6bcb77; background: rgba(107,203,119,.08); }

/* ===== Footer ===== */
.site-footer {
    width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px;
    border-top: 1px solid var(--border); text-align: center;
}
.site-footer p { font-size: 11px; color: var(--text-dim); }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: #6bcb77; }

/* ===== Animations ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .65; }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===== Responsive (shared) ===== */
@media (max-width: 520px) {
    .theme-toggle { top: 12px; right: 12px; width: 48px; height: 26px; }
    .toggle-thumb { width: 20px; height: 20px; }
    :root.light .toggle-thumb { transform: translateX(22px); }
    .nav-links a { padding: 5px 10px; font-size: 10px; }
}
