/* =========================================================
   YAKANGCODER — Showcase Dashboard
   ========================================================= */

:root {
    --bg:         #0a0a09;
    --bg-alt:     #131311;
    --bg-card:    #15140f;
    --bg-hover:   #1d1c19;
    --bg-muted:   #1a1916;
    --sidebar-bg: #0d0c0b;

    --text-1:     #f0eee8;
    --text-2:     #d4d2cb;
    --text-3:     #959289;
    --text-4:     #6a6760;

    --border:     rgba(240,238,232, 0.08);
    --border-md:  rgba(240,238,232, 0.14);
    --border-hi:  rgba(240,238,232, 0.24);

    --accent:     #f0eee8;
    --positive:   #4ade80;

    --shadow-sm:  0 1px 8px rgba(0,0,0,0.18);
    --shadow-md:  0 4px 24px rgba(0,0,0,0.14);
    --shadow-lg:  0 8px 40px rgba(0,0,0,0.20);
    --shadow-drawer: 2px 0 32px rgba(0,0,0,0.28);

    --font-s:     'Inter', system-ui, -apple-system, sans-serif;

    --ease:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out:   cubic-bezier(0.16, 1.00, 0.30, 1.00);

    --dur-xs:     100ms;
    --dur-sm:     200ms;
    --dur-md:     380ms;
    --dur-lg:     600ms;

    --gutter:     1.5rem;
    --sidebar-w:  240px;
    --radius:     10px;
    --radius-sm:  6px;
    --radius-pill: 100px;
}


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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
    background: var(--bg-alt);
    color: var(--text-1);
    font-family: var(--font-s);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background var(--dur-md) var(--ease), color var(--dur-md) var(--ease);
}

img { display: block; max-width: 100%; height: auto; }
img[loading="lazy"] { opacity: 0; transition: opacity 0.3s ease; }
img.loaded { opacity: 1; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
em { font-style: italic; font-family: var(--font-d); font-weight: 400; }
address { font-style: normal; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }

::selection { background: var(--text-1); color: var(--bg); }

:focus-visible { outline: 2px solid var(--text-1); outline-offset: 2px; border-radius: 4px; }

/* Subtle, theme-aware scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb {
    background: var(--border-md);
    border-radius: 999px;
    border: 2px solid var(--bg-alt);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }
* { scrollbar-width: thin; scrollbar-color: var(--border-md) var(--bg-alt); }

.skip-link {
    position: absolute; top: -200%; left: 1rem;
    background: var(--text-1); color: var(--bg);
    padding: .65rem 1.25rem; border-radius: var(--radius-sm);
    z-index: 9999; font-size: .85rem;
}
.skip-link:focus { top: 1rem; }

/* ---- App shell: sidebar + main --------------------- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100svh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ---- Main ----------------------------------------- */
.main {
    display: flex; flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

/* ---- Topbar --------------------------------------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
    gap: .75rem;
    transition: background var(--dur-md) var(--ease), border-color var(--dur-md) var(--ease);
}
.topbar__crumbs {
    display: flex; align-items: center; gap: .5rem;
    font-size: .82rem; color: var(--text-3);
    flex-shrink: 0;
}
.topbar__crumbs .is-current { color: var(--text-1); font-weight: 500; }
.topbar__crumbs svg { color: var(--text-4); }

.topbar__actions {
    display: flex; align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid var(--border-md);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    transition: background var(--dur-xs) var(--ease), color var(--dur-xs) var(--ease);
    flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text-1); }

.btn-primary {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .55rem 1.1rem;
    font-size: .82rem; font-weight: 500;
    color: var(--bg);
    background: var(--text-1);
    border-radius: var(--radius-pill);
    transition: opacity var(--dur-xs) var(--ease);
}
.btn-primary:hover { opacity: .82; }
.btn-primary.btn-sm { padding: .45rem .85rem; font-size: .78rem; }
.btn-primary.btn-lg { padding: .85rem 1.5rem; font-size: .9rem; }

.btn-ghost {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .55rem 1.1rem;
    font-size: .82rem; font-weight: 500;
    color: var(--text-2);
    background: transparent;
    border: 1px solid var(--border-md);
    border-radius: var(--radius-pill);
    transition: background var(--dur-xs) var(--ease), color var(--dur-xs) var(--ease);
}
.btn-ghost:hover { background: var(--bg-muted); color: var(--text-1); }


/* ---- Page hero / VIDEOTRON ------------------------- */
.page-hero {
    width: 100%;
    padding: clamp(.75rem, 1.6vw, 1.5rem) clamp(1rem, 3vw, 2rem) clamp(.5rem, 1.5vw, 1rem);
}

.vt {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vt__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 580px;
    background: #050505;
    border-radius: 16px;
    padding: 14px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .05) inset,
        0 -1px 0 rgba(0, 0, 0, .6) inset,
        0 30px 60px -20px rgba(0, 0, 0, .8),
        0 10px 30px -10px rgba(0, 0, 0, .6),
        0 0 100px -20px rgba(255, 255, 255, .03);
    overflow: hidden;
    transform: perspective(2400px) rotateX(.6deg);
    transform-origin: center;
}

.vt__bezel {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, .08);
    border-radius: 50%;
    z-index: 20;
    box-shadow: 0 0 4px rgba(255, 255, 255, .04);
}
.vt__bezel--tl { top: 6px; left: 6px; }
.vt__bezel--tr { top: 6px; right: 6px; }
.vt__bezel--bl { bottom: 6px; left: 6px; }
.vt__bezel--br { bottom: 6px; right: 6px; }

