@charset "UTF-8";
/* Dystopamine Dream: styles for index.html */

:root {
    --bg: #030303;
    --text-main: #f0f0f0;
    --accent-cyan: #00ffff;
    --font-display: 'Poppins', sans-serif;
    --font-body: 'Poppins', sans-serif;
}

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

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Film Grain Overlay --- */
.noise {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.04;
}

/* overflow: clip, not hidden: hidden would make this the scroll container and stop the
   horizontal section's position: sticky from sticking to the screen */
#smooth-wrapper {
    position: relative;
    width: 100vw;
    overflow: clip;
}

#smooth-content {
    position: relative;
    width: 100%;
    background: var(--bg);
}

/* Tall wrapper for the horizontal section: js/script.js sets its height to one screen plus the
   scroll length of the hold, the sideways travel and the hold. z-index 11 keeps the section
   above the previous panel's content (z-index 10) while the soft landing slides it up over it. */
#horizontal-landing {
    position: relative;
    z-index: 11;
}

/* The horizontal panels. position: sticky keeps this one screen tall section glued to the top
   of the screen while the wrapper above scrolls past; will-change keeps it a stable layer
   for the soft landing's transform (js/script.js section 2.8). */
#horizontal-section {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    will-change: transform;
}

#horizontal-track {
    display: flex;
    flex-wrap: nowrap;
    width: max-content; /* Expands to fit panels 3-6 */
    height: 100vh;
    will-change: transform;
}

/* The Void zooms into The Epidemic. #void-zoom is a tall wrapper (js/script.js sets its height to
   one screen plus the zoom's scroll length) and #void-stage, one screen tall, stays stuck to the
   top inside it while the scroll plays the zoom (js/script.js section 2.9). Stacking, back to
   front: The Void (its eye canvas, the blue glow, then its title block), then The Epidemic. */
#void-zoom {
    position: relative;
}

#void-stage {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

#void-stage .slide-panel {
    position: absolute;
    top: 0;
    left: 0;
}

#panel-void {
    z-index: 1;
    /* The shadow along the top of The Void (below): how far down it reaches, and how strong it is (1 = as designed, about
       85% dark right at the edge; lower is lighter, 0 = none). */
    --void-shadow-height: clamp(140px, 28vh, 400px);
    --void-shadow-strength: 1;
}

/* A shadow along the top of The Void, as if the Hero above stood over it: darkest at the edge, fading out smoothly
   below it, which gives the eye some depth and softens the hard edge where it meets the Hero. It sits above the eye
   canvas (z-index 0) and the blue glow (1) and below the title block (10), so the eye is shaded but the words never
   are. It stays put while the eye zooms. The stops follow a smooth curve (0.92 x (1 - t) to the power 2.2) with many
   steps, because a straight-line fade on a dark picture shows up as faint bands. Even so, a fade over a smooth, very
   dark patch can show faint 1-level lines on a screen with good blacks, so the shadow carries a whisper of grain: the
   mask is fine noise (a small picture drawn by the browser, no file) that makes the shadow weaker by up to about 15
   per cent from pixel to pixel, which breaks those lines up (it is invisible at normal brightness: about half a grey
   level). Being part of the shadow's own transparency, it fades out with it, so it can leave no edge. A browser
   without mask support just shows the shadow without the grain. */
#panel-void::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--void-shadow-height);
    z-index: 2;
    pointer-events: none;
    opacity: var(--void-shadow-strength);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.67 0 0 0 0.515'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.67 0 0 0 0.515'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    -webkit-mask-size: 256px 256px;
    mask-size: 256px 256px;
    /* the visible shadow is 0.92 x (1 - t) to the power 2.2 (t = 0 at the top edge, 1 where it is gone); these stops are that
       curve divided by 0.85, the grain's average opacity, and capped at 1, so the shadow keeps the strength it was designed with */
    background: linear-gradient(to bottom,
        rgba(3, 3, 3, 1.000) 0%,
        rgba(3, 3, 3, 0.989) 4%,
        rgba(3, 3, 3, 0.901) 8%,
        rgba(3, 3, 3, 0.817) 12%,
        rgba(3, 3, 3, 0.738) 16%,
        rgba(3, 3, 3, 0.662) 20%,
        rgba(3, 3, 3, 0.575) 25%,
        rgba(3, 3, 3, 0.494) 30%,
        rgba(3, 3, 3, 0.405) 36%,
        rgba(3, 3, 3, 0.314) 43%,
        rgba(3, 3, 3, 0.236) 50%,
        rgba(3, 3, 3, 0.161) 58%,
        rgba(3, 3, 3, 0.094) 67%,
        rgba(3, 3, 3, 0.043) 77%,
        rgba(3, 3, 3, 0.010) 88%,
        rgba(3, 3, 3, 0) 100%);
}

