/* ============================================
   COMPRESSION — CSS-Only Kinetic Portfolio
   TM-620
   https://templatemo.com/tm-620-compression
   Design: TemplateMo
   ============================================ */

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

:root {
    --off-white: #FFFFFF;
    --carbon: #080D1A;
    --graphite: #121A2A;
    --steel: #334155;
    --ash: #94A3B8;
    --neon-chartreuse: #00E5FF;
    --seam: #1E293B;
    --font-spine: 'Outfit', sans-serif;
    --font-mono: 'Inter', sans-serif;
    --ease-heavy: cubic-bezier(0.77, 0, 0.175, 1);
    --duration: 0.8s;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    background: var(--carbon);
    color: var(--off-white);
    overflow: hidden;
    overflow-x: hidden;
    height: 100vh;
    width: 100%;
}

/* --- THE TRACK --- */
main.track {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    gap: 0;
    isolation: isolate; /* keep panel stacking contexts contained */
    z-index: 1;
    position: relative;
}


/* --- THE SLICES --- */
article.panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-right: 1px solid var(--seam);
    border-radius: 0;
    transition: flex var(--duration) var(--ease-heavy);
}

article.panel:last-child {
    border-right: none;
}

.panel__bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.panel__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 0;
    filter: brightness(0.4) grayscale(100%);
    transform: scale(1.05);
    transition:
        filter var(--duration) var(--ease-heavy),
        transform var(--duration) var(--ease-heavy);
}

.panel__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(26, 26, 26, 0.5) 0%,
        transparent 30%,
        transparent 60%,
        rgba(26, 26, 26, 0.6) 100%
    );
    z-index: 2;
    transition: opacity var(--duration) var(--ease-heavy);
}

/* Panel index */
.panel__index {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--off-white);
    opacity: 0.35;
    transition: opacity var(--duration) var(--ease-heavy);
    white-space: nowrap;
}

/* --- THE SPINE --- */
.spine {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
    z-index: 10;
    writing-mode: vertical-rl;
    font-family: var(--font-spine);
    font-size: clamp(2rem, 4vw, 3.5rem);
    text-transform: uppercase;
    color: var(--off-white);
    letter-spacing: 0.05em;
    line-height: 1;
    white-space: nowrap;
    opacity: 1;
    transition:
        opacity 0.4s var(--ease-heavy),
        transform 0.4s var(--ease-heavy);
    pointer-events: none;
}

/* --- THE DETAILS --- */
.details {
    position: absolute;
    bottom: 48px;
    left: 48px;
    right: 48px;
    z-index: 10;
    opacity: 0;
    transform: translateX(-30px);
    transition:
        opacity 0.5s var(--ease-heavy) 0.15s,
        transform 0.5s var(--ease-heavy) 0.15s;
    pointer-events: none;
}

.details__category {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--neon-chartreuse);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.details__category::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--neon-chartreuse);
}

.details__title {
    font-family: var(--font-spine);
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    text-transform: uppercase;
    color: var(--off-white);
    line-height: 0.95;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.details__meta {
    display: flex;
    gap: 32px;
    margin-bottom: 28px;
}

.details__meta-item {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.details__meta-label {
    color: var(--steel);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.details__meta-value {
    color: var(--off-white);
}

.details__description {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.7;
    color: rgba(240, 240, 240, 0.6);
    max-width: 420px;
    margin-bottom: 32px;
}

.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--neon-chartreuse);
    color: var(--carbon);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-heavy);
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.2);
}

.btn-view:hover {
    background: var(--off-white);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 255, 255, 0.3);
}

.btn-view svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s var(--ease-heavy);
}

.btn-view:hover svg {
    transform: translateX(4px);
}

/* ===========================================
   COMPRESSION ENGINE — HOVER STATES
   =========================================== */

main.track:hover > article.panel {
    flex: 1;
}

main.track > article.panel:hover {
    flex: 6;
}

article.panel:hover .panel__bg img {
    filter: brightness(0.85) grayscale(0%);
    transform: scale(1);
}

article.panel:hover .spine {
    opacity: 0.2;
    transform: translateX(-50%) rotate(180deg) translateY(-20px);
}

