/* ─────────────────────────────────────────────────────────────────────────────
   Shams Al-Duha — gallery page
   A fanned hero of graduation portraits, album filter chips on a sticky glass
   bar, a bento of tall portraits, polaroid prints for the small photographs,
   page-scoped lightbox refinements and a closing "follow us" band.
   ───────────────────────────────────────────────────────────────────────────── */

/* Registered so the filter's edge fades can ease in and out. */
@property --gl-fade-s { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --gl-fade-e { syntax: "<length>"; inherits: false; initial-value: 0px; }

@layer sections {

  /* ── Hero ──────────────────────────────────────────────────────────────── */
  .gl-hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }

  .gl-hero__stats { display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .gl-hero__stats li {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 2.6rem;
    padding-inline: var(--s-2) var(--s-4);
    border-radius: var(--r-pill);
    background: rgb(255 255 255 / 0.66);
    border: 1px solid var(--white);
    box-shadow: var(--shadow-inset), var(--shadow-sm);
    color: var(--ink-2);
    font-size: var(--fs-small);
  }
  .gl-hero__stats strong { font-family: var(--font-display); font-size: 1.15rem; color: var(--red); }
  .gl-hero__stat-icon {
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: var(--gold-soft);
    color: var(--gold-deep);
    box-shadow: inset 0 0 0 1px var(--gold-border);
  }
  .gl-hero__stat-icon svg { width: 0.95rem; height: 0.95rem; }
  .gl-fb-icon { color: #1877F2; }

  /* The fan: three portraits dealt from one stack. Pointer parallax (site.js)
     writes `translate`, the tilt writes the stage transform, so each card keeps
     its own spread in `transform`. */
  .gl-fan {
    --spread: 1;
    position: relative;
    justify-self: center;
    width: min(100%, 30rem);
    aspect-ratio: 1 / 1.02;
  }
  .gl-fan__rays {
    position: absolute;
    inset: -18%;
    z-index: -2;
    background: repeating-conic-gradient(from 0deg, rgb(247 209 74 / 0.3) 0deg 5deg, transparent 5deg 15deg);
    -webkit-mask: radial-gradient(closest-side, #000 22%, transparent 72%);
    mask: radial-gradient(closest-side, #000 22%, transparent 72%);
    animation: rays-spin 100s linear infinite;
    pointer-events: none;
  }
  .gl-fan__halo {
    position: absolute;
    inset: 6% 4%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgb(255 255 255 / 0.9), rgb(255 244 214 / 0.55) 55%, transparent);
    pointer-events: none;
  }
  .gl-fan__halo::after {
    content: "";
    position: absolute;
    inset: 4%;
    border-radius: 50%;
    border: 1.5px dashed rgb(233 178 58 / 0.55);
    animation: rays-spin 70s linear infinite reverse;
  }

  .gl-fan__stage {
    position: absolute;
    inset: 0;
    transform: perspective(1100px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform var(--dur-slow) var(--ease-out);
  }
  @media (hover: hover) {
    .gl-fan:hover { --spread: 1.22; }
  }

  .gl-fan__card {
    --x: 0%;
    --y: 0%;
    --r: 0deg;
    position: absolute;
    top: 7%;
    left: 27%;
    width: 46%;
    aspect-ratio: 9 / 14.5;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 7px solid var(--white);
    background: var(--gold-soft);
    box-shadow: 0 0 0 1px rgb(60 30 24 / 0.06), var(--shadow-lg), 0 40px 70px -40px rgb(149 14 23 / 0.45);
    transform: translateX(calc(var(--x) * var(--spread))) translateY(var(--y)) rotate(calc(var(--r) * var(--spread)));
    transition: transform 1s var(--ease-out);
    animation: gl-deal 1.2s var(--ease-out) backwards;
    animation-delay: 0.45s;
  }
  .gl-fan__card picture, .gl-fan__card img { width: 100%; height: 100%; }
  .gl-fan__card img { object-fit: cover; object-position: 50% 66%; }
  .gl-fan__card--start { --x: 52%; --y: 7%; --r: 9deg; z-index: 1; animation-delay: 0.6s; }
  .gl-fan__card--end   { --x: -52%; --y: 9%; --r: -10deg; z-index: 1; animation-delay: 0.72s; }
  .gl-fan__card--front { z-index: 2; animation-name: gl-deal-front; animation-delay: 0.3s; }
  .gl-fan__card--start img, .gl-fan__card--end img { filter: saturate(0.9); }

  @keyframes gl-deal { from { opacity: 0; transform: translateX(0) translateY(6%) rotate(0deg); } }
  @keyframes gl-deal-front { from { opacity: 0; transform: translateY(10%) scale(0.94); } }

  /* A band of light crosses the front portrait now and then. */
  .gl-fan__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgb(255 255 255 / 0.42) 50%, transparent 62%);
    translate: 130% 0;
    animation: gl-shine 6.5s var(--ease-out) 2s infinite;
    pointer-events: none;
  }
  @keyframes gl-shine { 0% { translate: 130% 0; } 22%, 100% { translate: -130% 0; } }

  .gl-fan__sun {
    position: absolute;
    z-index: 3;
    top: -2%;
    inset-inline-end: 1%;
    width: clamp(4.5rem, 3rem + 3vw, 6.5rem);
    height: auto;
    aspect-ratio: 1;
    rotate: 10deg;
    animation: sticker-float 6s ease-in-out infinite;
  }
  .gl-fan__badge {
    position: absolute;
    z-index: 3;
    bottom: 9%;
    inset-inline-start: -3%;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding-block: var(--s-2);
    padding-inline: var(--s-2) var(--s-5);
    border-radius: var(--r-pill);
    animation: gl-bob 7s ease-in-out 1.6s infinite;
  }
  .gl-fan__badge-icon {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--red), var(--red-deeper));
    color: var(--white);
    box-shadow: 0 0 0 4px rgb(247 209 74 / 0.45), var(--shadow-red);
  }
  .gl-fan__badge-icon svg { width: 1.25rem; height: 1.25rem; }
  .gl-fan__badge-text { display: grid; font-size: var(--fs-caption); line-height: 1.45; color: var(--ink-2); }
  .gl-fan__badge-text strong { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
  .gl-fan__hearts {
    position: absolute;
    z-index: 3;
    bottom: 2%;
    inset-inline-end: 3%;
    width: clamp(3.75rem, 2.5rem + 2.5vw, 5.5rem);
    height: auto;
    rotate: -10deg;
    animation: sticker-float 6s ease-in-out 1.2s infinite;
    pointer-events: none;
  }
  @keyframes gl-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
  }

  @media (max-width: 900px) {
    .gl-hero__grid { grid-template-columns: minmax(0, 1fr); }
    .gl-fan { width: min(100%, 24rem); margin-top: var(--s-4); }
  }
  @media (max-width: 480px) {
    .gl-fan { width: min(92%, 21rem); }
    .gl-fan__badge { inset-inline-start: -4%; padding-inline-end: var(--s-4); }
    .gl-fan__badge-icon { width: 2.2rem; height: 2.2rem; }
  }

  /* ── Albums section ────────────────────────────────────────────────────── */
  .gl-albums { isolation: isolate; }
  .gl-albums .ambient { --glow-a: 12% 18%; --glow-b: 88% 56%; }
  .gl-albums__sun { width: 112px; height: 112px; rotate: 9deg; animation: sticker-float 6s ease-in-out infinite; }

  /* Filter: a glass bar that stays under the floating header while browsing. */
  .gl-filter {
    position: sticky;
    z-index: 20;
    top: calc(var(--header-h) + var(--s-8));
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    padding: 0.35rem;
    border-radius: var(--r-pill);
  }
  .gl-filter__track {
    position: relative;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 1.25rem;
    scrollbar-width: none;
    border-radius: var(--r-pill);
  }
  .gl-filter__track::-webkit-scrollbar { display: none; }

  /* When the chips do not fit (phones, tablets) the hidden side fades out, so
     a chip always peeks from the edge the bar scrolls toward. gallery.js
     toggles the classes from the scroll position; in RTL "start" is right. */
  .gl-filter.is-scrollable .gl-filter__track {
    --gl-fade-s: 0px;
    --gl-fade-e: 0px;
    -webkit-mask-image: linear-gradient(to left, transparent, #000 var(--gl-fade-s), #000 calc(100% - var(--gl-fade-e)), transparent);
    mask-image: linear-gradient(to left, transparent, #000 var(--gl-fade-s), #000 calc(100% - var(--gl-fade-e)), transparent);
    transition: --gl-fade-s var(--dur-base) var(--ease-out), --gl-fade-e var(--dur-base) var(--ease-out);
  }
  .gl-filter.has-more-start .gl-filter__track { --gl-fade-s: 2.5rem; }
  .gl-filter.has-more-end .gl-filter__track { --gl-fade-e: 2.5rem; }
  .gl-filter__pill {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--pill-w, 0);
    height: var(--pill-h, 0);
    translate: var(--pill-x, 0) 0;
    border-radius: var(--r-pill);
    background: linear-gradient(135deg, var(--red), var(--red-deeper));
    box-shadow: var(--shadow-red), inset 0 1px 0 rgb(255 255 255 / 0.28);
    opacity: 0;
    transition:
      translate 0.6s var(--ease-out),
      width 0.6s var(--ease-out),
      opacity var(--dur-fast) linear;
    pointer-events: none;
  }
  .gl-filter.has-pill .gl-filter__pill { opacity: 1; }
  .gl-filter__pill.is-instant { transition: none; }

  .gl-filter__chip {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: var(--s-2);
    min-height: 2.9rem;
    padding-inline: var(--s-5) var(--s-3);
    border-radius: var(--r-pill);
    color: var(--ink-2);
    font-size: var(--fs-small);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) linear;
  }
  .gl-filter__chip:first-of-type { padding-inline-start: var(--s-5); }
  .gl-filter__icon { width: 1.05rem; height: 1.05rem; color: var(--red); transition: color var(--dur-base) linear, rotate var(--dur-slow) var(--ease-out); }
  @media (hover: hover) {
    .gl-filter__chip:hover { color: var(--ink); background: rgb(255 255 255 / 0.7); }
    .gl-filter__chip:hover .gl-filter__icon { rotate: -10deg; }
  }
  .gl-filter__count {
    display: grid;
    place-items: center;
    min-width: 1.7rem;
    height: 1.7rem;
    padding-inline: 0.35rem;
    border-radius: var(--r-pill);
    background: var(--bg-deep);
    color: var(--ink-2);
    font-size: var(--fs-caption);
    font-weight: 600;
    transition: background-color var(--dur-base) linear, color var(--dur-base) linear;
  }
  .gl-filter__chip[aria-pressed="true"] { color: var(--white); }
  @media (hover: hover) {
    .gl-filter__chip[aria-pressed="true"]:hover { color: var(--white); background: transparent; }
  }
  .gl-filter__chip[aria-pressed="true"] .gl-filter__icon { color: var(--gold-bright); }
  .gl-filter__chip[aria-pressed="true"] .gl-filter__count { background: rgb(255 255 255 / 0.2); color: var(--white); }
  /* Before the script measures, the pressed chip carries its own fill. */
  .gl-filter:not(.has-pill) .gl-filter__chip[aria-pressed="true"] { background: var(--red-strong); }
  .gl-filter__chip:focus-visible { outline: 2px solid var(--red); outline-offset: -3px; border-radius: var(--r-pill); }
  .gl-filter__chip[aria-pressed="true"]:focus-visible { outline-color: var(--gold-bright); }

  .gl-status {
    margin-top: var(--s-3);
    text-align: center;
    color: var(--ink-2);
    font-size: var(--fs-small);
  }
  .gl-status .num { color: var(--red-strong); font-weight: 600; }

  .gl-albums__list { margin-top: clamp(2.5rem, 1.75rem + 2.5vw, 4rem); }

  /* ── One album: heading, then its photographs ──────────────────────────── */
  .gl-album { transition: opacity 0.28s var(--ease-out), scale 0.28s var(--ease-out), filter 0.28s var(--ease-out); }
  .gl-album:not([hidden]) ~ .gl-album { margin-top: clamp(4rem, 2.5rem + 4.5vw, 7rem); }
  .gl-album.is-out { opacity: 0; scale: 0.985; filter: blur(5px); }

  .gl-album__head {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: var(--s-2) var(--s-5);
    margin-bottom: clamp(1.75rem, 1.25rem + 1.5vw, 2.75rem);
    padding-bottom: var(--s-5);
    border-bottom: 1px solid var(--line);
  }
  .gl-album__head::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: -1.5px;
    width: clamp(4rem, 12vw, 8rem);
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(to left, var(--red), var(--gold-bright));
  }
  .gl-album__index {
    font-family: var(--font-display);
    font-size: clamp(3rem, 2rem + 3vw, 4.75rem);
    font-weight: 700;
    line-height: 0.9;
    color: transparent;
    -webkit-text-stroke: 1.5px rgb(233 178 58 / 0.7);
    background: linear-gradient(180deg, rgb(247 209 74 / 0.35), transparent 85%);
    -webkit-background-clip: text;
    background-clip: text;
    user-select: none;
  }
  .gl-album__text { display: grid; gap: var(--s-1); }
  .gl-album__title { font-size: clamp(1.45rem, 1.15rem + 1vw, 2rem); line-height: var(--lh-tight); }
  .gl-album__desc { color: var(--ink-2); line-height: 1.75; }
  .gl-album__count { min-height: 2rem; padding-inline: var(--s-3); font-size: var(--fs-small); margin-bottom: 0.3rem; }

  /* ── Bento of tall portraits ───────────────────────────────────────────── */
  .gl-bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(0.75rem, 0.35rem + 1.1vw, 1.25rem);
  }
  .gl-bento__item { position: relative; min-width: 0; aspect-ratio: 4 / 5; }
  .gl-bento__item--hero { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }

  /* Tiles fill their cell, so a portrait's natural height never sizes the row. */
  .gl-shot { position: absolute; inset: 0; border-radius: var(--r-lg); }
  .gl-shot img { object-position: 50% 70%; }
  .gl-shot .shot__frame { border-radius: calc(var(--r-lg) - 0.7rem); }
  .gl-shot .shot__title { font-size: clamp(1rem, 0.9rem + 0.35vw, 1.2rem); }
  .gl-bento__item--hero .gl-shot img { object-position: 50% 62%; }
  .gl-bento__item--hero .shot__caption { opacity: 1; translate: 0 0; padding: clamp(1.25rem, 0.8rem + 1.5vw, 2rem); }
  .gl-bento__item--hero .shot__veil { opacity: 0.85; }
  .gl-bento__item--hero .shot__title { font-size: clamp(1.25rem, 1rem + 1vw, 1.8rem); }

  @media (max-width: 599px) {
    .gl-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gl-bento__item { aspect-ratio: 3 / 4; }
    .gl-bento__item--hero { grid-row: auto; aspect-ratio: 4 / 4.5; }
    .gl-shot .shot__caption { padding: var(--s-3); }
    .gl-shot .shot__tag { display: none; }
    .gl-bento__item--hero .shot__tag { display: inline-flex; }
    .gl-shot .shot__zoom { top: var(--s-2); inset-inline-end: var(--s-2); width: 2.2rem; height: 2.2rem; }
  }

  /* ── Polaroid prints for the small photographs ─────────────────────────── */
  /* The sources are only 206 px wide: a print never grows past 14rem, so the
     photograph inside stays close to its natural size. */
  .gl-prints {
    --cols: 5;
    --gap: clamp(0.9rem, 0.35rem + 1.6vw, 2rem);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: calc(var(--gap) * 1.2) var(--gap);
    padding-block: var(--s-4) var(--s-2);
  }
  .gl-prints__item {
    --r: -2.4deg;
    --dy: 0rem;
    position: relative;
    width: min(14rem, (100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
    rotate: var(--r);
    transform: translateY(var(--dy));
    transition: rotate var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  }
  .gl-prints__item:nth-child(2) { --r: 1.8deg; --dy: 0.7rem; }
  .gl-prints__item:nth-child(3) { --r: -1deg; --dy: -0.35rem; }
  .gl-prints__item:nth-child(4) { --r: 2.4deg; --dy: 0.5rem; }
  .gl-prints__item:nth-child(5) { --r: -1.7deg; --dy: 0.1rem; }
  [data-album="activities"] .gl-prints__item:nth-child(odd) { --r: 2deg; }
  [data-album="activities"] .gl-prints__item:nth-child(even) { --r: -2.2deg; }
  .gl-prints__item:focus-within { z-index: 2; rotate: 0deg; transform: translateY(-8px); }
  /* Hover effects only where a pointer can hover: a tap must not leave a
     print lifted and zoomed once the lightbox closes. */
  @media (hover: hover) {
    .gl-prints__item:hover { z-index: 2; rotate: 0deg; transform: translateY(-8px); }
    .gl-print:hover {
      box-shadow:
        0 0 0 1px var(--gold-border),
        0 3px 6px rgb(60 30 24 / 0.06),
        0 34px 50px -26px rgb(149 14 23 / 0.5);
    }
    .gl-print:hover .gl-print__photo img { scale: 1.05; }
    .gl-print:hover .gl-print__zoom { opacity: 1; scale: 1; }
    .gl-print:hover .gl-print__caption { color: var(--ink); }
    .gl-print:hover .gl-print__caption::before { opacity: 0; width: 5rem; }
  }

  /* Washi tape holding each print */
  .gl-prints__item::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: -0.75rem;
    left: 50%;
    width: 4.6rem;
    height: 1.5rem;
    translate: -50% 0;
    rotate: -5deg;
    background:
      repeating-linear-gradient(135deg, rgb(255 255 255 / 0.28) 0 6px, transparent 6px 12px),
      rgb(247 209 74 / 0.62);
    clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 50%);
    box-shadow: 0 2px 6px rgb(120 80 10 / 0.12);
    pointer-events: none;
  }
  .gl-prints__item:nth-child(even)::before {
    rotate: 6deg;
    background:
      repeating-linear-gradient(45deg, rgb(255 255 255 / 0.3) 0 6px, transparent 6px 12px),
      rgb(240 68 74 / 0.42);
  }

  .gl-print {
    display: block;
    width: 100%;
    padding: 0.6rem 0.6rem 0;
    border-radius: 6px;
    background: linear-gradient(180deg, #FFFFFF, #FFFCF7);
    box-shadow:
      0 0 0 1px rgb(60 30 24 / 0.05),
      0 2px 3px rgb(60 30 24 / 0.05),
      0 22px 36px -22px rgb(120 32 20 / 0.42);
    cursor: zoom-in;
    text-align: center;
    transform: perspective(700px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) var(--ease-out);
  }
  .gl-print:focus-visible {
    box-shadow:
      0 0 0 1px var(--gold-border),
      0 3px 6px rgb(60 30 24 / 0.06),
      0 34px 50px -26px rgb(149 14 23 / 0.5);
  }
  .gl-print:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; border-radius: 6px; }

  .gl-print__photo {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 2px;
    background: var(--gold-soft);
  }
  .gl-print__photo::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgb(60 30 24 / 0.08), inset 0 0 18px rgb(60 30 24 / 0.08);
    pointer-events: none;
  }
  .gl-print__photo picture, .gl-print__photo img { width: 100%; height: 100%; }
  .gl-print__photo img { object-fit: cover; transition: scale 1.2s var(--ease-out), filter var(--dur-slow) var(--ease-out); }
  .gl-print:focus-visible .gl-print__photo img { scale: 1.05; }
  .js [data-reveal] > .gl-print .gl-print__photo img { filter: saturate(0.5) sepia(0.2); }

  .gl-print__zoom {
    position: absolute;
    z-index: 1;
    top: 0.45rem;
    inset-inline-end: 0.45rem;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.9);
    color: var(--red-strong);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    scale: 0.6;
    transition: opacity var(--dur-base) var(--ease-out), scale var(--dur-slow) var(--ease-out);
  }
  .gl-print__zoom svg { width: 0.95rem; height: 0.95rem; }
  .gl-print:focus-visible .gl-print__zoom { opacity: 1; scale: 1; }

  /* The caption is written on the print when it is pointed at or focused;
     until then a red-gold stroke waits in its place. */
  .gl-print__caption {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 3rem;
    padding: 0.35rem 0.4rem 0.45rem;
    font-family: var(--font-display);
    font-size: clamp(0.85rem, 0.78rem + 0.25vw, 1rem);
    font-weight: 600;
    line-height: 1.3;
    color: transparent;
    transition: color var(--dur-base) var(--ease-out);
  }
  .gl-print__caption::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.4rem;
    height: 3px;
    translate: -50% -50%;
    border-radius: 3px;
    background: linear-gradient(to left, var(--red), var(--gold-bright));
    opacity: 0.75;
    transition: opacity var(--dur-base) var(--ease-out), width var(--dur-slow) var(--ease-out);
  }
  .gl-print:focus-visible .gl-print__caption { color: var(--ink); }
  .gl-print:focus-visible .gl-print__caption::before { opacity: 0; width: 5rem; }

  @media (hover: none) {
    .gl-print__caption { color: var(--ink); }
    .gl-print__caption::before { display: none; }
    /* The shared tile keeps its hover look after a tap; settle it back unless
       it is keyboard-focused. */
    .gl-shot:hover:not(:focus-visible) img { scale: 1; }
    .gl-shot:hover:not(:focus-visible) .shot__frame { opacity: 0; scale: 1.04; }
    .gl-shot:hover:not(:focus-visible) .shot__zoom { opacity: 0; scale: 0.6; }
  }

  /* Keyboard focus and the lightbox's focus return keep a tile clear of the
     sticky filter bar (html scroll-padding already clears the header). */
  .gl-shot, .gl-print {
    scroll-margin-top: calc(var(--s-8) - var(--s-6) + 3.6rem + var(--s-4));
    scroll-margin-bottom: var(--s-8);
  }
  @media (max-width: 560px) {
    .gl-shot, .gl-print { scroll-margin-top: calc(3.3rem + var(--s-4)); }
  }

  @media (max-width: 860px) {
    .gl-prints { --cols: 3; }
  }
  @media (max-width: 560px) {
    .gl-prints { --cols: 2; }
    .gl-print { padding: 0.45rem 0.45rem 0; }
    .gl-print__caption { min-height: 2.6rem; }
    .gl-album__head { grid-template-columns: auto minmax(0, 1fr); gap: var(--s-2) var(--s-4); }
    .gl-album__count { grid-column: 2; justify-self: start; margin-bottom: 0; }
    .gl-filter { top: calc(var(--header-h) + var(--s-6)); }
    .gl-filter__chip { min-height: 2.6rem; padding-inline: var(--s-4) var(--s-2); }
  }
  @media (max-width: 900px) {
    .gl-albums .section-head { flex-direction: row; align-items: end; }
    .gl-albums__sun { width: 76px; height: 76px; flex: none; }
  }
  @media (max-width: 480px) {
    .gl-albums__sun { display: none; }
  }

  /* Filtering: tiles of the chosen album rise back in, one after another. */
  .gl-albums__list.is-entering .gl-album:not([hidden]) :is(.gl-album__head, .gl-bento__item, .gl-prints__item) {
    animation: gl-tile-in 0.7s var(--ease-out) backwards;
    animation-delay: calc(var(--k, 0) * 55ms);
  }
  @keyframes gl-tile-in {
    from { opacity: 0; translate: 0 22px; scale: 0.96; filter: blur(6px); }
  }

  /* ── Lightbox refinements (the dialog itself lives in shared.css) ──────── */
  html.lightbox-open { scrollbar-gutter: stable; }

  /* gallery.js wraps the picture in a stage holding a blurred copy of the
     photograph: a warm glow behind portraits, a full backdrop for prints. */
  .gl-stage {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    max-width: 100%;
  }
  .gl-stage__ambient {
    position: absolute;
    inset: 6% -14%;
    z-index: -1;
    overflow: hidden;
    border-radius: 50%;
    opacity: 0.5;
    filter: blur(48px) saturate(1.4);
    pointer-events: none;
    transition: opacity 0.5s var(--ease-out);
  }
  .gl-stage__ambient img { width: 100%; height: 100%; object-fit: cover; }
  .lightbox.is-switching .gl-stage__ambient { opacity: 0; }

  .lightbox[open] { touch-action: pan-y pinch-zoom; }
  .lightbox.is-lowres .lightbox__figure { width: min(100%, 40rem, 100svh - 11rem); }
  .lightbox.is-lowres .gl-stage {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: rgb(40 16 12 / 0.6);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.14), 0 40px 90px -30px rgb(0 0 0 / 0.7);
  }
  .lightbox.is-lowres .gl-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(closest-side, transparent 45%, rgb(30 10 8 / 0.45));
    pointer-events: none;
  }
  .lightbox.is-lowres .gl-stage__ambient {
    inset: -10%;
    border-radius: 0;
    opacity: 0.92;
    filter: blur(20px) saturate(1.25) brightness(0.88);
  }
  /* Shown at most at twice its natural size, framed like a print. */
  .lightbox.is-lowres .lightbox__picture { width: min(412px, 72%); }
  .lightbox.is-lowres .lightbox__picture img {
    width: 100%;
    max-width: 100%;
    max-height: none;
    border: 6px solid var(--white);
    border-bottom-width: 22px;
    border-radius: 6px;
    rotate: -1.2deg;
    box-shadow: 0 30px 60px -24px rgb(0 0 0 / 0.65);
  }

  .gl-lb-album {
    padding-inline-start: var(--s-3);
    border-inline-start: 1px solid rgb(255 255 255 / 0.25);
    color: rgb(255 255 255 / 0.72);
    font-size: var(--fs-caption);
    white-space: nowrap;
  }
  @media (max-width: 560px) {
    .lightbox .lightbox__caption { flex-wrap: wrap; justify-content: center; row-gap: 0.2rem; max-width: 100%; border-radius: var(--r-md); text-align: center; }
    .gl-lb-album { flex-basis: 100%; padding-inline-start: 0; border-inline-start: 0; }
    .lightbox.is-lowres .lightbox__figure { width: min(100%, 100svh - 14rem); }
  }

  /* ── Follow band ───────────────────────────────────────────────────────── */
  /* Same ground as the albums above (section--flush-top: one gap, not two). */
  .gl-follow { background: linear-gradient(to bottom, var(--bg), var(--bg-deep)); }
  .gl-follow__panel {
    position: relative;
    isolation: isolate;
    overflow: clip;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(2.5rem, 1rem + 5vw, 5.5rem);
    align-items: center;
    padding: clamp(1.75rem, 0.75rem + 4.5vw, 4.75rem);
    border-radius: var(--r-xl);
    background:
      radial-gradient(70% 90% at 8% 10%, rgb(247 209 74 / 0.3), transparent 62%),
      radial-gradient(60% 80% at 100% 100%, rgb(215 20 31 / 0.08), transparent 70%),
      linear-gradient(160deg, var(--white), var(--red-mist));
    border: 1px solid var(--white);
    box-shadow: var(--shadow-inset), var(--shadow-lg);
  }
  .gl-follow__panel::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto 0 0;
    height: 5px;
    background: linear-gradient(to left, var(--red), var(--gold-bright) 50%, var(--red));
  }
  .gl-follow__rays {
    position: absolute;
    z-index: -1;
    top: 50%;
    inset-inline-end: -12%;
    width: min(44rem, 80vw);
    aspect-ratio: 1;
    translate: 0 -50%;
    background: repeating-conic-gradient(from 0deg, rgb(247 209 74 / 0.22) 0deg 5deg, transparent 5deg 15deg);
    -webkit-mask: radial-gradient(closest-side, #000 18%, transparent 70%);
    mask: radial-gradient(closest-side, #000 18%, transparent 70%);
    animation: rays-spin 110s linear infinite;
    pointer-events: none;
  }

  .gl-follow__copy { display: grid; gap: var(--s-4); justify-items: start; }
  .gl-follow__title { font-size: var(--fs-h2); line-height: var(--lh-tight); }
  .gl-follow__lead { color: var(--ink-2); font-size: var(--fs-lead); line-height: 1.85; max-width: 34rem; }
  .gl-follow__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }
  .gl-follow__wa .btn__icon { color: #1B9A4E; }

  .gl-follow__facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-4) var(--s-8);
    margin-top: var(--s-4);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
  }
  .gl-follow__fact { display: grid; gap: 0.1rem; }
  .gl-follow__fact + .gl-follow__fact { padding-inline-start: var(--s-8); border-inline-start: 1px solid var(--line); }
  .gl-follow__value {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--red);
  }
  .gl-follow__star { width: 0.6em; height: 0.6em; color: var(--gold); filter: drop-shadow(0 2px 4px rgb(233 178 58 / 0.45)); }
  .gl-follow__label { color: var(--ink-2); font-size: var(--fs-small); }

  .gl-follow__art {
    position: relative;
    justify-self: center;
    width: min(100%, 27rem);
    padding-block: var(--s-6) var(--s-10);
  }
  .gl-follow__page {
    position: relative;
    padding: 0.6rem 0.6rem 0.9rem;
    border-radius: var(--r-lg);
    background: var(--white);
    box-shadow: 0 0 0 1px var(--line), var(--shadow-lg), 0 50px 80px -50px rgb(149 14 23 / 0.45);
    transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) rotate(-2deg);
    transition: transform var(--dur-slow) var(--ease-out);
  }
  .gl-follow__cover {
    aspect-ratio: 960 / 366;
    overflow: hidden;
    border-radius: calc(var(--r-lg) - 0.6rem) calc(var(--r-lg) - 0.6rem) var(--r-xs) var(--r-xs);
    background: var(--gold-soft);
  }
  .gl-follow__cover img { width: 100%; height: 100%; object-fit: cover; }
  .gl-follow__profile {
    display: flex;
    align-items: end;
    gap: var(--s-3);
    margin-top: -1.6rem;
    padding-inline: var(--s-3);
  }
  .gl-follow__logo {
    flex: none;
    width: 3.9rem;
    height: 3.9rem;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 0 0 4px var(--white), 0 8px 18px -8px rgb(181 18 28 / 0.5);
  }
  .gl-follow__name { display: grid; min-width: 0; line-height: 1.35; font-size: var(--fs-caption); color: var(--ink-2); padding-bottom: 0.1rem; }
  .gl-follow__name strong { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
  .gl-follow__fb {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.3rem;
    height: 2.3rem;
    margin-inline-start: auto;
    border-radius: 50%;
    background: #1877F2;
    color: var(--white);
    box-shadow: 0 8px 16px -8px rgb(24 119 242 / 0.8);
  }
  .gl-follow__fb svg { width: 1.2rem; height: 1.2rem; }
  .gl-follow__thumbs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: var(--s-4);
  }
  .gl-follow__thumbs picture { aspect-ratio: 1; overflow: hidden; border-radius: var(--r-xs); background: var(--gold-soft); }
  .gl-follow__thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
  .gl-follow__thumbs picture:first-child img { object-position: 50% 60%; }

  .gl-follow__print {
    position: absolute;
    z-index: 2;
    bottom: 0;
    inset-inline-start: -4%;
    width: clamp(6rem, 4.5rem + 3vw, 7.75rem);
    padding: 0.4rem 0.4rem 1.5rem;
    border-radius: 4px;
    background: var(--white);
    box-shadow: 0 24px 40px -20px rgb(120 32 20 / 0.5), 0 0 0 1px var(--line);
    rotate: 7deg;
    animation: gl-bob 7s ease-in-out infinite;
  }
  .gl-follow__print img { width: 100%; aspect-ratio: 1; object-fit: cover; }
  .gl-follow__like {
    position: absolute;
    z-index: 2;
    top: 0;
    inset-inline-end: -3%;
    display: grid;
    place-items: center;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    background: linear-gradient(160deg, #F0444A, var(--red-strong));
    color: var(--white);
    box-shadow: 0 0 0 5px rgb(255 255 255 / 0.8), var(--shadow-red);
    animation: gl-beat 2.6s ease-in-out infinite;
  }
  .gl-follow__like svg { width: 1.5rem; height: 1.5rem; }
  @keyframes gl-beat {
    0%, 60%, 100% { scale: 1; }
    70%           { scale: 1.14; }
    80%           { scale: 0.96; }
  }

  @media (max-width: 980px) {
    .gl-follow__panel { grid-template-columns: minmax(0, 1fr); }
    .gl-follow__art { width: min(100%, 24rem); }
  }
  @media (max-width: 640px) {
    .gl-follow__actions .btn { flex: 1 1 100%; }
    .gl-follow__fact + .gl-follow__fact { padding-inline-start: var(--s-5); }
    .gl-follow__facts { gap: var(--s-4) var(--s-5); }
    .gl-follow__print { inset-inline-start: 0; }
    .gl-follow__like { inset-inline-end: 0; }
  }
}

@layer motion {
  @media (prefers-reduced-motion: reduce) {
    .gl-fan__rays, .gl-fan__halo::after, .gl-fan__card, .gl-fan__shine, .gl-fan__sun, .gl-fan__badge,
    .gl-fan__hearts, .gl-albums__sun, .gl-follow__rays, .gl-follow__print, .gl-follow__like,
    .gl-albums__list.is-entering .gl-album:not([hidden]) :is(.gl-album__head, .gl-bento__item, .gl-prints__item) { animation: none; }
    .gl-fan__shine { opacity: 0; }
    .gl-fan__stage, .gl-fan__card, .gl-filter__pill, .gl-filter__chip, .gl-filter__icon, .gl-filter__count,
    .gl-album, .gl-prints__item, .gl-print, .gl-print__photo img, .gl-print__zoom, .gl-print__caption,
    .gl-print__caption::before, .gl-stage__ambient, .gl-follow__page,
    .gl-filter.is-scrollable .gl-filter__track { transition-duration: 0.01ms; }
    .gl-filter__track { scroll-behavior: auto; }
    .js [data-reveal] > .gl-print .gl-print__photo img { filter: none; }
  }
}
