/* ====================================
   THE AI WORLD — Design System
   Portfolio: Nithin Sai Kumar Kopparapu
   ==================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- CSS Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Design Tokens --- */
:root {
    /* Backgrounds */
    --bg-primary: #000000;
    --bg-surface: #0a0a0f;
    --bg-elevated: #111118;
    --bg-glass: rgba(10, 10, 15, 0.7);

    /* Text */
    --text-primary: #f0f0f0;
    --text-secondary: #8a8a9a;
    --text-dim: #4a4a5a;
    --text-bright: #ffffff;

    /* Accents */
    --accent-yellow: #f5d547;
    --accent-purple: #a855f7;
    --accent-cyan: #22d3ee;
    --accent-active: var(--accent-yellow);

    /* Borders */
    --border: #1a1a2e;
    --border-light: #2a2a3e;

    /* Glows */
    --glow-yellow: rgba(245, 213, 71, 0.15);
    --glow-purple: rgba(168, 85, 247, 0.15);
    --glow-cyan: rgba(34, 211, 238, 0.1);
    --glow-active: var(--glow-yellow);

    /* Shadows */
    --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--glow-active);

    /* Typography */
    --font-mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;

    /* Sizing */
    --section-padding: clamp(4rem, 10vh, 8rem) clamp(1.5rem, 5vw, 6rem);
    --max-width: 1200px;
    --border-radius: 12px;
    --border-radius-lg: 20px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: 0.2s var(--ease-out-quart);
    --transition-med: 0.4s var(--ease-out-expo);
    --transition-slow: 0.8s var(--ease-out-expo);
}

/* --- Easter Egg: Purple Mode --- */
:root.purple-mode {
    --accent-active: var(--accent-purple);
    --glow-active: var(--glow-purple);
}

/* --- Base --- */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* --- Selection --- */
::selection {
    background: var(--accent-active);
    color: var(--bg-primary);
}

/* --- Three.js Canvas --- */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* --- Main Content Layer --- */
#app {
    position: relative;
    z-index: 1;
}

/* --- Typography System --- */
h1, h2, h3, h4 {
    font-family: var(--font-mono);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}

h3 {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
}

p {
    color: var(--text-secondary);
    max-width: 65ch;
}

a {
    color: var(--accent-active);
    text-decoration: none;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
    opacity: 0.8;
}

/* --- Section Base --- */
.section {
    padding: var(--section-padding);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.section__inner {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
}

/* --- Section Header --- */
.section__label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--accent-active);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: color var(--transition-med);
    text-shadow: 0 0 20px var(--glow-active);
}

.section__label::before {
    content: '';
    display: inline-block;
    width: 3rem;
    height: 2px;
    background: var(--accent-active);
    transition: background var(--transition-med);
    box-shadow: 0 0 10px var(--glow-active);
}

.section__title {
    margin-bottom: 1.5rem;
    text-shadow: 0 0 40px rgba(245, 213, 71, 0.08);
}

.section__desc {
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 700px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: var(--accent-active);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--glow-active);
    transition: all var(--transition-med);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--glow-active);
    opacity: 1;
}

.btn--outline {
    background: transparent;
    color: var(--accent-active);
    border: 1px solid var(--accent-active);
    transition: all var(--transition-med);
}

.btn--outline:hover {
    background: var(--glow-active);
    transform: translateY(-2px);
    opacity: 1;
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
}

.btn--ghost:hover {
    color: var(--accent-active);
    opacity: 1;
}

/* --- Tags / Pills --- */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-surface);
    transition: all var(--transition-fast);
}

.tag--accent {
    border-color: var(--accent-active);
    color: var(--accent-active);
    background: var(--glow-active);
    transition: all var(--transition-med);
}

.tag--cyan {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: var(--glow-cyan);
}

/* --- Cards --- */
.card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all var(--transition-med);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

.card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

/* --- Metric Display --- */
.metric {
    text-align: center;
}

.metric__value {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--accent-active);
    line-height: 1;
    transition: color var(--transition-med);
}

.metric__label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* --- Gradient Text --- */
.gradient-text {
    background: linear-gradient(135deg, var(--accent-active), var(--text-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: background var(--transition-med);
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-elevated);
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
    padding: 0.875rem 1.5rem;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    z-index: 1000;
    opacity: 0;
    transition: all var(--transition-med);
    white-space: nowrap;
    box-shadow: 0 0 30px var(--glow-purple);
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- Responsive Utilities --- */
@media (max-width: 768px) {
    .section {
        padding: clamp(3rem, 8vh, 5rem) 1.25rem;
    }

    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

/* --- Reveal animation base --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
