/* Shared styles for dmark.berlin — used by every page (index.html,
   photography.php, theatre.php, confetti.html, about.html, links.html).
   Anything page-specific (contact-form fields, photo grid, lightbox,
   confetti's own controls) stays inline in that page's own <style> block;
   only what every page needs lives here, so a fix made once doesn't have
   to be repeated across every file. (This comment has gone stale before —
   worth checking again the next time a page is added or removed.) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Each page sets --bg before this file's rules apply (index.html keeps the
   original purple; photography.php uses the darker palette). */
html, body {
  width: 100%; height: 100%;
  background: var(--bg, #1A0A2E);
  color: #F0EEE8;
  font-family: 'DM Mono', monospace;
  /* Sep 17 2026: fixes a real-device-only bug -- theatre.php's h1 ("theatre",
     just one short word) was reported rendering enormous on an actual
     Android phone, far past what clamp(1.1rem,1.5vw,2.2rem) allows at any
     viewport. Couldn't reproduce it in this session's own testing (devtools-
     style mobile emulation, both against localhost and the live
     dmark.berlin URL directly -- both rendered the heading at its correct,
     small size). That mismatch itself is the signature of Chromium's mobile
     font-boosting/text-autosizer: a real-device heuristic that inflates
     short/narrow text blocks it judges "too small to read" -- sometimes by
     a large factor for a single short word -- and one devtools' own device
     emulation doesn't reliably trigger, which is exactly why local testing
     never caught it. text-size-adjust:100% is the standard way to opt every
     page out of that heuristic entirely, so the site's own clamp()-computed
     sizes are what actually renders, matching what testing already showed. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Overflow lives on html alone, not html+body both. When both explicitly
   set a non-visible overflow (as this used to), body becomes its own
   independent scrolling box instead of its overflow propagating up to
   become the real viewport scrollbar — the standard browser behavior, and
   what should happen here. That's not cosmetic: an element's own
   scrollbar paints in normal stacking order like any other content on the
   page, so a position:fixed child (the canvas) could render on top of it —
   the real viewport scrollbar never can be painted over by page content.
   Confirmed live: document.documentElement.scrollHeight only reflected the
   page's real content height once body's own overflow was cleared. */
html { overflow-x: hidden; overflow-y: auto; }

canvas { position: fixed; inset: 0; display: block; }

@media (prefers-reduced-motion: reduce) { canvas { display: none; } }

/* ── link / nav-item pills, shared by the homepage's social row and the
   hamburger menu's stacked links ── */
.links a, .links button, .nav-link {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  font-weight: 400;
  text-transform: lowercase;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s; /* both used by every pill
    in this family now (see the two hover/focus rules below) -- kept in
    one shared declaration rather than split across rules */
}

.links { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Pushed to the lowest opacity that still holds 4.5:1 against this page's
   background (computed, not eyeballed -- swept in 0.01 steps, same method
   as the original contrast pass). linkedin/instagram are white text on a
   dark page: turning them *down* only ever raises their contrast further
   (a more-transparent pill reveals more of the dark backdrop, which reads
   as MORE contrast against white, not less), so there is no accessibility
   floor pushing those two anywhere -- left at their original, already-
   comfortable value rather than pushed toward invisible for no reason. */
.link-linkedin  { background: #FF3D7F; color: #fff; opacity: 0.52; }
.link-github    { background: #FFD600; color: #0D0D0D; opacity: 0.54; }
.link-instagram { background: #B44FFF; color: #fff; opacity: 0.52; }
.links button   { background: #00C4B4; color: #0D0D0D; opacity: 0.68; }
/* Sep 2026: "Links" button added to index.html's own links row, pointing at
   the new links.html page. Colour reuses links.html's own h1 colour
   (orange, palette 5's first entry) rather than introducing a fifth hue to
   this row — the button that takes you to that page is coloured like that
   page's own accent. Black text (orange is too light for white-on-colour
   here), pushed toward the lowest opacity that still holds 4.5:1 against
   index.html's background, same method as the other three links above:
   computed minimum 0.632, 0.65 used for a small margin (4.70:1). */
.link-links     { background: #F7A909; color: #0D0D0D; opacity: 0.65; }
/* Sep 9 2026: same scale "lift" as .nav-link's own hover further down --
   user asked for the two pill families to match. Also added :focus-visible
   here to match .nav-link's pairing, which already had it -- these two
   rules were inconsistent with each other before this (hover-only here,
   hover+focus there), so bringing the effect over without also bringing
   the same trigger states would've just traded one inconsistency for
   another. */
.links a:hover, .links button:hover,
.links a:focus-visible, .links button:focus-visible { opacity: 1.0; transform: scale(1.05); }

/* ── hamburger nav, top-right, present on every page ── */
.nav-toggle {
  position: fixed;
  top: 5vh;
  right: 6vw;
  z-index: 20;
  width: 44px;  /* still >= the WCAG 2.5.8 (AA) 24px target-size floor, with
                   real room to spare -- this is the button's actual hit
                   area, not just the visible icon, so it stays a
                   comfortable click/tap target even as the icon shrinks */
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* Opacity lives on the group, not the individual bars -- see below for
     why. Non-text UI component (WCAG 1.4.11), so the floor is 3:1 against
     the background, not 4.5:1 like body text -- computed minimum is 0.37 on
     the lighter of this nav's two pages; 0.40 keeps a bit of real margin
     (3.40:1 / 3.42:1) rather than sitting on the exact line. */
  opacity: 0.40;
  transition: opacity 0.2s;
}

.nav-toggle:hover { opacity: 1; }

.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: #F0EEE8;
  /* No opacity here: the X is two of these bars rotated to cross, and two
     independently-translucent siblings compound where they overlap (same
     phenomenon as the canvas particles compounding brighter, just two
     shapes instead of hundreds) -- the crossing point visibly read as less
     transparent than the rest of each bar. Opacity on the *parent* instead
     renders both bars fully opaque relative to each other first (so the
     overlap is just solid-over-solid, no compounding), then flattens that
     whole group to one layer before applying the group's own opacity once
     -- standard behavior for `opacity < 1` on an element with children, not
     a hack. Contrast math above still holds either way: it was always
     about the rendered color at 0.40, not which element the rule sits on.
     Hover swapped to match, on .nav-toggle itself just above. */
  transition: transform 0.2s, background 0.2s;
}

/* 9px = bar height + gap (3px + 6px), the real distance between bar
   centers -- must move in lockstep with those two values, or the rotated
   bars land off-center from each other instead of forming a clean X. */
.nav-toggle.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.nav-panel {
  position: fixed;
  /* Tied directly to .nav-toggle's own 5vh, not a second independent vh
     guess: .nav-panel's 1.1rem padding (17.6px at the default 16px root)
     pushes its first pill down from the panel's own box-top, so matching
     box-tops (top:5vh on both) leaves the first *visible* pill ~17.6px
     lower than the toggle's visible top — subtracting that same padding
     here instead makes the first pill's top track the toggle's top at any
     viewport height, not just one. (Found live, mid-fix: a flat 3.3vh here
     landed close by coincidence at one particular viewport height tested,
     but drifts from the toggle's true top at other heights since 5vh and
     3.3vh don't scale together — calc() ties them properly instead of
     approximating one fixed height.) */
  top: calc(5vh - 14.6px);
  /* Panel extends left of the toggle instead of down from it, clearing it
     horizontally by the toggle's own width (44px) + 16px gap (the same
     gap that used to separate them vertically, reused here horizontally).
     Needs the *full* 44px, not less: at equal top+right the panel would
     overlap the toggle, and being later in the DOM at the same z-index,
     it'd render (invisibly, since the panel has no background) over part
     of the button — intercepting clicks on that sliver instead of passing
     them to the toggle underneath, i.e. failing to close the menu from
     clicks on the left portion of the X. (Found live, mid-fix: a +30px
     offset here undershot the needed +44px by 14px, reproducing exactly
     that click-interception gap over the X's left edge — confirmed via
     getBoundingClientRect, not assumed.) */
  right: calc(6vw + 60px);
  z-index: 20;
  /* No min-width: the 60px clearance above is measured from this box's own
     right edge, but a wider-than-content box doesn't get any *safer* for
     that -- it only pushes the box's *left* edge further out, while the
     150px pills (align-items:flex-start, so they hug the box's left edge)
     stay exactly where they were. A 200px min-width against a 167.6px
     natural content width (150px pill + 17.6px left padding) left 32.4px
     of dead invisible space between the visible pill and the box's own
     right edge -- on top of the real 16px clearance, not instead of it --
     which is what actually read as "a big gap" to the eye even though the
     functional toggle-clearance was correct the whole time. Dropping it
     lets the box shrink to its real content width, so the visible pill
     sits right up against the true 16px safety gap instead of ~48px of
     it being empty padding. (Measured live, not assumed: 48.4px pill-to-
     toggle before this change, 16px box-to-toggle both before and after --
     confirms it was genuinely the box being oversized, not the clearance
     itself being too generous.) */
  padding: 1.1rem;
  padding-right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* fixed-width pills below, not stretched to the panel */
  gap: 0.7rem;
}
/* No background here on purpose: with one, the pills sat on a near-opaque
   card instead of the canvas, so their own opacity read as solid instead of
   transparent — same visible bug the fix below addresses, one cause. */

.nav-panel[hidden] { display: none; }

/* same font-size/padding as .links a/button (shared rule above) — these are
   meant to look like the same kind of pill, just stacked instead of in a
   row. Fixed width (measured against "photography", the longest label,
   plus a little breathing room) and centered text so every item matches
   instead of sizing to its own label.
   Standardised Sep 9 2026, revised same day once the user clarified
   further: each of these links now carries a FIXED identity colour
   — the destination page's own first palette colour — and that colour is
   now the single source of truth, used identically everywhere the nav
   appears (index.html, photography.php, theatre.php all point at these
   same three rules; the per-page override blocks that used to recolor
   them for photography.php/theatre.php are gone, not just visually
   matching but the same CSS). Deliberately breaks the site's own
   palette-per-page rule (user's words: "breaking my rule, but still
   logical") — e.g. the theatre-link pill is pacific-blue even when shown
   on photography.php, which isn't in photography's four-colour set — in
   exchange for a link always looking the same regardless of which page's
   menu you opened it from, a legible color-coded map of the site rather
   than three colours that happened to differ page to page.
   Because each pill is now the same fixed colour on all three pages, its
   opacity/text-colour has to stay safe against all three pages' --bg at
   once (index #1A0A2E, photography #240B31, theatre #012934), not just
   its own "home" page — swept via script (nav_contrast2.php, scratchpad),
   same two floors as before (>=3:1 pill-vs-bg WCAG 1.4.11 non-text UI,
   >=4.5:1 text-vs-rendered-pill), taking the worst (most demanding) of
   the three pages for each floor, then the higher of the two floors,
   then whichever text colour lets that combined value land lowest. White
   text won all three again. Home and theatre's pill both landed with a
   couple points of margin added past their computed minimum (0.81->0.83,
   0.61->0.63), same treatment as the hamburger's 0.37->0.40.
   Photography's pill (deep-lilac) is the one real shortfall, disclosed
   rather than hidden: against theatre.php's near-black backdrop it never
   reaches the 3:1 pill-visibility floor at *any* opacity (2.71:1 is the
   ceiling, at full opacity) — deep-lilac and that background are just too
   close in luminance. Used opacity 1.00 anyway (the best available, and
   there's no reason to hold it back given the floor's unreachable either
   way) — the link's text stays perfectly legible regardless (white on
   deep-lilac is high-contrast on its own terms), it's specifically the
   *pill's* distinctness from theatre.php's backdrop that falls short of
   the usual bar, only on that one page.
   Widened Sep 2026 once about.html/links.html joined: the same shortfall
   now also applies against both of those pages' backgrounds (2.55:1 on
   about.html, 2.39:1 on links.html — both worse than theatre.php's own
   2.71:1, still at opacity 1.00, still the best available). Nothing new
   to fix here, just three pages sharing the one pre-existing, already-
   accepted limitation instead of one. */
.nav-link-home,
.nav-link-photography,
.nav-link-theatre,
.nav-link-confetti,
.nav-link-about { width: 150px; text-align: center; color: #FFFFFF; }
/* home's opacity is bespoke per hosting page (Sep 9 2026) -- same
   --bg-per-page pattern already used everywhere else, a CSS variable each
   page's own :root sets, with the current uniform value as the fallback
   for any page that doesn't (kept deliberately equal to the worst-case
   binding page's own bespoke value among the original three pages,
   theatre.php's 0.83, not a lower one -- the fallback exists so an unknown
   *future* page that forgets to set its own value stays safe by default
   rather than silently under-transparent for its actual background).
   photography/theatre/confetti's own opacity stayed a single fixed value
   on purpose, worst-case across all hosting pages: computed per-page for
   all four links before choosing (project memory has the full table) --
   only home moved enough to be worth the extra values to track, the
   others' own per-page numbers were within ~2-5 points of their shared
   fixed value, not a visible difference. Worth re-checking this same table
   whenever a new page joins, since a new background could change which
   link(s) cross that "worth it" line -- which is exactly what happened
   when about.html/links.html joined (Sep 2026): both pushed theatre and
   confetti under their fixed values' floors too (photography already had
   its own unrelated, unfixable shortfall -- see the note above), so those
   two now also take the same var()-with-fallback treatment as home,
   overridden only on the two pages that need it. The four already-shipped
   pages (index/photography/theatre/confetti.html) don't set these new
   variables, so nothing changes for them -- same fallback values as
   before. */
.nav-link-home         { background: #B44FFF; opacity: var(--nav-home-opacity, 0.83); } /* index's first colour */
.nav-link-photography { background: #79589F; opacity: 1.00; } /* photography's first colour — see shortfall note above */
.nav-link-theatre     { background: #02AEBA; opacity: var(--nav-theatre-opacity, 0.63); } /* theatre's first colour */
/* confetti.html added Sep 11 2026 -- picked #FF6D00 rather than reusing
   any existing link's colour on purpose: it needed its own identity, and
   every colour already in use here is some shade of purple or teal/blue
   (home, photography, theatre respectively) -- a warm orange reads as
   clearly a fourth thing, not a near-duplicate of home's own purple.
   Fixed (not bespoke-per-page like home) on the same reasoning as
   photography/theatre: computed per-page first, the spread across pages
   was only ~0.08 (0.60-0.68), not worth tracking four separate values
   for. Opacity computed the same worst-case-across-pages way as
   photography/theatre's own (0.68 -> 0.70 with margin) -- confetti.html's
   own --bg is identical to index.html's (#1A0A2E, not a new derived
   value -- see confetti.html's own :root comment for why), so it didn't
   add a fourth *distinct* background to re-check photography/theatre's
   own already-fixed opacity against, only a fourth page rendering an
   already-covered one. */
.nav-link-confetti    { background: #FF6D00; opacity: var(--nav-confetti-opacity, 0.70); }
/* about.html added Sep 2026. First tried tea-green (that page's own h1
   colour, same doubling-up as theatre.php's pacific-blue) -- passed every
   contrast check comfortably but the user didn't like the colour itself,
   swapped for amethyst-smoke instead (same page's palette, still black
   text -- tea-green wasn't the only option here, just the first one that
   passed). The "first colour" convention (dark-magenta, this palette's
   actual first entry) was tried before either and rejected: it only
   reaches 1.79:1 pill-vs-bg even at opacity 1.00 against this site's
   darkest backgrounds, a hard fail opacity alone can't fix (raising
   opacity on a dark pill over a dark bg can't manufacture contrast that
   isn't there in the base colour). teal (white text) was also tried and
   rejected: fails at 2.79:1 even before considering opacity.
   amethyst-smoke needs BLACK text, not this shared rule's white -- still
   the one nav pill on the site that isn't white-on-colour -- see the
   color override below. Checked against all six
   backgrounds (not just this page's own), since like every other pill
   here it appears in every page's nav panel: worst case (on links.html)
   is 3.65:1 pill-vs-bg / 5.10:1 text-vs-pill at opacity 0.90, both with
   real margin above their floors (passable range starts around 0.83).
   Fixed, not bespoke-per-page, on the same "not worth tracking per-page"
   logic as photography/theatre/confetti. */
.nav-link-about        { background: #9487BF; opacity: 0.90; color: #0D0D0D; }
/* Sep 9 2026: opacity alone stopped being a reliable hover cue once
   photography's pill got pushed to opacity:1 at rest (see the shortfall
   note above) -- hovering it was a real no-op, nothing left to animate
   *to*. Added a scale "lift" that works regardless of resting opacity, so
   all three links get consistent, visible feedback -- home/theatre keep
   their opacity brightening too (unaffected, still real for them), this
   just stops depending on there being opacity headroom to spend. Kept
   subtle (1.05, roughly a 7-8px growth on a 150x~35px pill) to fit the
   site's flat, un-decorated visual language -- nothing else here uses
   shadows or scale, so this is already the boldest motion cue on the page
   and doesn't need to be bigger to read as intentional. */
.nav-link:hover, .nav-link:focus-visible { opacity: 1.0; transform: scale(1.05); }
/* no opacity here: it would win over the per-item value above (an attribute
   selector outweighs a single class) and could undo the contrast it was
   tuned for — cursor is enough to mark the current page */
.nav-link[aria-current="page"] { cursor: default; }

/* ── main-content wrapper, shared by photography.php/theatre.php/
   confetti.html (not index.html, which uses its own fixed-position
   .content/.name/.tagline/.bio layout instead — a deliberately different
   structure, not a fourth copy of this one). Promoted here Sep 15 2026:
   was identical, byte-for-byte, duplicated in all three pages' own
   <style> blocks -- .page itself had zero differences to preserve, .page
   h1 differed only in color (that page's own text colour -- confetti
   uses this site's ivory #F0EEE8, photography/theatre use plain white,
   both per the palette-per-page rule's black/white-for-text allowance,
   see [[feedback-dmarkberlin-palette-rule]]), and .page .intro likewise
   only in color -- except margin-bottom, which confetti alone had at
   2rem against photography/theatre's shared 2.6rem, with no comment or
   reasoning anywhere explaining the difference. Treated as accidental
   drift, not a deliberate choice, and unified to 2.6rem here rather than
   preserved as a third per-page override -- confirmed there's nothing in
   confetti.html's own layout that depends on the tighter gap (.intro is
   the last child of .page there, so its margin-bottom only affects the
   block's own total height, nothing it could visually collide with). */
.page {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16vh 6vw 10vh;
}

/* clamp(1.1rem, 1.5vw, 2.2rem) is the site-wide text-size ceiling --
   nothing renders larger than this anywhere, on any page, including
   index.html's own .name (which uses the identical formula without
   sharing this rule, since it isn't a .page h1). color stays a per-page
   override -- see the block comment above. */
.page h1 {
  font-size: clamp(1.1rem, 1.5vw, 2.2rem);
  font-weight: 400;
  text-transform: lowercase;
  margin-bottom: 0.6rem;
}

/* Same clamp() as index.html's own .bio -- this is that element's
   equivalent on every other page. color stays a per-page override -- see
   the block comment above. */
.page .intro {
  font-size: clamp(1.1rem, 1.25vw, 2.2rem);
  line-height: 1.6;
  text-transform: lowercase;
  max-width: 520px;
  margin-bottom: 2.6rem;
}

/* ── grayscale-at-rest, full-colour-on-hover photo tint. Sep 2026, promoted
   from three separate page-local copies with identical values
   (photography.php/theatre.php's gallery thumbnails, about.html's single
   portrait) once a third copy made the duplication worth fixing. Apply to
   any position:relative-able wrapper around a plain <img> — this class
   supplies the tint mechanics only (grayscale/scale/tint-fade), not the
   wrapper's own box model, since that varies by use (photography.php's
   .photo-thumb is also a masonry-grid <button>; about.html's
   .about-photo-wrap is a plain flex-item <div>). Requires the hosting
   page to set --bg (the tint colour) — every page using this already
   does. mix-blend-mode: color takes hue+saturation from --bg and keeps
   the photo's own lightness/detail, which is what makes it read as a
   tint rather than a flat colour wash; the <img> is desaturated first
   (grayscale(1) at rest) since color blend-mode alone only partially
   overrides a strongly-coloured original below full opacity. ── */
.tint-hover {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.tint-hover img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(1);
  transition: transform 0.2s, filter 0.2s;
}

.tint-hover:hover img { transform: scale(1.04); filter: grayscale(0); }

.tint-hover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  mix-blend-mode: color;
  opacity: 0.75;
  transition: opacity 0.2s;
  pointer-events: none;
}

.tint-hover:hover::after { opacity: 0; }

/* ── modal shell, shared by the contact form and the photo lightbox ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 4, 20, 0.82);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

/* Sep 2026, promoted from an identical page-local copy in both
   photography.php and theatre.php (same value, same "keep the animated
   canvas visibly present behind the photo" reasoning in both). This ID is
   only ever used by those two pages' own lightbox, so centralising it
   here doesn't affect anything else — just avoids the third copy this
   would otherwise become if a future gallery page needs one too. */
#lightbox-overlay { background: rgba(0, 0, 0, 0.60); }

/* Same construction as .nav-toggle's own open state (two 24x3px bars,
   rotate +-45deg, opacity 0.40 -> 1 on hover/focus, 0.2s) — this used to be
   a text "&times;" glyph with its own different color-alpha treatment, and
   only got fixed to actually match the hamburger as a photography.php-only
   override, so the contact modal's close button on index.html never
   matched despite that being the whole point. Promoted here so both modals
   share one real implementation instead of one page having the fix and the
   other still carrying the thing it was meant to replace. */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.40;
  transition: opacity 0.2s;
}

.modal-close:hover, .modal-close:focus-visible { opacity: 1; }

.modal-close span {
  grid-area: 1 / 1;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: #F0EEE8;
}

.modal-close span:nth-child(1) { transform: rotate(45deg); }
.modal-close span:nth-child(2) { transform: rotate(-45deg); }

/* Sep 2026, promoted from four separate page-local copies (photography.php/
   theatre.php had it twice each, for .nav-toggle and .modal-close;
   about.html/links.html once each, .modal-close doesn't apply there since
   neither has one). Every page restricted to a four-colour-plus-black/white
   palette needs this shared ivory (#F0EEE8) flipped to pure white — ivory
   isn't in any restricted palette's allowed set. Opt-in via a class on
   <body> rather than always-on, since index.html/confetti.html deliberately
   keep the ivory default (they're exempt from the palette rule, see
   [[feedback-dmarkberlin-palette-rule]]). */
.palette-page .nav-toggle span,
.palette-page .modal-close span { background: #FFFFFF; }

/* ── photo gallery + lightbox, shared by photography.php/theatre.php and any
   future gallery page. Sep 2026: promoted wholesale, confirmed byte-for-byte
   identical between the two pages first (diffed the actual rules, not
   assumed) before moving -- the only real per-page differences anywhere in
   either page's gallery/lightbox styling were --bg, --nav-home-opacity and
   .page h1's colour, all of which stay page-local since they're genuinely
   page-specific. Pairs with assets/lightbox.js, which expects exactly this
   markup/these classes -- see that file's own comment for the full contract
   (and lightbox.js's own no-op guard: a page that includes the script but
   has no #lightbox-overlay/.photo-thumb elements is unaffected). ── */
.empty-state {
  font-size: 1.1rem;
  text-transform: lowercase; /* see .page .intro */
  color: rgba(255, 255, 255, 0.55);
}

/* Masonry via CSS multi-column, not a fixed-ratio grid: photos are a mix of
   landscape and portrait, and forcing every tile into one shape would either
   crop portraits hard (object-fit: cover) or float them in letterboxed dead
   space (object-fit: contain). Columns let each photo keep its own natural
   aspect ratio and just flow into place instead. */
.photo-grid {
  column-width: 260px;
  column-gap: 1rem;
}

/* Hides a gallery page's whole content block (h1, intro, grid — everything
   .page contains) while the lightbox is open, not just the grid. Hiding
   .page itself rather than listing its children individually, so nothing
   new added inside .page later needs a matching rule of its own to stay
   covered. .page already goes inert then (assets/lightbox.js's own
   openLightbox()/closeLightbox()), this just makes that also true visually,
   clearing the whole viewport for the now-more-visible animation behind the
   lightbox itself (see #lightbox-overlay's own comment above). The
   hamburger and its panel are siblings of .page, not descendants —
   unaffected by this rule (the hamburger is hidden separately while the
   lightbox is open, see the .nav-toggle rule by #lightbox-overlay.clean). */
.page.lightbox-open { display: none; }

/* Box model / masonry-tile mechanics only -- the grayscale/tint hover
   effect itself is the shared .tint-hover class (above), applied alongside
   this one in the markup. */
.photo-thumb {
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  break-inside: avoid;
  -webkit-column-break-inside: avoid; /* older Safari */
}

/* ── lightbox — reuses .modal-overlay / .modal-close chrome above, custom
   inner layout for an image + caption instead of a form. Behaviour (zoom,
   swipe, slideshow, full screen) lives in assets/lightbox.js. ── */
.lightbox {
  max-width: min(1100px, 90vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  min-height: 0;   /* the picture gives way when space runs short, never the caption */
  object-fit: contain;
  border-radius: 4px;
  display: block;
  transition: opacity 0.35s ease;   /* the slideshow's fade (.fading) */
}
.lightbox:focus { outline: none; }   /* focused on open (lightbox.js) so Space reaches the slideshow; it's not a control */
.lightbox img.fading { opacity: 0; }
.lightbox img.zoomable { cursor: zoom-in; }

.lightbox-caption {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  min-height: 1.4em;
  flex-shrink: 0;
}

.lightbox-filename {
  display: inline-block;
  margin-top: 0.3em;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.5);
}

/* "3 / 24" within the section: where you are, and the hint that there's more */
.lightbox-count {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: -0.5rem;
  flex-shrink: 0;
}
.lightbox-count[hidden] { display: none; }

/* Each arrow is two of the same bars the hamburger's X uses, pivoted at one
   edge instead of the center so they meet at a point instead of crossing
   through a middle -- half the X, not a lookalike. The vertex (the shared
   pivot point, not the open ends) is what determines which way a chevron
   reads as pointing -- "<" has its point on the LEFT with both arms opening
   toward the right, the same relationship an arrowhead has to the direction
   it's pointing -- so prev (should point left) pivots from the left, next
   from the right. */
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.40;
  transition: opacity 0.2s;
  z-index: 101;
}

.lightbox-nav:hover, .lightbox-nav:focus-visible { opacity: 1; }

.lightbox-nav span {
  grid-area: 1 / 1;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: #FFFFFF;
}

.lightbox-prev span:nth-child(1) { transform-origin: left center; transform: rotate(-45deg); }
.lightbox-prev span:nth-child(2) { transform-origin: left center; transform: rotate(45deg); }
.lightbox-next span:nth-child(1) { transform-origin: right center; transform: rotate(45deg); }
.lightbox-next span:nth-child(2) { transform-origin: right center; transform: rotate(-45deg); }

.lightbox-prev { left: 2vw; }
.lightbox-next { right: 2vw; }
.lightbox-nav[hidden] { display: none; }

/* The toolbar lightbox.js adds, top-left (the top-right corner has the close
   cross and, faintly behind the overlay, the menu button): zoom (a magnifying
   glass, "+" in the lens / "-" while zoomed), play/pause, full screen,
   download and copy link (archive pictures only), hide controls.
   Same look as the close cross: ivory, white on palette pages, faint until
   hovered or focused. */
.lightbox-tools {
  position: absolute;
  top: 1rem;
  left: 1.2rem;
  display: flex;
  gap: 4px;
  z-index: 102;
}
#lightbox-overlay .modal-close { z-index: 102; }   /* both stay above a zoomed picture */
.lightbox-tool {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #F0EEE8;
  opacity: 0.40;
  transition: opacity 0.2s;
}
.palette-page .lightbox-tool { color: #FFFFFF; }
.lightbox-tool:hover, .lightbox-tool:focus-visible { opacity: 1; }
.lightbox-tool[hidden] { display: none; }
.lightbox-tool svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lightbox-play svg { fill: currentColor; stroke: none; }
/* each button's two states: lightbox.js sets .zoomed / .playing / .fs on the overlay */
#lightbox-overlay.zoomed .lightbox-zoom .plus,
.lightbox-play .pause,
#lightbox-overlay.playing .lightbox-play .play,
.lightbox-fs .exit,
#lightbox-overlay.fs .lightbox-fs .enter { display: none; }
#lightbox-overlay.playing .lightbox-play .pause,
#lightbox-overlay.fs .lightbox-fs .exit { display: inline; }
#lightbox-overlay.playing .lightbox-play { opacity: 0.85; }   /* while playing: easy to find, to pause */
.lightbox-hide { display: none; }
#lightbox-overlay.playing .lightbox-hide { display: grid; }   /* "hide controls" only while the slideshow plays */

/* Controls hidden (H, during the slideshow): only the picture, and no pointer;
   a click/tap, H or Esc brings everything back (lightbox.js). */
#lightbox-overlay.clean { cursor: none; }
#lightbox-overlay.clean .lightbox-tools,
#lightbox-overlay.clean .modal-close,
#lightbox-overlay.clean .lightbox-nav,
#lightbox-overlay.clean .lightbox-caption,
#lightbox-overlay.clean .lightbox-count { visibility: hidden; }
#lightbox-overlay.clean .lightbox img { cursor: none; }
/* the page's menu button, which shows through the overlay: hidden whenever the
   photo viewer is open (Nov 2026), not just with the controls hidden -- next
   to the viewer's own close button it read as a second, clashing control, and
   lightbox.js makes it inert while the viewer is open anyway */
body:has(#lightbox-overlay.open) .nav-toggle { visibility: hidden; }
/* ...and the picture as large as the screen allows: the full height or the
   full width, whichever it reaches first -- never stretched, never cropped
   (a small picture is scaled up, so it may look soft). */
#lightbox-overlay.clean .lightbox {
  position: fixed;
  inset: 0;
  max-width: none;
  max-height: none;
  display: block;
}
#lightbox-overlay.clean .lightbox img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
}
#lightbox-overlay.clean .lightbox-caption,
#lightbox-overlay.clean .lightbox-count { display: none; }

/* an album link (#set-design/set-build) lands with a little room above its heading */
.archive-section, .archive-group { scroll-margin-top: 1.5rem; }

/* "Link copied" (lightbox.js), just under the toolbar */
.lightbox-toast {
  position: absolute;
  top: 4.2rem;
  left: 1.6rem;
  z-index: 102;
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #F0EEE8;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.lightbox-toast.show { opacity: 1; }

/* Zoomed: .lightbox becomes a full-screen scroll box and the picture shows at
   its real size -- dragged with a mouse, or panned natively on a touch screen. */
#lightbox-overlay.zoomed .lightbox {
  position: fixed;
  inset: 0;
  max-width: none;
  max-height: none;
  overflow: auto;
  display: block;
  padding: 4.5rem 2vw 2vw;
  outline: none;
  overscroll-behavior: contain;
}
#lightbox-overlay.zoomed .lightbox img {
  max-width: none;
  max-height: none;
  margin: 0 auto;
  cursor: grab;
  touch-action: pan-x pan-y pinch-zoom;
  user-select: none;
}
#lightbox-overlay.zoomed .lightbox img:active { cursor: grabbing; }
#lightbox-overlay.zoomed .lightbox-caption,
#lightbox-overlay.zoomed .lightbox-count,
#lightbox-overlay.zoomed .lightbox-nav { display: none; }

/* Full screen: plain black, and the picture may use more of the height. */
#lightbox-overlay.fs { background: #000000; }
#lightbox-overlay.fs .lightbox { max-height: 94vh; }
#lightbox-overlay.fs .lightbox img { max-height: 86vh; }

/* Touch screens: no arrows -- the phone convention (Photos, Google Photos,
   PhotoSwipe) is to swipe, which lightbox.js handles; horizontal swipes go to
   the script, pinch still zooms the page. #lightbox-overlay outranks the
   small-screen rule further down that resizes the arrows. */
#lightbox-overlay:not(.zoomed) { touch-action: pinch-zoom; }
@media (pointer: coarse) {
  #lightbox-overlay .lightbox-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) { .lightbox img { transition: none; } }


/* .modal/.modal h2 themselves, shared by index.html's contact form and
   confetti.html's customise panel (not photography.php/theatre.php,
   whose lightbox is a different, purpose-built layout -- .lightbox, not
   .modal). Promoted here Sep 15 2026, same pass as .page above: was
   duplicated between just those two pages. width stays a per-page
   override (480px for a 3-field contact form, 560px for confetti's much
   wider colour/shape picker rows) -- clearly content-driven, not
   drift. confetti.html also keeps its own extra max-height/overflow-y
   (index's short form never needed to scroll; confetti's panel can).
   .modal h2's font-weight used to differ too (500 index.html, 400
   confetti.html) with no stated reason on either side -- resolved Sep 17
   2026 by matching confetti.html to index.html's 500, as part of
   standardising every page's type to index's (the user's own instruction,
   prompted by "heavy fonts on mobile" reading clunky elsewhere -- see
   project memory for where that actually traced to). margin-bottom stays
   a genuine per-page difference (1.6rem index.html, 1.4rem confetti.html)
   -- untouched, unrelated to that complaint. */
.modal {
  background: #231040;
  border: 1px solid rgba(240, 238, 232, 0.12);
  border-radius: 4px;
  padding: 2.2rem 2.4rem 2rem;
  position: relative;
}

.modal h2 {
  font-size: 1rem;
  text-transform: lowercase;
  color: #F0EEE8;
}

@media (max-width: 600px) {
  /* same ~0.87 ratio to the desktop size as before (was 52/60); still
     clears the 24px WCAG 2.5.8 target-size floor with real room. Panel
     keeps the same 14px gap that used to sit below the (now smaller)
     toggle, now horizontal instead, same top-aligned reasoning as desktop. */
  .nav-toggle { top: 4vh; right: 5vw; width: 38px; height: 38px; }
  /* width/height only, not top/right: .modal-close is positioned relative
     to its own modal overlay (rem units), not the viewport (vh/vw) the way
     .nav-toggle is -- giving it vh/vw offsets too would move it somewhere
     unrelated to where it actually needs to sit. */
  .modal-close { width: 38px; height: 38px; }
  .nav-panel   { top: calc(4vh - 17.6px); right: calc(5vw + 52px); } /* same padding-compensation as desktop */
  /* .page/.modal mobile padding -- identical across every page that sets
     either, same promotion as their own desktop rules above. */
  .page  { padding: 13vh 6vw 8vh; }
  .modal { padding: 1.8rem 1.4rem 1.4rem; }
  .lightbox-nav { width: 38px; height: 38px; }
}
