/* ============================================================
   Wedding reply card — bespoke, self-contained page styles.
   Identity: graphite pencil portrait on its own cream paper,
   a single deep-laurel accent, system serif + sans (no webfonts).
   Namespaced under .inv so it never leans on Bootstrap.
   ============================================================ */

/* ============================================================
   TOKENS
   ============================================================ */
:root {
    /* the palette is three colours; everything else is derived from them, so the
       triplets are kept alongside for the rgba() lines, washes and shadows */
    --paper-rgb:   255, 250, 238;  /* cream, sampled from the drawing's own paper */
    --ink-rgb:      44,  42,  38;  /* warm graphite-black */
    --laurel-rgb:   69,  96,  79;  /* deep laurel green */

    --paper:       rgb(var(--paper-rgb));
    --ink:         rgb(var(--ink-rgb));    /* body text */
    --pencil:      #6E6A62;                /* muted graphite — secondary text, matches the drawing */
    --laurel:      rgb(var(--laurel-rgb)); /* the green as a *field* — never inverted */
    --accent:      var(--laurel);          /* the green as a *mark* — re-pointed inside .topband */
    --accent-ink:  #354B3E;                /* darker green for text-on-paper contrast */
    --line:        rgba(var(--ink-rgb), 0.16);  /* hairline rules */
    --line-strong: rgba(var(--ink-rgb), 0.30);
    --flag:        #9B3B2E;                /* the one red — form errors only */

    --display: Georgia, "Times New Roman", Times, serif;
    --body:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --measure: 1120px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --transition: 0.3s var(--ease);  /* the default hover/focus timing */
}

/* ============================================================
   PAGE SHELL
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

/* this page opts out of the Bootstrap entrypoint, so it carries its own reset —
   without it the UA's 8px body margin leaves a gutter around the paper */
html { background: var(--paper); }  /* also colours the overscroll area */
body { margin: 0; }

/* a modal dialog should be the only thing that moves, but Safari still scrolls
   the page behind it, so the scroll is stopped at the root for as long as one is
   open — on both elements, or iOS keeps the touch scroll to itself */
html:has(dialog[open]),
html:has(dialog[open]) body {
    overflow: hidden;
}
/* and where the scrollbar takes up room, its gutter is held open, or taking the
   scroll away would shift the whole page sideways under the dialog */
html { scrollbar-gutter: stable; }

.inv {
    margin: 0;
    min-height: 100svh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* faint paper grain — sits above the background, below content */
.inv::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.05;
    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='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");
}

