/* ==========================================================================
   freelanxur -- Portfolio CSS
   Theme: Gold accent on dark/light backgrounds, Inter font
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. THEME VARIABLES
   -------------------------------------------------------------------------- */

[data-theme="dark"] {
    --bg: #09090B;
    --bg-secondary: #111113;
    --surface: #18181B;
    --surface-hover: #222225;
    --text: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #63636E;
    --accent: #F5C542;
    --accent-dark: #E8A317;
    --accent-light: #FBE88A;
    --accent-muted: #C88A0A;
    --hero-gradient-start: rgba(9, 9, 11, 0.97);
    --hero-gradient-mid: rgba(14, 14, 16, 0.95);
    --hero-gradient-end: rgba(20, 18, 12, 0.93);
    --card-border: rgba(245, 197, 66, 0.08);
    --card-border-hover: rgba(245, 197, 66, 0.2);
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.6);
    --tag-bg-alpha: 0.15;
    --tag-text-alpha: 0.9;
    --status-bg: rgba(34, 197, 94, 0.15);
    --status-text: #22c55e;
    --status-dot: #22c55e;
    --unavailable-bg: rgba(239, 68, 68, 0.15);
    --unavailable-text: #ef4444;
    --unavailable-dot: #ef4444;
    --navbar-bg: rgba(9, 9, 11, 0.85);
    --navbar-border: rgba(245, 197, 66, 0.06);
    --skill-track: rgba(245, 197, 66, 0.08);
    --timeline-line: rgba(245, 197, 66, 0.2);
    --timeline-dot: #F5C542;
    --nda-bg: rgba(245, 197, 66, 0.08);
    --nda-text: #A1A1AA;
    --footer-border: rgba(245, 197, 66, 0.08);
    --psyduck-filter: grayscale(0);
    --surface-rgb: 24, 24, 27;
    --accent-rgb: 245, 197, 66;
}

[data-theme="light"] {
    --bg: #FAFAF7;
    --bg-secondary: #F0EDE6;
    --surface: #FFFFFF;
    --surface-hover: #F5F3EE;
    --text: #1A1A2E;
    --text-secondary: #555570;
    --text-muted: #888898;
    --accent: #C88A0A;
    --accent-dark: #A06F08;
    --accent-light: #E8B84A;
    --accent-muted: #9A7520;
    --hero-gradient-start: rgba(250, 250, 247, 0.97);
    --hero-gradient-mid: rgba(248, 245, 238, 0.95);
    --hero-gradient-end: rgba(255, 248, 225, 0.93);
    --card-border: rgba(200, 138, 10, 0.1);
    --card-border-hover: rgba(200, 138, 10, 0.25);
    --shadow: rgba(0, 0, 0, 0.06);
    --shadow-lg: rgba(0, 0, 0, 0.12);
    --tag-bg-alpha: 0.1;
    --tag-text-alpha: 1;
    --status-bg: rgba(34, 197, 94, 0.1);
    --status-text: #16a34a;
    --status-dot: #16a34a;
    --unavailable-bg: rgba(239, 68, 68, 0.1);
    --unavailable-text: #dc2626;
    --unavailable-dot: #dc2626;
    --navbar-bg: rgba(250, 250, 247, 0.85);
    --navbar-border: rgba(200, 138, 10, 0.08);
    --skill-track: rgba(200, 138, 10, 0.08);
    --timeline-line: rgba(200, 138, 10, 0.2);
    --timeline-dot: #C88A0A;
    --nda-bg: rgba(200, 138, 10, 0.06);
    --nda-text: #888898;
    --footer-border: rgba(200, 138, 10, 0.1);
    --psyduck-filter: grayscale(1) contrast(1.2);
    --surface-rgb: 255, 255, 255;
    --accent-rgb: 200, 138, 10;
}

/* --------------------------------------------------------------------------
   2. BASE & RESET
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 990;
    opacity: 0.025;
    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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

[data-theme="light"] body::after {
    opacity: 0.015;
}

img {
    max-width: 100%;
    height: auto;
}

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

/* --------------------------------------------------------------------------
   3. LAYOUT
   -------------------------------------------------------------------------- */

.section {
    padding: 80px 20px;
    position: relative;
}

.section-content {
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 0;
    color: var(--text);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
    margin-top: 0;
}

