/* Mobile home: infinite lens grid of project creatives (built by mobile-lens.js) on phones and
   on touch tablets held upright. Keep this query in sync with mobile-lens.js / gallery.js. */
.lens, .lens-proxy { display: none; }

@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) and (hover: none) and (pointer: coarse) {
  body.has-lens {
    position: fixed;
    inset: 0;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
    background: #000;
  }
  body.has-lens .home-page,
  body.has-lens [data-app],
  body.has-lens .site-footer,
  body.has-lens .canvas { display: none; }
  /* The site's own header returns over the (white) overlays so About/CV/Contact can reach each other. */
  body.has-lens:not(.has-shell-overlay) > .site-header { display: none; }
  /* over the lens, the overlay close sits exactly where the menu button is */
  body.has-lens > .site-header .site-nav { display: none; }
  body.has-lens > .site-header .site-name { gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
  body.has-lens > .site-header .site-avatar { width: 26px; height: 26px; margin: 0; }
  body.has-lens > .site-header .site-name-icon { width: 12px; height: 12px; margin-left: -4px; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
  body.has-lens > .site-header { --pad-r: 14px; --close: 44px; height: calc(env(safe-area-inset-top, 0px) + 60px); padding-top: env(safe-area-inset-top, 0px); padding-left: 20px; transition: none; }

  /* Hidden scrollers Lenis drives; only their movement is used. (Not lenis-*: Lenis strips that prefix.) */
  .lens-proxy {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }
  .lens-proxy > div { width: 100px; height: 100px; }
  .lens[hidden] { display: none; }

  .lens {
    --ease: cubic-bezier(.16, 1, .3, 1);
    --grey: #8e8e93;
    display: block;
    position: fixed;
    z-index: 15;
    inset: 0;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: var(--sans);
    letter-spacing: -.02em;
    /* one finger drives the grid (JS); two fingers stay the browser's, so a zoomed-in page can
       always be pinched back out (with "none" a stray zoom could never be undone) */
    touch-action: pinch-zoom;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
  }
  .lens :focus { outline: none; }
  .lens :focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
  :where(.lens) button { font: inherit; letter-spacing: inherit; color: inherit; }

  .lens-grid {
    position: absolute;
    inset: 0;
    transform-origin: 50% 36%;
    will-change: transform;
  }
  .lens-safe { position: absolute; top: 0; left: 0; width: 0; height: env(safe-area-inset-top, 0px); visibility: hidden; pointer-events: none; }
  .lens-tile,
  .lens-card-media {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    background: #161616;
    backface-visibility: hidden;
    will-change: transform;
  }
  .lens-tile { border-radius: 8px; }
  .lens-tile::after,
  .lens-card-media::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06);
    content: "";
    pointer-events: none;
  }
  .lens-tile img,
  .lens-card-media img,
  .lens-card-media video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
  }
  .lens-card-media video { opacity: 0; transition: opacity .5s ease; }
  .lens-card-media video.is-playing { opacity: 1; }

  /* Blur only where the lens bends: thin strips at the top and sides. */
  .lens-edge { position: absolute; inset: 0; pointer-events: none; }
  .lens-edge.is-top, .lens-edge.is-left, .lens-edge.is-right {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
  .lens-edge.is-top {
    inset: 0 0 auto;
    height: 16%;
    -webkit-mask: linear-gradient(to bottom, #000, transparent);
    mask: linear-gradient(to bottom, #000, transparent);
  }
  .lens-edge.is-left, .lens-edge.is-right { top: 0; bottom: 40%; width: 13%; }
  .lens-edge.is-left {
    right: auto;
    -webkit-mask: linear-gradient(to right, #000, transparent), linear-gradient(to bottom, #000 55%, transparent);
    -webkit-mask-composite: source-in;
    mask: linear-gradient(to right, #000, transparent), linear-gradient(to bottom, #000 55%, transparent);
    mask-composite: intersect;
  }
  .lens-edge.is-right {
    left: auto;
    -webkit-mask: linear-gradient(to left, #000, transparent), linear-gradient(to bottom, #000 55%, transparent);
    -webkit-mask-composite: source-in;
    mask: linear-gradient(to left, #000, transparent), linear-gradient(to bottom, #000 55%, transparent);
    mask-composite: intersect;
  }
  .lens-edge.is-vignette {
    background: radial-gradient(ellipse 75% 60% at 50% 36%, transparent 55%, rgb(0 0 0 / .55) 100%);
  }

  /* Progressive blur under the intro copy. */
  .lens-blur { position: absolute; right: 0; bottom: 0; left: 0; height: 40%; pointer-events: none; }
  .lens-blur > div { position: absolute; inset: 0; }
  .lens-blur > div:nth-child(1) {
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    -webkit-mask: linear-gradient(to bottom, transparent, #000 40%);
    mask: linear-gradient(to bottom, transparent, #000 40%);
  }
  .lens-blur > div:nth-child(2) {
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
    -webkit-mask: linear-gradient(to bottom, transparent 25%, #000 80%);
    mask: linear-gradient(to bottom, transparent 25%, #000 80%);
  }
  .lens-blur::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgb(0 0 0 / 0) 0%, rgb(0 0 0 / .4) 30%, rgb(0 0 0 / .78) 62%, rgb(0 0 0 / .92) 100%);
    content: "";
  }

  /* Darken + blur everything behind an opened piece. */
  .lens-dim {
    position: absolute;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    background: rgb(0 0 0 / .55);
    -webkit-backdrop-filter: blur(18px) saturate(.8);
    backdrop-filter: blur(18px) saturate(.8);
    pointer-events: none;
  }
  /* details up: the grid behind goes darker so the copy reads; the creative stays in view.
     A plain black layer fades in on top (cheap), rather than re-tinting the blurred layer. */
  .lens-dim::after { position: absolute; inset: 0; background: #000; opacity: 0; content: ""; transition: opacity .38s ease; }
  .lens.has-sheet .lens-dim::after { opacity: .69; }
  .lens.is-focused .lens-dim { visibility: visible; }

  .lens-card { position: absolute; inset: 0; perspective: 900px; pointer-events: none; }
  .lens-card[hidden] { display: none; }
  .lens.is-focused .lens-card { pointer-events: auto; }
  .lens-card-media { visibility: hidden; transform-origin: 50% 50%; cursor: pointer; }
  .lens-caption {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;   /* expand button centred on the title + detail lines */
    justify-content: space-between;
    gap: 16px;
    opacity: 0;
    color: var(--grey);
    font-size: 13px;
    line-height: 1.35;
    pointer-events: none;
  }
  .lens.is-focused .lens-caption { pointer-events: auto; }
  .lens-caption b { display: block; color: #fff; font-size: 15px; font-weight: 600; }
  .lens-caption-copy { min-width: 0; }
  .lens-view {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / .12);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease;
  }
  .lens-view:active { transform: scale(.95); background: rgb(255 255 255 / .2); }
  .lens-close {
    position: absolute;
    z-index: 25;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    right: 14px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / .14);
    font-size: 22px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity .2s ease;
  }
  .lens.is-focused .lens-close { opacity: 1; pointer-events: auto; transition: opacity .3s ease .2s; }

  /* Position in the set — swipe the card, or tap the arrows. */
  /* Stepper: two round chevron buttons with the count between them, floating below the card. */
  .lens-count {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    left: 50%;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 44px;
    opacity: 0;
    color: rgb(255 255 255 / .9);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
    transform: translate3d(-50%, 0, 0);
    pointer-events: none;
  }
  .lens.is-focused .lens-count { pointer-events: auto; }
  .lens-count-num {
    min-width: 4.6em;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgb(255 255 255 / .06);
    text-align: center;
  }
  .lens-step {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / .1);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08);
    color: rgb(255 255 255 / .85);
    place-items: center;
    cursor: pointer;
    translate: 0 0;
    transition: color .16s ease, transform .16s ease, background-color .16s ease, translate .55s var(--ease);
  }
  .lens-step:active { color: #fff; background: rgb(255 255 255 / .18); transform: scale(.88); }
  .lens-step svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

  /* Taps shouldn't leave a focus ring on the card controls (keyboards still get one). */
  @media (hover: none) {
    .lens-card :focus-visible { outline: none; }
  }

  /* Safari 26 tints its toolbars from whatever fixed box sits at the viewport's top/bottom
     midpoint. Solid black fixed strips keep that read constant instead of flickering as
     tiles and blurred layers slide underneath; the mask makes them look like a soft fade. */
  .lens-tint {
    position: fixed;
    z-index: 30;
    left: 0;
    width: 100%;
    background-color: #000;
    pointer-events: none;
  }
  .lens-tint.is-top {
    top: 0;
    height: calc(env(safe-area-inset-top, 0px) + 14px);
    -webkit-mask: linear-gradient(to bottom, #000 calc(100% - 14px), transparent);
    mask: linear-gradient(to bottom, #000 calc(100% - 14px), transparent);
  }
  .lens-tint.is-bottom {
    bottom: 0;
    height: calc(env(safe-area-inset-bottom, 0px) + 14px);
    -webkit-mask: linear-gradient(to top, #000 calc(100% - 14px), transparent);
    mask: linear-gradient(to top, #000 calc(100% - 14px), transparent);
  }

  /* ---------- Intro copy ---------- */
  .lens-hero {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0 24px calc(env(safe-area-inset-bottom, 0px) + 20px);
    pointer-events: none;
    transition: opacity .45s ease .1s;
  }
  .lens-hero > * { pointer-events: auto; }
  .lens-hero { isolation: isolate; }
  .lens-hero::before {
    position: absolute;
    z-index: -1;
    inset: -120px 0 0;
    background: linear-gradient(to bottom, rgb(0 0 0 / 0), rgb(0 0 0 / .72) 38%, rgb(0 0 0 / .88) 70%, rgb(0 0 0 / .92));
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%);
    mask-image: linear-gradient(to bottom, transparent, #000 40%);
    pointer-events: none;
    content: "";
  }
  .lens.is-focused .lens-hero { opacity: 0; transition: opacity .25s ease; }
  .lens.is-focused.is-closing .lens-hero { opacity: 1; transition: opacity .2s ease; }
  .lens.is-focused .lens-hero > * { pointer-events: none; }
  .lens-hero p {
    max-width: 18em;
    margin: 0;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.035em;
  }
  .lens-hero p strong { color: #fff; font-weight: 600; }
  .lens-cta {
    display: flex;
    width: 100%;
    margin-top: 24px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: #0a0a0a;   /* deep black, lifted off the blur by a hairline */
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14);
    transition: transform .16s ease, background .16s ease;
  }
  .lens-cta:active { transform: scale(.97); background: #161616; }


  /* ---------- Menu bar ---------- */
  .lens-bar {
    position: absolute;
    z-index: 20;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px 8px 20px;
    background: linear-gradient(to bottom, rgb(0 0 0 / .75), rgb(0 0 0 / 0));
    transition: opacity .3s ease;
  }
  .lens.is-focused .lens-bar { opacity: 0; pointer-events: none; }
  /* menu open: the list scrolls up under a blurred band behind the name and close button */
  .lens-bar::before {
    position: absolute; z-index: -1; inset: 0 0 -40px 0; content: "";
    background: linear-gradient(to bottom, rgb(8 8 8 / .85), rgb(8 8 8 / .5) 60%, rgb(8 8 8 / 0));
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent); mask-image: linear-gradient(to bottom, #000 50%, transparent);
    opacity: 0; pointer-events: none; transition: opacity .3s ease;
  }
  .lens.is-menu .lens-bar::before { opacity: 1; }
  .lens-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
  }
  .lens-chev {
    width: 12px;
    height: 12px;
    margin-left: -4px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .7;
  }
  .lens-mark {
    display: block;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 40%;
    background: #222;
    box-shadow: 0 0 0 1px rgb(255 255 255 / .12);
  }
  .lens-menu-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / .1);
    cursor: pointer;
    transition: background .2s ease, transform .2s var(--ease);
  }
  .lens-menu-btn:active { transform: scale(.92); }
  .lens-menu-btn i {
    position: absolute;
    right: 14px;
    left: 14px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transition: transform .42s var(--ease);
  }
  .lens-menu-btn i:nth-child(1) { top: 18px; }
  .lens-menu-btn i:nth-child(2) { top: 24.5px; }
  .lens-menu-btn[aria-expanded="true"] i:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
  .lens-menu-btn[aria-expanded="true"] i:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

  .lens-menu {
    position: absolute;
    z-index: 15;
    inset: 0;
    visibility: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(env(safe-area-inset-top, 0px) + 80px) 24px calc(env(safe-area-inset-bottom, 0px) + 32px);
    opacity: 0;
    background: rgb(8 8 8 / .8);
    -webkit-backdrop-filter: blur(24px) saturate(.9);
    backdrop-filter: blur(24px) saturate(.9);
    touch-action: pan-y pinch-zoom;
    transition: opacity .28s ease, visibility 0s linear .28s;
  }
  .lens-menu.is-open { visibility: visible; opacity: 1; transition: opacity .36s ease; }
  /* closing: rows lift away into a blur from the bottom up, then the panel fades */
  .lens-menu.is-closing { transition: opacity .34s ease .14s, visibility 0s linear .48s; }
  .lens-menu h2 {
    margin: 0 0 6px;
    color: var(--grey);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .lens-menu ul { margin: 0 0 36px; padding: 0; list-style: none; }
  .lens-menu .lens-info { margin-bottom: 40px; }
  .lens-info .lens-item { font-size: 30px; min-height: 60px; }
  .lens-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 52px;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid rgb(255 255 255 / .08);
    border-radius: 0;
    background: none;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.035em;
    text-align: left;
    cursor: pointer;
  }
  .lens-item .meta {
    flex: none;
    color: var(--grey);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -.01em;
    white-space: nowrap;
  }
  .lens-menu-foot { display: flex; justify-content: space-between; color: var(--grey); font-size: 13px; }
  .lens-menu .reveal {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(12px);
    transition: opacity .2s ease, filter .2s ease, transform .2s ease;
  }
  .lens-menu.is-open .reveal {
    opacity: 1;
    filter: blur(0);
    transform: none;
    transition: opacity .8s var(--ease), filter .8s var(--ease), transform .8s var(--ease);
    transition-delay: var(--d, 0ms);
  }
  .lens-menu.is-closing .reveal {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(-10px);
    transition: opacity .26s ease, filter .3s ease, transform .36s var(--ease);
    transition-delay: var(--dc, 0ms);
  }

  /* Expand button beside the project name (opens the details sheet). */
  .lens-view { width: 36px; padding: 0; justify-content: center; }
  .lens-view svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

  /* ---------- Details sheet: the case-study copy on a dim, like the CV ---------- */
  .lens-sheet {
    position: absolute;
    z-index: 26;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    touch-action: pan-y pinch-zoom;
    transition: opacity .38s ease, visibility 0s linear .38s;
  }
  .lens-sheet[hidden] { display: none; }
  .lens-sheet.is-open { visibility: visible; opacity: 1; transition: opacity .38s ease; }
  .lens-sheet-scroll {
    position: relative;   /* the x is positioned inside it, so it scrolls with the copy */
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(env(safe-area-inset-top, 0px) + 84px) 24px calc(env(safe-area-inset-bottom, 0px) + 124px);
    -webkit-user-select: text;
    user-select: text;
    /* copy scrolling up fades out before it reaches the close button */
    /* scrolling up, the copy fades over the 24px under the creative and goes behind it */
    -webkit-mask-image: linear-gradient(to bottom, transparent var(--fade-top, 0px), #000 calc(var(--fade-top, 0px) + 24px));
    mask-image: linear-gradient(to bottom, transparent var(--fade-top, 0px), #000 calc(var(--fade-top, 0px) + 24px));
    will-change: transform;
  }
  /* Header = the card caption's twin (same type, same spot); the x sits on its right, centred. */
  /* the card's caption shows the title the whole time (it rides with the creative); this twin
     keeps the layout and the dialog's label, but isn't drawn, so the title is never doubled */
  .lens-sheet-head {
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 36px;
    margin: 0 0 16px;
    padding-right: 52px;        /* room for the 36px x plus 16px */
    color: var(--grey);
    font-size: 13px;
    line-height: 1.35;
  }
  .lens-sheet-title { margin: 0; color: #fff; font-size: 15px; font-weight: 600; line-height: inherit; letter-spacing: inherit; }
  .lens-sheet-kicker { margin: 0; }
  .lens-sheet-summary {
    margin: 0;
    color: #fff;
    font-size: clamp(22px, 6.2vw, 28px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.07em;
  }
  .lens-sheet-section { margin-top: 40px; }
  .lens-sheet-section[hidden] { display: none; }
  .lens-sheet-section h3 { margin: 0 0 10px; color: #898989; font-size: 12px; font-weight: 400; letter-spacing: -.01em; }
  .lens-sheet-role { margin: 0; color: #fff; font-size: 17px; font-weight: 600; letter-spacing: -.05em; }
  .lens-sheet-team { margin: 0; color: #ddd; font-size: 15px; line-height: 1.45; letter-spacing: -.03em; }
  .lens-sheet-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    margin-top: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgb(255 255 255 / .12);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
  }
  .lens-sheet-link[hidden] { display: none; }
  .lens-sheet-link:active { background: rgb(255 255 255 / .2); }
  /* Placed by JS exactly over the card's expand button (same size), so one spot toggles. */
  /* Word-by-word reveal, as in the CV overlay. */
  .lens-sheet .w2 { display: inline-block; }
  .lens-sheet :is(.w2, .rv2) {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(8px);
    transition: opacity .42s ease var(--rd, 0ms), filter .5s ease var(--rd, 0ms), transform .55s var(--ease) var(--rd, 0ms);
  }
  .lens-sheet.is-revealed :is(.w2, .rv2) { opacity: 1; filter: none; transform: none; }
  .lens-sheet:not(.is-open) :is(.w2, .rv2) { transition: none; }
  /* While the sheet is up, the card's own controls step back. */
  .lens.has-sheet .lens-card { z-index: 28; pointer-events: none; }
  /* stepping projects with the details up: the copy fades out; then the new words reset instantly */
  .lens-sheet.is-swapping .lens-sheet-scroll > * { opacity: 0; transition: opacity .16s ease; }
  .lens-sheet.is-resetting :is(.w2, .rv2) { transition: none !important; }

  /* Expanded view: a scrim with a light blur along the bottom (like the header band over About /
     CV / Contact) under the counter; the copy scrolls away beneath it. */
  .lens-band {
    position: absolute;
    z-index: 27;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(env(safe-area-inset-bottom, 0px) + 116px);
    visibility: hidden;
    opacity: 0;
    background: linear-gradient(to top, rgb(0 0 0 / .8), rgb(0 0 0 / .5) 60%, rgb(0 0 0 / 0));
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    -webkit-mask-image: linear-gradient(to top, #000 50%, transparent);
    mask-image: linear-gradient(to top, #000 50%, transparent);
    pointer-events: none;
    transition: opacity .25s ease, visibility 0s linear .25s;
  }
  .lens.has-sheet .lens-band { visibility: visible; opacity: 1; transition: opacity .35s ease .1s; }
  .lens.has-sheet :is(.lens-card-media, .lens-caption, .lens-count) { pointer-events: none; }
  .lens.has-sheet .lens-step { pointer-events: auto; }
  /* the arrows spread to the bottom corners as the creative rises; the number stays in the middle */
  .lens.has-sheet .lens-step[data-step="-1"] { translate: var(--spread-l, 0) 0; }
  .lens.has-sheet .lens-step[data-step="1"] { translate: var(--spread-r, 0) 0; }
  .lens.has-sheet .lens-close { pointer-events: auto; }
  /* the expand button fades away as the details open; the × in the corner is the only close */
  .lens-view { transition: transform .16s ease, background .16s ease, opacity .2s ease; }
  .lens.has-sheet .lens-view { opacity: 0; }

  /* Tablets held upright: same layout, scaled for the bigger screen. */
  @media (min-width: 600px) {
    .lens-hero { padding: 0 40px calc(env(safe-area-inset-bottom, 0px) + 32px); }
    /* intro copy and CTA span the full width between equal margins; type scales to fill it */
    .lens-hero p { max-width: none; font-size: clamp(28px, 5.8vw, 60px); text-wrap: pretty; }
    .lens-bar { padding-left: 32px; padding-right: 24px; }
    body.has-lens > .site-header { --pad-r: 24px; padding-left: 32px; }
    .lens-menu { padding-left: max(40px, calc((100% - 640px) / 2)); padding-right: max(40px, calc((100% - 640px) / 2)); }
    .lens-sheet-scroll { padding-left: max(40px, calc((100% - 640px) / 2)); padding-right: max(40px, calc((100% - 640px) / 2)); }
    .lens-sheet-summary { font-size: 34px; }
    .lens-caption b, .lens-sheet-title { font-size: 17px; }
  }

  /* ---------- Load: copy fades up out of a blur (keyframes so the start state always applies) ---------- */
  .lens .w { display: inline-block; }
  @keyframes lens-rv-in {
    from { opacity: 0; filter: blur(10px); transform: translateY(10px); }
    to { opacity: 1; filter: blur(0); transform: none; }
  }
  .lens.is-intro .rv { animation: lens-rv-in 1.1s var(--ease) var(--d, 0ms) both; }
  /* intro copy: the desktop hero's reveal (1.9s a word, heavy blur, ~105ms apart) */
  @keyframes lens-word-in {
    0% { opacity: 0; filter: blur(18px); transform: translate3d(0, .3em, 0); }
    45% { opacity: .75; }
    100% { opacity: 1; filter: blur(0); transform: none; }
  }
  .lens.is-intro .lens-hero .w.rv { animation: lens-word-in 1.9s var(--ease) var(--d, 0ms) both; }
  .lens.is-intro .lens-cta.rv { animation: lens-rv-in 1.6s var(--ease) var(--d, 0ms) both; }
  /* back from a card: the intro copy blurs in again, quicker */
  .lens.is-return .lens-hero .rv { animation: lens-rv-in .5s var(--ease) var(--d2, 0ms) both; }
}

/* Only ever matches lens elements, so it needs no width condition. */
@media (prefers-reduced-motion: reduce) {
  .lens-cta, .lens-menu, .lens-menu .reveal, .lens-menu-btn i, .lens-bar {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .lens.is-intro .rv, .lens.is-return .rv { animation: none !important; }
  .lens-menu.is-closing, .lens-menu.is-closing .reveal { transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .lens-band, .lens-step { transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .lens-sheet, .lens-sheet :is(.w2, .rv2) { transition-duration: 1ms !important; transition-delay: 0ms !important; }
}