.inv__wrap {
    position: relative;
    z-index: 1;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* ============================================================
   SHARED PRIMITIVES
   ============================================================ */

/* the small letterspaced cap — eyebrows, form labels, the copy confirmation */
.eyebrow,
.form-label {
    font-family: var(--body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin: 0;
}

/* the standfirst under a section title */
.notice__lede,
.reply__lede,
.gallery__lede {
    max-width: 30rem;
    margin: 1rem auto 0;
    font-size: 1.02rem;
    color: var(--pencil);
}

/* one focus treatment for everything interactive; the components below shift
   the offset where a ring at arm's length would collide with a neighbour */
.langbar__link:focus-visible,
.submit:focus-visible,
.form-control:focus-visible,
.gallery__frame:focus-visible,
.lightbox__btn:focus-visible,
.lightbox__close:focus-visible,
.lightbox__download:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ============================================================
   TOP BAND — the first screen, full-bleed laurel
   The paper-context tokens are re-pointed here, so every rule
   inside inverts without being rewritten. Islands that stay on
   paper (the portrait's mat) reset them back.
   ============================================================ */
.topband {
    position: relative;
    background: var(--laurel);
    --ink:         var(--paper);
    --pencil:      rgba(var(--paper-rgb), 0.68);
    --accent-ink:  rgba(var(--paper-rgb), 0.84);
    --accent:      #B7CCBA;  /* light sage — the amp, focus rings */
    --line:        rgba(var(--paper-rgb), 0.20);
    --line-strong: rgba(var(--paper-rgb), 0.34);
}

/* the band holds exactly one screen: langbar on top, hero taking the rest */
.topband > .inv__wrap {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

/* the active pill inverts too — paper chip, laurel type */
.topband .langbar__link.is-active {
    background: var(--paper);
    color: var(--laurel);
}

/* ============================================================
   LANGUAGE SWITCH — pinned to the top of the page
   ============================================================ */
.langbar {
    position: relative;
    z-index: 2;
    padding-top: clamp(1.1rem, 2.5vw, 1.6rem);
}

.langbar__list {
    /* wide enough that the active pill's fill clears the separator on both sides */
    --langbar-gap: 0.9rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--langbar-gap);
    list-style: none;
    margin: 0;
    padding: 0;
}

.langbar__link {
    display: inline-block;
    padding: 0.4rem 0.7rem;
    font-family: var(--body);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pencil);
    text-decoration: none;
    border-radius: 2px;
    transition: color var(--transition), background-color var(--transition);
}
.langbar__link:hover { color: var(--accent-ink); }
.langbar__link:focus-visible { outline-offset: 2px; }
.langbar__link.is-active {
    color: var(--paper);
    background: var(--accent);
}

/* hairline separators between the language options */
.langbar__list li + li { position: relative; }
.langbar__list li + li::before {
    content: "";
    position: absolute;
    left: calc(var(--langbar-gap) / -2);  /* centred in the gap, so both neighbours clear it equally */
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 0.9rem;
    background: var(--line);
}

@media (max-width: 767.98px) {
    .langbar__list { justify-content: center; }
}

/* ============================================================
   HERO — the opened invitation
   ============================================================ */
.hero {
    display: grid;
    /* the drawing carries the page — give its leaf the wider share */
    grid-template-columns: 1.15fr 1fr;
    align-items: stretch;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    /* less air up top so the hero sits closer to the language switch */
    padding: clamp(0.25rem, 1vw, 0.75rem) 0 clamp(1.5rem, 3vw, 2.5rem);
}
/* inside the band the langbar already claims its slice, so the hero just
   fills what's left of the screen; min-height:0 lets it shrink to do so */
.topband .hero { flex: 1; min-height: 0; }

/* left leaf — the portrait, matted like a framed drawing */
.hero__plate {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* the fold — hairline between the two leaves */
.hero__plate::after {
    content: "";
    position: absolute;
    top: 8%;
    bottom: 8%;
    right: calc(clamp(1.5rem, 4vw, 3.5rem) / -2);
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--line-strong) 18%, var(--line-strong) 82%, transparent);
}

/* the mat: a passe-partout in the page's own paper, so the frame and the page
   below the band are the same ground — only the hairline border separates them */
.portrait {
    --mat: clamp(0.85rem, 2.2vw, 1.6rem);
    /* against the dark field the sheet reads as hung, not printed:
       a tight contact shadow under a wide, deep ambient one */
    --lift:     14px 30px -16px;
    --lift-far: 46px 80px -44px;
    /* a paper island on the laurel field — put the paper-context hairlines back
       so the mat keeps its graphite rules instead of the band's light ones */
    --line:        rgba(var(--ink-rgb), 0.16);
    --line-strong: rgba(var(--ink-rgb), 0.30);
    position: relative;
    /* the drawing is a tall 5:7 sheet — track the viewport height so it never
       outgrows the fold on short screens */
    width: min(100%, 34rem, 58svh);
    margin: 0;
    padding: var(--mat);
    background: var(--paper);
    border: 1px solid var(--line-strong);
    box-shadow:
        0 1px 2px rgba(20, 30, 24, 0.20),
        0 var(--lift) rgba(20, 30, 24, 0.45),
        0 var(--lift-far) rgba(15, 24, 19, 0.75);
}
/* second hairline, hugging the sheet itself */
.portrait::after {
    content: "";
    position: absolute;
    inset: calc(var(--mat) - 1px);
    border: 1px solid var(--line);
    pointer-events: none;
}
.portrait__img {
    display: block;
    width: 100%;
    height: auto;
    /* the signature move: multiply melts the scan's white into the paper */
    mix-blend-mode: multiply;
}

/* right leaf — the words */
.hero__card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem) 0;
}
.hero__intro { margin: 0 0 1.6rem; }

.names {
    font-family: var(--display);
    font-weight: 400;
    font-optical-sizing: auto;
    line-height: 0.92;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--ink);
}
.names__line { display: block; font-size: clamp(3rem, 8.5vw, 5.75rem); }
.names__amp {
    display: block;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(2.4rem, 6vw, 4rem);
    color: var(--accent);
    margin: 0.1em 0 0.05em;
    padding-left: 0.15em;
}

.meta {
    margin: 2rem 0 0;
    font-size: 1.02rem;
    color: var(--pencil);
    line-height: 1.7;
}
/* the date is marked in the drawing's own paper tone — a highlighter swipe.
   The negative margin cancels the padding so the text still lines up with the
   schedule below; the band is what overhangs, the way a marker would. */