.section-subheader {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 48px;
    margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   4. NAVBAR
   -------------------------------------------------------------------------- */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--navbar-bg);
    --navbar-blur: 20px;
    --navbar-opacity: 0.85;
    backdrop-filter: blur(var(--navbar-blur));
    -webkit-backdrop-filter: blur(var(--navbar-blur));
    border-bottom: 1px solid var(--navbar-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-logo {
    height: 32px;
    width: auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    padding: 4px 0;
    position: relative;
    transition: color 0.25s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: width 0.25s ease;
}

.nav-link:hover {
    color: var(--accent);
}

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

.nav-link.active {
    color: var(--accent);
}

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

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.theme-toggle:hover {
    background: var(--surface-hover);
}

.theme-toggle-img {
    width: 28px;
    height: 28px;
    filter: var(--psyduck-filter);
    transition: filter 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover .theme-toggle-img {
    transform: scale(1.1);
}


/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-light));
    z-index: 1001;
    transition: width 0.05s linear;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. MOBILE MENU
   -------------------------------------------------------------------------- */

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    opacity: 0.98;
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.mobile-menu.active {
    display: flex;
}

.mobile-link {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 24px;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}

.mobile-link:hover {
    color: var(--accent);
    background: var(--surface);
}

/* --------------------------------------------------------------------------
   6. HERO SECTION
   -------------------------------------------------------------------------- */

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hero-gradient-start), var(--hero-gradient-mid), var(--hero-gradient-end));
    padding-top: 70px;
    overflow: hidden;
}

.hero-section .section-content {
    text-align: center;
    position: relative;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.15) 0%, transparent 70%);
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] .hero-glow {
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08) 0%, transparent 70%);
}

.hero-parallax {
    will-change: transform;
}

.hero-greeting {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 300;
}

.hero-name {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    margin-top: 0;
    line-height: 1.1;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 0;
    margin-top: 8px;
    flex-wrap: wrap;
}

.hero-title .logo-img {
    height: 60px;
    width: auto;
}

.hero-title .title-text {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.15em;
    text-transform: lowercase;
}

.hero-tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 16px;
    font-weight: 300;
    line-height: 1.6;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 20px;
}

.status-badge.available {
    background: var(--status-bg);
    color: var(--status-text);
}

.status-badge.unavailable {
    background: var(--unavailable-bg);
    color: var(--unavailable-text);
}

.status-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-dot);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.status-badge.unavailable .status-dot {
    background: var(--unavailable-dot);
    animation: none;
}

/* Metrics Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.metric-card {
    background: rgba(var(--surface-rgb), 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-border-hover);
    box-shadow: 0 8px 32px var(--shadow-lg);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 400;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    cursor: pointer;
}

.chevron {
    display: block;
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(45deg);
    transition: border-color 0.2s ease;
}

.scroll-indicator:hover .chevron {
    border-color: var(--accent);
}

/* Hero staggered entrance */
@keyframes heroEntrance {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-stagger {
    opacity: 0;
    animation: heroEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-stagger:nth-child(1) { animation-delay: 0.1s; }
.hero-stagger:nth-child(2) { animation-delay: 0.25s; }
.hero-stagger:nth-child(3) { animation-delay: 0.4s; }
.hero-stagger:nth-child(4) { animation-delay: 0.55s; }
.hero-stagger:nth-child(5) { animation-delay: 0.7s; }

/* --------------------------------------------------------------------------
   8. ABOUT
   -------------------------------------------------------------------------- */

.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 48px;
    align-items: start;
}

.about-photo-col {
    position: sticky;
    top: 100px;
}

.about-photo {
    width: 100%;
    border-radius: 16px;
    border: 2px solid var(--card-border);
    object-fit: cover;
    aspect-ratio: 3 / 4;
    transition: border-color 0.3s ease;
}

.about-photo:hover {
    border-color: var(--card-border-hover);
}

.about-text-col {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.about-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-text p {
    margin-bottom: 16px;
    margin-top: 0;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 -20px 0;
}

.about-logo-section {
    border-top: 1px solid var(--card-border);
    padding-top: 24px;
}

.about-logo-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.about-logo-icon {
    height: 24px;
    width: auto;
}

.about-logo-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

/* --------------------------------------------------------------------------
   9. SKILLS
   -------------------------------------------------------------------------- */

#skills {
    padding-top: 0;
}

.skill-item {
    margin-bottom: 20px;
}

.skill-item:last-child {
    margin-bottom: 0;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
}

.skill-bar {
    height: 10px;
    background: var(--skill-track);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skill-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-light));
    position: relative;
    width: 0;
    transition: width 1.2s ease-out;
}

