:root {
    --bg: #080808;
    --text: #f1f5f9;
    --muted: #64748b;
    --border: rgba(255, 255, 255, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
}

/* ═══ LEFT PANEL ════════════════════════════════════════════════════ */

#left-panel {
    position: fixed;
    top: 0; left: 0;
    width: 38%; height: 100vh;
    overflow: hidden;
    flex-shrink: 0;
}

.headshot-wrap { position: absolute; inset: 0; z-index: 0; }

.headshot-face {
    position: absolute; inset: 0;
    z-index: 3;
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 25%, transparent 48%);
    mask-image: linear-gradient(to bottom, black 0%, black 25%, transparent 48%);
    pointer-events: none;
}
.headshot-face img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center top;
    display: block;
}

.headshot-wrap img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center top;
    display: block;
}

.headshot-wrap::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 65%;
    background: linear-gradient(to bottom, transparent 0%, var(--bg) 72%);
    pointer-events: none;
}

.left-meta {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0 44px 44px;
    z-index: 4;
}

.name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 3vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 0.95;
    color: var(--text);
    margin-bottom: 24px;
}

.socials { display: flex; gap: 10px; align-items: center; }

.social-icon {
    color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    text-decoration: none;
    transition: color .2s, border-color .2s, background .2s;
}
.social-icon:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.07);
}

/* ─ Spotify widget ────────────────────────────────────────────────── */
#spotify-widget {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 2;
    background: rgba(8,8,8,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 14px 16px;
    min-width: 170px;
}

.spotify-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
}

.spotify-chevron {
    width: 12px; height: 12px;
    color: var(--muted);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform .25s ease;
}
#spotify-widget.expanded .spotify-chevron { transform: rotate(180deg); }

.spotify-artists-wrap {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
#spotify-widget.expanded .spotify-artists-wrap {
    max-height: 200px;
}

#spotify-artists { padding-top: 12px; }

.spotify-logo {
    width: 14px; height: 14px;
    color: #1DB954;
    flex-shrink: 0;
}

.spotify-label {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

#spotify-artists {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spotify-artist {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--muted);
    transition: color .2s;
}
.spotify-artist:hover { color: var(--text); }

.spotify-artist img {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity .2s;
}
.spotify-artist:hover img { opacity: 1; }

.spotify-artist span {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══ RIGHT PANEL ═══════════════════════════════════════════════════ */

#right-panel {
    margin-left: 38%;
    width: 62%; height: 100vh;
    overflow-y: auto; overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}
#right-panel::-webkit-scrollbar { display: none; }

/* ═══ CARD SECTIONS ═════════════════════════════════════════════════ */

.card-section {
    height: 100vh;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 60px 44px 40px 44px;
    gap: 20px;
    position: relative;
    overflow: hidden;
}


/* ─ Radial blow-out orb ──────────────────────────────────────────── */
.card-section::before {
    content: '';
    position: absolute;
    width: 200%; height: 200%;
    top: 50%; left: 50%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-rgba) 0%, transparent 55%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 1s cubic-bezier(0.16,1,0.3,1), opacity .5s ease;
}
.card-section.active::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}


/* ═══ SECTION HEADER ════════════════════════════════════════════════ */

.section-header {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .22s ease, transform .22s ease;
}

.card-section.active .section-header {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .42s ease .05s,
        transform .68s cubic-bezier(0.34,1.28,0.64,1) .05s;
}

.section-logo {
    width: 80px; height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    padding: 10px;
}

.section-identity {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-logo img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.section-company-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-company {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
}

.section-company-link {
    color: var(--glow);
    opacity: 0.45;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: opacity .2s;
    margin-top: 6px;
}
.section-company-link svg { width: 20px; height: 20px; }
.section-company-link:hover { opacity: 1; }

.section-role {
    font-size: 0.95rem;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.section-date-badge {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.03em;
    white-space: nowrap;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 100px;
    padding: 4px 12px;
    flex-shrink: 0;
    align-self: center;
}

/* ═══ MEDIA GRID ════════════════════════════════════════════════════ */

.media-grid {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .5s ease .15s, transform .6s cubic-bezier(0.34,1.1,0.64,1) .15s;
}
.card-section.active .media-grid { opacity: 1; transform: translateY(0); }

.media-card {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.07);
    cursor: pointer;
    transition: border-color .25s;
}

.media-card:first-child { grid-row: 1 / 4; }
.media-card:hover { border-color: rgba(255,255,255,0.18); }

/* ─ Image card ───────────────────────────────────────────────────── */
.media-card.media-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.media-card.media-img:hover img { transform: scale(1.04); }

/* ─ Link card ────────────────────────────────────────────────────── */
.media-card.media-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    color: var(--muted);
}
.media-card.media-link svg { width: 28px; height: 28px; opacity: 0.6; }
.media-card.media-link span {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-align: center;
    padding: 0 16px;
}
.media-card.media-link:hover { color: var(--text); }
.media-card.media-link:hover svg { opacity: 1; }