/* The eye: photo, shading and particles. With the zoom on, js/script.js adds .void-scene-on to the
   stage, draws all of it into one canvas (.void-scene), and hides these layers, which then only
   serve as that canvas's source pictures. A canvas is a finished picture the graphics card just
   scales, so zooming it never makes the browser repaint a huge layer, which is what made scrolling
   back out glitch (missing patches, cropped title) on big screens. Without the zoom (reduced
   motion) these layers simply show as an ordinary panel background. */
.void-eye {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.void-scene-on .void-eye {
    display: none;
}

.void-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* The title's soft glow. Each line carries its own shadow, painted just before that line's text, so a
   line's shadow also falls over the bottom of the line above it (the slight white-to-grey shading on
   "THE" and "DIGITAL"). With the zoom on, the glow is instead a pre-drawn picture behind each line
   (.void-title-glow, made in js/script.js) painted in the same order, because a big blur is very costly
   for the browser to redraw while the title scales up. The pictures are drawn to match this shadow. */
.void-title span {
    display: block;
    position: relative;
    isolation: isolate;
    text-shadow: 0 0 80px rgba(26, 91, 114, 0.6), 0 2px 40px rgba(0, 0, 0, 0.95);
}

.void-scene-on .void-title span {
    text-shadow: none;
}

.void-title-glow {
    position: absolute;
    z-index: -1;
    pointer-events: none;
}

/* The copy block (title, tagline and button) zooms separately from the eye, because it sits much
   closer to the camera. */
.void-copy {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform, opacity;
}

/* The blue light at the far end of the pupil: a small canvas (made in js/script.js) that is scaled
   and faded. Sized and centred on the screen by the script. */
.void-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    will-change: transform, opacity;
}

/* The Epidemic panel itself is empty, see-through and click-through: only its content zooms out of
   the glow (js/script.js section 2.9), so nothing frames it. The content is three separate pieces,
   the text, the button and the baby, and each zooms on its own at its own depth. The pieces (not
   the empty box around them) take the pointer, so that box never covers The Void's button. */
#panel-epidemic {
    z-index: 3;
    pointer-events: none;
}

.epidemic-text,
.epidemic-action,
.epidemic-image {
    pointer-events: auto;
    will-change: transform, opacity;
}

/* Container for the normal (non-sticky) vertical scroll flow */
#vertical-top,
#vertical-section {
    position: relative;
    width: 100%;
    display: block; /* Normal stacking flow */
}

.slide-panel {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

/* Engineered Addiction and The Addiction Machine, the two middle panels of the sideways travel (the Machine joined
   it there on 2026-11-22), are each 50px wider on each side than the screen: more black between them and the two
   video panels at the ends of the travel (and between the two of them), a moment of calm while the neighbours slide
   past. The padding keeps their content exactly screen-wide and centred, so only the black grows. js/script.js adds
   the width of each one's pause and measures the real panel widths, so the travel, the triggers and the menu links
   follow. (The Addiction Machine's selector names the track, so this stylesheet leaves the machine alone in a page that
   still has it in the vertical section: a visitor can briefly get the new stylesheet with the old page while the files
   are being uploaded.) */
#panel-architecture,
#horizontal-track #panel-machine {
    width: calc(100vw + 100px);
    padding: 0 50px;
}

/* The Breaking Point: pure black instead of the page's --bg */
#panel-breaking {
    background: #000000;
}

.panel-bg {
    position: absolute;
    top: -40vh;
    left: -40vw;
    width: 180vw;
    height: 180vh;
    object-fit: cover;
    z-index: 0;
    opacity: 0.6;
    will-change: transform;
}

