﻿body {
}
:root {
    --bg: #000;
    --bg2: #141414;
    --ink: #e9f0ff;
    --muted: #aab8d8;
    --accent: #9ff6ec;
    --card: #0f1317;
    --ring: rgba(159,246,236,.35);
    --logoOpacity: 0.15;
    --max: 1200px;
    --radius: 18px;
    --shadow: 0 6px 30px rgba(0,0,0,.25);
    --borderClr: rgba(255,255,255,.06);
    --linkClr: var(--accent);
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f6f7f9;
        --bg2: #eef1f5;
        --ink: #0b1220;
        --muted: #5c6b7a;
        --accent: #12b5a6;
        --card: #ffffff;
        --ring: rgba(18,181,166,.25);
        --logoOpacity: 0.08;
        --borderClr: rgba(0,0,0,.06);
        --linkClr: #0a7f78;
        color-scheme: light;
    }
}

:root[data-theme="light"] {
    --bg: #f6f7f9;
    --bg2: #eef1f5;
    --ink: #0b1220;
    --muted: #5c6b7a;
    --accent: #12b5a6;
    --card: #ffffff;
    --ring: rgba(18,181,166,.25);
    --logoOpacity: 0.08;
    --borderClr: rgba(0,0,0,.06);
    --linkClr: #0a7f78;
    color-scheme: light;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
    color: var(--ink);
    font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial
}

a {
    color: var(--linkClr);
    text-decoration: none
}

    a:hover {
        text-decoration: underline
    }

.parallax-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    height: 520px;
    opacity: var(--logoOpacity);
    z-index: 0;
    pointer-events: none;
    background: url('/images/logo.png') center/contain no-repeat;
    filter: drop-shadow(0 8px 22px rgba(0,0,0,.25));
}

.wrap {
    position: relative;
    z-index: 2;
    max-width: var(--max);
    margin-inline: auto;
    padding: 24px
}
/* ---- Header: never grow taller ---- */
:root {
    --headerH: 68px; /* tweak if you want */
}

/* ===== Header: lock height + prevent wrapping ===== */
header.site {
    /* keep your existing flex layout */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    /* new: never wrap into a 2nd row */
    flex-wrap: nowrap;
    white-space: nowrap;
    /* new: cap the height so it never expands vertically */
    height: 64px; /* adjust if your design needs */
    max-height: 64px;
    overflow: hidden; /* if something tries to spill vertically, clip */
}

    /* Let nav be the “shrinkable” middle */
    header.site nav {
        min-width: 0;
        overflow: hidden; /* prevents nav from forcing layout wider */
        text-overflow: ellipsis;
        white-space: nowrap;
    }

        /* Make nav links stay on one line */
        header.site nav a {
            white-space: nowrap;
        }

    /* If we enter compact mode, hide nav only (keep logo + theme toggle) */
    header.site.compact nav {
        display: none !important;
    }

    /* Make sure brand doesn't force wrapping */
    header.site .brand {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

        /* Prevent "Pishah" from forcing a wrap if super tight */
        header.site .brand h1 {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }


/*header.site {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0
}*/

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

    .brand img {
        width: 48px;
        height: 48px;
        border-radius: 10px;
       /* box-shadow: var(--shadow)*/
    }

    .brand h1 {
        font-size: 18px;
        margin: 0
    }

nav a {
    margin-left: 16px;
    font-weight: 600
}

.themeToggle {
    border: 1px solid var(--borderClr);
    background: transparent;
    color: var(--ink);
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 20px;
    align-items: center;
    padding: 28px 0;
    min-height: 60vh
}

    .hero h2 {
        font-size: clamp(22px,5.5vw,36px);
        margin: 0 0 10px
    }

    .hero p {
        color: var(--muted);
        margin: 0 0 20px
    }

.cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.btn {
    background: var(--accent);
    color: #001122;
    border: 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow)
}

    .btn.ghost {
        background: transparent;
        color: var(--ink);
        border: 1px solid var(--ring)
    }

