/* ============================================================
   RESHUFFLE — Magazine flipbook for the Featured Work section
   Scroll-driven 3D page turn. Falls back to flat spreads on
   touch / narrow / reduced-motion.
   Pages are "art paper" spreads: cream stock, framed plates,
   per-project accent color, editorial type.
   ============================================================ */

.magazine {
    position: relative;
    background:
        radial-gradient(ellipse 90% 60% at 50% -10%, #241a12 0%, transparent 60%),
        linear-gradient(180deg, #0c0a08 0%, #110d09 50%, #0a0807 100%);
    --ink: #221a10;
    --paper-base: #f6f0e2;
}

/* fine film grain across the whole section */
.magazine::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Section intro */
.mag-intro {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 120px 24px 30px;
}
.mag-intro .section-label {
    display: inline-block;
    color: var(--orange);
    letter-spacing: 0.42em;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-left: 0.42em;
}
.mag-intro .section-label::before,
.mag-intro .section-label::after {
    content: "";
    display: inline-block;
    width: 26px;
    height: 1px;
    background: var(--orange);
    vertical-align: middle;
    margin: 0 14px;
    opacity: 0.6;
}
.mag-intro h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.4rem, 6.4vw, 5rem);
    line-height: 0.98;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fbf6ec;
}
.mag-intro h2 em {
    font-style: italic;
    color: var(--orange);
}
.mag-intro p {
    color: var(--gray-lighter);
    max-width: 540px;
    margin: 20px auto 0;
    font-size: 1.02rem;
    line-height: 1.65;
}

/* ---------- Pinned stage ---------- */
.mag-stage {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 2800px;
    perspective-origin: 50% 42%;
}

/* warm spotlight pooling behind the book */
.mag-stage::before {
    content: "";
    position: absolute;
    width: min(82vw, 1240px);
    height: min(90vh, 920px);
    background:
        radial-gradient(ellipse at 50% 40%, rgba(255, 122, 50, 0.28), transparent 62%),
        radial-gradient(ellipse at 50% 60%, rgba(255, 180, 90, 0.10), transparent 70%);
    filter: blur(50px);
    opacity: 0.85;
    pointer-events: none;
}

.mag-book {
    position: relative;
    width: min(70vw, 780px);
    height: min(82vh, 860px);
    transform-style: preserve-3d;
}

/* stacked page-edge thickness on the outer (right) side */
.mag-book::before,
.mag-book::after {
    content: "";
    position: absolute;
    top: 1.4%;
    right: -7px;
    width: 9px;
    height: 97.2%;
    border-radius: 0 8px 8px 0;
    background: repeating-linear-gradient(180deg, #efe7d8 0 2px, #d8cdb8 2px 4px);
    box-shadow: 3px 6px 18px rgba(0, 0, 0, 0.45);
    z-index: -1;
}
.mag-book::after { right: -13px; top: 2.4%; height: 95.2%; opacity: 0.7; }

/* ---------- A leaf (one project page) ---------- */
.mag-leaf {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform-origin: left center;
    will-change: transform;
    transition: transform 0.05s linear;
    border-radius: 3px 14px 14px 3px;
}

.leaf-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 3px 14px 14px 3px;
    overflow: hidden;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 40px 90px rgba(0, 0, 0, 0.6);
}

/* the spine-edge crease shading for depth */
.leaf-face::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 90px;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.05) 40%, transparent);
    pointer-events: none;
    z-index: 5;
}

.leaf-front { z-index: 2; }
.leaf-back {
    transform: rotateY(180deg);
    background:
        radial-gradient(circle at 70% 25%, rgba(255,255,255,0.08), transparent 55%),
        var(--accent, #14110c);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.leaf-back::after { left: auto; right: 0; transform: scaleX(-1); }

/* moving sheen while a page turns (set via JS opacity) */
.leaf-front .leaf-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 28%, rgba(255, 255, 255, 0.55) 50%, transparent 72%);
    opacity: 0;
    z-index: 6;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* back face artwork */
.back-art {
    text-align: center;
    opacity: 0.95;
}
.back-art .back-num {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(5rem, 13vw, 10rem);
    font-weight: 800;
    line-height: 1;
    opacity: 0.2;
    letter-spacing: -0.02em;
}
.back-art .back-name {
    letter-spacing: 0.5em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-top: 6px;
    opacity: 0.9;
    padding-left: 0.5em;
}

/* ============================================================
   PAGE BASE (front face)
   ============================================================ */
.page {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, #ebe1cd 0%, var(--paper-base) 15%, #f8f3e7 100%);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    padding: clamp(20px, 3vh, 38px) clamp(22px, 3vw, 46px);
    font-size: 14px;
    isolation: isolate;
}
/* paper tooth */
.page::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.5;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.045'/%3E%3C/svg%3E");
}

