/* ── Theme CSS Variables ── */
:root {
    /* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
       ACCENT PALETTE — only edit values in this block
       to retheme the entire site at once.
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
    /* Primary accent */
    --accent-400:     #fbbf24;   /* lighter — hover tints        */
    --accent-500:     #d97706;   /* main    — buttons, links, CTAs */
    --accent-600:     #b45309;   /* darker  — pressed states      */
    --accent-700:     #92400e;   /* darkest — deep shadows        */
    /* Secondary accent — desaturated, for tags / borders / muted UI */
    --accent-s-bg:     rgba(217, 119, 6, 0.08);   /* tag background  */
    --accent-s-border: rgba(217, 119, 6, 0.20);   /* tag border      */
    --accent-s-text:   rgba(251, 191, 36, 0.75);  /* muted label     */
    /* RGB triplets — used inside rgba() elsewhere */
    --accent-rgb:       217, 119, 6;    /* matches --accent-500    */
    --accent-light-rgb: 251, 191, 36;   /* matches --accent-400    */
    --accent-dark-rgb:  180, 83, 9;     /* light-mode canvas tint  */

    --surface-50:  #f8fafc;
    --surface-100: #f1f5f9;
    --surface-800: #1e293b;
    --surface-900: #0f172a;
    --surface-950: #020617;
    --color-white: #ffffff;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    /* Semantic tokens */
    --bg-body: #020617;
    --text-body: #e2e8f0;
    --card-bg: rgba(15, 23, 42, 0.5);
    --overlay-bg: rgba(2, 6, 23, 0.85);
    --overlay-border: rgba(30, 41, 59, 0.5);
    --overlay-gradient: rgba(2, 6, 23, 0.95);
    --cursor-glow: rgba(var(--accent-rgb), 0.08);
    --grain-opacity: 0.03;
}

[data-theme="light"] {
    --surface-50:  #020617;
    --surface-100: #0f172a;
    --surface-800: #e2e8f0;
    --surface-900: #f1f5f9;
    --surface-950: #f8fafc;
    --color-white: #0f172a;
    --slate-300: #334155;
    --slate-400: #475569;
    --slate-500: #64748b;
    --slate-600: #94a3b8;
    --slate-700: #cbd5e1;
    --slate-800: #e2e8f0;
    /* Semantic tokens */
    --bg-body: #fcfcfc;
    --text-body: #1e293b;
    --card-bg: rgba(255, 255, 255, 0.7);
    --overlay-bg: rgba(252, 252, 252, 0.95);
    --overlay-border: rgba(226, 232, 240, 0.5);
    --overlay-gradient: rgba(252, 252, 252, 0.95);
    --cursor-glow: rgba(var(--accent-rgb), 0.08);
    --grain-opacity: 0.018;
}

/* ── Smooth theme transition ── */
html, body, nav, section, footer, div, a, p, h1, h2, h3, span, ul, li,
.timeline-card, .timeline-dot, .timeline-dot-inner, .timeline-track,
.timeline-connector, .timeline-year, .skill-pill, .nav-link::after {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ── Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--bg-body); color: var(--text-body); overflow-x: hidden; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface-900); }
::-webkit-scrollbar-thumb { background: var(--accent-500); border-radius: 3px; }

.grain::after {
    content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 9999; opacity: var(--grain-opacity);
}

.glow { box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.15); }
.glow-text { text-shadow: 0 0 30px rgba(var(--accent-rgb), 0.3); }

/* ── Headline gradient shine sweep ── */
#hero-tagline {
    background: linear-gradient(90deg,
    var(--slate-300) 0%,
    var(--slate-300) 35%,
    var(--accent-500) 50%,
    var(--slate-300) 65%,
    var(--slate-300) 100%
    );
    background-size: 300% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-position: 100% center;
    transition: background-position 0.5s ease-out;
}

#hero-tagline.shine-sweep {
    animation: shine-sweep 3s ease-in-out;
    transition: none;
}

@keyframes shine-sweep {
    0% {
    background-position: 150% center;
    }
    100% {
    background-position: -50% center;
    }
}

.card-hover { transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease, background-color 0.4s ease, border-color 0.4s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(var(--accent-rgb), 0.1); }