.card {
    background: var(--card);
    border: 1px solid var(--borderClr);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
}

    .card:hover {
        transform: scale(1.03);
        border-color: var(--accent);
        box-shadow: 0 8px 35px rgba(0,0,0,.35);
    }


.preview {
    aspect-ratio: 16/10;
    width: 100%;
    border-radius: var(--radius);
    background: linear-gradient(135deg,#103035,#0c1f25);
    display: block;
    overflow: hidden
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .preview {
        background: linear-gradient(135deg,#e9f6f6,#eaf2f7)
    }
}

.section {
    margin: 56px 0
}

    .section h3 {
        font-size: 28px;
        margin: 0 0 18px
    }

/* ===== Carousel styling ===== */
.carousel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center
}

.carBtn {
    border: 1px solid var(--borderClr);
    background: transparent;
    color: var(--ink);
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer
}

    .carBtn:focus {
        outline: 2px solid var(--ring);
        outline-offset: 2px
    }

/* the scroller */
.track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory; /* keep mandatory */
    scroll-padding-left: 12px; /* so the first card can sit with breathing room */
    padding: 4px 2px 12px;
}

    .track::-webkit-scrollbar {
        height: 8px
    }

    .track::-webkit-scrollbar-thumb {
        background: rgba(127,127,127,.3);
        border-radius: 999px
    }

/* each card */
.proj {
    flex: 0 0 clamp(260px,33vw,360px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

    .proj .thumb {
        display: block
    }

.thumbImg {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--borderClr);
    background: #0d172b;
    position: relative;
    z-index: 1
}

    .thumbImg.broken {
        object-fit: contain;
        background: #111826
    }

.meta {
    padding: 12px
}

    .meta h4 {
        margin: 0 0 4px;
        font-size: 18px
    }

    .meta p {
        margin: 0 10px 10px 0;
        color: var(--muted)
    }

.pill {
    display: inline-block;
    margin-right: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(100,210,255,.12);
    border: 1px solid var(--ring);
    font-weight: 600
}
/* Full-card overlay link when href is present */
.proj .cover {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    z-index: 2;
    text-indent: -9999px
}

    .proj .cover:focus {
        outline: 2px solid var(--ring);
        outline-offset: 2px
    }

.videoWrap {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--borderClr)
}

    .videoWrap iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0
    }

.vidNav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px
}

.filler {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted)
}

footer {
    opacity: .8;
    border-top: 1px solid var(--borderClr);
    padding: 18px 0;
    font-size: 14px
}
/* Mobile tweaks */
@media (max-width: 900px) {
    header.site {
        padding: 8px 0
    }

    .wrap {
        padding: 16px
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 20px 0;
        min-height: auto
    }

        .hero h2 {
            font-size: clamp(22px,6vw,30px)
        }

    #heroCard {
        order: -1
    }

    .preview {
        aspect-ratio: 4/3
    }
}

@media (max-width: 480px) {
    .cta .btn {
        padding: 10px 12px;
        font-weight: 700
    }
}
/* Ensure images inside preview scale nicely */
.preview img {
    display: block;
    width: 100%;
    height: auto
}
/* Ensure images inside preview scale nicely */
.preview img {
    display: block;
    width: 100%;
    height: auto
}
/* Hero card text spacing */
#heroCard h3 {
    margin: 10px 12px 4px;
    font-size: clamp(16px,4.5vw,20px)
}

#heroCard p {
    margin: 0 12px 12px;
    color: var(--muted)
}
/* --- HERO CARD ONLY (safe overrides) --- */
#heroCard {
    aspect-ratio: auto; /* let content define height */
    overflow: visible; /* don't clip the text */
    display: block;
}

    #heroCard img {
        display: block;
        width: 100%;
        height: auto;
        border-top-left-radius: var(--radius);
        border-top-right-radius: var(--radius);
    }

    #heroCard .meta {
        padding: 12px;
    }

        #heroCard .meta h3 {
            margin: 10px 0 4px;
            font-size: clamp(16px,4.5vw,20px)
        }

        #heroCard .meta p {
            margin: 0 0 12px;
            color: var(--muted)
        }

header.site {
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
    border-bottom: 1px solid var(--borderClr);
}

