  /* ============================================================
     ATRIUM — right edge, presentation hall for placed artifacts
  ============================================================ */
  /* ============================================================
     ATRIUM HANDLE — three-state vertical blade
     Collapsed: 28px wide, vertical text 'atrium', brushed metal
                accent on the visible left edge
     Expanded: same width but with attention pulse + stronger glow
                (this is the moment the user has noticed it)
     Hidden:    when the Atrium panel is open
  ============================================================ */
  .atrium-handle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 116px;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 30;
    /* Dark glass body with subtle warm tint, mirroring drawer language */
    background:
      linear-gradient(
        180deg,
        rgba(50, 35, 22, 0.18) 0%,
        rgba(15, 10, 8, 0.32) 100%
      );
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 8px 0 0 8px;
    /* Brushed-metal accent — a vertical edge-of-light on the left side
       (where the panel emerges from). Subtle warm rim on the right. */
    box-shadow:
      /* Outer glow, gentle */
      -3px 0 14px rgba(232, 196, 120, 0.10),
      /* Inner left edge — the brushed gold accent */
      inset 2px 0 0 rgba(232, 196, 120, 0.55),
      inset 3px 0 0 rgba(184, 133, 74, 0.25);
    color: rgba(220, 170, 100, 0.62);
    opacity: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }
  body.revealed[data-state="idle"] .atrium-handle,
  body.revealed[data-state="live"] .atrium-handle {
    opacity: 1;
    /* Continuous slow shimmer of the brushed-gold accent */
    animation: handle-shimmer 4.5s ease-in-out infinite;
  }
  @keyframes handle-shimmer {
    0%, 100% {
      box-shadow:
        -3px 0 14px rgba(232, 196, 120, 0.10),
        inset 2px 0 0 rgba(232, 196, 120, 0.55),
        inset 3px 0 0 rgba(184, 133, 74, 0.25);
    }
    50% {
      box-shadow:
        -4px 0 22px rgba(232, 196, 120, 0.30),
        inset 2px 0 0 rgba(255, 220, 160, 0.85),
        inset 3px 0 0 rgba(214, 168, 106, 0.45);
    }
  }
  .atrium-handle:hover {
    color: var(--gold-icon);
    background: linear-gradient(
      180deg,
      rgba(70, 48, 28, 0.32) 0%,
      rgba(25, 18, 12, 0.45) 100%
    );
    box-shadow:
      -5px 0 26px rgba(232, 196, 120, 0.42),
      inset 2px 0 0 rgba(255, 230, 180, 0.95),
      inset 3px 0 0 rgba(232, 196, 120, 0.6);
  }
  /* When the Atrium panel is open, the handle rides its left edge —
     anchored to the thing it controls so the relationship is unambiguous */
  /* Open panel: the tab steps aside entirely — the left lane and a
     right-swipe close the Atrium (TK, 2026-06-12). The compound selector
     outweighs the revealed[data-state] visibility rule above. */
  body.revealed.atrium-open .atrium-handle,
  body.atrium-open .atrium-handle {
    right: 38%;
    opacity: 0;
    pointer-events: none;
    transition: right 0.6s cubic-bezier(0.7, 0, 0.2, 1),
                opacity 0.45s ease,
                box-shadow 0.5s ease,
                color 0.3s ease,
                background 0.3s ease;
  }
  @media (max-width: 720px) {
    body.atrium-open .atrium-handle {
      right: 92%;
    }
  }
  .atrium-handle {
    transition:
      right 0.6s cubic-bezier(0.7, 0, 0.2, 1),
      opacity 1.2s ease,
      box-shadow 0.5s ease,
      color 0.3s ease,
      transform 0.4s ease,
      background 0.3s ease;
  }
  .atrium-handle-inner {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: inherit;
    pointer-events: none;
    user-select: none;
  }
  .atrium-badge {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%) scale(0.4);
    width: 16px; height: 16px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--gold-light), var(--gold-warm));
    color: var(--bg-0);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 10px rgba(232, 196, 120, 0.65);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    pointer-events: none;
  }
  .atrium-badge.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  .atrium-handle.pulse {
    animation: handle-pulse 1.4s ease-out;
  }
  @keyframes handle-pulse {
    0% {
      box-shadow:
        -7px 0 38px rgba(232, 196, 120, 0.85),
        inset 2px 0 0 rgba(255, 240, 210, 1),
        inset 3px 0 0 rgba(255, 220, 160, 0.85);
      filter: brightness(1.35);
    }
    100% {
      box-shadow:
        -3px 0 14px rgba(232, 196, 120, 0.10),
        inset 2px 0 0 rgba(232, 196, 120, 0.55),
        inset 3px 0 0 rgba(184, 133, 74, 0.25);
      filter: brightness(1);
    }
  }

  .atrium {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 38%;
    min-width: 400px;
    max-width: 560px;
    background: rgba(13, 11, 10, 0.82);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    border-left: 1px solid rgba(220, 170, 100, 0.22);
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.7, 0, 0.2, 1);
    z-index: 28;
    overflow-y: auto;
    /* the left lane: room for the feel rail + a half-breath before the
       assets (TK: balance — the images eat the reclaimed space), and the
       lane itself is the door — touch it to close */
    padding: 36px 20px 80px 50px;
    display: flex;
    flex-direction: column;
  }
  .atrium.open { transform: translateX(0); }
  .atrium::-webkit-scrollbar { width: 4px; }
  .atrium::-webkit-scrollbar-track { background: transparent; }
  .atrium::-webkit-scrollbar-thumb { background: var(--bone-15); border-radius: 2px; }

  .atrium-header {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--bone-30);
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--bone-08);
    display: flex; justify-content: space-between; align-items: center;
  }
  .atrium-header .title { color: var(--gold-icon-soft); }
  .atrium-header .close {
    background: none; border: none; padding: 4px 8px;
    color: var(--bone-50); cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px; letter-spacing: 0.2em;
    transition: color 0.2s ease;
  }
  .atrium-header .close:hover { color: var(--gold-icon); }

  .atrium-empty {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 14px;
    color: var(--bone-30);
    text-align: center;
    padding: 0 20px;
  }
  .atrium-empty .glyph {
    width: 38px; height: 38px;
    border: 1px solid rgba(220, 170, 100, 0.32);
    border-radius: 50%;
    position: relative;
    margin-bottom: 8px;
  }
  .atrium-empty .glyph::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(220, 170, 100, 0.32);
    border-radius: 50%;
  }
  .atrium-empty .line-italic {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 17px;
    color: var(--bone-50);
    line-height: 1.4;
  }
  .atrium-empty .line-mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--bone-30);
  }

  .artifact {
    position: relative;
    margin-bottom: 18px;
    padding: 16px 14px;
    background: rgba(245, 240, 232, 0.03);
    border: 1px solid rgba(220, 170, 100, 0.18);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(20px);
    animation: artifact-in 0.7s cubic-bezier(0.2, 0, 0.2, 1) forwards;
  }
  @keyframes artifact-in {
    to { opacity: 1; transform: translateX(0); }
  }
  .artifact:hover {
    background: rgba(50, 35, 18, 0.18);
    border-color: rgba(220, 170, 100, 0.42);
  }
  .artifact-corner {
    position: absolute;
    width: 8px; height: 8px;
    border: 1px solid rgba(220, 170, 100, 0.45);
    pointer-events: none;
  }
  .artifact-corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
  .artifact-corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
  .artifact-corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }
  .artifact-corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }

  .artifact-meta {
    display: flex; justify-content: space-between;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--bone-30);
  }
  .artifact-meta .from { color: var(--gold-icon-soft); }
  .artifact-meta .from.tk { color: var(--tk); }
  .artifact-meta .from.apryl { color: var(--april); }
  .artifact-body {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.5;
    color: var(--bone);
  }
  .artifact-body img {
    width: 100%;
    border-radius: 2px;
    display: block;
    margin-top: 4px;
  }
  .artifact-body .file-icon {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
  }
  .artifact-body .file-icon-glyph {
    width: 32px; height: 40px;
    border: 1px solid rgba(220, 170, 100, 0.45);
    border-radius: 2px;
    position: relative;
    flex-shrink: 0;
  }
  .artifact-body .file-icon-glyph::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 10px; height: 10px;
    border-left: 1px solid rgba(220, 170, 100, 0.45);
    border-bottom: 1px solid rgba(220, 170, 100, 0.45);
  }
  .artifact-body .file-info {
    flex: 1; min-width: 0;
  }
  .artifact-body .file-name {
    font-family: 'Fraunces', serif;
    font-size: 15px;
    color: var(--bone);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .artifact-body .file-size {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--bone-30);
    margin-top: 4px;
  }

  /* Mobile: Atrium becomes full-screen sheet */
  @media (max-width: 720px) {
    .atrium-handle {
      width: 24px;
      height: 100px;
    }
    .atrium-handle-inner {
      font-size: 9px;
      letter-spacing: 0.36em;
    }
    .atrium-badge { width: 14px; height: 14px; font-size: 8px; top: 6px; }
    .atrium {
      width: 92%;
      min-width: 0;
      max-width: none;
      padding: 26px 14px 80px 46px;
    }
    .artifact-body { font-size: 15px; }
  }

/* AI intent — a luminous halo when SHE selects a card. Pure glow:
   shadows render OUTSIDE the box, so the image is never covered (the
   masked-rim approach half-rendered on iPad Safari and washed over
   the content). */
.artifact.ai-intent {
  outline: 1.5px solid rgba(255, 214, 130, 0.9);
  outline-offset: 2px;
  animation: ai-halo 1.6s ease-in-out infinite;
}
@keyframes ai-halo {
  0%, 100% {
    box-shadow: 0 0 8px 2px rgba(255, 214, 130, 0.35),
                0 0 28px 6px rgba(255, 214, 130, 0.18);
  }
  50% {
    box-shadow: 0 0 14px 3px rgba(255, 240, 200, 0.75),
                0 0 44px 12px rgba(255, 214, 130, 0.35);
  }
}