.magnetic-btn { transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

/* ── Timeline ── */
.timeline-track { position: absolute; left: 23px; top: 0; bottom: 0; width: 2px; background: var(--surface-800); }
.timeline-progress { position: absolute; left: 23px; top: 0; width: 2px; height: 0; background: linear-gradient(to bottom, var(--accent-500), var(--accent-400)); border-radius: 1px; }
.timeline-progress::after {
    content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
    width: 8px; height: 8px; border-radius: 50%; background: var(--accent-400);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6), 0 0 30px rgba(var(--accent-rgb), 0.3);
}
@media (min-width: 768px) {
    .timeline-track { left: calc(50% - 1px); transform: none; }
    .timeline-progress { left: calc(50% - 1px); transform: none; }
}
.timeline-dot {
    width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--surface-800);
    background: var(--surface-900); display: flex; align-items: center; justify-content: center;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); position: relative; z-index: 2;
}
.timeline-dot.active {
    border-color: var(--accent-500); background: var(--surface-950);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3), 0 0 40px rgba(var(--accent-rgb), 0.1);
}
.timeline-dot-inner {
    width: 12px; height: 12px; border-radius: 50%; background: var(--slate-700); transition: all 0.5s ease;
}
.timeline-dot.active .timeline-dot-inner { background: var(--accent-500); box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.6); }
.timeline-card {
    background: var(--card-bg); border: 1px solid var(--surface-800); border-radius: 1rem;
    padding: 2rem; transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative; overflow: hidden;
}
.timeline-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 0;
    background: linear-gradient(to bottom, var(--accent-500), var(--accent-400));
    transition: height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.timeline-card.active { border-color: rgba(var(--accent-rgb), 0.3); box-shadow: 0 10px 40px rgba(var(--accent-rgb), 0.08); }
.timeline-card.active::before { height: 100%; }
.timeline-connector {
    position: absolute; top: 24px; width: 40px; height: 2px; background: var(--surface-800);
    transition: background 0.5s ease;
}
.timeline-connector.active { background: var(--accent-500); }
@media (min-width: 768px) {
    .exp-row:nth-child(odd) .timeline-connector { right: -40px; }
    .exp-row:nth-child(even) .timeline-connector { left: -40px; }
}

/* ── Current timeline item ── */
.current-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2) 0%, rgba(var(--accent-light-rgb), 0.1) 100%);
    border: 1px solid rgba(var(--accent-rgb), 0.4);
    border-radius: 12px;
    color: var(--accent-500);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.4);
    }
    50% {
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0);
    }
}

.timeline-dot-current {
    border-color: var(--accent-500) !important;
    background: var(--surface-950) !important;
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.5), 0 0 40px rgba(var(--accent-rgb), 0.2) !important;
    animation: dotPulse 2s ease-in-out infinite;
}

.timeline-dot-current .timeline-dot-inner {
    background: var(--accent-500) !important;
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.8) !important;
}

@keyframes dotPulse {
    0%, 100% {
    transform: scale(1);
    }
    50% {
    transform: scale(1.1);
    }
}

.timeline-card-current {
    border-color: rgba(var(--accent-rgb), 0.4) !important;
    box-shadow: 0 10px 50px rgba(var(--accent-rgb), 0.15) !important;
}

.timeline-card-current::before {
    height: 100% !important;
}

/* ── Timeline current celebration ── */
.timeline-celebration {
    position: absolute;
    pointer-events: none;
    z-index: 20;
}
.celebration-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 1;
}
.celebration-ring {
    position: absolute;
    border: 2px solid rgba(var(--accent-rgb), 0.6);
    border-radius: 50%;
    pointer-events: none;
}

/* ── Typing effect ── */
.typing-text {
    display: inline;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent-500);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typing-text-company .typing-cursor,
.typing-text-achievement .typing-cursor {
    display: none;
}

.achievement-item {
    opacity: 1;
}

.typing-text-achievement {
    min-height: 1em;
    display: inline-block;
}

.timeline-year {
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; letter-spacing: 0.1em;
    color: var(--slate-600); transition: color 0.5s ease;
}
.timeline-year.active { color: var(--accent-500); }

/* Secondary-accent tag used for skills, project tags, etc. */
.tag-pill {
    background: var(--accent-s-bg);
    border: 1px solid var(--accent-s-border);
    color: var(--accent-s-text);
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    display: inline-block;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tag-pill:hover {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.35);
    color: var(--accent-500);
}

.skill-pill { transition: all 0.3s ease; }
.skill-pill:hover { background-color: var(--accent-500); color: var(--surface-950); transform: scale(1.05); }

/* ── Project filter tabs ── */
.project-filter-btn {
    background: transparent;
    border: 1px solid var(--surface-800);
    color: var(--text-body);
    cursor: pointer;
}
.project-filter-btn:hover {
    border-color: rgba(var(--accent-rgb), 0.4);
    color: var(--accent-500);
}
.project-filter-btn.active {
    background: var(--accent-500);
    border-color: var(--accent-500);
    color: var(--surface-950);
    font-weight: 600;
}
.project-card { transition: opacity 0.4s ease, transform 0.4s ease; }
.project-card.hidden-card { opacity: 0; transform: scale(0.95); position: absolute; pointer-events: none; visibility: hidden; height: 0; overflow: hidden; }