/* Active nav link style */
nav a.active {
    color: var(--accent);
    text-decoration: underline;
}
/* before (too global) */
/* .card { … } */

/* after (scoped to your horizontal scroller) */
.cards > .card {
    --card-w: clamp(260px, 85vw, 420px);
    flex: 0 0 var(--card-w);
    max-width: var(--card-w);
    margin: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

@media (min-width: 768px) {
    .cards {
        scroll-snap-type: x mandatory;
    }

        .cards > .card {
            --card-w: clamp(260px, 28vw, 360px);
        }
}

@media (min-width: 1200px) {
    .cards > .card {
        --card-w: 340px;
    }
}

section[id] {
    scroll-margin-top: 120px;
}
/* Prevent hover scaling inside the horizontal scroller (Edge loop fix) */
.track .card:hover {
    transform: none; /* stop size change = stop re-snap loop */
    border-color: var(--accent);
    box-shadow: 0 8px 35px rgba(0,0,0,.35);
}

/* Extra guard: isolate each item’s paint/layout so hover doesn’t bubble */
.proj {
    contain: layout paint;
}

/* Nice-to-have: reduce overscroll bounce that can retrigger snaps */
.track {
    overscroll-behavior-x: contain;
}
/* make sure the grid clips the middle column; prevents the track from overlapping buttons */
/*.carousel {
    overflow: visible;*/ /* allow buttons to breathe */
/*}

.watch-carousel,
.track {
    overflow: hidden;*/
/*}
*/
    /* allow the middle column to actually shrink instead of overflowing its grid cell */
    .carousel > * {
        min-width: 0;
    }

/* explicit stacking: buttons above the scrolling track */
.track {
    position: relative;
    z-index: 0;
}

.carBtn {
    position: relative;
    z-index: 3;
    isolation: isolate;
}

/* iOS: promote buttons to their own layer so taps win over the composited track */
.carBtn {
    -webkit-transform: translateZ(0);
    touch-action: manipulation;
}

.watch-section {
    margin: 2rem 0;
}


.watch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.watch-controls {
    display: flex;
    gap: 0.5rem;
}

.carousel-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--borderClr);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    box-shadow: var(--shadow);
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    z-index: 10;
}

.carousel-nav {
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    z-index: 10;
}


.watch-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 10px 16px 16px;
    scroll-padding-left: 16px;
    scroll-padding-right: 16px;
    scroll-snap-type: x mandatory;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}

    .watch-carousel::-webkit-scrollbar {
        height: 10px;
    }

    .watch-carousel::-webkit-scrollbar-thumb {
        border-radius: 999px;
    }

.watch-card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: block;
    unicode-bidi: isolate;
    contain: layout;
    --watch-w: clamp(175px, 22vw, 240px);
    flex: 0 0 var(--watch-w);
    max-width: var(--watch-w);
    cursor: pointer;
}

.poster-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
}

.poster {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 28px;
    background: var(--card);
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,0.22);
    --border-w: 5px;
    --border-color: #ff4b1f;
    --fill: 60%;
    --fade: 14%;
}


    .poster::before {
        content: "";
        position: absolute;
        inset: 0;
        padding: var(--border-w);
        border-radius: inherit;
        /* Gradient border paint (white -> color up to --fill, then fade out) */
        background: linear-gradient( to top, white 0%, var(--border-color) var(--fill), rgba(0,0,0,0) calc(var(--fill) + var(--fade)) );
        /* turn it into a BORDER (hole punched out in the middle) */
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
    }




    .poster img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.mood-badge,
.rating-badge,
.date-badge {
    position: absolute;
    z-index: 5;
}

