/* ═══════════════════════════════════
   RESET & BASE
═══════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-secondary: #333333;
    --border-color: #e0e0e0;
    --card-bg: rgba(240, 240, 240, 0.77);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --accent-color: #fc440f;
    --accent-secondary: #ff6d44;
}

body.dark-mode {
    --bg-color: #000000;
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #222222;
    --card-bg: rgba(25, 25, 25, 0.77);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(0, 0, 0, 0.95);
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Fragment Mono', monospace;
    font-size: 14px;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ═══════════════════════════════════
   SCROLL PROGRESS
═══════════════════════════════════ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ═══════════════════════════════════
   THEME TOGGLE
═══════════════════════════════════ */
.theme-toggle-fixed {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9998;
}

#theme-switch {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 60px;
    height: 30px;
    background-color: var(--border-color);
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    padding: 5px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: background-color 0.4s ease;
}

.toggle-label .sun,
.toggle-label .moon {
    font-size: 16px;
    transition: opacity 0.4s ease;
}

.toggle-label .sun {
    opacity: 1;
}

.toggle-label .moon {
    opacity: 0.3;
}

body.dark-mode .toggle-label .sun {
    opacity: 0.3;
}

body.dark-mode .toggle-label .moon {
    opacity: 1;
}

.toggle-label::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background-color: #fff;
    border-radius: 50%;
    top: 4px;
    left: 4px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#theme-switch:checked+.toggle-label::after {
    transform: translateX(30px);
    background-color: #000;
}

/* ═══════════════════════════════════
   NAVBAR (desktop)
═══════════════════════════════════ */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--navbar-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.4s ease;
}

.navbar.scrolled {
    padding: 1rem 0;
    box-shadow: 0 2px 20px var(--shadow-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--text-color);
}

/* hamburger — hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1060;
    background: none;
    border: none;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

/* Nav links list */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link:hover {
    background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.nav-link.active {
    color: var(--accent-color);
}

.bracket {
    color: var(--accent-color);
}

/* Mobile overlay — hidden on desktop */
.nav-mob-overlay {
    display: none;
}

/* ═══════════════════════════════════
   HERO (desktop)
═══════════════════════════════════ */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color);
    overflow: hidden;
    padding-top: 120px;
}

.hero-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
    justify-content: space-between;
}

/* Utilities */
.desktop-hidden {
    display: none !important;
}

/* Grid Layout */
.desktop-main-columns {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 40px;
    margin-top: 40px;
    align-items: start;
}

.desktop-left-col {
    padding-top: 40px;
    display: flex;
    flex-direction: column;
}

.desktop-right-col {
}

/* Typography & Titles */
.hero-title {
    color: var(--text-color);
    font-size: 80px;
    font-weight: 400;
    line-height: 1.1;
    text-align: left;
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    min-height: 100px;
}

.hero-title::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
    color: var(--accent-color);
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.role-java {
    color: var(--text-color);
    font-size: 14px;
    letter-spacing: 2px;
    margin-top: 10px;
    align-self: flex-end;
    margin-right: 20px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Right Column Blog Card */
.blog-placeholder {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 10px 40px var(--shadow-color);
    border: 1px solid var(--border-color);
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.8s;
}

.blog-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.blog-header {
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--text-color);
    opacity: 0.5;
}

.blog-count {
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--accent-color);
    border: 1px solid rgba(252, 68, 15, 0.35);
    border-radius: 3px;
    padding: 2px 6px;
}

.blog-post-item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-decoration: none;
    color: inherit;
    padding: 14px 0;
    transition: opacity 0.2s ease;
}

.blog-post-item:hover {
    opacity: 0.75;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-post-date {
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.blog-post-tag {
    font-size: 7px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-color);
    background: rgba(252, 68, 15, 0.08);
    border-radius: 3px;
    padding: 2px 6px;
}

.blog-post-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.4;
    letter-spacing: 0.3px;
}

.blog-post-excerpt {
    font-size: 9.5px;
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-cta {
    font-size: 8.5px;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-top: 2px;
}

.blog-divider {
    height: 1px;
    background: var(--border-color);
    width: 100%;
}

/* Projects Row */
.desktop-projects-section {
    margin-top: 60px;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1s;
}

.desktop-projects-header {
    font-size: 14px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.desktop-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.d-project-card {
    background: var(--sc-bg);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
}

body.dark-mode .d-project-card {
    background: #131313;
}

.d-project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}

.d-project-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Colored left panel — mirrors .stack-visual */
.d-card-visual {
    flex: 0 0 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg,
            hsl(var(--chue, 12), 58%, 20%) 0%,
            hsl(var(--chue, 12), 28%, 10%) 100%);
}

/* Subtle grid texture — mirrors .stack-visual::before */
.d-card-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 16px 16px;
}