/* The actual LED screen surface */
.vt__screen {
    position: relative;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 50% at 50% 50%, rgba(255, 255, 255, .04) 0%, transparent 60%),
        linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .04);
    box-shadow:
        inset 0 0 80px rgba(0, 0, 0, .8),
        inset 0 1px 0 rgba(255, 255, 255, .04);
}

/* Subtle pixel grid */
.vt__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
    background-size: 4px 4px;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
    opacity: .4;
}

/* Faint noise film-grain effect via layered radial gradients */
.vt__noise {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 23% 17%, rgba(255, 255, 255, .012) 0 1px, transparent 1px) 0 0 / 3px 3px,
        radial-gradient(circle at 67% 83%, rgba(255, 255, 255, .012) 0 1px, transparent 1px) 0 0 / 5px 5px,
        radial-gradient(circle at 41% 51%, rgba(255, 255, 255, .008) 0 1px, transparent 1px) 0 0 / 7px 7px;
    pointer-events: none;
    z-index: 2;
    opacity: .6;
}

/* Slow horizontal sweep band */
.vt__sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 255, .035) 48%,
        transparent 65%
    );
    pointer-events: none;
    z-index: 3;
    animation: vt-sweep 14s ease-in-out infinite;
    transform: translateX(-30%);
}

@keyframes vt-sweep {
    0%, 100% { transform: translateX(-30%); opacity: .5; }
    50% { transform: translateX(30%); opacity: 1; }
}

/* Edge vignette to deepen the screen */
.vt__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 100% 80% at 50% 50%, transparent 50%, rgba(0, 0, 0, .5) 100%);
    pointer-events: none;
    z-index: 4;
}

/* Display content centered on the screen */
.vt__display {
    position: relative;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1.25rem, 3vw, 2.25rem);
    color: var(--text-1);
}

.vt__hud {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: clamp(.55rem, 1vw, .7rem);
    color: var(--text-3);
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1;
}

.vt__hud--bot {
    justify-content: space-between;
}

.vt__hud-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--positive, #4ade80);
    box-shadow: 0 0 8px var(--positive, #4ade80);
    animation: vt-pulse 2.4s ease-in-out infinite;
}

