:root {
    color-scheme: dark;
    --bg: #10275B;
    --surface: #1B3972;
    --surface-elevated: #17346B;
    --border: rgba(82, 115, 166, 0.72);
    --border-hover: rgba(231, 237, 246, 0.38);
    --accent: #E7EDF6;
    --accent-muted: rgba(231, 237, 246, 0.12);
    --text: #F8FAFD;
    --text-2: #CED9E9;
    --text-3: #A9BBD4;
    --live: #4ADE80;
    --display: 'Space Grotesk', -apple-system, sans-serif;
    --sans: 'Inter', -apple-system, sans-serif;
    --mono: 'Geist Mono', 'SF Mono', monospace;
    --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: -260px;
    left: -260px;
    width: 900px;
    height: 900px;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle, rgba(74, 134, 212, 0.36), rgba(27, 57, 114, 0.12) 45%, transparent 72%);
}

a { color: inherit; }

/* ─── Layout ─── */
.layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 72px;
}

/* ─── Profile sidebar ─── */
.profile {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    padding: 64px 0 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile__header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.profile__avatar {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 26px;
    border: 1px solid var(--border);
    box-shadow: 0 18px 36px rgba(4, 14, 38, 0.5);
}

.profile__name {
    font-family: var(--display);
    font-size: 38px;
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin-bottom: 8px;
}

.profile__role {
    font-size: 15px;
    color: var(--text-2);
}

.profile__about {
    font-size: 14px;
    color: var(--text-3);
    line-height: 1.65;
    margin-bottom: 18px;
}

.profile__location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 5px 12px;
    margin-bottom: 40px;
}

.profile__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 40px;
}

.profile__nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
}

.profile__nav a::before {
    content: "";
    width: 18px;
    height: 1px;
    background: var(--border);
    transition: width 0.3s var(--ease), background 0.2s;
}

.profile__nav a:hover,
.profile__nav a.is-active { color: var(--text); }

.profile__nav a:hover::before,
.profile__nav a.is-active::before {
    width: 36px;
    background: var(--accent);
}

.profile__links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile__links a {
    font-size: 13px;
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.profile__links a:hover { color: var(--text); }

/* ─── Content ─── */
.content {
    padding: 64px 0 96px;
    min-width: 0;
}

.section { scroll-margin-top: 40px; }

.section + .section { margin-top: 72px; }

@media (min-width: 861px) {
    .section:last-child { min-height: calc(100vh - 136px); }
}

.section__title {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

.section__title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Cards ─── */
.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 24px;
    text-decoration: none;
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

a.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.card h3 {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.card p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    margin-top: 8px;
}

.card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card__meta {
    display: block;
    margin-top: 4px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-3);
    transition: color 0.2s;
}

.card p + .card__meta { margin-top: 14px; }

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

.card--wide { grid-column: 1 / -1; }

.badge {
    flex-shrink: 0;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 100px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    color: var(--text-2);
}

.badge--live {
    color: #0B2A17;
    background: var(--live);
    border-color: transparent;
}

/* ─── Timeline ─── */
.timeline {
    position: relative;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 28px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 30px;
    bottom: 30px;
    width: 1px;
    background: var(--border);
}

.timeline__item { position: relative; }

.timeline__item::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 28px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border-hover);
}

.timeline__item--current::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-muted);
}

.timeline__item--current .card__meta { color: var(--accent); }

/* ─── Projects ─── */
.project__icon {
    width: 48px;
    height: 48px;
    border-radius: 22.5%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin-bottom: 16px;
}

.project:hover .card__meta { color: var(--text); }

/* ─── Smile.CX easter egg ─── */
.smilecx-trigger {
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.smilecx-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 0.15em;
    border-radius: 2px;
}

.smilecx-logo {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate3d(-9999px, -9999px, 0);
    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.25));
    will-change: transform, opacity;
}

.smilecx-logo img {
    width: 20px;
    height: 20px;
    display: block;
}

/* ─── Scroll Reveal ─── */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js [data-reveal].in {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ─── Responsive ─── */
@media (max-width: 860px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0 20px;
    }

    .profile {
        position: static;
        max-height: none;
        overflow: visible;
        padding: 40px 0 0;
    }

    .profile__header {
        flex-direction: row;
        align-items: center;
        gap: 18px;
        margin-bottom: 18px;
    }

    .profile__avatar { width: 80px; height: 80px; border-radius: 22px; }
    .profile__name { font-size: 32px; margin-bottom: 4px; }
    .profile__location { margin-bottom: 20px; }
    .profile__nav { display: none; }

    .profile__links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .profile__links a {
        display: inline-block;
        font-size: 12px;
        border: 1px solid var(--border);
        border-radius: 100px;
        padding: 6px 12px;
    }

    .profile__links a:hover { border-color: var(--border-hover); }

    .content { padding: 48px 0 64px; }
    .section + .section { margin-top: 56px; }
}

@media (max-width: 480px) {
    .profile__header { flex-direction: column; align-items: flex-start; }
    .grid { grid-template-columns: 1fr; }
}