.meta strong {
    display: inline-block;
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.35rem;
    color: var(--laurel);
    background: var(--paper);
    padding: 0.08em 0.45em 0.14em;
    margin-left: -0.45em;
    letter-spacing: 0.005em;
}
.meta__schedule { display: grid; gap: 0.7rem; margin-top: 0.7rem; }
/* the thank you that stands where the schedule did, on the guest's own page */
.meta__note { display: block; max-width: 28rem; margin-top: 1rem; }
.meta__event { display: grid; gap: 0.1rem; }
.meta__event-when { color: var(--ink); font-weight: 500; }
.meta__event-where { font-size: 0.94rem; color: var(--pencil); }

.scroll-cue {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 2.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--accent-ink);
    text-decoration: none;
}
.scroll-cue__arrow {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 1px;
    background: currentColor;
}
/* the head: top + right borders spun about the box centre, so the vertex points
   along the rule and only its tip meets the end — the arms stay clear of it */
.scroll-cue__arrow::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    transform: translate(-1px, -50%) rotate(45deg);
    transition: transform 0.4s var(--ease);
}
.scroll-cue:hover .scroll-cue__arrow::after { transform: translate(2px, -50%) rotate(45deg); }

/* ---- confirmation: the same right leaf, with the receipt instead of the date ---- */

/* the eyebrow carries the tick, so it sets its own line */
.confirm__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* the seal — a small ring around the tick, the one "done" mark on the page.
   Fixed width, so the eyebrow's line-height doesn't pull the ring into an oval */
.confirm__seal {
    display: grid;
    place-items: center;
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--accent);
}
.confirm__seal svg { width: 0.8rem; height: 0.8rem; }

.confirm__title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.06;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--ink);
}
.confirm__lede {
    max-width: 34ch;
    margin: 1.6rem 0 0;
    font-size: 1.02rem;
    color: var(--pencil);
    line-height: 1.7;
}

/* the two numbers to call on the day: a small stacked pair, each name over its
   digits, so they stay tappable instead of running on inside the paragraph.
   It takes the ink of whatever it sits on — laurel on the confirmation, paper
   on the check-in — so only the placing changes between the two. */
.contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.6rem;
    margin: 0.9rem 0 0;
}
/* one of us: the name, then the two ways of reaching them stacked under it */
.contacts__host {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.contacts__link {
    color: var(--pencil);
    text-decoration: none;
    transition: color var(--transition);
}
.contacts__link:hover { color: var(--accent-ink); }
.contacts__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.contacts__name { font-family: var(--display); font-size: 1.15rem; line-height: 1.2; color: var(--ink); }
.contacts__num { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
/* an address is longer than the column it sits in on a narrow screen */
.contacts__mail { font-size: 0.95rem; overflow-wrap: anywhere; }

/* the sign-off — the salutation in the body hand, the names in the display one,
   so the two lines read as a hand-written close rather than one more paragraph */
.confirm__signoff {
    margin: 1.7rem 0 0;
    font-size: 1.02rem;
    color: var(--pencil);
    line-height: 1.5;
}
.confirm__names {
    font-family: var(--display);
    font-size: 1.35rem;
    letter-spacing: 0.005em;
    color: var(--ink);
}

/* stack the leaves on narrow screens */
@media (max-width: 767.98px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-top: 3rem;
        text-align: center;
    }
    .hero__plate::after { display: none; }
    .portrait {
        --mat: 0.8rem;
        --lift:     10px 22px -14px;
        --lift-far: 32px 56px -36px;
        width: min(100%, 24rem);
    }
    .hero__card { padding-top: 0.5rem; align-items: center; }
    .hero__intro, .meta, .confirm__lede, .confirm__signoff { text-align: center; }
    .contacts { justify-content: center; }
    .confirm__eyebrow { justify-content: center; }
    /* centred here, so the swipe shouldn't be pulled left */
    .meta strong { margin-left: 0; }
    .scroll-cue { align-self: center; }
}

/* ============================================================
   CARDS — the notice on the invitation, with the code form on it,
   and the message card on a guest's own page
   ============================================================ */
.notice {
    position: relative;
    padding: clamp(3rem, 6.5vw, 5.75rem) 0 clamp(1.75rem, 4vw, 3rem);
}
/* between the wall and the sign-off, so it needs less air above than the notice */
.reply {
    position: relative;
    padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(2rem, 5vw, 3rem);
}
/* each on its own white card, lifted off the cream page: the only white surface
   on the page, so the one thing to read or to do stands out */
.notice__inner,
.reply__inner {
    position: relative;
    z-index: 1;
    /* the measure is the content's; the padding is added on top so the card keeps
       the same line length it had on the bare page */
    --notice-pad: clamp(1.5rem, 5vw, 3.25rem);
    max-width: calc(40rem + 2 * var(--notice-pad));
    margin: 0 auto;
    padding: var(--notice-pad);
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 3px;
    box-shadow:
        0 1px 2px rgba(var(--ink-rgb), 0.05),
        0 18px 40px -24px rgba(var(--ink-rgb), 0.35);
}
/* nothing follows the notice's head, so it carries no bottom margin of its own */
.notice__head { text-align: center; }
.reply__head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3rem); }
.notice__title,
.reply__title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.05;
    margin: 0.9rem 0 0;
    color: var(--ink);
}