@keyframes vt-pulse {
    0%, 100% { opacity: .55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.vt__hud-bar {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 10px;
}

.vt__hud-bar i {
    display: block;
    width: 2px;
    background: var(--text-3);
    border-radius: 1px;
    animation: vt-bar 1.6s ease-in-out infinite;
}

.vt__hud-bar i:nth-child(1) { height: 30%; animation-delay: 0s; }
.vt__hud-bar i:nth-child(2) { height: 60%; animation-delay: .15s; }
.vt__hud-bar i:nth-child(3) { height: 90%; animation-delay: .3s; }
.vt__hud-bar i:nth-child(4) { height: 70%; animation-delay: .45s; }
.vt__hud-bar i:nth-child(5) { height: 45%; animation-delay: .6s; }

@keyframes vt-bar {
    0%, 100% { transform: scaleY(.4); opacity: .5; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* Center brand mark */
.vt__mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .75rem;
    margin: auto 0;
}

.vt__mark-line {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 300;
    font-size: clamp(2rem, 8vw, 6rem);
    line-height: 1;
    letter-spacing: -.04em;
    color: var(--text-1);
    text-shadow: 0 0 24px rgba(255, 255, 255, .05);
}

.vt__mark-sep {
    width: 36px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--text-3), transparent);
    margin: .25rem 0;
}

.vt__mark-sub {
    font-size: clamp(.7rem, 1.4vw, .9rem);
    color: var(--text-3);
    letter-spacing: .04em;
    line-height: 1.4;
    font-weight: 300;
}

/* Caption row under the screen */
.vt__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 .25rem;
    flex-wrap: wrap;
}

.vt__caption {
    font-size: .65rem;
    color: var(--text-4);
    letter-spacing: .14em;
    text-transform: uppercase;
    line-height: 1;
}

.vt__cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    color: var(--text-2);
    text-decoration: none;
    transition: color var(--dur-xs) var(--ease);
    line-height: 1;
}

.vt__cta svg {
    transition: transform var(--dur-xs) var(--ease);
}

.vt__cta:hover {
    color: var(--text-1);
}

.vt__cta:hover svg {
    transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
    .vt__sweep,
    .vt__hud-dot,
    .vt__hud-bar i {
        animation: none;
    }
    .vt__frame { transform: none; }
}


/* ---- Section head --------------------------------- */
.section-head {
    padding: clamp(1rem, 2.5vw, 2rem) clamp(1rem, 3vw, 2rem) clamp(.5rem, 1.5vw, 1.25rem);
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    width: 100%;
}
.section-title {
    font-family: var(--font-d);
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    font-weight: 300; letter-spacing: -.025em;
    color: var(--text-1);
}
.section-sub { font-size: clamp(.7rem, 1.2vw, .78rem); color: var(--text-3); margin-top: .15rem; }

.filters {
    display: flex; gap: .35rem; flex-wrap: wrap;
    max-width: 100%;
    overflow: visible;
}
.chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .7rem;
    font-size: clamp(.7rem, 1.2vw, .78rem); color: var(--text-3);
    background: var(--bg);
    border: 1px solid var(--border-md);
    border-radius: var(--radius-pill);
    transition: background var(--dur-xs) var(--ease), color var(--dur-xs) var(--ease), border-color var(--dur-xs) var(--ease);
    white-space: nowrap;
}
.chip:hover { color: var(--text-1); border-color: var(--border-hi); }
.chip.is-active { background: var(--text-1); color: var(--bg); border-color: var(--text-1); }
.chip span {
    font-size: .62rem; opacity: .7;
    font-variant-numeric: tabular-nums;
}

.sort { display: flex; align-items: center; gap: .5rem; }
.sort label { font-size: clamp(.65rem, 1.1vw, .72rem); color: var(--text-4); }
.sort select {
    padding: .3rem .55rem;
    background: var(--bg);
    border: 1px solid var(--border-md);
    border-radius: var(--radius-sm);
    font-size: clamp(.7rem, 1.2vw, .78rem); color: var(--text-1);
    cursor: pointer;
}

/* ---- Project grid --------------------------------- */
.projects { padding-bottom: clamp(1rem, 2vw, 1.5rem); }
.grid {
    padding: 0 clamp(1rem, 3vw, 2rem);
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(.75rem, 1.5vw, 1rem);
    width: 100%;
    align-items: start;
}

.proj {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--dur-md) var(--ease),
                box-shadow var(--dur-md) var(--ease),
                background var(--dur-md) var(--ease);
    opacity: 0;
    transform: translateY(16px);
    animation: fade-up var(--dur-md) var(--ease-out) forwards;
}
.proj.is-hidden { display: none; }