article.panel:hover .details {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

main.track:hover > article.panel .panel__index {
    opacity: 0;
}

article.panel:hover .panel__index {
    opacity: 0.35 !important;
}

/* ===========================================
   GLOBAL HEADER — Enterprise Grade
   =========================================== */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    height: 72px;
    background: rgba(8, 13, 26, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 4px 24px rgba(0,0,0,0.4);
    pointer-events: auto;
    transition: height 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

/* Scroll-shrink class applied via JS */
.global-header.scrolled {
    height: 60px;
    background: rgba(8, 13, 26, 0.96);
    box-shadow: 0 2px 32px rgba(0,0,0,0.6);
}

/* Logo */
.logo {
    font-family: var(--font-spine);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--off-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.logo:hover { opacity: 0.85; }

.logo__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--neon-chartreuse);
    border-radius: 6px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo:hover .logo__icon {
    transform: rotate(-6deg) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.4);
}

.logo__icon svg {
    width: 16px;
    height: 16px;
    fill: var(--carbon);
}

.logo__text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 2px;
}

.logo__name {
    font-family: var(--font-spine);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--off-white);
}

.logo__role {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--neon-chartreuse);
    opacity: 0.8;
}

/* Vertical divider between logo and nav */
.header__divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    margin: 0 32px 0 24px;
    flex-shrink: 0;
}

/* Nav */
.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.nav a {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    position: relative;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    white-space: nowrap;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: calc(100% - 28px);
    height: 1px;
    background: var(--neon-chartreuse);
    border-radius: 1px;
    transition: transform 0.25s ease;
    transform-origin: center;
}

.nav a:hover {
    color: var(--off-white);
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.nav a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* CTA buttons pushed to right */
.nav__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding-left: 16px;
    flex-shrink: 0;
}

.nav a.highlight-green {
    color: var(--neon-chartreuse);
    background-color: rgba(0, 229, 255, 0.06);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 6px;
    font-weight: 600;
    padding: 7px 18px;
}

.nav a.highlight-green::after { display: none; }

.nav a.highlight-green:hover {
    background-color: rgba(0, 229, 255, 0.12);
    border-color: var(--neon-chartreuse);
    color: var(--neon-chartreuse);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
    transform: translateY(-1px);
}

.nav a.highlight-cyan {
    color: var(--carbon);
    background: linear-gradient(135deg, var(--neon-chartreuse) 0%, #00bfff 100%);
    border: none;
    border-radius: 6px;
    font-weight: 700;
    padding: 8px 20px;
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.2);
    letter-spacing: 0.1em;
}

.nav a.highlight-cyan::after { display: none; }

.nav a.highlight-cyan:hover {
    background: linear-gradient(135deg, #00bfff 0%, var(--neon-chartreuse) 100%);
    color: var(--carbon);
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.35);
    transform: translateY(-2px);
}

/* ── Hamburger Button (mobile only) ── */
.nav-toggle-btn {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    flex-shrink: 0;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.nav-toggle-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.22);
}

.nav-toggle-btn span {
    display: block;
    width: 18px;
    height: 1.5px;
    background-color: var(--off-white);
    transition: transform 0.35s cubic-bezier(0.77, 0, 0.175, 1),
                opacity 0.25s ease,
                background-color 0.3s ease;
    border-radius: 2px;
    transform-origin: center;
}

/* Hamburger → X when open */
.nav-toggle-btn.is-open {
    border-color: rgba(0, 229, 255, 0.35);
    background: rgba(0, 229, 255, 0.07);
}

.nav-toggle-btn.is-open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
    background-color: var(--neon-chartreuse);
}

.nav-toggle-btn.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle-btn.is-open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
    background-color: var(--neon-chartreuse);
}

/* ══════════════════════════════════════
   MOBILE NAV DRAWER
   Lives as direct child of <body>, completely
   outside any header stacking context.
   ══════════════════════════════════════ */
.mobile-nav {
    display: none; /* shown only on mobile via media query */
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    z-index: 99999;
    background: rgba(8, 13, 26, 0.98);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    flex-direction: column;
    align-items: stretch;
    padding: 80px 24px 32px;
    gap: 6px;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition:
        transform 0.4s cubic-bezier(0.77, 0, 0.175, 1),
        opacity 0.3s ease,
        visibility 0s linear 0.4s;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
    box-shadow: -8px 0 40px rgba(0,0,0,0.6);
}