.skill-fill.animate {
    animation: skillGrow 1.2s ease-out forwards;
}

.skill-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: translateX(-100%);
    animation: shimmerSweep 0.8s ease-out 1.3s forwards;
}

.skills-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 24px;
}

/* --------------------------------------------------------------------------
   10. SERVICES
   -------------------------------------------------------------------------- */

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.service-card {
    background: rgba(var(--surface-rgb), 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-border-hover);
    box-shadow: 0 8px 30px var(--shadow);
}

.service-icon {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--accent);
    line-height: 1;
}

.service-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.service-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* --------------------------------------------------------------------------
   11. PROJECTS
   -------------------------------------------------------------------------- */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    background: rgba(var(--surface-rgb), 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px 24px;
    min-height: 180px;
    max-height: 180px;
    overflow: hidden;
    transition: max-height 0.4s ease, transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;
}

.project-card:hover {
    max-height: 500px;
    transform: translateY(-4px);
    border-color: var(--card-border-hover);
    box-shadow: 0 8px 30px var(--shadow);
}

.project-card.nda {
    cursor: default;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.project-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
}

.project-link {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.project-link:hover {
    text-decoration: underline;
}

.nda-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--nda-bg);
    color: var(--nda-text);
    border-radius: 20px;
    font-size: 0.75rem;
    font-style: italic;
}

.project-card-github {
    background: transparent;
    border: 1px dashed var(--card-border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    min-height: 180px;
    max-height: 180px;
    transition: transform 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.project-card-github:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-4px);
    max-height: 180px;
    background: transparent;
    box-shadow: none;
}

.github-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.github-card-icon {
    width: 24px;
    height: 24px;
}

.github-card-text {
    font-size: 1rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   12. EXPERIENCE TIMELINE
   -------------------------------------------------------------------------- */

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--timeline-line);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline.timeline-visible::before {
    transform: scaleY(1);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--timeline-dot);
    border: 3px solid var(--bg);
    z-index: 1;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.timeline-company {
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 8px;
}

.timeline-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Timeline alternating reveals */
.timeline-item.slide-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item.slide-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item.slide-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Timeline dot pulse */
@keyframes dotPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.timeline-item.slide-visible::before {
    animation: dotPulse 0.4s ease-out;
}

/* --------------------------------------------------------------------------
   13. CONTACT
   -------------------------------------------------------------------------- */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.contact-card {
    background: rgba(var(--surface-rgb), 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.contact-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-border-hover);
    box-shadow: 0 8px 30px var(--shadow);
    background: rgba(var(--accent-rgb), 0.04);
}

.contact-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--accent);
    line-height: 1;
}

.contact-icon img {
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

.contact-label {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text);
}