/* ---- the code form on the invitation ----
   The way through to a guest's own page. Nothing is posted: it is a GET that
   builds the URL out of what they type. */
.notice__code-lede {
    max-width: 26rem;
    margin: clamp(1.75rem, 4vw, 2.5rem) auto 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--pencil);
}
.code {
    display: grid;
    max-width: 22rem;
    margin: 1.25rem auto 0;
    text-align: center;
}
.code .form-label { margin-bottom: 0.55rem; }
/* the four characters, spaced out and centred: a code to read back, not prose */
.code .form-control {
    font-size: 1.2rem;
    letter-spacing: 0.42em;
    /* the tracking hangs off the last letter; the indent puts the run back in the middle */
    text-indent: 0.42em;
    text-align: center;
    text-transform: uppercase;
}
.code .form-control::placeholder { letter-spacing: 0.1em; text-indent: 0; text-transform: none; }
/* a long label wraps rather than pushing past the card */
.code .submit {
    max-width: 100%;
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
    text-align: center;
}

/* ---- form scaffolding ----
   Both forms are rendered by the Symfony form component through the Bootstrap 5
   theme. Bootstrap's stylesheet is never loaded — only its class names are, and
   they're dressed here as this page's own primitives:
     .mb-3 …………… one field row      .form-control ……… text input / textarea
     .form-label ……… its label        .invalid-feedback … a field's error
*/
.form { display: grid; gap: 1.75rem; }

/* one field row. The theme prints label → control → errors, but the label claims
   its own line and everything else follows. */
.mb-3 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
}
.mb-3 > * { flex: 0 0 100%; }
.mb-3 > .form-label { flex: 0 1 auto; order: -2; }

/* ---- text inputs ---- */
.form-control {
    width: 100%;
    font-family: var(--body);
    font-size: 1.02rem;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    padding: 0.6rem 0.1rem;
    transition: border-color var(--transition);
}
.form-control::placeholder { color: var(--pencil); opacity: 0.7; }
/* the underline is the focus signal here, so no ring */
.form-control:focus {
    outline: none;
    border-bottom-color: var(--accent);
}
textarea.form-control { resize: vertical; min-height: 3.2rem; line-height: 1.6; }

/* the theme flags a rejected value on the control itself */
.form-control.is-invalid { border-bottom-color: var(--flag); }
.invalid-feedback,
.alert-danger {
    font-size: 0.86rem;
    color: var(--flag);
}

/* ---- submit ---- */
.submit {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    font-family: var(--body);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 2px;
    padding: 1rem 2.75rem;
    cursor: pointer;
    transition: background-color var(--transition), transform 0.25s var(--ease);
}
.submit:hover { background: var(--accent-ink); }
.submit:active { transform: translateY(1px); }

/* ============================================================
   CLOSING — the wall, the message card and the footer share one
   padded block, so the photos and what follows read as one ending
   ============================================================ */
.closing {
    padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(2rem, 5vw, 3rem);
}

/* ---- footer ---- */
.foot { text-align: center; }
.foot__heart {
    font-size: 1.75rem;
    line-height: 1;
}
.foot__names {
    font-family: var(--display);
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    color: var(--ink);
    margin: 0.5rem 0 0.75rem;
}
.foot__amp { margin: 0 0.5rem; color: var(--accent); font-style: italic; }
.foot__note { font-size: 0.82rem; letter-spacing: 0.06em; color: var(--pencil); margin: 0; }

/* ============================================================
   GALLERY — a wall of photos in justified rows. Every frame
   keeps its own ratio: the basis is that ratio at the row's
   target height, and the grow is the same ratio again, so a
   row scales by one factor and its photos end level, flush to
   both edges, portrait beside landscape and nothing cropped.
   ============================================================ */