.mobile-nav.is-open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition:
        transform 0.4s cubic-bezier(0.77, 0, 0.175, 1),
        opacity 0.3s ease,
        visibility 0s linear 0s;
}

.mobile-nav__label {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 8px;
}

.mobile-nav__link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    padding: 13px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.mobile-nav__link::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.mobile-nav__link:hover {
    color: var(--off-white);
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.14);
}

.mobile-nav__link:hover::before {
    background: var(--neon-chartreuse);
}

.mobile-nav__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.mobile-nav__link.highlight-green {
    color: var(--neon-chartreuse);
    background: rgba(0, 229, 255, 0.06);
    border-color: rgba(0, 229, 255, 0.22);
    justify-content: center;
}

.mobile-nav__link.highlight-green::before { display: none; }

.mobile-nav__link.highlight-green:hover {
    background: rgba(0, 229, 255, 0.12);
    border-color: var(--neon-chartreuse);
}

.mobile-nav__link.highlight-cyan {
    color: var(--carbon);
    background: linear-gradient(135deg, var(--neon-chartreuse) 0%, #00bfff 100%);
    border: none;
    font-weight: 700;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.2);
}

.mobile-nav__link.highlight-cyan::before { display: none; }

.mobile-nav__link.highlight-cyan:hover {
    background: linear-gradient(135deg, #00bfff 0%, var(--neon-chartreuse) 100%);
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.35);
}

/* Backdrop overlay */
.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.35s ease,
        visibility 0s linear 0.35s;
}

.mobile-nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.35s ease,
        visibility 0s linear 0s;
}


/* ===========================================
   CSS-ONLY MODALS (:target)
   =========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;

    background: rgba(8, 13, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.5s var(--ease-heavy),
        visibility 0s linear 0.5s;
}

.modal-overlay:target {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity 0.5s var(--ease-heavy),
        visibility 0s linear 0s;
}

.modal-overlay:target .modal__content {
    opacity: 1;
    transform: translateY(0);
}

.modal__close {
    position: absolute;
    top: 28px;
    right: 36px;
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--off-white);
    font-family: var(--font-mono);
    font-size: 1.4rem;
    border: 1px solid var(--steel);
    border-radius: 0;
    transition:
        border-color 0.3s var(--ease-heavy),
        color 0.3s var(--ease-heavy);
}

.modal__close:hover {
    border-color: var(--neon-chartreuse);
    color: var(--neon-chartreuse);
}

.modal__content {
    position: relative;
    max-width: 900px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 50px;
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.5s var(--ease-heavy) 0.1s,
        transform 0.5s var(--ease-heavy) 0.1s;
    scrollbar-width: thin;
    scrollbar-color: var(--steel) transparent;
    background: rgba(8, 13, 26, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal__content::-webkit-scrollbar {
    width: 4px;
}

.modal__content::-webkit-scrollbar-track {
    background: transparent;
}

.modal__content::-webkit-scrollbar-thumb {
    background: var(--steel);
    border-radius: 0;
}

.modal__content::-webkit-scrollbar-thumb:hover {
    background: var(--ash);
}

.modal__label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--neon-chartreuse);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal__label::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 1px;
    background: var(--neon-chartreuse);
}

.modal__heading {
    font-family: var(--font-spine);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    text-transform: uppercase;
    color: var(--off-white);
    line-height: 0.95;
    margin-bottom: 36px;
}

.modal__text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.9;
    color: rgba(240, 240, 240, 0.6);
    margin-bottom: 24px;
}

.modal__text strong {
    color: var(--off-white);
    font-weight: 700;
}

.modal__text a {
    color: var(--off-white);
    text-decoration: none;
    border-bottom: 1px solid var(--steel);
    padding-bottom: 2px;
    transition: border-color 0.3s var(--ease-heavy);
}

.modal__text a:hover {
    border-color: var(--neon-chartreuse);
}

.modal__divider {
    width: 48px;
    height: 1px;
    background: var(--steel);
    margin: 36px 0;
    border: none;
}

/* Work modal — project grid */
.modal__project-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.modal__project-list li {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.modal__project-list li:hover {
    transform: translateY(-4px);
    border-color: rgba(61,255,160,0.3);
}

.modal__project-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.modal__project-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.modal__project-name {
    color: var(--off-white);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.modal__project-year {
    color: var(--steel);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    margin-bottom: 12px;
}

.modal__project-link {
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--neon-chartreuse);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(61,255,160,0.2);
    padding: 6px 12px;
    border-radius: 4px;
    align-self: flex-start;
    transition: all 0.2s ease;
}

.modal__project-link:hover {
    background: rgba(61,255,160,0.1);
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--off-white);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(61, 255, 160, 0.1);
    border-color: rgba(61, 255, 160, 0.4);
    color: var(--neon-chartreuse);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
}