@keyframes fade-up {
    to { opacity: 1; transform: translateY(0); }
}

.proj:hover {
    border-color: var(--border-md);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.proj__link { display: block; }
.proj__link:hover .proj__arrow { background: var(--text-1); color: var(--bg); border-color: var(--text-1); }

	.proj__media {
	    position: relative;
	    background: var(--bg-muted);
	    display: flex;
	    align-items: center;
	    justify-content: center;
	    overflow: hidden;
	    min-height: 180px;
	}
	.proj__media img {
	    display: block;
	    width: 100%;
	    height: auto;
	    object-fit: contain;
	    max-height: 320px;
	}
.proj__badge {
    position: absolute; top: .65rem; left: .65rem;
    font-size: .65rem;
    padding: .2rem .55rem;
    background: var(--text-1);
    color: var(--bg);
    border-radius: var(--radius-pill);
    letter-spacing: .04em;
    z-index: 2;
}

.proj__body { padding: .85rem 1rem 1rem; }
.proj__top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .5rem;
}
.proj__cat { font-size: .7rem; color: var(--text-3); letter-spacing: .04em; }
.proj__year {
    font-size: .7rem; color: var(--text-4);
    font-variant-numeric: tabular-nums;
}
.proj__title {
    font-family: var(--font-d);
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    font-weight: 300; letter-spacing: -.02em;
    color: var(--text-2);
    margin-bottom: .35rem;
    line-height: 1.2;
}
.proj__desc {
    font-size: .78rem; color: var(--text-3);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .65rem;
}
.proj__foot {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: .65rem;
    border-top: 1px solid var(--border);
}
.tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.tag {
    font-size: .65rem; color: var(--text-3);
    background: var(--bg-alt);
    padding: .15rem .5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.proj__arrow {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-md);
    display: grid; place-items: center;
    color: var(--text-2);
    transition: background var(--dur-xs) var(--ease), color var(--dur-xs) var(--ease), border-color var(--dur-xs) var(--ease);
}

/* ---- Contact / Footer -------------------------------- */
/* Professional portfolio footer — mobile-first */
.contact {
    width: 100%;
    padding: 2rem 1rem max(2rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
    box-sizing: border-box;
}

.contact__inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* — Brand block — */
.contact__brand {
    display: flex;
    align-items: center;
    gap: .875rem;
}

.contact__avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-md);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 4px;
}

.contact__avatar-stripes {
    display: flex;
    gap: 2px;
    width: 100%;
    height: 100%;
    align-items: stretch;
}

.contact__avatar-stripes i {
    display: block;
    flex: 1;
    background: linear-gradient(180deg, transparent 0%, var(--text-1) 100%);
    opacity: .35;
    border-radius: 1px;
}

.contact__avatar-stripes i:nth-child(1) { height: 50%; align-self: flex-end; }
.contact__avatar-stripes i:nth-child(2) { height: 65%; align-self: flex-end; }
.contact__avatar-stripes i:nth-child(3) { height: 80%; align-self: flex-end; }
.contact__avatar-stripes i:nth-child(4) { height: 100%; }
.contact__avatar-stripes i:nth-child(5) { height: 75%; align-self: flex-end; }

.contact__brand-text {
    min-width: 0;
}

.contact__name {
    font-weight: 500;
    font-size: .9rem;
    color: var(--text-1);
    margin-bottom: .15rem;
    line-height: 1.3;
}

.contact__bio {
    font-size: .72rem;
    color: var(--text-3);
    line-height: 1.5;
}

/* — Copyright — */
.contact__copyright {
    font-size: .68rem;
    color: var(--text-4);
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    line-height: 1.4;
}

/* ---- TABLET / DESKTOP: horizontal layout ---- */
@media (min-width: 768px) {
    .contact {
        padding: 2.5rem 1.5rem max(2rem, env(safe-area-inset-bottom));
    }

    .contact__inner {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 2rem;
    }

    .contact__brand {
        flex-shrink: 0;
    }

    .contact__copyright {
        width: 100%;
        margin-top: .5rem;
        padding-top: 1rem;
    }
}