.mood-badge {
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    border-radius: 18px 0 18px 0;
    background: var(--accent-color, #ff4b1f);
    display: grid;
    place-items: center;
    box-shadow: 0 16px 28px rgba(0,0,0,0.20);
}


    .mood-badge i {
        color: #fff;
        font-size: 30px;
        line-height: 1;
    }
    /* finished / default */
    .mood-badge.is-finished {
        background: var(--accent-color, #ff4b1f);
    }


    /* currently watching */
    .mood-badge.is-watching {
        background: var(--accent-color, #22c55e);
    }


    /* planned / paused (optional) */
    .mood-badge.is-planned {
        background: #6b7cff; /* calm blue */
    }

.date-badge {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    text-align: center;
    white-space: nowrap;
    padding: 7px;
    border-radius: 0 12px 0 12px;
    color: #fff;
    font-weight: 800;
    font-size: 12px;
   /* backdrop-filter: blur(6px);*/
}

.rating-badge {
    right: 0px;
    bottom: 0px;
    width: 54px;
    height: 54px;
    border-radius: 18px 0 23px 0;
    background: #fff;
    color: dimgrey;
    font-weight: 900;
    font-size: 22px;
    display: grid;
    place-items: center;
    box-shadow: 0 16px 28px rgba(0,0,0,0.20);
}
.poster-wrap.is-watching .rating-badge {
    display: none;
}



.watch-caption {
    margin-top: 10px;
    font-size: 14px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

/* Modal container */
.watch-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

    .watch-modal.is-open {
        display: block;
    }

.watch-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

/* Panel sized to viewport and safe areas */
.watch-modal__panel {
    position: absolute;
    left: 50%;
    top: calc(12px + var(--safe-top));
    transform: translateX(-50%);
    width: min(860px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom));
    border-radius: 20px;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--borderClr);
    box-shadow: 0 18px 60px rgba(0,0,0,0.35);
    /* KEY: allow content to scroll inside */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Close button stays reachable */
.watch-modal__close {
    position: absolute; /* inside panel, but panel is now correctly sized */
    top: 10px;
    right: 12px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--borderClr);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    display: grid;
    place-items: center;
    z-index: 3;
}
.btn:focus {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* Scroll area: THIS is what fixes the cutoff */
.watch-modal__content {
    padding: 18px;
    padding-top: 64px; /* leaves space for close button so it doesn't overlap text */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
}

/* Poster fits without forcing the modal too tall */
.watch-modal__poster {
    width: 100%;
    border-radius: 16px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: var(--bg2);
}

/* Phone portrait: single column + smaller poster */
@media (max-width: 720px) {
    .watch-modal__content {
        grid-template-columns: 1fr;
    }

    .watch-modal__poster {
        max-height: 45dvh; /* prevents poster from eating the whole screen */
    }
}
/* --- Watching carousel position indicator --- */
.watch-progress {
    height: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    overflow: hidden;
    margin-top: 10px;
}

.watch-progress__fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: rgba(159,246,236,0.9);
    transform-origin: left center;
}

/* Optional: subtle “active card” hint (super gentle) */
.watch-card.is-active .poster {
    box-shadow: 0 18px 44px rgba(0,0,0,0.28);
    outline: 1px solid rgba(159,246,236,0.35);
    outline-offset: 2px;
}
/* Anchor card indicator (the one the nav buttons land on) */
.watch-card.is-anchor .poster {
    outline: 2px solid rgba(159,246,236,0.55);
    outline-offset: 3px;
}

/* Tiny “page index” pill on the anchor card */
.watch-card .nav-index {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    display: none;
    z-index: 6;
}

.watch-card.is-anchor .nav-index {
    display: inline-block;
}




/* ===== Flickr-ish Justified Gallery ===== */
.flickr-gallery {
    --gap: 10px;
    --rowH: 360px; /* target row height */
    display: block;
}

.fg-row {
    display: flex;
    gap: var(--gap);
    margin-bottom: var(--gap);
}

.fg-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--borderClr);
    box-shadow: var(--shadow);
    flex: 0 0 auto;
}

    .fg-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transform: scale(1.01);
        transition: transform .25s ease, filter .25s ease, opacity .25s ease;
        opacity: 0;
    }

    .fg-item.is-loaded img {
        opacity: 1;
    }

    .fg-item:hover img {
        transform: scale(1.06);
    }

@media (max-width: 720px) {
    .flickr-gallery {
        --rowH: 140px;
        --gap: 8px;
    }

    .fg-item {
        border-radius: 14px;
    }
}