.pagination-number {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--steel);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-number:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--off-white);
}

.pagination-number.active {
    background: rgba(61, 255, 160, 0.1);
    border-color: var(--neon-chartreuse);
    color: var(--neon-chartreuse);
}

.modal__project-list li.hidden {
    display: none !important;
}

/* Contact modal — grid */
.modal__contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 40px;
}

.modal__contact-item {
    font-family: var(--font-mono);
}

.modal__contact-label {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--steel);
    margin-bottom: 8px;
}

.modal__contact-value {
    font-size: 0.8rem;
    color: var(--off-white);
}

.modal__contact-value a {
    color: var(--off-white);
    text-decoration: none;
    border-bottom: 1px solid var(--steel);
    padding-bottom: 2px;
    transition: border-color 0.3s var(--ease-heavy);
}

.modal__contact-value a:hover {
    border-color: var(--neon-chartreuse);
}

/* --- BOTTOM STRIP --- */
.global-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 36px;
    pointer-events: none;
    background: linear-gradient(
        0deg,
        rgba(8, 13, 26, 0.8) 0%,
        transparent 100%
    );
}

.footer__credit {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(240, 240, 240, 0.3);
    pointer-events: auto;
}

.footer__credit a {
    color: rgba(240, 240, 240, 0.5);
    text-decoration: none;
}

