/* ─── Variables & Reset ───────────────────────────────────────────────────────── */
:root {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-muted: #a1a1aa;
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(255, 255, 255, 0.06);
    --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Disable native smooth-scroll so Lenis takes over */
html {
    scroll-behavior: auto;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 8rem;
    overflow-x: hidden;
    position: relative;
}

body::selection {
    background: rgba(255, 255, 255, 0.9);
    color: black;
}

/* ─── Subtle noise / grain overlay ───────────────────────────────────────────── */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

/* ─── Mouse Follower Glow ─────────────────────────────────────────────────────── */
#mouse-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.055) 0%,
        rgba(255, 255, 255, 0.015) 35%,
        transparent 65%
    );
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    will-change: left, top;
}

/* ─── Base Layout ─────────────────────────────────────────────────────────────── */
.container {
    max-width: 650px;
    margin: 0 auto;
    padding: 6rem 1.5rem 2rem;
    position: relative;
    z-index: 10;
}

.divider {
    border: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    margin: 3rem 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.arrow-up-right {
    display: inline-block;
    font-size: 0.8em;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

a:hover .arrow-up-right {
    transform: translate(2px, -2px);
}

/* ─── Header Section ──────────────────────────────────────────────────────────── */
.header {
    margin-bottom: 2rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.name {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    /* Required for GSAP per-char transform */
    perspective: 800px;
}

/* Required so GSAP per-char rotateX works */
.name .char {
    display: inline-block;
    transform-origin: 50% 100%;
    will-change: transform, opacity;
}

.role {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.social-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 2px;
}

.social-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--text-primary);
    transition: width 0.3s ease;
}

.social-link:hover {
    color: var(--text-primary);
}

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

/* ─── Sections ────────────────────────────────────────────────────────────────── */
.section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-beaker,
.icon-music {
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.view-all {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.view-all:hover {
    color: var(--text-primary);
}

/* ─── Projects List ───────────────────────────────────────────────────────────── */
.projects-list {
    display: flex;
    flex-direction: column;
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
    will-change: transform;
    /* GSAP handles translateX on hover */
}

.project-item:first-child {
    border-top: 1px solid var(--border-color);
}

.project-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s ease;
    text-align: right;
    max-width: 60%;
}

.project-item:hover .project-name {
    color: var(--text-muted);
}

.project-item:hover .project-desc {
    color: var(--text-primary);
}

/* ─── Spotify / Lanyard Widget ────────────────────────────────────────────────── */
.spotify-container {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: transparent;
    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}

.spotify-container:hover {
    background: var(--hover-bg);
    border-color: rgba(255, 255, 255, 0.16);
}

.spotify-loading,
.spotify-offline {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sp-icon-offline {
    opacity: 0.45;
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

.spotify-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Album art wrapper — holds cover image + live dot */
.sp-cover-wrap {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}

.sp-album-art {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
    display: block;
    will-change: transform, opacity;
}

/* Pulsing "live" indicator */
.sp-live-dot {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: #1db954;
    border-radius: 50%;
    border: 1.5px solid var(--bg-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sp-live-dot.active {
    opacity: 1;
    animation: sp-pulse 2s ease-in-out infinite;
}

@keyframes sp-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.5);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 4px rgba(29, 185, 84, 0);
    }
}

.sp-info {
    flex: 1;
    min-width: 0;
}

.sp-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.1rem;
}

.sp-artist {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

.sp-progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    margin-bottom: 0.3rem;
    overflow: hidden;
}

.sp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, #fff 100%);
    width: 0%;
    border-radius: 1px;
    transition: width 1s linear;
}

.sp-time-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 0.02em;
}

/* ─── Bottom Dock Navigation ──────────────────────────────────────────────────── */
.bottom-dock {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.5rem;
    z-index: 50;
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    display: flex;
    justify-content: center;
    align-items: center;
    will-change: transform, opacity;
}

.dock-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.dock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.15s ease;
}

.dock-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.dock-btn:active {
    transform: translateY(0px) scale(0.93);
}

/* ─── Command Palette Modal ───────────────────────────────────────────────────── */
/* GSAP controls opacity & pointer-events; keep only layout here */
.cmd-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 14vh;
}

.cmd-palette-container {
    width: 100%;
    max-width: 600px;
    background: #080808;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.95),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    overflow: hidden;
    margin: 0 1rem;
    will-change: transform, opacity;
}

.cmd-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-icon {
    color: var(--text-muted);
    display: flex;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.cmd-header input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    font-family: var(--font-sans);
}

.cmd-header input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.cmd-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.cmd-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
}

.cmd-body {
    padding: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.cmd-body::-webkit-scrollbar {
    width: 4px;
}
.cmd-body::-webkit-scrollbar-track {
    background: transparent;
}
.cmd-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.cmd-section {
    margin-bottom: 0.5rem;
}

.cmd-section-title {
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
}

.cmd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s ease;
    border: 1px solid transparent;
    text-decoration: none;
    will-change: transform, opacity;
}

.cmd-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.cmd-item-left svg {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.cmd-item:hover,
.cmd-item.selected {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
}

.cmd-item:hover .cmd-item-left svg,
.cmd-item.selected .cmd-item-left svg {
    color: var(--text-primary);
}

.cmd-shortcut {
    font-size: 0.7rem;
    font-family: monospace;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-muted);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ─── Mobile Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        padding-bottom: 8rem;
        overflow-x: hidden;
    }

    .container {
        padding: 4rem 1.25rem 2rem;
    }

    .name {
        font-size: 1.55rem;
    }

    .role {
        font-size: 0.9rem;
    }

    .social-links {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .social-link {
        font-size: 0.85rem;
    }

    /* Stack project items vertically on mobile */
    .project-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
        padding: 0.85rem 0;
    }

    .project-desc {
        text-align: left;
        max-width: 100%;
        font-size: 0.82rem;
    }

    /* Spotify widget */
    .sp-title {
        font-size: 0.88rem;
    }

    .sp-artist {
        font-size: 0.78rem;
    }

    /* Bottom dock — safe area for iPhone notch */
    .bottom-dock {
        bottom: max(1.25rem, calc(env(safe-area-inset-bottom, 0px) + 1rem));
        padding: 0.4rem;
    }

    .dock-btn {
        width: 40px;
        height: 40px;
    }

    /* Command palette */
    .cmd-palette-overlay {
        padding-top: 8vh;
        align-items: flex-start;
    }

    .cmd-palette-container {
        margin: 0 0.75rem;
        max-height: 85vh;
    }

    .cmd-body {
        max-height: calc(85vh - 65px);
    }

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

    .divider {
        margin: 2rem 0;
    }
}