/* masthead + footer rules */
.page-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid currentColor;
    padding-bottom: 10px;
    color: var(--ink);
    position: relative;
}
.page-top::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -5px;
    height: 1px;
    background: currentColor;
    opacity: 0.35;
}
.page-kicker {
    letter-spacing: 0.26em;
    text-transform: uppercase;
    font-size: 0.62rem;
    font-weight: 800;
}
.page-kicker b { color: var(--accent); font-weight: 800; }
.page-folio {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 800;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    opacity: 0.85;
}
.page-bot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1.5px solid currentColor;
    padding-top: 10px;
    color: var(--ink);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.9;
}
.page-bot .accent { color: var(--accent); }

/* ============================================================
   PAPER-PAGE SYSTEM (.pp)
   Variants: .pp-hero (media / text) · .pp-flip (text / media)
             .pp-cols (side-by-side)
   ============================================================ */
.page.pp {
    gap: clamp(12px, 2vh, 20px);
}
.page.pp > * { position: relative; z-index: 3; }
.page.pp > .pp-ghost,
.page.pp > .pp-band { position: absolute; }

/* huge outlined ghost number, background art */
.pp-ghost {
    position: absolute;
    top: 7%;
    right: -1.5%;
    z-index: 1 !important;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 800;
    font-size: clamp(9rem, 34vh, 16rem);
    line-height: 0.8;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--accent);
    text-stroke: 1.5px var(--accent);
    opacity: 0.16;
    pointer-events: none;
    user-select: none;
}
.pp-ghost.bl { top: auto; right: auto; bottom: 8%; left: -1.5%; }

/* solid accent band behind the media (position tuned inline) */
.pp-band {
    position: absolute;
    left: -6%;
    right: -6%;
    height: 34%;
    top: 30%;
    background: var(--accent);
    z-index: 1 !important;
    pointer-events: none;
    opacity: 0.92;
}

/* --- text bundle --- */
.pp-lede {
    display: flex;
    align-items: flex-start;
    gap: clamp(18px, 2.4vw, 30px);
}
.pp-lede.stack { flex-direction: column; gap: 12px; }
.lede-l { flex: 0 0 auto; max-width: 46%; }
.pp-lede.stack .lede-l { max-width: none; }
.lede-r {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 6px;
}

.pp-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.1rem, 5.8vh, 3.5rem);
    line-height: 0.92;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.pp-title em { font-style: italic; color: var(--accent); }
.pp-chip {
    display: inline-block;
    margin-top: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 5px 10px;
}
.pp-blurb {
    font-size: clamp(0.84rem, 1.7vh, 0.98rem);
    line-height: 1.6;
    color: #3a332a;
    max-width: 58ch;
}
.pp-blurb .dropcap {
    float: left;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.2em;
    line-height: 0.68;
    font-weight: 800;
    padding: 5px 9px 0 0;
    color: var(--accent);
}
/* pull-quote flavor */
.pp-blurb.quote {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: clamp(0.98rem, 2vh, 1.18rem);
    line-height: 1.5;
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    color: #2e281f;
}

/* small stat chips row */
.pp-stats {
    display: flex;
    gap: clamp(14px, 2vw, 26px);
    margin-top: 2px;
}
.pp-stats span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-top: 2px solid var(--accent);
    padding-top: 6px;
    min-width: 78px;
}
.pp-stats b {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.06rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
}
.pp-stats i {
    font-style: normal;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6a6154;
}