/* ─ GitHub card ──────────────────────────────────────────────────── */
.media-github {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    background: #0d1117;
    border-color: #30363d;
    transition: border-color .25s;
}
.media-github:hover { border-color: #58a6ff; }

.gh-arrow {
    position: absolute;
    bottom: 12px; right: 12px;
    width: 13px; height: 13px;
    color: #7d8590;
    transition: color .2s, transform .2s;
}
.media-github:hover .gh-arrow {
    color: #58a6ff;
    transform: translate(2px, -2px);
}

.gh-mark {
    width: 22px; height: 22px;
    color: rgba(230,237,243,0.5);
    flex-shrink: 0;
}

.gh-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gh-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e6edf3;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.gh-desc {
    font-size: 0.68rem;
    color: #7d8590;
    line-height: 1.4;
}

/* ─ Side-by-side card pair ───────────────────────────────────────── */
.media-row-pair {
    display: flex;
    gap: 6px;
    min-height: 0;
}
.media-row-pair .media-card {
    flex: 1;
    min-width: 0;
}

/* ─ YouTube card ─────────────────────────────────────────────────── */
.media-youtube {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    background: #0f0f0f;
    border-color: #1f1f1f;
    transition: border-color .25s;
}
.media-youtube:hover { border-color: #ff0000; }
.media-youtube:hover .gh-arrow { color: #ff0000; transform: translate(2px,-2px); }

.yt-mark { width: 22px; height: 22px; color: #ff0000; flex-shrink: 0; }
.yt-body { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.yt-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem; font-weight: 600;
    color: #e6edf3; letter-spacing: -0.01em; line-height: 1.2;
}
.yt-desc { font-size: 0.68rem; color: #7d8590; line-height: 1.4; }

/* ─ Reddit card ──────────────────────────────────────────────────── */
.media-reddit {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    background: #0f0f0f;
    border-color: #1f1f1f;
    transition: border-color .25s;
}
.media-reddit:hover { border-color: #ff4500; }
.media-reddit:hover .gh-arrow { color: #ff4500; transform: translate(2px,-2px); }

.reddit-mark { width: 22px; height: 22px; color: #ff4500; flex-shrink: 0; }
.reddit-body { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.reddit-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem; font-weight: 600;
    color: #e6edf3; letter-spacing: -0.01em; line-height: 1.3;
}
.reddit-stat { font-size: 0.8rem; font-weight: 700; color: #ff4500; letter-spacing: -0.01em; }

/* ─ Stack card ───────────────────────────────────────────────────── */
.media-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 16px;
}

.stack-label {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.stack-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 4px 9px;
}

.stack-tag img {
    width: 13px; height: 13px;
    min-width: 13px; min-height: 13px;
    max-width: 13px; max-height: 13px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

/* ─ Stat card ────────────────────────────────────────────────────── */
.media-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px;
}
.media-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--glow);
}
.media-stat-label {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}

/* ═══ TIMELINE NAV — full viewport height ═══════════════════════════ */

#timeline-nav {
    position: fixed;
    top: 0;
    left: calc(38% - 125px);
    width: 140px; height: 100vh;
    padding: 44px 10px 44px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 50;
    pointer-events: none;
}

/* Spine */
#timeline-nav::before {
    content: '';
    position: absolute;
    width: 1px;
    top: 44px; bottom: 44px;
    right: 18px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(255,255,255,0.12) 8%,
        rgba(255,255,255,0.12) 92%,
        transparent 100%
    );
}

/* ─ Dot items ─────────────────────────────────────────────────────── */
.tn-item {
    flex: 1;
    max-height: 100px;
    display: flex; align-items: center; justify-content: flex-end;
    gap: 9px;
    background: none; border: none;
    cursor: pointer; padding: 0;
    pointer-events: all;
}

.tn-label {
    font-size: 0.6rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.16);
    white-space: nowrap;
    transition: color .2s ease, opacity .2s ease;
}
.tn-item:hover .tn-label { color: rgba(255,255,255,0.45); }
.tn-item.active .tn-label { color: rgba(255,255,255,0.65); font-weight: 500; }

/* ─ The dot itself ───────────────────────────────────────────────── */
.tn-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #3a3a3a;
    flex-shrink: 0;
    position: relative;
    margin-right: 5px;
    box-shadow: 0 0 0 4px var(--bg);
    transition:
        width  .45s cubic-bezier(0.34,1.5,0.64,1),
        height .45s cubic-bezier(0.34,1.5,0.64,1),
        background .3s ease,
        box-shadow .3s ease,
        margin-right .45s cubic-bezier(0.34,1.5,0.64,1);
}

/* Active: big glowing dot */
.tn-item.active .tn-dot {
    width: 14px; height: 14px;
    margin-right: 1px;
    background: var(--dot-glow, #fff);
    box-shadow:
        0 0 0 4px var(--bg),
        0 0 0 9px color-mix(in srgb, var(--dot-glow, #fff) 18%, transparent),
        0 0 20px var(--dot-glow, rgba(255,255,255,0.6));
}

/* Pulsing ring */
.tn-item.active .tn-dot::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--dot-glow, rgba(255,255,255,0.5));
    transform: translate(-50%, -50%) scale(0.4);
    animation: dot-ring 1.8s ease-out infinite;
}

@keyframes dot-ring {
    0%   { transform: translate(-50%,-50%) scale(0.4); opacity: 0.7; }
    100% { transform: translate(-50%,-50%) scale(2.2); opacity: 0; }
}

/* ═══ MOBILE ════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    body { flex-direction: column; }

    #left-panel {
        position: relative;
        width: 100%; height: 42vh;
        border-right: none; border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }
    .left-meta { padding: 0 28px 28px; }
    .name { font-size: clamp(1.8rem, 7vw, 2.8rem); margin-bottom: 16px; }

    #right-panel { margin-left: 0; width: 100%; height: 58vh; }

    .card-section { height: 58vh; padding: 24px 16px 16px 16px; gap: 16px; }
    .section-logo { width: 60px; height: 60px; border-radius: 50%; }
    .section-header { gap: 18px; }
    .section-company { font-size: clamp(1.5rem, 6vw, 2rem); }
    .section-role { font-size: 0.82rem; }
    .media-grid { height: 200px; flex: none; }
    .media-card { border-radius: 10px; }
    .media-stat-value { font-size: 1.6rem; }
    #timeline-nav { display: none; }
}