/* The other backgrounds are boxes 180% of the screen, so they have room to drift and zoom as the page scrolls
   (js/script.js section 2.5), which means only the middle of the picture shows. A background marked
   data-no-parallax (the hero's video) fills its panel exactly instead and is left alone by that script:
   the whole picture shows, uncropped, and does not zoom. */
.panel-bg[data-no-parallax] {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.overlay-dark {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(3,3,3,0.3) 0%, rgba(3,3,3,0.9) 100%);
    z-index: 1;
}

.panel-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1600px;
    padding: 0 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* The hero: the logo, a few lines about the film under it, then the Watch Trailer button. The description is
   Montserrat Regular, 12px on an 18px line, in a 35rem (560px) column that sits in the middle with its lines
   left-aligned. 560px gives the same six lines as the design picture (so does anything from 552 to 566px; a wider
   column pulls a word up and changes the breaks). The font is added to the Google Fonts link in index.html.
   Spacing: the logo's own margin is the gap above the text (0.8rem) and the button has its own 2rem above it;
   --hero-gap is the extra room added to BOTH gaps (30px since 2026-11-22: one number moves the logo, the text and
   the button apart or together). */
#panel-hero { --hero-gap: 30px; }

.hero-logo {
    width: 100%;
    max-width: 300px;
    margin: 0 0 calc(0.8rem + var(--hero-gap));
    font-size: 1rem;
    line-height: 0;
}

.hero-copy {
    width: 100%;
    max-width: 35rem;
    font-family: 'Montserrat', var(--font-body);
    font-weight: 400;
    font-size: 0.75rem;
    line-height: 1.5;
    text-align: left;
    color: #fff;
    margin-bottom: var(--hero-gap);   /* added to the button's own 2rem above it */
}

/* A screen with little height (a phone held sideways): a smaller logo and a smaller --hero-gap (10px) keep the logo, the
   text and the button on it; on the shortest ones (568 x 320) there is no room for any extra gap */
@media (max-height: 430px) {
    #panel-hero { --hero-gap: 10px; }
    .hero-logo { max-width: 220px; }
}
@media (max-height: 340px) {
    #panel-hero { --hero-gap: 0px; }
}

/* The smallest phones held upright (320 x 568): the text takes 12 lines there, so there is no room for the extra gap,
   and the taller group would run up into the menu icon beside the logo */
@media (max-width: 340px) and (max-height: 600px) {
    #panel-hero { --hero-gap: 0px; }
}

.split-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
    text-align: left;
}

.split-content.reverse {
    grid-template-columns: 1fr 1fr;
    direction: rtl;
}

.split-content.reverse > * {
    direction: ltr;
}

.img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: 4px;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.18);
    will-change: transform;
}

/* Add .img-contain to an .img-wrapper to show its image whole: no cover-crop,
   no zoom, and sized to the panel's height as well as the column's width. */
.img-wrapper.img-contain {
    aspect-ratio: auto;
    overflow: visible;
}

.img-wrapper.img-contain img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    margin: 0 auto;
    object-fit: contain;
    transform: none;
}

/* The Breaking Point image is trimmed to 544 of its original 900px width (the empty black
   sides), so on desktop it is shown at 60.44% of the column: the same size the woman had
   before the trim. The phone rules below let her use the free height instead. */
#panel-breaking .img-wrapper.img-contain img {
    width: 60.44%;
}

h1, h2, h3 {
    font-family: var(--font-display);
    text-transform: uppercase;
    line-height: 1.1;
}

.title-huge {
    font-size: clamp(3rem, 6vw, 8rem);
    font-weight: 700;
    color: white;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

/* Title words that slide in on scroll (The Attention Collapse, js/script.js section 2.7) */
.slide-word {
    display: inline-block;
    will-change: transform;
}

.subtitle {
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
    color: var(--accent-cyan);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    display: block;
}

p {
    font-size: clamp(0.65rem, 1.0vw, 1.0rem);
    line-height: 1.4;
    color: #cccccc;
    max-width: 600px;
}

.text-centered {
    margin: 0 auto;
    text-align: center;
    max-width: 700px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.8);
    color: #fff;
}