.cursor-follower {
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--cursor-glow) 0%, transparent 70%);
    border-radius: 50%; position: fixed; pointer-events: none; z-index: 0;
    transform: translate(-50%, -50%); transition: opacity 0.3s ease;
}

.nav-link { position: relative; }
.nav-link::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
    background: var(--accent-500); transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.project-overlay { background: linear-gradient(to top, var(--overlay-gradient) 0%, transparent 100%); }

/* ── Gallery animations ── */
#gallery-grid { perspective: 1200px; }
.gallery-item {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}
.gallery-shimmer {
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: overlay;
}

/* ── Skill card gradients ── */
.skill-bg-0 { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08) 0%, rgba(var(--accent-light-rgb), 0.04) 50%, transparent 100%); }
.skill-bg-1 { background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(217, 70, 239, 0.04) 50%, transparent 100%); }
.skill-bg-2 { background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(20, 184, 166, 0.04) 50%, transparent 100%); }
.skill-bg-3 { background: linear-gradient(135deg, rgba(var(--accent-light-rgb), 0.08) 0%, rgba(251, 191, 36, 0.04) 50%, transparent 100%); }
.skill-bg-4 { background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.04) 50%, transparent 100%); }
.skill-bg-5 { background: linear-gradient(135deg, rgba(236, 72, 153, 0.08) 0%, rgba(244, 114, 182, 0.04) 50%, transparent 100%); } .skill-bg-6 { background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(234, 179, 8, 0.04) 50%, transparent 100%); } .skill-bg-7 { background: linear-gradient(135deg, rgba(217, 70, 239, 0.08) 0%, rgba(192, 38, 211, 0.04) 50%, transparent 100%); }
.skill-bg-6 { background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(234, 179, 8, 0.04) 50%, transparent 100%); } .skill-bg-7 { background: linear-gradient(135deg, rgba(217, 70, 239, 0.08) 0%, rgba(192, 38, 211, 0.04) 50%, transparent 100%); }
.skill-bg-7 { background: linear-gradient(135deg, rgba(217, 70, 239, 0.08) 0%, rgba(192, 38, 211, 0.04) 50%, transparent 100%); }

/* ── Project cards ── */
#projects-grid { perspective: 1200px; }
.project-card {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* ── Project fallback gradients ── */
.project-img-container {
    position: relative;
    height: 224px; /* h-56 = 14rem = 224px */
    overflow: hidden;
    background: var(--surface-800);
}

.project-img-fallback {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: fallbackFadeIn 0.3s ease-out forwards;
    transition: transform 0.7s ease-out;
}

.project-img-fallback::after {
    content: '';
    position: absolute;
    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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 2;
}

@keyframes fallbackFadeIn {
    from {
    opacity: 0;
    transform: scale(0.98);
    }
    to {
    opacity: 1;
    transform: scale(1);
    }
}

/* Gradient variants - 8 unique color combinations */
.fallback-gradient-0 {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(var(--accent-light-rgb), 0.08) 50%, rgba(var(--accent-rgb), 0.05) 100%);
}

.fallback-gradient-1 {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(217, 70, 239, 0.08) 50%, rgba(168, 85, 247, 0.05) 100%);
}

.fallback-gradient-2 {
    background: linear-gradient(135deg, rgba(var(--accent-light-rgb), 0.15) 0%, rgba(251, 191, 36, 0.08) 50%, rgba(var(--accent-light-rgb), 0.05) 100%);
}

.fallback-gradient-3 {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(244, 114, 182, 0.08) 50%, rgba(236, 72, 153, 0.05) 100%);
}

.fallback-gradient-4 {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(20, 184, 166, 0.08) 50%, rgba(16, 185, 129, 0.05) 100%);
}

.fallback-gradient-5 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(99, 102, 241, 0.08) 50%, rgba(59, 130, 246, 0.05) 100%);
}

.fallback-gradient-6 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(234, 179, 8, 0.08) 50%, rgba(245, 158, 11, 0.05) 100%);
}

.fallback-gradient-7 {
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.15) 0%, rgba(192, 38, 211, 0.08) 50%, rgba(217, 70, 239, 0.05) 100%);
}

/* Ensure hover scale animation works on fallback */
.project-card:hover .project-img-fallback {
    transform: scale(1.1);
}

/* Project action buttons */
.project-action-btn {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ── Theme toggle button ── */
.theme-toggle {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--surface-800);
    background: var(--surface-900); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; position: relative; overflow: hidden;
}
.theme-toggle:hover { border-color: var(--accent-500); background: var(--surface-950); }
.theme-toggle svg { width: 18px; height: 18px; transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease; }
.theme-toggle .icon-sun { position: absolute; color: #f59e0b; opacity: 0; transform: rotate(-90deg) scale(0.5); }
.theme-toggle .icon-moon { position: absolute; color: var(--accent-500); opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
