/* ==========================================================================
   Design Tokens & Variables
   Extracted from Stitch Design System
   ========================================================================== */
   :root {
    --color-bg: #0e0e0f;
    --color-surface: #131314;
    --color-surface-dim: #131314;
    --color-surface-low: #1c1b1c;
    --color-surface-container: #201f20;
    --color-surface-high: #2a2a2b;
    --color-surface-highest: #353436;
    --color-surface-lowest: #0e0e0f;
    --color-surface-bright: #3a393a;
    
    --color-primary: #00fdee;
    --color-primary-dim: #00ded1;
    --color-primary-container: #00d2ff;
    --color-on-primary-container: #00566a;
    
    --color-secondary: #a855f7;
    --color-secondary-fixed: #c084fc;
    --color-secondary-fixed-dim: #d8b4fe;
    --color-secondary-container: #3b0764;
    
    --color-tertiary: #e5d7ff;
    --color-tertiary-container: #ccb6ff;
    
    --color-text: #e5e2e3;
    --color-text-muted: #bbc9cf;
    --color-outline: #859399;
    --color-outline-variant: #3c494e;
    
    --color-error: #ffb4ab;
    --color-error-container: #93000a;
    
    --font-display: 'Geist', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

/* Purple ambient glow background */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, rgba(0, 0, 0, 0) 60%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(0, 253, 238, 0.05) 0%, rgba(0, 0, 0, 0) 60%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* ==========================================================================
   Custom Color Controller Panel
   ========================================================================== */
.color-panel {
    background: rgba(14, 14, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    width: 280px;
}

.color-panel.open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
}

.preset-btn {
    border: 2px solid transparent;
}
.preset-btn:hover {
    border-color: rgba(255,255,255,0.8);
    box-shadow: 0 0 10px currentColor;
}

/* Override iro.js default focus outline */
.IroColorPicker * {
    outline: none !important;
}

/* ==========================================================================
   Global Resets & Base Styles
   ========================================================================== */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

::selection {
    background-color: var(--color-primary-container);
    color: var(--color-on-primary-container);
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-primary-dim);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 9999;
    transition: transform 0.1s ease-out;
}

/* Typography Utilities */
.font-display-lg { font-family: var(--font-display); }
.font-label-mono { font-family: var(--font-mono); }
.font-body-lg { font-family: var(--font-body); }
.text-glow { text-shadow: 0 0 15px rgba(165, 231, 255, 0.4); }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    animation: marquee 40s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

/* Scroll Reveal */
.reveal-section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Navigation */
.nav-link {
    position: relative;
    padding: 4px 0;
    text-decoration: none;
    color: var(--color-text-muted);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-primary-dim);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-primary);
}

/* Mobile Menu Slide Down */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

#mobile-menu.open {
    max-height: 300px;
}

/* Glass & Tags */
.glass-tag {
    background: rgba(71, 214, 255, 0.05);
    border: 1px solid rgba(71, 214, 255, 0.15);
    backdrop-filter: blur(8px);
}

/* Buttons */
.primary-button {
    background: var(--color-primary);
    color: var(--color-surface-lowest);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    cursor: pointer;
}

.primary-button:hover {
    background: var(--color-secondary);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(165, 231, 255, 0.3);
}

.secondary-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(71, 214, 255, 0.4);
}

/* Bento Cards */
.bento-card {
    background: rgba(28, 27, 28, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover {
    border-color: rgba(71, 214, 255, 0.3);
    background: rgba(32, 31, 32, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

/* Skill Cards */
.skill-card {
    background: rgba(28, 27, 28, 0.4);
    border-radius: 12px;
    padding: 32px;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
}

.skill-card:hover {
    background: rgba(32, 31, 32, 0.6);
    transform: translateY(-2px);
    border-color: rgba(71, 214, 255, 0.2);
}

/* Tech Badges */
.tech-badge {
    background: rgba(28, 27, 28, 0.6);
    border: 1px solid rgba(0, 210, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-badge:hover {
    border-color: var(--color-primary-container);
    background: rgba(0, 210, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
    transform: scale(1.05);
}

/* Loading Spinner for Form */
.form-spinner {
    display: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-loading .form-spinner {
    display: inline-block;
}

.form-loading .btn-text {
    display: none;
}