.contact-value {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.contact-card .contact-icon {
    transition: transform 0.25s ease;
}

.contact-card:hover .contact-icon {
    transform: translateY(-4px);
}


/* Glassmorphism inner border for depth */
[data-theme="dark"] .service-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .contact-card {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .service-card,
[data-theme="light"] .project-card,
[data-theme="light"] .contact-card {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

/* Cursor-tracking glow on cards */
@media (hover: hover) {
    .glow-card {
        position: relative;
        overflow: hidden;
    }

    .glow-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: inherit;
        background: radial-gradient(
            circle 200px at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(var(--accent-rgb), 0.08),
            transparent 60%
        );
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        z-index: 1;
    }

    .glow-card:hover::before {
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   14. FOOTER
   -------------------------------------------------------------------------- */

.footer {
    position: relative;
    border-top: none;
    padding: 48px 20px 40px;
    text-align: center;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom, rgba(var(--accent-rgb), 0.03), transparent);
    pointer-events: none;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-content span {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.footer-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 120px;
    width: auto;
    opacity: 0.03;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   15. BUTTONS
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: #09090B;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow-lg);
}

.btn-accent:active {
    transform: translateY(0);
}

.btn-magnetic {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

/* --------------------------------------------------------------------------
   16. ANIMATIONS -- Keyframes
   -------------------------------------------------------------------------- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: var(--typing-width, 100%);
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    50% {
        transform: translateY(-10px) translateX(-50%);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.8;
    }
}

@keyframes skillGrow {
    from {
        width: 0;
    }
}

@keyframes shimmerSweep {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

/* --------------------------------------------------------------------------
   17. ANIMATION UTILITY CLASSES
   -------------------------------------------------------------------------- */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0s, transform 0s;
}

.animate-on-scroll.animate-visible {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger delay helpers -- JS will set animation-delay inline */

/* --------------------------------------------------------------------------
   18. RESPONSIVE -- Tablet (max-width: 1024px)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-content {
        padding: 0 24px;
    }
}

/* --------------------------------------------------------------------------
   19. RESPONSIVE -- Mobile (max-width: 768px)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .theme-toggle {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .section {
        padding: 60px 16px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        max-height: none;
        cursor: default;
    }

    .project-card:hover {
        max-height: none;
    }

    .project-card-github {
        min-height: auto;
        max-height: none;
        padding: 32px;
    }

    .project-card-github:hover {
        max-height: none;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-photo-col {
        position: static;
        max-width: 280px;
        margin: 0 auto;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .metric-card {
        padding: 24px 16px;
    }

    .metric-value {
        font-size: 2rem;
    }

    .hero-section {
        padding-top: 70px;
        padding-bottom: 60px;
    }

    .scroll-indicator {
        bottom: 16px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 32px;
    }

    .nav-content {
        padding: 0 16px;
    }

    .timeline {
        padding-left: 28px;
    }

    .timeline-item::before {
        left: -25px;
    }

    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

/* --------------------------------------------------------------------------
   20. RESPONSIVE -- Small Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
    .section {
        padding: 48px 12px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .hero-greeting {
        font-size: 1rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        padding: 20px 16px;
    }

    .metric-value {
        font-size: 1.75rem;
    }

    .metric-label {
        font-size: 0.8rem;
    }

    .service-card {
        padding: 24px;
    }

    .project-card {
        padding: 20px;
    }

    .contact-card {
        padding: 24px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .footer {
        padding: 36px 12px 32px;
    }

    .timeline {
        padding-left: 24px;
    }

    .timeline-item::before {
        left: -21px;
        width: 10px;
        height: 10px;
    }

    .timeline::before {
        left: 6px;
    }
}

/* --------------------------------------------------------------------------
   21. SELECTION & SCROLLBAR
   -------------------------------------------------------------------------- */

::selection {
    background: var(--accent);
    color: #09090B;
}

::-moz-selection {
    background: var(--accent);
    color: #09090B;
}

/* Custom scrollbar for WebKit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   PAGE LOADER
   -------------------------------------------------------------------------- */

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    background: var(--bg);
    opacity: 1;
    transition: opacity 0.6s ease;
    animation: loaderSafetyHide 0s 3s forwards;
}

.page-loader.fade-out {
    opacity: 0;
}

@keyframes loaderSafetyHide {
    to { visibility: hidden; pointer-events: none; z-index: -1; }
}

.page-loader.hidden {
    pointer-events: none;
}

.loader-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    opacity: 0;
    animation: loaderFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.loader-brand {
    display: flex;
    align-items: center;
    gap: 0;
    transition: gap 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.loader-logo {
    height: 60px;
    width: auto;
}

.loader-text {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: lowercase;
    display: inline-block;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    margin-left: 0;
    transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1),
                margin-left 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loaderFadeIn {
    to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   BACK TO TOP
   -------------------------------------------------------------------------- */

.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: rgba(var(--surface-rgb), 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    pointer-events: none;
    z-index: 998;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    border-color: var(--card-border-hover);
    color: var(--accent);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* --------------------------------------------------------------------------
   22. BACKDROP-FILTER FALLBACK
   -------------------------------------------------------------------------- */

@supports not (backdrop-filter: blur(12px)) {
    .metric-card,
    .service-card,
    .project-card,
    .contact-card,
    .back-to-top {
        background: var(--surface);
    }
}

/* --------------------------------------------------------------------------
   23. REDUCED MOTION
   -------------------------------------------------------------------------- */

@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;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }

    .scroll-indicator {
        animation: none;
    }

    .status-badge .status-dot {
        animation: none;
    }

    .page-loader {
        display: none;
    }
}
