/* ================================================================
   PORTFOLIO (gramophonev2) — extracted from its inline <style> block,
   unmodified other than: selectors scoped under #portfolioRoot so
   class names shared with services (.section-intro, .section-outro,
   .section-label, .scroll-cue*) don't collide; html/body global resets
   dropped (services' own css/style.css already owns those); the
   keyframe renamed to avoid any future name clash.
   ================================================================ */

#portfolioRoot {
    /* ── Colours (swap these to retheme the entire page) ── */
    --c-bg:           #080808;
    --c-bg-light:     #0f0f0f;
    --c-text:         #f0ede8;
    --c-text-muted:   rgba(240, 237, 232, 0.42);
    --c-accent:       #c8a97a;
    --c-rule:         rgba(240, 237, 232, 0.10);

    /* ── Typography ──
       BrandonGrotesque is the only typeface used site-wide — self-hosted
       via css/fonts/fonts.css (linked in index.html <head>), full
       100–900 weight range + italics. All three variables point at it;
       kept separate (rather than collapsed into one) since call sites
       already differentiate "display" vs "body" usage by weight. */
    --f-display: 'BrandonGrotesque', sans-serif;
    --f-body:    'BrandonGrotesque', sans-serif;
    --f-brandon: 'BrandonGrotesque', sans-serif;

    font-family: var(--f-body);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================================
   SHARED UTILITIES
   ================================================================ */
#portfolioRoot .section-label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    margin-bottom: 28px;
}


/* ================================================================
   SECTION 2 — GALLERY (pinned by ScrollTrigger)
   ================================================================ */
#portfolioRoot .gallery-section {
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: var(--c-bg);
    /* The gallery's pin can now engage while services' own pinned
       section is still finishing up (see js/transition.js) — sit
       above it during that brief overlap, and above the shard-0
       clone's settle (z-index 9999) only once that's gone. */
    z-index: 500;
}

/* Full-viewport stage */
#portfolioRoot .gallery-viewport {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Edge vignettes — fade images smoothly into the page bg */
#portfolioRoot .gallery-viewport::before,
#portfolioRoot .gallery-viewport::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 10vw;
    z-index: 10;
    pointer-events: none;
}

#portfolioRoot .gallery-viewport::before {
    left:  0;
    background: linear-gradient(to right, var(--c-bg) 0%, transparent 100%);
}

#portfolioRoot .gallery-viewport::after {
    right: 0;
    background: linear-gradient(to left,  var(--c-bg) 0%, transparent 100%);
}

/* Mount point for the WebGL canvas — cards, lighting and the
   glass shards are now rendered by Three.js, not the DOM. */
#portfolioRoot .gallery-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
}

#portfolioRoot .gallery-canvas {
    position: absolute;
    inset: 0;
    display: block;
}

/* ── Gallery HUD ──────────────────────────────────────────── */

/* Counter + progress bar at the bottom */
#portfolioRoot .gallery-hud {
    position: absolute;
    bottom: 8vh;
    /* Centred via left:0/right:0 + auto margins, not transform:
       translateX(-50%) — js/transition.js's reveal animation tweens
       `scale` on this element, and GSAP's transform system fully owns
       `transform` once it touches any part of it, silently dropping
       any translateX() set in the stylesheet. Auto-margin centering
       is immune to that since it isn't a transform. */
    left: 0;
    right: 0;
    width: fit-content;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 20;
}

#portfolioRoot .gallery-counter {
    font-family: var(--f-brandon);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.22em;
    color: var(--c-text-muted);
    min-width: 56px;
    text-align: right;
}

#portfolioRoot .gallery-progress-track {
    width: 100px;
    height: 1px;
    background: var(--c-rule);
    position: relative;
    overflow: hidden;
}

#portfolioRoot .gallery-progress-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: rgba(240, 237, 232, 0.55);
    /* width is set inline by JS — no transition so it stays in sync with scrub */
}

#portfolioRoot .gallery-counter-total {
    min-width: 56px;
    text-align: left;
    font-family: var(--f-brandon);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.22em;
    color: rgba(240, 237, 232, 0.20);
}

/* Floating caption just above the HUD */
#portfolioRoot .gallery-caption {
    position: absolute;
    bottom: calc(8vh + 44px);
    /* left:0/right:0, not left:50%+translateX(-50%) — see the note on
       .gallery-hud above; same GSAP-clobbers-transform issue applies
       here (this element is also scale-tweened by revealGallery()). */
    left: 0;
    right: 0;
    z-index: 20;
    text-align: center;
    pointer-events: none;
    /* JS toggles opacity via GSAP */
}

#portfolioRoot .gallery-caption-text {
    font-family: var(--f-brandon);
    font-size: 14px;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--c-text-muted);
    white-space: nowrap;
}


/* ================================================================
   CARD INFO PANEL — opens on card click (see js/portfolio.js)
   ================================================================ */

/* Dims the 70% of the viewport the panel doesn't cover. Sits behind
   the (opaque) panel, so only that remaining area actually reads as
   shadowed. */
#portfolioRoot .gallery-info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 6, 0.6);
    opacity: 0;
    pointer-events: none;
    z-index: 900;
}
#portfolioRoot .gallery-info-overlay.is-open {
    pointer-events: auto;
    cursor: pointer;
}

#portfolioRoot .gallery-info-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 30vw;
    min-width: 360px;
    height: 100vh;
    z-index: 901;
    /* "Metallic white" — a soft brushed-steel gradient rather than a
       flat white fill. */
    background:
        linear-gradient(115deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 30%),
        linear-gradient(135deg, #f6f7f9 0%, #e6e9ed 26%, #ffffff 48%, #dde1e6 72%, #f3f4f6 100%);
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    color: #14161a;
    overflow-y: auto;
}
#portfolioRoot .gallery-info-panel.is-open {
    pointer-events: auto;
}

#portfolioRoot .gallery-info-content {
    padding: 5rem 3rem 3rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

#portfolioRoot .gallery-info-panel .section-label {
    color: rgba(20, 22, 26, 0.45);
    margin-bottom: 18px;
}

#portfolioRoot .gallery-info-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(20, 22, 26, 0.14);
    background: rgba(255, 255, 255, 0.55);
    color: #14161a;
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}
#portfolioRoot .gallery-info-close:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.06);
}

#portfolioRoot .gallery-info-title {
    font-family: var(--f-display);
    font-size: clamp(1.7rem, 2.3vw, 2.5rem);
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    color: #14161a;
}

#portfolioRoot .gallery-info-body {
    font-family: var(--f-body);
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(20, 22, 26, 0.66);
    flex: 1;
}

#portfolioRoot .gallery-info-cta {
    align-self: flex-start;
    margin-top: 2.5rem;
    padding: 0.95rem 2.3rem;
    background: #14161a;
    color: #f5f6f8;
    border: none;
    font-family: var(--f-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#portfolioRoot .gallery-info-cta:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    #portfolioRoot .gallery-info-panel {
        width: 88vw;
        min-width: 0;
    }
    #portfolioRoot .gallery-info-content {
        padding: 4.5rem 2rem 2.5rem;
    }
}