/* Large faded project number — mirrors .stack-num */
.d-card-num {
    position: relative;
    z-index: 1;
    font-size: 22px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: hsl(var(--chue, 12), 75%, 68%);
    opacity: 0.35;
    letter-spacing: -1px;
}

.d-card-info {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
    justify-content: center;
}

.d-project-title {
    font-size: 12px;
    color: var(--sc-text);
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.d-project-desc {
    font-size: 9.5px;
    color: var(--sc-sub);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.d-card-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.d-tag {
    font-size: 7.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--sc-tag-col);
    background: var(--sc-tag-bg);
    border-radius: 3px;
    padding: 2px 6px;
}

.d-card-footer {
    display: flex;
    align-items: center;
    margin-top: 4px;
}

.d-view-link {
    font-size: 8.5px;
    color: var(--accent-color);
    letter-spacing: 1.5px;
    font-weight: bold;
}

/* Desktop Footer */
.desktop-footer {
    text-align: center;
    padding: 20px 0;
    font-size: 11px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* Allow mobile overrides later in CSS by making these contents/hidden */
@media (max-width: 768px) {

    .desktop-right-col,
    .desktop-projects-section,
    .desktop-footer {
        display: none !important;
    }

    .desktop-main-columns,
    .desktop-left-col {
        display: contents;
    }
}

/* ═══════════════════════════════════
   DESKTOP RESPONSIVE BREAKPOINTS
═══════════════════════════════════ */
@media (max-width:1400px) {
    .hero-title {
        font-size: 70px;
    }
}

@media (max-width:1200px) {
    .hero-title {
        font-size: clamp(50px, 8vw, 70px);
    }

    .desktop-main-columns {
        grid-template-columns: 1fr;
    }

    .desktop-right-col {
        display: none;
    }

    .desktop-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:900px) {
    .nav-link {
        font-size: 12px;
    }

    .hero-title {
        font-size: clamp(36px, 9vw, 60px);
    }

    .desktop-projects-grid {
        grid-template-columns: 1fr;
    }
}


/* Mobile footer — hidden on desktop, shown only inside ≤768px media query */
.mobile-footer {
    display: none;
}

/* ═══════════════════════════════════════════════════════════
   STACKED CARDS — shared tokens (light + dark)
   Both desktop + mobile need the tokens; section hidden desktop.
═══════════════════════════════════════════════════════════ */
:root {
    --sc-bg: #f3f3f3;
    --sc-text: #111111;
    --sc-sub: #555555;
    --sc-tag-bg: rgba(0, 0, 0, 0.06);
    --sc-tag-col: #666666;
}

body.dark-mode {
    --sc-bg: #131313;
    --sc-text: #ffffff;
    --sc-sub: #aaaaaa;
    --sc-tag-bg: rgba(255, 255, 255, 0.07);
    --sc-tag-col: #888888;
}

/* Hidden on desktop */
.stack-section {
    display: none;
}


/* ═══════════════════════════════════════════════════════════
   MOBILE  ≤ 768px  —  ALL CHANGES ARE INSIDE THIS BLOCK ONLY
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── 0. MISC ──────────────────────────────────────────── */
    .theme-toggle-fixed {
        bottom: 1.4rem;
        right: 1.4rem;
    }

    /* ── NAVBAR HEIGHT FIX ────────────────────────────────
       Give the bar an explicit height so it doesn't feel
       cramped. nav-container fills it and keeps logo +
       hamburger vertically centred via align-items:center.
    ──────────────────────────────────────────────────────── */
    .navbar {
        padding: 0 !important;
        /* height drives the size, not padding */
        height: 76px;
    }

    .navbar.scrolled {
        height: 64px;
        /* slight shrink on scroll — still comfortable */
        box-shadow: 0 2px 20px var(--shadow-color);
    }

    .nav-container {
        padding: 0 1.4rem;
        height: 100%;
        /* fill the fixed navbar height */
        align-items: center;
        /* vertically centre logo + hamburger */
    }

    /* Push hero padding down to match the taller navbar */
    .hero {
        padding-top: 76px;
    }

    /* Bigger logo + hamburger bars on mobile */
    .logo {
        font-size: 13px;
        letter-spacing: 2px;
    }

    .hamburger {
        padding: 8px;
        /* larger tap target */
    }

    .hamburger span {
        width: 26px;
        /* wider bars — more visible */
        height: 2px;
        /* slightly thicker */
    }

    /* ── 1. HAMBURGER → RIGHT-SIDE DRAWER ────────────────── */
    .hamburger {
        display: flex;
    }

    .nav-menu {
        /* Right drawer — slides from right edge */
        position: fixed;
        top: 0;
        right: 0;
        left: auto !important;
        /* override any legacy left:-100% */
        width: min(260px, 72vw);
        height: 100dvh;

        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 2.8rem;
        padding: 3rem 2.8rem;
        text-align: left;

        background-color: var(--navbar-bg);
        border-left: 1px solid var(--border-color);
        box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);

        /* Motion — transform instead of left */
        transform: translateX(100%);
        transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 1050;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu li {
        padding: 0;
        width: 100%;
    }

    .nav-link {
        font-size: 14px;
        letter-spacing: 2.5px;
        font-weight: 700;
    }

    /* Scrim — injected by JS as .nav-mob-overlay */
    .nav-mob-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.54);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.32s ease;
        /* hidden until .visible added */
    }

    .nav-mob-overlay.visible {
        opacity: 1;
        pointer-events: all;
    }

    /* Hamburger ↔ X morph */
    .hamburger.active span:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }

    /* ── 2. HIDE CERTIFIED BADGE ──────────────────────────── */
    .stamp {
        display: none !important;
    }

    /* ── 3. LOCATION — hidden here; JS moves it below stack ── */
    .location {
        display: none !important;
    }

    /* Styling applied after JS repositions the element */
    .location.stack-location-el {
        display: flex !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        text-align: center;
        font-size: 10px;
        letter-spacing: 2.5px;
        text-transform: uppercase;
        color: var(--text-secondary);
        padding: 36px 0 52px;
        opacity: 0.55;
        animation: none !important;
        /* cancel fadeInUp */
    }

    /* ── 4. HIDE BACKGROUND "EBB" ─────────────────────────── */
    .bg-mark {
        display: none !important;
    }

    /* ── HERO — compact centered layout ──────────────────── */
    .hero {
        min-height: auto;
        padding-top: 72px;
        padding-bottom: 0;
        overflow: visible;
    }

    .hero-container {
        min-height: 42vh;
        padding: 0 24px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .hero-title {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100%;
        font-size: clamp(24px, 7.5vw, 40px);
        text-align: center;
        white-space: normal;
        word-break: break-word;
        margin: 0;
        min-height: 44px;
    }

    .role-java,
    .role-python {
        display: none !important;
    }

    .latest-project,
    .project-card {
        display: none !important;
    }

    /* ── STACK SECTION ─────────────────────────────────────
       CSS GRID: header spans both columns, card + dots side
       by side on row 2, hint spans both on row 3.
       Dots column is narrow (22px) and sits on the RIGHT.
    ──────────────────────────────────────────────────────── */
    .stack-section {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "card"
            "rdots"
            "hint";
        column-gap: 0;
        align-items: start;
        padding: 28px 16px 0;
    }

    /* Header row spans both columns */
    .stack-header {
        grid-area: header;
        width: 100%;
        max-width: unset;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
    }

    .stack-label {
        font-size: 9px;
        letter-spacing: 3px;
        text-transform: uppercase;
        color: var(--text-secondary);
    }

    .stack-counter {
        font-family: 'Courier New', monospace;
        font-size: 11px;
        letter-spacing: 2px;
        color: var(--text-secondary);
    }

    /* ── 5. CARD: slightly slimmer ────────────────────────── */
    .stack-wrapper {
        grid-area: card;
        position: relative;
        width: 100%;
        max-width: unset;
        height: 185px;
        overflow: hidden;
        /* clip cards sliding in/out horizontally */
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
    }

    .stack-wrapper:active {
        cursor: grabbing;
    }

    /* ── 6. DOTS: horizontal row below card ──────────────── */
    .stack-dots {
        grid-area: rdots;
        display: flex;
        flex-direction: row;
        align-self: center;
        justify-content: center;
        align-items: center;
        gap: 9px;
        margin: 12px 0 0;
        padding: 0;
    }

    .stack-dot {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: rgba(128, 128, 128, 0.28);
        border: none;
        cursor: pointer;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
        transition:
            width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
            background 0.3s ease;
    }

    .stack-dot.active {
        width: 22px;
        /* wide pill = active indicator */
        border-radius: 3px;
        background: var(--accent-color);
    }

    /* Hint row spans both columns */
    .stack-hint {
        grid-area: hint;
        font-size: 8.5px;
        letter-spacing: 2.5px;
        text-transform: uppercase;
        color: rgba(128, 128, 128, 0.35);
        text-align: center;
        user-select: none;
        margin-top: 10px;
        animation: hintFloat 2.8s ease-in-out infinite;
        transition: opacity 0.5s ease;
    }

    .stack-hint.hidden {
        opacity: 0;
        pointer-events: none;
        animation: none;
    }

    @keyframes hintFloat {

        0%,
        100% {
            opacity: 0.45;
            transform: translateY(0);
        }

        50% {
            opacity: 1;
            transform: translateY(-4px);
        }
    }

    /* ── 7. HORIZONTAL CAROUSEL — card states ─────────────── */
    .stack-card {
        position: absolute;
        inset: 0;
        background: var(--sc-bg);
        border-radius: 22px;
        display: flex;
        flex-direction: row;
        overflow: hidden;

        opacity: 0;
        transform: translateX(100%);
        z-index: 1;
        pointer-events: none;
        will-change: transform, opacity;

        transition:
            transform 0.50s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.40s cubic-bezier(0.22, 1, 0.36, 1),
            box-shadow 0.4s ease;
    }

    .stack-card.is-active {
        opacity: 1;
        transform: translateX(0);
        z-index: 10;
        pointer-events: all;
        box-shadow:
            0 10px 36px rgba(0, 0, 0, 0.14),
            0 3px 8px rgba(0, 0, 0, 0.08);
    }

    body.dark-mode .stack-card.is-active {
        box-shadow:
            0 14px 48px rgba(0, 0, 0, 0.60),
            0 4px 12px rgba(0, 0, 0, 0.40);
    }

    /* Slide in from right (next card) */
    .stack-card.is-entering-right {
        opacity: 0;
        transform: translateX(100%);
        z-index: 5;
        pointer-events: none;
    }

    /* Slide in from left (prev card) */
    .stack-card.is-entering-left {
        opacity: 0;
        transform: translateX(-100%);
        z-index: 5;
        pointer-events: none;
    }

    /* Exit to the left */
    .stack-card.is-exiting-left {
        opacity: 0;
        transform: translateX(-110%);
        z-index: 12;
        pointer-events: none;
        transition:
            transform 0.40s cubic-bezier(0.4, 0, 0.85, 0.2),
            opacity 0.28s ease-in;
    }

    /* Exit to the right */
    .stack-card.is-exiting-right {
        opacity: 0;
        transform: translateX(110%);
        z-index: 12;
        pointer-events: none;
        transition:
            transform 0.40s cubic-bezier(0.4, 0, 0.85, 0.2),
            opacity 0.28s ease-in;
    }

    /* Visual column */
    .stack-visual {
        flex: 0 0 88px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
        background: linear-gradient(145deg,
                hsl(var(--chue, 12), 58%, 20%) 0%,
                hsl(var(--chue, 12), 28%, 10%) 100%);
    }

    .stack-visual::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image:
            linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
        background-size: 16px 16px;
    }

    .stack-num {
        position: relative;
        z-index: 1;
        font-size: 26px;
        font-weight: 700;
        font-family: 'Courier New', monospace;
        color: hsl(var(--chue, 12), 75%, 68%);
        opacity: 0.32;
        letter-spacing: -1px;
    }

    /* Info panel */
    .stack-info {
        flex: 1;
        padding: 14px 14px 12px 12px;
        /* slightly tighter for slimmer card */
        display: flex;
        flex-direction: column;
        gap: 6px;
        justify-content: center;
        overflow: hidden;
    }

    .stack-title-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .stack-title {
        font-size: 13.5px;
        font-weight: 700;
        color: var(--sc-text);
        letter-spacing: 0.3px;
        line-height: 1.2;
        margin: 0;
    }

    .stack-wip {
        font-size: 7px;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: var(--accent-color);
        border: 1px solid rgba(252, 68, 15, 0.4);
        border-radius: 3px;
        padding: 2px 5px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .stack-desc {
        font-size: 10px;
        color: var(--sc-sub);
        line-height: 1.6;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

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

    .s-tag {
        font-size: 7.5px;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: var(--sc-tag-col);
        background: var(--sc-tag-bg);
        border-radius: 3px;
        padding: 2px 6px;
    }

    .stack-cta {
        font-size: 9.5px;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: var(--accent-color);
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-top: 2px;
        transition: gap 0.25s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .stack-cta:active {
        gap: 10px;
    }

    /* ── FOOTER COPYRIGHT ──────────────────────────────────
       Sits below the relocated .location text.
       Subtle — small, muted, centred, breathes with padding.
    ──────────────────────────────────────────────────────── */
    .mobile-footer {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0 20px 48px;
        /* top space provided by location's bottom padding */
        font-size: 9px;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: var(--text-color);
        opacity: 0.28;
        font-family: 'Fragment Mono', monospace;
        user-select: none;
    }

}

/* end @media 768px */


/* ── Very small phones ≤ 380px ── */
@media (max-width: 380px) {
    .stack-wrapper {
        height: 172px;
    }

    .stack-visual {
        flex: 0 0 74px;
    }

    .stack-num {
        font-size: 22px;
    }

    .stack-title {
        font-size: 12.5px;
    }

    .stack-desc {
        font-size: 9.5px;
    }

    .hero-title {
        font-size: clamp(22px, 8vw, 32px);
    }
}