/* ---- LARGE DESKTOP: more breathing room ---- */
@media (min-width: 1280px) {
    .contact {
        padding: 3rem 2.5rem max(2.5rem, env(safe-area-inset-bottom));
    }

    .contact__inner {
        gap: 3rem;
    }
}

/* ---- COMPACT MOBILE (< 360px): tighter but readable ---- */
@media (max-width: 359.98px) {
    .contact {
        padding: 1.5rem .875rem max(1.5rem, env(safe-area-inset-bottom));
    }

    .contact__inner {
        gap: 1.25rem;
    }

    .contact__avatar {
        width: 38px;
        height: 38px;
    }

    .contact__name {
        font-size: .85rem;
    }

    .contact__bio {
        font-size: .68rem;
    }
}

/* ---- Reveal --------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--dur-md) var(--ease-out), transform var(--dur-md) var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ---- Reduced motion ------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    .proj, .reveal { opacity: 1 !important; transform: none !important; }
}

/* =====================================================================
   MOBILE NAVIGATION — Fixed top-right menu trigger + drawer overlay
   ===================================================================== */

/* Root-level fixed-controls layer.
   - Direct child of <body>, sibling of .app.
   - position: fixed → its containing block is the initial containing
     block (the viewport), independent of any ancestor of .app.
   - isolation: isolate creates a new stacking context so descendants
     cannot escape z-index via the parent's stacking rules.
   - pointer-events: none on the wrapper so it does not block clicks
     behind the button; the button itself re-enables pointer events. */
#mobile-fixed-controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    display: block;
    pointer-events: none;
    isolation: isolate;
    transform: none;
    contain: layout;
}

.menu-toggle {
    position: absolute;
    top: max(.75rem, env(safe-area-inset-top));
    right: max(.75rem, env(safe-area-inset-right));
    z-index: 300;
    display: none;          /* hidden on desktop */
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg);
    border: 1px solid var(--border-md);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    pointer-events: auto;
    transition: background var(--dur-xs) var(--ease), color var(--dur-xs) var(--ease), box-shadow var(--dur-xs) var(--ease);
}
.menu-toggle:hover {
    background: var(--bg-muted);
    color: var(--text-1);
    box-shadow: var(--shadow-md);
}
.menu-toggle:focus-visible {
    outline: 2px solid var(--text-1);
    outline-offset: 2px;
}

/* Icon swap: show bars by default, X when drawer is open */
.menu-toggle__icon { display: block; }
.menu-toggle__icon--close { display: none; }
.menu-toggle.is-open .menu-toggle__icon--bars { display: none; }
.menu-toggle.is-open .menu-toggle__icon--close { display: block; }

/* Mobile drawer: sidebar acts as left slide-in drawer */
.sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(280px, 78vw);
    height: 100svh;
    z-index: 200;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    box-shadow: var(--shadow-drawer);
    transition: left var(--dur-md) cubic-bezier(0.16, 1, 0.3, 1),
                background var(--dur-md) var(--ease);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.sidebar.is-open { left: 0; }

/* Backdrop overlay */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 150;
    pointer-events: none;
    transition: background var(--dur-sm) var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.sidebar-backdrop.is-visible {
    background: rgba(0,0,0,0.45);
    pointer-events: auto;
}

/* Mobile drawer internal layout */
.sidebar__brand {
    display: flex; align-items: center; gap: .55rem;
    padding: .5rem 0 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    min-height: 36px;
}
.sidebar__brand .brand__mark { width: 28px; height: 28px; flex-shrink: 0; }
.sidebar__brand .brand__mark img { width: 28px; height: 28px; }
.sidebar__brand .brand__name { font-size: .82rem; font-weight: 500; color: var(--text-1); }

.sidebar__nav {
    display: flex; flex-direction: column; gap: .1rem;
    flex: 1; padding: .75rem .25rem;
}
.side-link {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem .65rem;
    font-size: .82rem; color: var(--text-3);
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    transition: background var(--dur-xs) var(--ease), color var(--dur-xs) var(--ease), border-color var(--dur-xs) var(--ease);
}
.side-link:hover { background: var(--bg-muted); color: var(--text-1); }
.side-link.is-active { background: var(--bg-muted); color: var(--text-1); border-left-color: var(--text-1); }
.side-link svg { flex-shrink: 0; opacity: .7; }
.side-link.is-active svg { opacity: 1; }
.side-link span:not(.side-link__count) { flex: 1; }
.side-link__count {
    margin-left: auto; font-size: .62rem; color: var(--text-4);
    background: var(--bg); padding: .1rem .4rem;
    border-radius: 4px; border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}

