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

/* ── TOKENS ─────────────────────────── */
:root {
    --bg:      #020202;
    --card:    #1D212B;
    --fg:      #E8EAF2;
    --muted:   #A7ADBA;
    --accent:  #FF9FFA;
    --border:  transparent;
    --radius:  12px;
    --gap:     24px;
}

/* ── BASE ───────────────────────────── */
html { height: 100%; }

body {
    background-color: var(--bg);
    background-image: radial-gradient(rgba(255,255,255,0.18) 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--fg);
    font-family: 'IBM Plex Mono', monospace;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

/* ── NAV ────────────────────────────── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: var(--gap);
    display: flex;
    align-items: center;
    gap: var(--gap);
    max-width: 1512px;
    margin: 0 auto;
    view-transition-name: main-nav;
}

.nav--reveal {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #0D1117;
    border-radius: var(--radius);
}

.nav-group::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.nav-group--main { flex: 1; min-width: 0; }
.nav-group--socials .nav-pill { flex: none; }

.nav-pill {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 12px;
    background: var(--card);
    border-radius: 8px;
    font-family: 'Space Mono', monospace;
    white-space: nowrap;
    min-width: 0;
    font-size: 14px;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, background 0.2s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

.nav-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.nav-pill:hover:not(.active) {
    color: var(--accent);
    background: #131720;
    transform: translateY(-2px);
}

.nav-pill:active:not(.active) {
    transform: translateY(2px);
    transition: color 0.2s, background 0.2s, transform 0.08s ease-out;
}

.nav-pill--pressed {
    transform: translateY(2px) !important;
    color: var(--accent);
    background: #131720;
    transition: color 0.2s, background 0.2s, transform 0.08s ease-out !important;
}

.nav-pill.active {
    background: var(--accent);
    color: #020202;
}
.nav-pill.active::before { background: linear-gradient(to bottom, rgba(255,255,255,0.35), transparent); }

/* ── VIEW TRANSITIONS ──────────────── */
::view-transition-old(root),
::view-transition-new(root),
::view-transition-old(main-nav),
::view-transition-new(main-nav),
::view-transition-group(main-nav) {
    animation: none;
}

/* ── FADE ───────────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.vt-arrived .fade-in {
    opacity: 1;
    transform: none;
    animation: none;
}

/* ── CARD STRIP ─────────────────────── */
.card-strip {
    flex-shrink: 0;
}

.strip-title {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    letter-spacing: -0.04em;
    word-spacing: -0.2em;
    text-transform: uppercase;
    color: #fff;
}

.strip-tags {
    color: rgba(255,255,255,0.20);
}

/* ── TILE BADGES ───────────────────── */
.info-badge,
.link-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 36px;
    height: 36px;
    background: #131720;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 3;
}

.info-badge::before,
.link-badge::before,
.confidential-badge::before,
.wip-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.25), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.project:hover .info-badge { opacity: 1; }

/* ── CONFIDENTIAL / WIP BADGE ──────── */
.confidential-badge,
.wip-badge {
    position: absolute;
    bottom: 6px; right: 6px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 3;
}

.confidential-badge {
    background: #230D0A;
    color: #C82800;
}

.wip-badge {
    background: #2B2A0F;
    color: #E8B600;
}

.project:hover .confidential-badge,
.project:hover .wip-badge { opacity: 1; }

/* ── MOBILE NAV ─────────────────────── */
@media (max-width: 860px) {
    .nav-group--socials { display: none; }

    nav {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px var(--gap) 16px;
        background: transparent;
        z-index: 100;
        transform: none;
        transition: none;
    }
}