/* --- The Grand Illusion: human + robot hands (animated by GSAP, js/script.js section 2.6) ---
   Both PNGs share one px -> vw scale (--hand-s). Each hand is placed by its
   fingertip pixel (human 2541,419 / robot 63,421) so the tips meet exactly at
   --tip-x / --tip-y when the animation is at rest. */
.illusion-hands {
    --hand-w: 51.5vw;
    --hand-s: calc(var(--hand-w) / 2616);
    --tip-x: 50%;
    --tip-y: 33%;
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

.illusion-hand {
    position: absolute;
    will-change: transform;
}

.illusion-hand img {
    display: block;
    width: 100%;
    height: auto;
    will-change: transform;
}

.hand-human {
    width: calc(var(--hand-s) * 2616);
    left: calc(var(--tip-x) - var(--hand-s) * 2541);
    top: calc(var(--tip-y) - var(--hand-s) * 419);
}

.hand-robot {
    width: calc(var(--hand-s) * 2594);
    left: calc(var(--tip-x) - var(--hand-s) * 63);
    top: calc(var(--tip-y) - var(--hand-s) * 421);
    z-index: 1;
}

.btn {
    /* One number sizes every button: 1 is the size they had until 2026-11-20, 0.6667 is a third smaller. The label,
       the play triangle and the padding shrink together; the 1px outline stays 1px. The two padding values are the
       full-size ones (a phone's version is set in the media query further down). */
    --btn-scale: 0.6667;
    --btn-pad-y: 1.2rem;
    --btn-pad-x: 3rem;
    display: inline-block;
    margin-top: 2rem;
    padding: calc(var(--btn-pad-y) * var(--btn-scale)) calc(var(--btn-pad-x) * var(--btn-scale));
    font-size: calc(1em * var(--btn-scale));   /* a link (the footer's Contact) shrinks from the text around it */
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: white;
    text-decoration: none;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
    transition: color 0.3s, border-color 0.3s;
    cursor: pointer;
    z-index: 100;
    will-change: transform;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}

/* A real <button> starts from the browser's own 13.33px (a link has no such size), so it shrinks from that */
button.btn { font-size: calc(13.3333px * var(--btn-scale)); }

.btn:hover { color: black; border-color: white; }
.btn:hover::before { transform: scaleX(1); transform-origin: left; }

/* The play triangle in the video buttons is drawn here instead of typed as a character: phones swap a typed
   triangle for their own blue emoji play button. This one is the size and place the typed triangle had on a
   computer (0.73em wide, 0.84em tall, an equilateral triangle, 0.54em from the words). It takes the text
   colour, so it turns black with the label when the button is hovered. (It is cut out of a box with clip-path;
   a triangle made of borders gets its edges rounded down to whole pixels and comes out smaller.) */
.play-icon {
    display: inline-block;
    width: 0.727em; height: 0.84em;
    background: currentColor;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    margin: 0 0.54em 0 0.08em;
    vertical-align: -0.02em;
    forced-color-adjust: none;   /* so it stays visible in a high-contrast mode, where backgrounds are replaced */
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox-overlay.active { opacity: 1; pointer-events: auto; }
.lightbox-content {
    /* 90% of the screen up to 1100px, but never taller than the screen leaves room for (the close button sits 50px above) */
    width: min(90%, 1100px, calc((100vh - 110px) * 16 / 9)); aspect-ratio: 16 / 9;
    position: relative; transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox-overlay.active .lightbox-content { transform: scale(1); }

.lightbox-close {
    position: absolute; top: -50px; right: 0;
    background: none; border: none; color: white;
    font-size: 2.5rem; line-height: 1; font-family: var(--font-display);
    cursor: pointer; opacity: 0.6; transition: opacity 0.3s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-content video {
    width: 100%; height: 100%;
    background: #000; box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    outline: none;
}

/* The Fit button is only for phones held upright (the block below); everywhere else it is not shown */
.lightbox-fit {
    display: none; position: absolute; z-index: 2;
    background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.35); color: #fff;
    font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
    cursor: pointer;
}
@media (hover: hover) { .lightbox-fit:hover { background: #fff; color: #000; } }

/* Phones held sideways, and any window too short for the 16:9 box with the close button above it: the box takes the
   whole height of the screen, the whole picture shows, and the close button moves inside its top right corner. */
@media (orientation: landscape) and (max-height: 520px) {
    .lightbox-content { width: auto; height: 100%; max-width: 100%; }
    .lightbox-content video { box-shadow: none; }
    .lightbox-close { top: 0.25rem; right: 0.25rem; z-index: 2; opacity: 0.85; text-shadow: 0 0 10px rgba(0,0,0,0.7); }
    /* the menu icon would sit on the picture's corner next to the close button */
    .hamburger-btn { transition: opacity 0.3s; }
    body.lightbox-open .hamburger-btn { opacity: 0; pointer-events: none; }
}

/* Phones held upright (up to 767px wide): the video lightbox fills the whole screen and the picture is cropped to fit,
   centred, instead of sitting letterboxed in a small 16:9 box. The Fit button (shown only here) switches to the whole
   picture: the lightbox then has the class is-fit, and the button says Fill. js/script.js section 4 also plays the
   film's phone cut here when there is one (a file named like the film with _mobile before the extension). */
@media (max-width: 767px) and (orientation: portrait) {
    .lightbox-overlay { height: 100vh; height: 100dvh; background: #000; backdrop-filter: none; }
    .lightbox-content,
    .lightbox-overlay.active .lightbox-content { width: 100%; max-width: none; height: 100%; aspect-ratio: auto; transform: none; }
    /* a soft dark band along the top keeps the two buttons readable over a bright picture */
    .lightbox-content::before {
        content: ''; position: absolute; top: 0; left: 0; right: 0; z-index: 1; pointer-events: none;
        height: calc(env(safe-area-inset-top, 0px) + 5.5rem);
        background: linear-gradient(180deg, rgba(0,0,0,0.7), rgba(0,0,0,0));
    }
    .lightbox-content video { object-fit: cover; box-shadow: none; }
    .lightbox-overlay.is-fit .lightbox-content video { object-fit: contain; }
    .lightbox-close {
        top: calc(env(safe-area-inset-top, 0px) + 0.4rem); right: calc(env(safe-area-inset-right, 0px) + 0.4rem); z-index: 2;
        width: 48px; height: 48px; padding: 0; display: flex; align-items: center; justify-content: center;
        opacity: 0.9; text-shadow: 0 0 10px rgba(0,0,0,0.7);
    }
    .lightbox-fit {
        display: block; min-height: 44px; padding: 0 1.1rem;
        top: calc(env(safe-area-inset-top, 0px) + 0.5rem); left: calc(env(safe-area-inset-left, 0px) + 1rem);
    }
    /* the menu icon would sit on top of the close button */
    .hamburger-btn { transition: opacity 0.3s; }
    body.lightbox-open .hamburger-btn { opacity: 0; pointer-events: none; }
}

.hamburger-btn {
    position: fixed; top: 2.5rem; right: 5vw;
    z-index: 10001; background: transparent; border: none;
    cursor: pointer; display: flex; flex-direction: column; gap: 6px; padding: 10px;
    mix-blend-mode: difference;
}
.hamburger-btn .bar {
    width: 35px; height: 2px; background-color: #fff;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.hamburger-btn.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-btn.active .bar:nth-child(2) { opacity: 0; transform: translateX(20px); }
.hamburger-btn.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.menu-overlay {
    position: fixed; inset: 0;
    background: rgba(3, 3, 3, 0.98); backdrop-filter: blur(15px);
    z-index: 10000; display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
.menu-overlay.active { opacity: 1; pointer-events: auto; }
.menu-nav ul { list-style: none; text-align: center; }
.menu-nav li { margin: 1.5rem 0; overflow: hidden; }

.menu-link {
    font-family: var(--font-display);
    font-size: clamp(1rem, 3vw, 2rem);
    color: var(--text-main); text-decoration: none; text-transform: uppercase;
    font-weight: 500; letter-spacing: 0.05em; display: inline-block;
    transform: translateY(100%); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
}

.menu-overlay.active .menu-link { transform: translateY(0); }
.menu-overlay.active li:nth-child(1) .menu-link { transition-delay: 0.1s; }
.menu-overlay.active li:nth-child(2) .menu-link { transition-delay: 0.15s; }
.menu-overlay.active li:nth-child(3) .menu-link { transition-delay: 0.2s; }
.menu-overlay.active li:nth-child(4) .menu-link { transition-delay: 0.25s; }
.menu-overlay.active li:nth-child(5) .menu-link { transition-delay: 0.3s; }
.menu-overlay.active li:nth-child(6) .menu-link { transition-delay: 0.35s; }
.menu-overlay.active li:nth-child(7) .menu-link { transition-delay: 0.4s; }
.menu-overlay.active li:nth-child(8) .menu-link { transition-delay: 0.45s; }
.menu-overlay.active li:nth-child(9) .menu-link { transition-delay: 0.5s; }
.menu-overlay.active li:nth-child(10) .menu-link { transition-delay: 0.55s; }
.menu-link:hover { color: var(--accent-cyan); }

/* Ten links at full size (2rem type, 1.5rem between them) need about 745px of height. On a shorter screen (a laptop window under about
   760px tall, a phone held sideways) the space between the links shrinks first (never below 0.5rem), then the type, just enough to keep
   the whole list on the screen. On any screen where it already fits nothing changes. --menu-items is how many links the menu has
   (index.html): change it when one is added or removed. 1.6 is a link's height as a multiple of its type size (Poppins), and the
   list has one more gap than links (above the first and below the last); 2rem is the breathing room at the top and bottom. */
@supports (height: 100dvh) {
    .menu-nav {
        --menu-items: 10;
        --menu-size: min(clamp(1rem, 3vw, 2rem), max(0.7rem, (100dvh - 2rem - (var(--menu-items) + 1) * 0.5rem) / (var(--menu-items) * 1.6)));
        --menu-gap: clamp(0.5rem, (100dvh - 2rem - var(--menu-items) * 1.6 * var(--menu-size)) / (var(--menu-items) + 1), 1.5rem);
    }
    /* (the item gets the link's type size too: below 16px its own 16px line would otherwise be taller than the link) */
    .menu-nav li { margin: var(--menu-gap) 0; font-size: var(--menu-size); }
    .menu-link { font-size: var(--menu-size); }
}

/* Media Queries */
@media (max-width: 900px) {
    .split-content, .split-content.reverse {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .split-content.reverse > * {
        direction: ltr;
    }
    .split-content p { margin: 0 auto; }
    .img-wrapper { max-height: 40vh; }
    .img-wrapper.img-contain { max-height: none; }
    .img-wrapper.img-contain img { max-height: 40vh; }
    /* The Breaking Point's subject is tall and narrow, so on a phone it is limited by height:
       let it use the free height (the text above takes about 420px, margins included), never
       less than the standard 32vh and never more than 55vh. */
    #panel-breaking .img-wrapper.img-contain img { width: auto; max-height: clamp(32vh, calc(100vh - 420px), 55vh); }
    .split-content .btn { margin-top: 1.25rem; --btn-pad-y: 0.85rem; --btn-pad-x: 2rem; }   /* the full-size padding; --btn-scale shrinks it */
    .illusion-hands { --hand-w: 88vw; --tip-y: 27%; }
}

/* Short phones (iPhone SE and similar): text, button and image all stack in one screen */
@media (max-width: 900px) and (max-height: 700px) {
    .img-wrapper.img-contain img { max-height: 32vh; }
    /* Engineered Addiction has a longer paragraph now (it names Noam Chomsky), so its picture gives up a little more
       height here: the block stays as tall as before and its heading stays clear of the menu icon */
    #panel-architecture .img-wrapper.img-contain img { max-height: 25vh; }
}

/* Reduced motion: no zoom. The Void and The Epidemic are plain stacked panels, as in the
   rest of the page (js/script.js leaves the stage alone, so #void-zoom keeps its natural height). */
@media (prefers-reduced-motion: reduce) {
    #void-stage {
        position: relative;
        height: auto;
        overflow: visible;
        background: none;
    }
    #void-stage .slide-panel { position: relative; }
}