.sidebar__foot {
    display: flex; padding: .75rem .25rem;
    border-top: 1px solid var(--border); flex-shrink: 0;
}
.sidebar__foot .status { display: flex; align-items: center; gap: .55rem; }
.sidebar__foot .status__dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--positive);
    box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--positive) 18%, transparent);
    flex-shrink: 0;
}
.sidebar__foot .status__title { font-size: .72rem; color: var(--text-1); font-weight: 500; }
.sidebar__foot .status__sub { font-size: .62rem; color: var(--text-4); }

/* Mobile: page uses full width */
.app { grid-template-columns: 1fr !important; }

/* Menu trigger visible on mobile */
@media (max-width: 767.98px) {
    .menu-toggle { display: flex; }
}

/* =====================================================================
   RESPONSIVE — Mobile-first cascade
   ===================================================================== */

/* ---- S : >= 480px — small tablet / large phone ---- */
@media (min-width: 480px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- M : >= 768px — tablet / small laptop ----------- */
@media (min-width: 768px) {
    :root { --sidebar-w: 220px; }
    .app {
        grid-template-columns: var(--sidebar-w) 1fr;
        grid-template-areas: "sidebar main";
    }

    /* sidebar always visible at >= 768px (overrides mobile drawer) */
    .sidebar {
        position: sticky;
        top: 0;
        left: auto;
        width: var(--sidebar-w);
        height: 100svh;
        z-index: 100;
        padding: 1.25rem;
        box-shadow: none;
    }
    .menu-toggle { display: none; }
    .sidebar-backdrop { display: none; }

    /* Reset mobile drawer internal spacing on desktop */
    .sidebar__brand { padding: .5rem .5rem 1.5rem; border-bottom: none; }
    .sidebar__brand .brand__mark { width: 28px; height: 28px; }
    .sidebar__brand .brand__mark img { width: 28px; height: 28px; }
    .sidebar__brand .brand__name { font-size: .85rem; }
    .sidebar__nav { padding: 0; }
    .side-link {
        border-left: none;
        border-radius: var(--radius-sm);
    }
    .side-link__count { font-size: .65rem; }
    .sidebar__foot {
        padding: 1rem 0 0;
        border-top: 1px solid var(--border);
    }
    .sidebar__foot .status__dot {
        width: 8px; height: 8px;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive) 18%, transparent);
    }
    .sidebar__foot .status__title { font-size: .78rem; }
    .sidebar__foot .status__sub { font-size: .68rem; }

    .topbar__crumbs { display: flex; }

    .page-hero { padding: 1.5rem 1.25rem 1.25rem; }
    .vt { max-height: 500px; }

    .section-head { padding: 1.75rem 1.25rem 1rem; align-items: flex-end; }
    .section-head > div { flex-direction: row; align-items: flex-end; }

    .grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; padding: 0 clamp(1.25rem, 3vw, 2rem); }
    .proj__desc { -webkit-line-clamp: 2; }
}

/* ---- L : >= 1024px — tablet landscape / small desktop */
@media (min-width: 1024px) {
    :root { --sidebar-w: 240px; }
    .topbar { padding: 1rem clamp(1.5rem, 4vw, 2.5rem); }
    .topbar__crumbs { display: flex; }
    .topbar__actions { gap: .65rem; }

    .page-hero { padding: 2rem 1.5rem 1.5rem; }
    .vt { max-height: 560px; }

    .section-head {
        padding: 2rem clamp(1.5rem, 4vw, 2.5rem) 1.25rem;
        gap: 1.5rem;
    }
    .section-title { font-size: clamp(1.3rem, 2vw, 1.6rem); }
    .section-sub { font-size: .78rem; }
    .filters { flex-wrap: wrap; overflow: visible; }
    .chip { font-size: .78rem; }
    .sort label { font-size: .72rem; }
    .sort select { font-size: .78rem; }

    .grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 0 clamp(1.5rem, 4vw, 2.5rem); }
    .proj__body { padding: .85rem 1rem 1rem; }
    .proj__title { font-size: clamp(1rem, 1.3vw, 1.15rem); }
    .proj__desc { font-size: .78rem; }
    .tag { font-size: .65rem; }
}