.footer__scroll-hint {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(240, 240, 240, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer__scroll-hint::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 1px;
    background: rgba(240, 240, 240, 0.3);
}

/* --- ENTRANCE ANIMATION --- */
@keyframes sliceIn {
    0% { transform: scaleX(0); opacity: 0; }
    100% { transform: scaleX(1); opacity: 1; }
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

article.panel {
    transform-origin: left center;
    animation: sliceIn 1s var(--ease-heavy) both;
}

article.panel:nth-child(1) { animation-delay: 0.05s; }
article.panel:nth-child(2) { animation-delay: 0.15s; }
article.panel:nth-child(3) { animation-delay: 0.25s; }
article.panel:nth-child(4) { animation-delay: 0.35s; }
article.panel:nth-child(5) { animation-delay: 0.45s; }

.global-header {
    animation: none;
    opacity: 1;
}

.global-footer {
    animation: fadeUp 0.6s var(--ease-heavy) 0.7s both;
}


.spine {
    animation: fadeUp 0.5s var(--ease-heavy) backwards;
}

article.panel:nth-child(1) .spine { animation-delay: 0.6s; }
article.panel:nth-child(2) .spine { animation-delay: 0.7s; }
article.panel:nth-child(3) .spine { animation-delay: 0.8s; }
article.panel:nth-child(4) .spine { animation-delay: 0.9s; }
article.panel:nth-child(5) .spine { animation-delay: 1.0s; }

/* ============================================
   RESPONSIVE — Enterprise Grade
   ============================================ */

/* ── Tablet (≤1024px) — collapse some label text ── */
@media (max-width: 1024px) {
    .global-header {
        padding: 0 32px;
    }

    .header__divider {
        margin: 0 20px 0 16px;
    }

    .nav {
        gap: 1px;
    }

    .nav a {
        padding: 7px 10px;
        font-size: 0.58rem;
    }

    .logo__role {
        display: none;
    }

    .availability-badge {
        display: none;
    }
}

/* ── Mobile (≤768px) — hamburger + card-grid panels ── */
@media (max-width: 768px) {

    /* ── Body & scroll ── */
    body {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        /* iOS rubber-band scroll */
        -webkit-overflow-scrolling: touch;
    }

    /* ── Track: vertical card grid ── */
    main.track {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 64px);
        padding-top: 64px; /* clear header */
        gap: 0;
    }

    /* ── Each panel as a full-width card ── */
    article.panel {
        flex: none !important;
        width: 100%;
        /* Taller cards so content breathes */
        height: clamp(220px, 55vw, 320px);
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        cursor: pointer;
        /* No entrance animation on mobile — too janky */
        animation: none;
        opacity: 1;
        transform: none;
    }

    article.panel:last-child {
        border-bottom: none;
    }

    /* Always show image, slightly brighter */
    .panel__bg img {
        filter: brightness(0.55) grayscale(0%) !important;
        transform: scale(1.02) !important;
        transition: filter 0.4s ease, transform 0.4s ease;
    }

    /* Always-visible gradient overlay on mobile */
    .panel__bg::after {
        background: linear-gradient(
            180deg,
            rgba(8,13,26,0.3) 0%,
            transparent 25%,
            transparent 45%,
            rgba(8,13,26,0.92) 100%
        ) !important;
        opacity: 1 !important;
    }

    /* Hide vertical spine text — replaced by horizontal layout */
    .spine { display: none !important; }

    /* Panel counter badge — top-left, always visible */
    .panel__index {
        opacity: 0.5 !important;
        top: 16px;
        left: 20px;
        transform: none;
        font-size: 0.5rem;
        letter-spacing: 0.2em;
    }

    /* Details — always visible, anchored to bottom */
    .details {
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        bottom: 20px;
        left: 20px;
        right: 20px;
        /* Stagger-in handled by touch-active class */
    }

    .details__category {
        font-size: 0.55rem;
        letter-spacing: 0.2em;
        margin-bottom: 6px;
    }

    .details__title {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
        line-height: 1;
        margin-bottom: 10px;
    }

    /* Show description on mobile — was hidden before */
    .details__description {
        display: block;
        font-size: 0.68rem;
        line-height: 1.6;
        max-width: 100%;
        margin-bottom: 14px;
        /* Limit to 2 lines on very small screens */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .details__meta {
        gap: 16px;
        margin-bottom: 14px;
        flex-wrap: wrap;
    }

    .details__meta-item {
        font-size: 0.62rem;
    }

    /* View button — bigger tap target */
    .btn-view {
        padding: 11px 22px;
        font-size: 0.62rem;
        letter-spacing: 0.15em;
        min-height: 44px;
        border-radius: 24px;
    }

    /* ── Header ── */
    .global-header {
        padding: 0 20px;
        height: 64px;
        /* Safe area top inset for notched phones */
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(64px + env(safe-area-inset-top, 0px));
    }

    .global-header.scrolled {
        height: calc(56px + env(safe-area-inset-top, 0px));
    }

    .header__divider { display: none; }
    .logo__role { display: none; }
    .availability-badge { display: none; }

    .logo__name {
        font-size: 0.82rem;
    }

    /* Hide desktop nav, show hamburger button */
    .nav--desktop { display: none !important; }
    .nav-toggle-btn { display: flex; }

    /* Show mobile nav elements */
    .mobile-nav { display: flex; }
    .mobile-nav-backdrop { display: block; }

    /* ── Mobile nav drawer improvements ── */
    .mobile-nav {
        /* Safe-area aware padding */
        padding-top: calc(72px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
        padding-left: 20px;
        padding-right: 20px;
        gap: 4px;
        width: min(300px, 88vw);
    }

    /* Profile pill at top of drawer */
    .mobile-nav__label {
        font-size: 0.48rem;
        letter-spacing: 0.28em;
        padding-bottom: 14px;
        margin-bottom: 10px;
    }

    /* Larger tap targets for nav links — WCAG 2.5.5 */
    .mobile-nav__link {
        min-height: 48px;
        padding: 14px 18px;
        font-size: 0.7rem;
        border-radius: 10px;
        transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease,
                    transform 0.15s ease;
    }

    .mobile-nav__link:active {
        transform: scale(0.98);
        background: rgba(255,255,255,0.08);
    }

    .mobile-nav__actions {
        gap: 10px;
        padding-top: 18px;
        margin-top: 10px;
    }

    .mobile-nav__actions .mobile-nav__link {
        min-height: 48px;
        justify-content: center;
        text-align: center;
    }

    /* ── Footer — compact visible strip on mobile ── */
    .global-footer {
        display: flex !important;
        position: relative;
        padding: 14px 20px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        background: rgba(8,13,26,0.95);
        border-top: 1px solid rgba(255,255,255,0.06);
        flex-direction: column;
        align-items: center;
        gap: 4px;
        pointer-events: auto;
    }

    .footer__credit {
        font-size: 0.5rem;
        opacity: 0.5;
        text-align: center;
    }

    .footer__scroll-hint {
        font-size: 0.48rem;
        opacity: 0.35;
        letter-spacing: 0.18em;
    }

    /* Change "hover" hint to "tap" */
    .footer__scroll-hint::before { display: none; }

    /* ── Modals on mobile ── */
    .modal-overlay {
        align-items: flex-start;
        padding: 0;
    }

    .modal__content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        padding: 24px 20px 48px !important;
        /* Account for notch */
        padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)) !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal__close {
        position: fixed;
        /* Below notch */
        top: calc(16px + env(safe-area-inset-top, 0px));
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        border-radius: 50%;
        background: rgba(8,13,26,0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-color: rgba(255,255,255,0.15);
        z-index: 1100;
    }

    .modal__heading {
        font-size: clamp(2rem, 8vw, 3rem);
    }

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

    /* Full-screen modal override for mobile */
    .fs-modal__content.modal__content {
        padding: calc(64px + env(safe-area-inset-top, 0px)) 20px
                 calc(48px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ── Small phones (≤480px) ── */
@media (max-width: 480px) {
    .global-header {
        padding: 0 16px;
        padding-top: env(safe-area-inset-top, 0px);
    }

    .logo__icon {
        width: 28px;
        height: 28px;
        margin-right: 8px;
    }

    .logo__name {
        font-size: 0.75rem;
    }

    .nav-toggle-btn {
        width: 38px;
        height: 38px;
    }

    article.panel {
        height: clamp(200px, 52vw, 280px);
    }

    .details__title {
        font-size: clamp(1.15rem, 4.5vw, 1.5rem);
    }

    /* Stats row: 2 columns on small phones */
    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Project grid: single column */
    .modal__project-list {
        grid-template-columns: 1fr !important;
    }

    .modal__skills-grid {
        grid-template-columns: 1fr !important;
    }

    /* Blog featured card: stack on mobile */
    .blog-card--featured {
        grid-template-columns: 1fr !important;
    }

    .blog-cards-row {
        grid-template-columns: 1fr !important;
    }
}

/* ── Landscape phones (≤768px height) ── */
@media (max-height: 500px) and (orientation: landscape) {
    article.panel {
        height: 85vw;
        min-height: 180px;
    }

    .global-header {
        height: 52px;
    }

    main.track {
        padding-top: 52px;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Touch-active panel state (mobile tap) ── */
article.panel.touch-active {
    flex: 6 !important;
}

article.panel.touch-active .panel__bg img {
    filter: brightness(0.75) grayscale(0%) !important;
    transform: scale(1) !important;
}

@media (max-width: 768px) {
    article.panel.touch-active .panel__bg img {
        filter: brightness(0.65) grayscale(0%) !important;
    }
}

article.panel.touch-active .spine {
    opacity: 0.2 !important;
}

article.panel.touch-active .details {
    opacity: 1 !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
}

/* ── Availability badge — header layout ── */
.global-header {
    gap: 0;
}

.availability-badge {
    margin-left: 12px;
    flex-shrink: 0;
}

/* ── Typing cursor animation ── */
@keyframes typeCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.spine::after {
    content: '|';
    display: inline-block;
    margin-left: 4px;
    animation: typeCursor 1.2s ease-in-out infinite;
    opacity: 0;
    font-size: 0.7em;
    color: var(--neon-chartreuse);
    writing-mode: horizontal-tb;
    transform: rotate(180deg);
}

article.panel:hover .spine::after {
    opacity: 1;
}
