:root {
    /* Colors from portfolio.html */
    --bg: #0a0812;
    --surface: #100d1a;
    --card: #15112299;
    --violet: #7c3aed;
    --violet-light: #a78bfa;
    --violet-pale: #ddd6fe;
    --accent: #f0abfc;
    --text-main: #e9e4f5;
    --text-muted: #7c6f9a;
    --border: rgba(124, 58, 237, 0.18);
    --glow: rgba(124, 58, 237, 0.35);
    
    /* Original Brand Colors maintained for compatibility maybe? */
    /* No, let's stick to the new design as requested */
    --primary: var(--violet);
    --primary-glow: var(--glow);
    --secondary: var(--accent);
    
    /* Fonts */
    --font-main: 'DM Mono', monospace;
    --font-heading: 'Syne', sans-serif;
    --font-mono: 'DM Mono', monospace;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;

    /* Radius scale */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Type scale */
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;

    /* Motion */
    --ease-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
    --transition-fast: 0.2s;
    --transition-base: 0.3s;

    /* Elevation & Glass system */
    --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(124,58,237,0.08);
    --glow-hover: 0 0 24px rgba(124,58,237,0.3), 0 0 48px rgba(124,58,237,0.12);
    --glass-bg: rgba(21, 17, 34, 0.6);
    --glass-border: rgba(124, 58, 237, 0.2);
    --glass-blur: blur(16px);
}

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

body:not(.native-cursor) *,
body:not(.native-cursor) *::before,
body:not(.native-cursor) *::after {
    cursor: none !important;
}

body.use-native-cursor *,
body.use-native-cursor *::before,
body.use-native-cursor *::after {
    cursor: auto !important;
}

body.native-cursor *,
body.native-cursor *::before,
body.native-cursor *::after {
    cursor: auto !important;
}

body.use-native-cursor .cursor-dot,
body.use-native-cursor .cursor-outline {
    display: none !important;
}

body.native-cursor .cursor-dot,
body.native-cursor .cursor-outline {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body {
    font-family: var(--font-main);
    font-size: clamp(15px, 0.15vw + 14px, 16px);
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: .035;
  pointer-events: none;
}

/* ── BACKGROUND MESH ── */
.mesh {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden;
}
.mesh::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.22) 0%, transparent 70%);
  top: -200px; right: -200px;
  animation: drift1 18s ease-in-out infinite alternate;
}
.mesh::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,171,252,.10) 0%, transparent 70%);
  bottom: 10%; left: -150px;
  animation: drift2 22s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(-80px, 120px) scale(1.15); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(60px, -80px) scale(1.1); } }

main {
    position: relative;
    z-index: 2;
}

::selection {
    background: var(--primary);
    color: #fff;
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* ----------------
 * Utilities
 * ---------------- */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

.mono {
    font-family: var(--font-mono);
}

/* ----------------
 * Enhanced Loader (Terminal Style)
 * ---------------- */
#loader {
    position: fixed;
    inset: 0;
    background: #05040a;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.loader-content {
    width: 90%;
    max-width: 500px;
}

.loader-terminal {
    background: rgba(10, 8, 18, 0.5);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    text-align: left;
}

.loader-terminal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, rgba(124, 58, 237, 0.05) 50%, transparent);
    animation: scanline 4s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    from { transform: translateY(-100%); }
    to { transform: translateY(100%); }
}

.terminal-line {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--violet-light);
    opacity: 0;
    transform: translateY(5px);
    animation: lineFadeIn 0.3s forwards;
}

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

.loader-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    overflow: hidden;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

#loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* ----------------
 * Custom Cursor
 * ---------------- */
/* ── CURSOR ── */
.cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9999;
  pointer-events: none;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: transform .1s;
}
.cursor-outline {
  position: fixed; top: 0; left: 0; z-index: 9999;
  pointer-events: none;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--violet-light);
  transform: translate(-50%, -50%);
  transition: width .25s, height .25s, transform .08s;
  opacity: .6;
  background: transparent;
}
body:hover .cursor-outline { opacity: .6; }

/* ----------------
 * Navigation
 * ---------------- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 0;
    z-index: 1000; /* Increased to be above everything */
    transition: all 0.4s ease;
}

header.scrolled {
    padding: 0.75rem 0;
    background: rgba(5, 2, 9, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: -1px;
    text-shadow: 0 0 10px rgba(189, 0, 255, 0.5);
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px; left: 0; width: 0; height: 1px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover { color: #fff; text-shadow: 0 0 8px var(--primary); }
.nav-links a:hover::after { width: 100%; }

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: #fff;
}

.lang-btn.active {
    color: #fff;
    background: rgba(189, 0, 255, 0.25);
    box-shadow: 0 0 12px rgba(189, 0, 255, 0.35);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.4);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.7); }

/* ── READING PROGRESS ── */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(to right, var(--violet), var(--accent));
    z-index: 1002;
    pointer-events: none;
    transition: width 0.1s linear;
}

@media (prefers-reduced-motion: reduce) {
    #reading-progress {
        transition: none;
    }
}

/* ── SKIP LINK ── */
.skip-link {
    position: absolute;
    top: -48px;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--violet);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    z-index: 10001;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
    .skip-link {
        transition: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .mesh,
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}

/* ----------------
 * Canvas & Hero
 * ---------------- */
#bg-canvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #1a0525 0%, #000 100%);
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding-top: 4rem;
}

/* Background Glow for Hero */
.hero::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw; height: 70vw;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.22) 0%, transparent 65%);
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
    animation: hero-pulse 5s ease-in-out infinite alternate;
}
@keyframes hero-pulse {
    from { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.hero-content {
    text-align: center;
    max-width: 1100px;
    padding: 0 2rem;
}

.hero h1 {
    font-size: clamp(3.5rem, 8vw, 7rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-family: var(--font-heading);
    font-weight: 800;
}
.hero h1 .glow-word {
    background: linear-gradient(135deg, var(--violet-light) 0%, var(--accent) 60%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient-shift 4s ease-in-out infinite alternate;
}
@keyframes gradient-shift {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

/* ----------------
 * Discord Card
 * ---------------- */
