.modal-overlay {
      position: fixed; inset: 0;
      background: rgba(8,9,11,0.72);
      -webkit-backdrop-filter: blur(12px);
      backdrop-filter: blur(12px);
      z-index: 50;
      opacity: 0;
      pointer-events: none;
      transition: opacity .28s ease;
      display: grid;
      place-items: center;
      padding: 24px;
    }
    .modal-overlay.open {
      opacity: 1;
      pointer-events: auto;
    }
    /* Selected project: same cream playing-card bezel as 3D tiles, scaled up */
    .modal {
      --bezel: 14px;
      width: min(360px, 90vw);
      background: var(--tile);
      color: var(--tile-ink);
      border-radius: 22px;
      padding: var(--bezel);
      overflow: hidden;
      box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.5),
        0 28px 56px -14px rgba(0,0,0,0.55),
        0 48px 100px -40px rgba(0,0,0,0.7);
      transform: translateY(12px) scale(0.98);
      transition: transform .32s cubic-bezier(.2,.8,.2,1);
    }
    .modal-overlay.open .modal {
      transform: translateY(0) scale(1);
    }
    .modal-chrome {
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 2px 10px;
      font-family: var(--mono);
      font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
      color: #666;
      background: transparent;
    }
    .modal-chrome .file-name { color: #222; }
    .modal-close {
      appearance: none; border: 0; background: transparent;
      color: #666; cursor: pointer; font-size: 16px;
      width: 24px; height: 24px;
      display: grid; place-items: center;
      border-radius: 6px;
    }
    .modal-close:hover { background: rgba(0,0,0,.08); color: #111; }
    .modal-img {
      width: 100%;
      aspect-ratio: 3 / 4;
      background-size: cover;
      background-position: center;
      background-color: #2a2a2a;
      position: relative;
      overflow: hidden;
      border-radius: 10px;
      box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
    }
    .modal-video {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      background: #111;
    }
    .modal-body {
      padding: 14px 4px 6px;
    }
    .modal-eyebrow {
      font-family: var(--mono);
      font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
      color: #777;
      display: flex; justify-content: space-between;
      margin-bottom: 8px;
    }
    .modal-awards {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-start;
      gap: 12px;
      margin: 4px 0 14px;
    }
    .modal-awards:empty { display: none; margin: 0; }
    .modal-awards .award {
      display: block;
      height: 64px;
      overflow: hidden;
      line-height: 0;
      clip-path: inset(1.5% round 2px);
    }
    .modal-awards .award img {
      display: block;
      width: auto;
      height: 64px;
      max-width: 88px;
      object-fit: contain;
      -webkit-user-drag: none;
      user-select: none;
      pointer-events: none;
    }
    .modal-title {
      font-family: var(--mono);
      font-weight: 500;
      font-size: 13px;
      line-height: 1.25;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      margin: 0;
      color: var(--tile-ink);
    }
    .modal-sub {
      font-family: var(--serif);
      font-style: italic;
      font-size: 15px;
      color: #666;
      margin: 6px 0 0;
    }
    .modal-actions {
      display: flex; gap: 8px;
      padding: 14px 2px 4px;
    }
    .modal-actions a, .modal-actions button {
      flex: 1;
      appearance: none;
      border: 1px solid rgba(0,0,0,.14);
      background: transparent;
      color: #141414;
      cursor: pointer;
      padding: 11px 12px;
      border-radius: 6px;
      font-family: var(--mono);
      font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
      text-decoration: none;
      text-align: center;
      transition: background .2s, color .2s, border-color .2s;
    }
    .modal-actions a.primary,
    .modal-actions button.primary {
      background: #141414; color: #f2f0ea; border-color: #141414;
    }
    .modal-actions a.primary:hover,
    .modal-actions button.primary:hover { background: #000; }
    .modal-actions button:hover { background: #141414; color: #f2f0ea; }

    /* Case study view — same cream card language as tiles/modal, full-screen */
    .project-view {
      position: fixed; inset: 0;
      z-index: 70;
      display: grid;
      place-items: center;
      padding: clamp(56px, 8vh, 72px) clamp(18px, 3vw, 36px) clamp(18px, 3vh, 28px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .45s cubic-bezier(.2,.8,.2,1);
      background:
        radial-gradient(ellipse 90% 60% at 50% 35%, var(--bg-glow), transparent 70%),
        radial-gradient(ellipse 70% 50% at 80% 90%, var(--accent-wash), transparent 55%),
        var(--bg);
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }
    .project-view.open {
      opacity: 1;
      pointer-events: auto;
    }
    body.showing-project .stage,
    body.showing-project .brand-stack,
    body.showing-project .foot,
    body.showing-project .modal-overlay,
    body.showing-project .mobile-reel,
    body.showing-project .mobile-scroll-hint,
    body.showing-contact .stage,
    body.showing-contact .brand-stack,
    body.showing-contact .foot,
    body.showing-contact .modal-overlay,
    body.showing-contact .mobile-reel,
    body.showing-contact .mobile-scroll-hint {
      opacity: 0 !important;
      pointer-events: none !important;
      transition: opacity .35s ease;
    }
    .project-back {
      position: fixed;
      top: 28px; left: 36px;
      z-index: 72;
      appearance: none;
      border: 1px solid var(--panel-border);
      border-radius: 6px;
      background: var(--panel-bg);
      color: var(--ink);
      font-family: var(--mono);
      font-size: 10px;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      padding: 12px 16px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      box-shadow:
        inset 0 0 0 1px var(--panel-inset),
        var(--panel-lift);
      transition: border-color .2s, color .2s, background .2s, box-shadow .2s;
    }
    .project-back:hover {
      border-color: var(--accent);
      color: var(--accent);
    }
    .project-back .arrow {
      color: var(--accent);
      font-size: 14px;
      line-height: 1;
    }
    .project-panel {
      --bezel: 14px;
      --panel-max-h: min(820px, calc(100vh - 96px));
      width: min(960px, calc(100vw - 48px));
      max-height: var(--panel-max-h);
      margin: 0;
      display: grid;
      /* Default: portrait / near-square — side-by-side like tactic.studio/work */
      grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.95fr);
      gap: clamp(14px, 2vw, 22px);
      align-items: stretch;
      background: var(--tile);
      color: var(--tile-ink);
      border-radius: 20px;
      padding: var(--bezel);
      box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.5),
        0 28px 56px -14px rgba(0,0,0,0.55),
        0 48px 100px -40px rgba(0,0,0,0.7);
      transform: translateY(18px) scale(0.985);
      transition: transform .5s cubic-bezier(.2,.8,.2,1);
      overflow: hidden;
    }
    .project-view.open .project-panel {
      transform: translateY(0) scale(1);
    }
    /* Landscape / 16:9 — video on top (full width), copy below; fits one viewport */
    .project-panel.is-landscape {
      grid-template-columns: 1fr;
      grid-template-rows: auto minmax(0, 1fr);
      width: min(920px, calc(100vw - 48px));
      --media-max-h: min(50vh, 460px);
    }
    .project-media {
      position: relative;
      border-radius: 12px;
      overflow: hidden;
      align-self: center;
      justify-self: center;
      width: max-content;
      max-width: 100%;
      max-height: calc(var(--panel-max-h) - (var(--bezel) * 2));
      background: #111;
      line-height: 0;
      min-height: 0;
      min-width: 0;
      isolation: isolate;
    }
    /* Poster drives frame size so swaps don't collapse before video metadata arrives */
    .project-poster {
      display: block;
      max-width: 100%;
      max-height: calc(var(--panel-max-h) - (var(--bezel) * 2));
      width: auto;
      height: auto;
      vertical-align: top;
      background: #111;
      user-select: none;
      pointer-events: none;
    }
    .project-media video {
      position: absolute;
      inset: 0;
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      background: transparent;
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s ease;
      /* Bias crop toward the right edge where encode fringe often sits */
      transform: scale(1.09);
      transform-origin: 30% center;
    }
    .project-media.has-started video,
    .project-media.is-playing video {
      opacity: 1;
    }
    .project-panel.is-landscape .project-media {
      width: max-content;
      max-width: 100%;
      max-height: var(--media-max-h);
      justify-self: center;
      background: #111;
      overflow: hidden;
    }
    .project-panel.is-landscape .project-poster {
      max-height: var(--media-max-h);
    }
    .project-panel.is-landscape .project-media video {
      transform: scale(1.09);
      transform-origin: 30% center;
    }
    .project-play {
      position: absolute;
      inset: 0;
      margin: auto;
      width: 52px; height: 52px;
      border-radius: 50%;
      border: 0;
      background: rgba(10, 11, 13, 0.72);
      /* Icon stays cream on the dark disc in both themes (var(--ink) inverts in light mode) */
      color: #f2f0ea;
      cursor: pointer;
      display: grid;
      place-items: center;
      transition: transform .25s ease, background .2s, opacity .25s;
      z-index: 2;
    }
    .project-play:hover { transform: scale(1.06); background: rgba(10, 11, 13, 0.88); }
    .project-play svg { width: 20px; height: 20px; margin-left: 2px; }
    .project-media.is-playing .project-play { opacity: 0; pointer-events: none; }
    .project-copy {
      display: flex;
      flex-direction: column;
      min-width: 0;
      min-height: 0;
      padding: 6px 6px 4px 0;
      max-height: calc(var(--panel-max-h) - (var(--bezel) * 2));
      overflow: hidden;
    }
    .project-panel.is-landscape .project-copy {
      padding: 2px 4px 4px;
      max-height: none; /* fills remaining row under video */
    }
    .project-actions {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      gap: 0;
      padding: 0;
      margin: 0;
      background: var(--tile);
      position: sticky;
      top: 0;
      z-index: 2;
    }
    .project-actions button {
      appearance: none;
      border: 1px solid rgba(0,0,0,.14);
      background: transparent;
      color: #141414;
      cursor: pointer;
      padding: 11px 14px;
      border-radius: 6px;
      font-family: var(--mono);
      font-size: 9px;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      text-align: center;
      transition: background .2s, color .2s, border-color .2s;
      align-self: flex-start;
    }
    .project-actions button:hover { background: #141414; color: #f2f0ea; }
    .project-identity {
      flex-shrink: 0;
      padding: 14px 2px 0 0;
      background: var(--tile);
    }
    .project-gallery {
      flex-shrink: 0;
      display: none;
      flex-direction: column;
      gap: 10px;
      padding: 14px 2px 0 0;
      background: var(--tile);
    }
    .project-panel.has-gallery .project-gallery { display: flex; }
    .project-gallery-nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .project-gallery-index {
      font-family: var(--mono);
      font-size: 10px;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: #777;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .project-gallery-index .num { color: #141414; }
    .project-gallery-index .sep { color: #bbb; margin: 0 0.15em; }
    .project-gallery-controls {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .project-gallery-controls button {
      appearance: none;
      width: 28px;
      height: 28px;
      border: 1px solid rgba(0,0,0,.14);
      border-radius: 6px;
      background: transparent;
      color: #141414;
      cursor: pointer;
      font-family: var(--mono);
      font-size: 12px;
      line-height: 1;
      display: grid;
      place-items: center;
      transition: background .2s, color .2s, border-color .2s, opacity .2s;
    }
    .project-gallery-controls button:hover:not(:disabled) {
      background: #141414;
      color: #f2f0ea;
      border-color: #141414;
    }
    .project-gallery-controls button:disabled {
      opacity: 0.28;
      cursor: default;
    }
    .project-gallery-progress {
      display: flex;
      gap: 4px;
      height: 2px;
    }
    .project-gallery-progress span {
      flex: 1;
      height: 100%;
      background: rgba(0,0,0,0.1);
      border-radius: 1px;
      transition: background .25s ease;
    }
    .project-gallery-progress span.is-active {
      background: #141414;
    }
    .project-gallery-progress span.is-done {
      background: rgba(0,0,0,0.28);
    }
    /* Dedicated fade strip — owns layout space so it never overlaps copy */
    .project-identity::after,
    .project-panel.has-gallery .project-gallery::after {
      content: '';
      display: block;
      height: 18px;
      margin-top: 14px;
      background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.04) 40%,
        transparent 100%
      );
      pointer-events: none;
    }
    .project-panel.has-gallery .project-identity::after { display: none; }
    .project-copy-scroll-wrap {
      flex: 1 1 auto;
      min-height: 0;
      min-width: 0;
      display: flex;
      flex-direction: column;
    }
    .project-copy-scroll {
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      scrollbar-width: thin;
      padding: 0 2px 0 0;
    }
    .project-scroll-rail {
      display: none;
    }
    .project-media {
      transition: opacity .28s ease, transform .32s cubic-bezier(.2,.8,.2,1);
    }
    .project-media.is-swapping {
      opacity: 0.2;
      transform: translateX(var(--gallery-exit, -10px));
    }
    .project-eyebrow {
      font-family: var(--mono);
      font-size: 9px;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: #777;
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }
    .project-eyebrow .accent { color: #555; }
    .project-title {
      font-family: var(--mono);
      font-weight: 500;
      font-size: clamp(15px, 1.8vw, 22px);
      line-height: 1.15;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin: 0;
      color: var(--tile-ink);
    }
    .project-client {
      font-family: var(--serif);
      font-style: italic;
      font-size: 15px;
      color: #666;
      margin: 8px 0 0;
    }
    .project-more {
      display: none;
      margin-top: 18px;
      appearance: none;
      border: 0;
      background: transparent;
      padding: 0;
      cursor: pointer;
      font-family: var(--mono);
      font-size: 9px;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: #777;
      transition: color .2s;
    }
    .project-panel.has-gallery .project-more.is-visible { display: inline-flex; align-items: center; gap: 8px; }
    .project-more:hover { color: #141414; }
    .project-more .arrow { color: #141414; font-size: 12px; }
    .project-awards {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 16px;
      margin: 14px 0;
    }
    .project-awards:empty { display: none; margin: 0; }
    .project-awards .award {
      display: block;
      height: 112px;
      overflow: hidden;
      line-height: 0;
      /* Hide any 1px plate/halo without eating into the badge art */
      clip-path: inset(1.5% round 2px);
    }
    .project-awards .award img {
      display: block;
      height: 112px;
      width: auto;
      max-width: 144px;
      object-fit: contain;
      -webkit-user-drag: none;
      user-select: none;
      pointer-events: none;
    }
    .project-lede {
      font-family: var(--sans);
      font-style: normal;
      font-size: 14px;
      line-height: 1.6;
      font-weight: 600;
      color: var(--tile-ink);
      margin: 0 0 12px;
    }
    .project-lede:empty { display: none; margin: 0; }
    .project-body {
      font-family: var(--sans);
      font-style: normal;
      font-size: 13px;
      font-weight: 400;
      line-height: 1.65;
      color: #444;
    }
    .project-body p { margin: 0 0 12px; }
    .project-body p:last-child { margin-bottom: 0; }

    /* Contact view — same cream card language as project tiles */

    body.showing-project .mobile-about-reel,
    body.showing-project .mobile-about-reel + .mobile-scroll-hint,
    body.showing-project .about-overlay {
      opacity: 0 !important;
      pointer-events: none !important;
      transition: opacity .35s ease;
    }

    /*
     * Mobile project overlays (preview modal + case study).
     * Breakpoint matches Work/About mobile reels (max-width: 900px).
     */
    @media (max-width: 900px) {
      /*
       * Keep mobile chrome (TACTIC lockup + hamburger) above project overlays.
       * site-menu.js fades this chrome on showing-project; override for touch QA.
       */
      body.showing-modal .mobile-topbar,
      body.showing-project .mobile-topbar,
      body:has(.modal-overlay.open) .mobile-topbar {
        z-index: 80;
        opacity: 1 !important;
        pointer-events: none;
      }
      body.showing-modal .brand-stack,
      body.showing-project .brand-stack,
      body:has(.modal-overlay.open) .brand-stack {
        z-index: 81;
        opacity: 1 !important;
        pointer-events: none;
      }
      body.showing-modal .brand-home,
      body.showing-project .brand-home,
      body:has(.modal-overlay.open) .brand-home {
        pointer-events: auto !important;
      }
      body.showing-modal .site-menu-stack,
      body.showing-project .site-menu-stack,
      body:has(.modal-overlay.open) .site-menu-stack {
        z-index: 82;
        opacity: 1 !important;
        pointer-events: none;
      }
      body.showing-modal .site-menu,
      body.showing-project .site-menu,
      body:has(.modal-overlay.open) .site-menu {
        pointer-events: auto !important;
      }
      body.showing-modal .site-menu-sheet.open,
      body.showing-project .site-menu-sheet.open,
      body:has(.modal-overlay.open) .site-menu-sheet.open {
        z-index: 85;
      }

      .modal-close,
      .modal-actions a,
      .modal-actions button,
      .project-back,
      .project-actions button {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        min-height: 44px;
      }
      .modal-close {
        min-width: 44px;
      }

      /* Dim carousel behind an open preview — same treatment as showing-about */
      body:has(.modal-overlay.open) .mobile-about-reel,
      body.showing-modal .mobile-about-reel {
        filter: blur(8px) saturate(0.7);
        opacity: 0.45;
        pointer-events: none;
        transition: filter .35s ease, opacity .35s ease;
      }
      body:has(.modal-overlay.open) .mobile-about-reel + .mobile-scroll-hint,
      body.showing-modal .mobile-about-reel + .mobile-scroll-hint {
        opacity: 0 !important;
      }

      .modal-overlay {
        padding:
          calc(var(--mobile-topbar-h, 56px) + env(safe-area-inset-top, 0px) + 12px)
          max(14px, calc(env(safe-area-inset-right, 0px) + 14px))
          calc(18px + env(safe-area-inset-bottom, 0px))
          max(14px, calc(env(safe-area-inset-left, 0px) + 14px));
        place-items: start center;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        box-sizing: border-box;
      }
      .modal {
        width: min(360px, 100%);
        max-height: min(
          84dvh,
          calc(
            100dvh
            - var(--mobile-topbar-h, 56px)
            - env(safe-area-inset-top, 0px)
            - env(safe-area-inset-bottom, 0px)
            - 36px
          )
        );
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }
      .modal-img {
        aspect-ratio: 3 / 4;
        width: 100%;
        height: auto;
        max-height: min(42dvh, 320px);
      }

      .project-back {
        top: calc(var(--mobile-topbar-h, 56px) + env(safe-area-inset-top, 0px) + 8px);
        left: max(14px, env(safe-area-inset-left, 0px));
        z-index: 79;
      }
      .project-view {
        padding:
          calc(64px + env(safe-area-inset-top, 0px))
          max(14px, calc(env(safe-area-inset-right, 0px) + 14px))
          max(18px, calc(env(safe-area-inset-bottom, 0px) + 18px))
          max(14px, calc(env(safe-area-inset-left, 0px) + 14px));
        place-items: start center;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
      }
      .project-panel {
        --panel-max-h: none;
        width: min(560px, 100%);
        max-width: 100%;
        max-height: none;
        grid-template-columns: 1fr;
        grid-template-rows: none;
        overflow: visible;
        box-sizing: border-box;
      }
      .project-panel.is-landscape {
        width: min(560px, 100%);
        --media-max-h: min(36vh, 260px);
      }
      .project-media {
        max-height: min(42vh, 320px);
      }
      .project-poster {
        max-height: min(42vh, 320px);
      }
      .project-panel.is-landscape .project-media,
      .project-panel.is-landscape .project-poster {
        max-height: var(--media-max-h);
      }
      .project-copy {
        max-height: none;
        padding: 4px 2px 8px;
        overflow: visible;
      }
      .project-actions {
        position: sticky;
        top: 0;
        padding-bottom: 4px;
      }
      .project-copy-scroll {
        overflow: visible;
      }
    }

    @media (max-width: 900px) and (orientation: landscape) {
      .modal-overlay {
        padding:
          calc(var(--mobile-topbar-h, 44px) + env(safe-area-inset-top, 0px) + 8px)
          max(16px, calc(env(safe-area-inset-right, 0px) + 12px))
          max(10px, calc(env(safe-area-inset-bottom, 0px) + 6px))
          max(16px, calc(env(safe-area-inset-left, 0px) + 12px));
        place-items: center;
        overflow: hidden;
      }
      .modal {
        --bezel: 10px;
        width: 100%;
        max-width: min(640px, 100%);
        max-height: min(
          88dvh,
          calc(
            100dvh
            - var(--mobile-topbar-h, 44px)
            - env(safe-area-inset-top, 0px)
            - env(safe-area-inset-bottom, 0px)
            - 20px
          )
        );
        display: grid;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas:
          "chrome chrome"
          "media body"
          "actions actions";
        gap: 8px 12px;
        overflow: hidden;
      }
      .modal-chrome {
        grid-area: chrome;
        padding-bottom: 4px;
      }
      .modal-img {
        grid-area: media;
        aspect-ratio: 3 / 4;
        width: 100%;
        height: auto;
        max-height: 100%;
        min-height: 0;
        align-self: center;
      }
      .modal-body {
        grid-area: body;
        padding: 0 2px;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
      }
      .modal-awards {
        margin: 2px 0 8px;
        gap: 8px;
      }
      .modal-awards .award {
        height: 48px;
      }
      .modal-awards .award img {
        height: 48px;
        max-width: 64px;
      }
      .modal-title {
        font-size: 11px;
      }
      .modal-sub {
        font-size: 13px;
        margin-top: 4px;
      }
      .modal-actions {
        grid-area: actions;
        padding: 4px 2px 2px;
        gap: 6px;
      }
      .modal-actions a,
      .modal-actions button {
        padding: 8px 10px;
        font-size: 8px;
      }

      .project-back {
        top: calc(var(--mobile-topbar-h, 44px) + env(safe-area-inset-top, 0px) + 6px);
        left: max(10px, env(safe-area-inset-left, 0px));
        padding: 8px 12px;
        font-size: 9px;
        z-index: 79;
      }
      .project-view {
        padding:
          calc(32px + env(safe-area-inset-top, 0px))
          max(16px, calc(env(safe-area-inset-right, 0px) + 12px))
          max(10px, calc(env(safe-area-inset-bottom, 0px) + 6px))
          max(16px, calc(env(safe-area-inset-left, 0px) + 12px));
        place-items: center;
        overflow: hidden;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
      }
      .project-panel,
      .project-panel.is-landscape,
      .project-panel.is-portrait {
        --bezel: 10px;
        --panel-max-h:
          calc(
            100dvh
            - 32px - env(safe-area-inset-top, 0px)
            - 10px - env(safe-area-inset-bottom, 0px)
            - 12px
          );
        --media-max-h: min(calc(var(--panel-max-h) - (var(--bezel) * 2)), 78%);
        --media-max-w: min(26vw, 152px);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        max-height: var(--panel-max-h);
        height: var(--panel-max-h);
        grid-template-columns: minmax(0, var(--media-max-w)) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        column-gap: 12px;
        overflow: hidden;
        align-items: stretch;
      }
      .project-panel.is-landscape {
        --media-max-w: min(34vw, 220px);
        --media-max-h: min(42vh, calc(var(--panel-max-h) - (var(--bezel) * 2) - 8px));
        grid-template-columns: minmax(0, var(--media-max-w)) minmax(0, 1fr);
      }
      .project-panel.is-portrait {
        --media-max-w: min(24vw, 140px);
        --media-max-h: min(calc(var(--panel-max-h) - (var(--bezel) * 2)), 86%);
      }
      .project-media,
      .project-panel.is-landscape .project-media,
      .project-panel.is-portrait .project-media {
        align-self: center;
        justify-self: center;
        width: max-content;
        max-width: var(--media-max-w);
        height: auto;
        max-height: var(--media-max-h);
        min-height: 0;
        min-width: 0;
      }
      .project-poster,
      .project-panel.is-landscape .project-poster,
      .project-panel.is-portrait .project-poster {
        display: block;
        width: auto;
        height: auto;
        max-width: var(--media-max-w);
        max-height: var(--media-max-h);
        object-fit: contain;
        object-position: center;
      }
      .project-panel.is-landscape .project-media video,
      .project-media video {
        object-fit: contain;
        transform: none;
        background: #111;
      }
      .project-play {
        width: 40px;
        height: 40px;
      }
      .project-play svg {
        width: 16px;
        height: 16px;
      }
      .project-copy,
      .project-panel.is-landscape .project-copy {
        display: flex;
        flex-direction: column;
        min-width: 0;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        padding: 0 2px 0 0;
        overflow: hidden;
      }
      .project-actions,
      .project-identity,
      .project-gallery {
        flex: 0 0 auto;
        position: static;
        background: var(--tile);
      }
      .project-actions {
        padding: 0 0 2px;
      }
      .project-actions button {
        padding: 8px 10px;
        font-size: 8px;
      }
      .project-identity {
        padding: 8px 10px 0 0;
      }
      .project-eyebrow {
        margin-bottom: 6px;
        font-size: 8px;
      }
      .project-title {
        font-size: clamp(13px, 2.8vw, 17px);
        line-height: 1.2;
      }
      .project-client {
        margin-top: 4px;
        font-size: 13px;
      }
      .project-gallery {
        padding: 8px 10px 0 0;
        gap: 6px;
      }
      .project-gallery-controls button {
        width: 28px;
        height: 28px;
      }
      .project-copy-scroll-wrap {
        flex: 1 1 auto;
        min-height: 0;
        min-width: 0;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 6px;
      }
      .project-copy-scroll {
        flex: 1 1 auto;
        min-height: 0;
        min-width: 0;
        overflow-x: hidden;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        scrollbar-width: none;
        padding: 8px 8px 10px 0;
        box-sizing: border-box;
      }
      .project-copy-scroll::-webkit-scrollbar {
        width: 0;
        height: 0;
      }
      .project-scroll-rail {
        flex: 0 0 4px;
        display: block;
        align-self: stretch;
        margin: 8px 2px 8px 0;
        border-radius: 4px;
        background: rgba(20, 20, 20, 0.1);
        position: relative;
        overflow: hidden;
        opacity: 0.7;
        transition: opacity .2s ease;
      }
      .project-scroll-rail.is-active {
        opacity: 1;
      }
      .project-scroll-rail.is-idle {
        opacity: 0;
        pointer-events: none;
      }
      .project-scroll-thumb {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 30%;
        border-radius: 4px;
        background: rgba(20, 20, 20, 0.38);
        pointer-events: none;
        will-change: transform, height;
      }
      .project-lede {
        font-size: 13px;
        line-height: 1.45;
        overflow-wrap: break-word;
      }
      .project-body {
        font-size: 12px;
        line-height: 1.5;
        overflow-wrap: break-word;
      }
      .project-panel.has-gallery .project-gallery::after {
        height: 10px;
        margin-top: 6px;
      }
    }