/* ---- XL : >= 1280px — large desktop --------------- */
@media (min-width: 1280px) {
    .topbar { padding: 1rem 2rem; }
    .page-hero { padding: 2rem 2rem 1.25rem; }
    .vt { max-height: 620px; }
    .section-head { padding: 2rem 2rem 1.25rem; }
    .grid { padding: 0 2rem; gap: 1rem; }
}

/* ---- XS : 320–430px — compact mobile overrides ---- */
@media (max-width: 479.98px) {
    /* — TOPBAR ——————————————————————————————————
       Compact mobile topbar. Safe-area aware. */
    .topbar {
        padding: .55rem .75rem;
        gap: .4rem;
        min-height: 56px;
        padding-top: max(.55rem, env(safe-area-inset-top));
        padding-right: max(.75rem, env(safe-area-inset-right));
    }
    .topbar__crumbs { display: none; }
    .topbar__actions { gap: .35rem; flex: 0; min-width: 0; }

    .icon-btn { width: 44px; height: 44px; }

    /* — HERO ——————————————————————————————————
       Mobile: videotron stays full-width, smaller, with
       reduced title size and tighter padding. */
    .page-hero {
        padding: .65rem .75rem 0;
    }
    .vt__frame {
        border-radius: 10px;
        padding: 10px;
        transform: none;
    }
    .vt__mark-line {
        font-size: clamp(2rem, 12vw, 3.5rem);
    }
    .vt__mark-sep { width: 28px; }
    .vt__mark-sub { font-size: .72rem; }
    .vt__hud { font-size: .55rem; }
    .vt__caption { font-size: .6rem; }
    .vt__cta { font-size: .72rem; }
    .vt__meta { flex-direction: row; align-items: center; }

    /* — SECTION HEAD ————————————————————————————
       Filter chips scroll horizontally. Sort below chips. */
    .section-head {
        padding: .9rem .85rem .5rem;
        flex-direction: column;
        align-items: stretch;
        gap: .75rem;
    }
    .section-title {
        font-size: 1.1rem;
        letter-spacing: -.02em;
    }
    .section-sub {
        font-size: .68rem;
        margin-top: .1rem;
    }

    .filters {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: .3rem;
        scroll-snap-type: x mandatory;
        padding-bottom: .15rem;
    }
    .chip {
        font-size: .7rem;
        padding: .32rem .65rem;
        white-space: nowrap;
        flex-shrink: 0;
        scroll-snap-align: start;
    }
    .chip span { font-size: .6rem; }

    .sort {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
    }
    .sort label { font-size: .68rem; }
    .sort select { font-size: .72rem; padding: .3rem .5rem; }

    /* — PROJECT GRID —————————————————————————————
       Single column, comfortable card spacing. */
    .grid {
        padding: 0 .85rem;
        gap: .7rem;
    }
    .proj {
        border-radius: 10px;
    }
    .proj__media {
        min-height: 160px;
    }
    .proj__body {
        padding: .7rem .85rem .75rem;
    }
    .proj__top {
        margin-bottom: .4rem;
    }
    .proj__cat { font-size: .62rem; letter-spacing: .03em; }
    .proj__year { font-size: .62rem; }
    .proj__title {
        font-size: 1rem;
        line-height: 1.2;
        margin-bottom: .3rem;
    }
    .proj__desc {
        font-size: .75rem;
        line-height: 1.5;
        -webkit-line-clamp: 2;
        margin-bottom: .6rem;
    }
    .proj__foot {
        padding-top: .55rem;
    }
    .tags { gap: .25rem; }
    .tag { font-size: .6rem; padding: .12rem .4rem; }
    .proj__arrow { width: 22px; height: 22px; }
    .proj__badge { font-size: .6rem; padding: .15rem .5rem; }
}