/* --- link pills --- */
.page-links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}
.page-link {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border: 1.5px solid var(--accent);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--accent);
    background: transparent;
    transition: color 0.3s ease;
}
.page-link::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.1, 1);
    z-index: -1;
}
.page-link:hover { color: #fff; }
.page-link:hover::before { transform: scaleX(1); }
.page-link svg { width: 12px; height: 12px; transition: transform 0.3s; }
.page-link:hover svg { transform: translate(2px, -2px); }

/* --- media zone --- */
.pp-media {
    flex: 1;
    min-height: 0;
    display: grid;
    gap: clamp(10px, 1.4vh, 14px);
    align-content: center;
}
/* side-by-side pages */
.pp-cols {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 0.85fr 1.2fr;
    gap: clamp(16px, 2.4vw, 30px);
    align-items: stretch;
}
.pp-cols.media-left { grid-template-columns: 1.2fr 0.85fr; }
.pp-cols .pp-copy {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 13px;
    min-width: 0;
    padding-bottom: 4px;
}
.pp-cols .pp-media { flex: none; min-height: 0; }

/* ============================================================
   PLATES — framed artwork, native aspect ratios
   ============================================================ */
.plate {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    background: #fffdf8;
    padding: 6px;
    border: 1px solid rgba(34, 26, 16, 0.16);
    box-shadow:
        0 2px 5px rgba(30, 21, 10, 0.12),
        0 16px 34px rgba(30, 21, 10, 0.20);
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.4s;
}
a.plate { cursor: pointer; }
.plate[data-zoom] { cursor: zoom-in; }
.plate:hover {
    transform: translateY(-3px);
    box-shadow:
        0 4px 9px rgba(30, 21, 10, 0.14),
        0 24px 46px rgba(30, 21, 10, 0.26);
}
.plate.tilt-l { transform: rotate(-1.4deg); }
.plate.tilt-r { transform: rotate(1.2deg); }
.plate.tilt-l:hover { transform: rotate(-1.4deg) translateY(-3px); }
.plate.tilt-r:hover { transform: rotate(1.2deg) translateY(-3px); }

.plate .ph {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #e8e0cf;
}
.plate img,
.plate video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.plate:hover img,
.plate:hover video { transform: scale(1.045); }

/* aspect-locked plate variants (native media ratios) */
.ph.a169   { flex: none; aspect-ratio: 16 / 9; }
.ph.a43    { flex: none; aspect-ratio: 4 / 3; }
.ph.aport  { flex: none; aspect-ratio: 1044 / 1575; }
.ph.apress { flex: none; aspect-ratio: 1600 / 1213; }
.ph.astrip { flex: none; aspect-ratio: 1600 / 320; }

/* caption strip under the artwork */
.plate-cap {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 7px 3px 2px;
    font-size: 0.53rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6c6355;
    white-space: nowrap;
    overflow: hidden;
}
.plate-cap b { color: var(--accent); font-weight: 800; }

/* corner tag on a plate (over the artwork) */
.p-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 4;
    background: var(--accent);
    color: #fff;
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 9px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ---------- Browser-window plate for live-site shots ---------- */
.bf-link {
    position: relative;
    display: block;
    min-width: 0;
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bf-link:hover { transform: translateY(-3px); }
.bf-link.tilt-l { transform: rotate(-1.2deg); }
.bf-link.tilt-r { transform: rotate(1.1deg); }
.bf-link.tilt-l:hover { transform: rotate(-1.2deg) translateY(-3px); }
.bf-link.tilt-r:hover { transform: rotate(1.1deg) translateY(-3px); }
/* hero browser plates: cap width so the frame fits the page height */
.pp-media > .bf-link.solo {
    width: min(100%, 76vh);
    margin: 0 auto;
}

.browser-frame {
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
    box-shadow:
        0 2px 5px rgba(30, 21, 10, 0.14),
        0 18px 40px rgba(30, 21, 10, 0.24);
    border: 1px solid rgba(34, 26, 16, 0.14);
}
.bf-link:hover .browser-frame {
    box-shadow:
        0 4px 9px rgba(30, 21, 10, 0.15),
        0 26px 50px rgba(30, 21, 10, 0.3);
}
.bf-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(#f1ede5, #e7e1d6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.bf-bar i.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.bf-bar i.dot:nth-child(1) { background: #f1655b; }
.bf-bar i.dot:nth-child(2) { background: #f5bd4f; }
.bf-bar i.dot:nth-child(3) { background: #61c554; }
.bf-url {
    margin-left: 9px;
    flex: 1;
    background: #fff;
    border-radius: 6px;
    padding: 4px 11px;
    font-size: 0.58rem;
    letter-spacing: 0.02em;
    color: #6a6458;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bf-shot {
    position: relative;
    aspect-ratio: 2880 / 1428;
    overflow: hidden;
    background: #f4f1ea;
}
.bf-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.bf-link:hover .bf-shot img { transform: scale(1.04); }

/* hover "visit" cue */
.visit-cue {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 12, 10, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 10px 18px;
    border-radius: 100px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.35s, transform 0.35s;
    pointer-events: none;
    max-width: 92%;
}
.visit-cue svg { width: 13px; height: 13px; flex: 0 0 auto; }
.visit-cue.sm { font-size: 0.58rem; padding: 8px 14px; }
a.plate:hover .visit-cue,
.bf-link:hover .visit-cue {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ---------- per-page media grids ---------- */
/* August print collage */
.pp-media.m-aug {
    grid-template-columns: 0.62fr 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        "port press"
        "strip strip";
}
.m-aug .g-port  { grid-area: port; }
.m-aug .g-press { grid-area: press; }
.m-aug .g-strip { grid-area: strip; }
.m-aug .g-port .ph, .m-aug .g-press .ph { flex: 1; aspect-ratio: auto; }

/* Simba film stills — big frame + offset small frame */
.pp-media.m-film {
    grid-template-columns: 1fr 0.52fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        "v1 v1"
        "note v2";
    align-content: stretch;
}
.m-film .g-v1 { grid-area: v1; }
.m-film .g-v2 { grid-area: v2; margin-top: -9%; z-index: 4; }
.m-film .g-note {
    grid-area: note;
    align-self: end;
    padding: 4px 12px 8px 0;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #6c6355;
    line-height: 1.7;
}
.m-film .g-v1 .ph { flex: 1; aspect-ratio: auto; }

/* NextWave trio filmstrip */
.pp-media.m-trio {
    grid-template-columns: 1fr 1fr 1fr;
    align-content: center;
    align-items: start;
}
.m-trio .plate:nth-child(2) { transform: translateY(clamp(10px, 2.4vh, 22px)); }
.m-trio .plate:nth-child(2):hover { transform: translateY(clamp(7px, 2vh, 19px)); }

/* Khanak deck 2x2 */
.pp-media.m-2x2 {
    grid-template-columns: 1fr 1fr;
    align-content: center;
}

/* stacked browser frames (FOMO) */
.pp-media.m-stack2 {
    grid-template-rows: auto auto;
    align-content: center;
}

/* ============================================================
   COVER page
   ============================================================ */
.page.cover {
    background:
        radial-gradient(circle at 82% 14%, rgba(255, 107, 53, 0.28), transparent 46%),
        radial-gradient(circle at 12% 88%, rgba(255, 150, 70, 0.12), transparent 40%),
        #15110b;
    color: #f6f1e7;
    justify-content: space-between;
}
.page.cover::before { mix-blend-mode: screen; opacity: 0.4; }
.page.cover .page-top, .page.cover .page-bot { color: #f6f1e7; border-color: rgba(246,241,231,0.5); }
.page.cover .page-top::after { background: rgba(246,241,231,0.5); }
.cover-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cover-issue {
    letter-spacing: 0.5em; text-transform: uppercase;
    font-size: 0.72rem; color: var(--orange); font-weight: 700; margin-bottom: 20px;
    padding-left: 0.5em;
}
.cover-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(3.2rem, 13vh, 7.6rem);
    line-height: 0.86;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.cover-title em { font-style: italic; color: var(--orange); }
.cover-lede { margin-top: 24px; max-width: 80%; color: var(--gray-lighter); line-height: 1.65; font-size: 0.96rem; }
.cover-index {
    margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 32px; max-width: 92%;
}
.cover-index span {
    display: flex; justify-content: space-between; gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 7px 0; font-size: 0.74rem; color: var(--gray-lighter);
    transition: color 0.25s, border-color 0.25s;
}
.cover-index span:hover { color: #fff; border-color: var(--orange); }
.cover-index span b { color: #fff; font-weight: 600; }

/* ---------- HUD: progress + hint ---------- */
.mag-hud {
    position: absolute;
    left: 0; right: 0; bottom: 28px;
    z-index: 5;
    display: flex; flex-direction: column; align-items: center; gap: 15px;
    pointer-events: none;
}
.mag-progress {
    width: min(58vw, 440px); height: 3px;
    background: rgba(255, 255, 255, 0.14); border-radius: 3px; overflow: hidden;
}
.mag-progress span {
    display: block; height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--orange), #ffb066);
    box-shadow: 0 0 12px rgba(255, 122, 50, 0.6);
}
.mag-counter {
    font-size: 0.7rem; letter-spacing: 0.2em; color: var(--gray-lighter); text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    padding: 6px 16px;
    backdrop-filter: blur(6px);
}
.mag-counter b { color: #fff; }
.mag-hint {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.64rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gray-light);
    transition: opacity 0.4s;
}
.mag-hint svg { animation: magBounce 1.6s infinite; }
@keyframes magBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- Lightbox ---------- */
.mag-lightbox {
    position: fixed; inset: 0; z-index: 4000;
    background: rgba(8, 6, 4, 0.95);
    display: none; align-items: center; justify-content: center;
    padding: 4vh 4vw;
    cursor: zoom-out;
    opacity: 0; transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}
.mag-lightbox.open { display: flex; opacity: 1; }
.mag-lightbox img, .mag-lightbox video {
    max-width: 100%; max-height: 100%; border-radius: 6px;
    box-shadow: 0 30px 90px rgba(0,0,0,0.6);
}
.mag-lightbox .lb-close {
    position: absolute; top: 22px; right: 26px; color: #fff;
    font-size: 2rem; cursor: pointer; line-height: 1; opacity: 0.8;
}
.mag-lightbox .lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    color: #fff; font-size: 2.4rem; cursor: pointer; padding: 20px; opacity: 0.7; user-select: none;
}
.mag-lightbox .lb-prev { left: 10px; }
.mag-lightbox .lb-next { right: 10px; }
.mag-lightbox .lb-nav:hover, .mag-lightbox .lb-close:hover { opacity: 1; }

/* ============================================================
   FLAT FALLBACK (touch / narrow / reduced motion)
   Media grids collapse to a clean single-column stack; plates
   size from their native aspect ratios.
   ============================================================ */
.magazine.mag-flat { height: auto !important; }
.magazine.mag-flat .mag-stage {
    position: static; height: auto; display: block;
    perspective: none; overflow: visible; padding: 10px 16px 60px;
}
.magazine.mag-flat .mag-stage::before { display: none; }
.magazine.mag-flat .mag-book {
    width: 100%; max-width: 680px; height: auto; margin: 0 auto;
    display: flex; flex-direction: column; gap: 26px; transform: none !important;
}
.magazine.mag-flat .mag-book::before,
.magazine.mag-flat .mag-book::after { display: none; }
.magazine.mag-flat .mag-leaf {
    position: relative; inset: auto; transform: none !important;
    height: auto; aspect-ratio: auto; border-radius: 12px;
}
.magazine.mag-flat .leaf-back { display: none; }
.magazine.mag-flat .leaf-face {
    position: relative; box-shadow: 0 18px 50px rgba(0,0,0,0.5);
}
.magazine.mag-flat .page {
    position: relative; inset: auto; min-height: 520px;
}
.magazine.mag-flat .mag-hud { display: none; }

/* natural-flow media in flat mode */
.magazine.mag-flat .page.pp { min-height: 0; gap: 18px; }
.magazine.mag-flat .pp-media,
.magazine.mag-flat .pp-cols {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: none;
}
.magazine.mag-flat .pp-cols .pp-copy { order: 2; padding-top: 4px; }
.magazine.mag-flat .plate .ph { flex: none; }
.magazine.mag-flat .plate .ph:not([class*="a1"]):not(.a43):not(.aport):not(.apress):not(.astrip) {
    aspect-ratio: 16 / 9;
}
/* re-assert native ratios that book-mode grids override with stretch */
.magazine.mag-flat .ph.aport  { aspect-ratio: 1044 / 1575; }
.magazine.mag-flat .m-aug .g-port { width: min(100%, 400px); align-self: center; }
.magazine.mag-flat .ph.apress { aspect-ratio: 1600 / 1213; }
.magazine.mag-flat .m-film .g-v1 .ph { aspect-ratio: 16 / 9; }
.magazine.mag-flat .m-film .g-v2 { margin-top: 0; width: 100%; }
.magazine.mag-flat .m-film .g-note { display: none; }
.magazine.mag-flat .pp-media > .bf-link.solo { width: 100%; }
.magazine.mag-flat .m-trio .plate:nth-child(2) { transform: none; }
.magazine.mag-flat .pp-ghost { font-size: clamp(7rem, 26vw, 11rem); }
.magazine.mag-flat .pp-band { display: none; }
.magazine.mag-flat .plate.tilt-l,
.magazine.mag-flat .plate.tilt-r,
.magazine.mag-flat .bf-link.tilt-l,
.magazine.mag-flat .bf-link.tilt-r { transform: none; }

@media (max-width: 600px) {
    .magazine.mag-flat .page { padding: 18px; font-size: 13px; }
    .magazine.mag-flat .pp-lede { flex-direction: column; gap: 12px; }
    .magazine.mag-flat .lede-l { max-width: none; }
    .magazine.mag-flat .cover-index { grid-template-columns: 1fr; }
    .magazine.mag-flat .cover-lede { max-width: 100%; }
    .pp-stats { flex-wrap: wrap; }
}