.gallery {
    position: relative;
    /* the message card sits tight under the wall — the wall, the card and the
       sign-off form the closing block */
    padding: 0 0 clamp(1.5rem, 4vw, 2.25rem);
    /* the height a row aims for; the growing settles where it lands */
    --row: clamp(6.5rem, 14vw, 10.5rem);
}
.gallery__head {
    text-align: center;
    margin: 0 0 clamp(1.5rem, 4vw, 2.25rem);
}
.gallery__title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    line-height: 1.1;
    margin: 0.9rem 0 0;
    color: var(--ink);
}
.gallery__grid {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(0.4rem, 1vw, 0.7rem);
    list-style: none;
    margin: 0;
    padding: 0;
}
.gallery__item {
    flex-grow: calc(var(--w) / var(--h));
    flex-shrink: 1;
    flex-basis: calc(var(--w) / var(--h) * var(--row));
    min-width: 0;
    margin: 0;
}
/* the fillers carry no photo and no height — all they do is stand in the last
   row and take the slack (see the template) */
.gallery__item--filler { height: 0; }

/* the frame is a link to the file itself: the lightbox takes the click, and a
   guest whose script never ran still gets the photo */
.gallery__frame {
    display: block;
    border-radius: 2px;
    cursor: zoom-in;
    transition: transform var(--transition);
}
.gallery__frame:hover { transform: translateY(-3px); }
.gallery__frame:focus-visible { outline-offset: 4px; }
.gallery__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--w) / var(--h);
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    box-shadow: 0 14px 30px -20px rgba(var(--ink-rgb), 0.55);
}

/* ============================================================
   LIGHTBOX — one photo at a time, over the page. The paper
   tokens are re-pointed here the way the top band does it, so
   every control inside reads light without being rewritten.
   ============================================================ */
.lightbox {
    --ink:         var(--paper);
    --pencil:      rgba(var(--paper-rgb), 0.68);
    --accent:      #B7CCBA;  /* light sage, as on the laurel band */
    --accent-ink:  rgba(var(--paper-rgb), 0.86);
    --line:        rgba(var(--paper-rgb), 0.22);

    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: clamp(0.75rem, 3vw, 2rem);
    border: 0;
    background: transparent;
    color: var(--ink);
    overflow: hidden;
}
.lightbox[open] {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 2vw, 1rem);
}
/* ::backdrop does not inherit the page's tokens everywhere yet, so the graphite
   is written out here rather than derived */
.lightbox::backdrop {
    background: rgba(28, 27, 24, 0.94);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.lightbox__stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 2px;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

/* the chips over the dark: the filmstrip's buttons, inverted, and kept on show —
   there is no hover to reveal them on a phone */
.lightbox__btn,
.lightbox__close,
.lightbox__download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--ink-rgb), 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    color: var(--accent-ink);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
.lightbox__btn:hover,
.lightbox__close:hover,
.lightbox__download:hover { color: var(--accent); border-color: var(--accent); }

.lightbox__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    z-index: 2;
}
.lightbox__btn--prev { left: 0; }
.lightbox__btn--next { right: 0; }
.lightbox__btn:active { transform: translateY(-50%) scale(0.96); }

.lightbox__close {
    position: absolute;
    top: clamp(0.75rem, 3vw, 2rem);
    right: clamp(0.75rem, 3vw, 2rem);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    z-index: 3;
}
.lightbox__close:active { transform: scale(0.96); }

.lightbox__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.lightbox__count {
    margin: 0;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--pencil);
}
.lightbox__download {
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-decoration: none;
}
.lightbox__download:active { transform: scale(0.98); }

/* ============================================================
   ENTRANCE MOTION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(14px); }
.inv.is-ready .reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.inv.is-ready .reveal[data-delay="1"] { transition-delay: 0.08s; }
.inv.is-ready .reveal[data-delay="2"] { transition-delay: 0.18s; }
.inv.is-ready .reveal[data-delay="3"] { transition-delay: 0.30s; }
.inv.is-ready .reveal[data-delay="4"] { transition-delay: 0.44s; }
.inv.is-ready .reveal[data-delay="5"] { transition-delay: 0.60s; }

/* the drawing settles rather than slides — slower, with a touch of scale */
.portrait.reveal { transform: translateY(14px) scale(0.985); }
.inv.is-ready .portrait.reveal { transform: none; transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }

@media (prefers-reduced-motion: reduce) {
    .reveal, .inv.is-ready .reveal { opacity: 1; transform: none; transition: none; }
    .scroll-cue__arrow::after { transition: none; }
    .gallery__frame { transition: none; }
}