/* Templates & Widgets look (live 2026-11): 3D screens with running templates and widget clips, used on /templates,
   /community, /, /cluview and four guide articles. Builds on /css/redesign.css + /css/refresh.css tokens.
   Clips are real pack widgets filmed through the packs' own harness, and templates filmed running in CLU VIEW
   (H.264, 20 fps); /js/showroom.js loads them. */
/* ── 3D screen: bezel, case depth, glass, glint ─────────────────────────── */
.dv { --w: 16; --h: 9; --bz: 12px; --rad: 12px; --glow: rgba(64,220,165,.30); --rx: 0deg; --ry: 0deg; --rz: 0deg; --gx: 30%; --gy: 0%;
  position: relative; perspective: 1700px; margin: 0; }
.dv__body { position: relative; padding: var(--bz); border-radius: var(--rad);
  background: linear-gradient(158deg, #3a3d42 0%, #1b1d21 14%, #0c0d0f 55%, #17191c 88%, #2a2c30 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(255,255,255,.05), 0 0 0 1px #000,
    0 60px 90px -40px rgba(0,0,0,.95), 0 0 90px -24px var(--glow);
  transform: rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz)); transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2,.8,.2,1), box-shadow .6s; will-change: transform; }
/* the back of the case, pushed behind: shows as depth when the screen turns */
.dv__body::before, .dv__body::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.dv__body::before { background: #0a0b0c; transform: translateZ(-7px); box-shadow: 0 0 0 1px #000; }
.dv__body::after { background: #060607; transform: translateZ(-14px); box-shadow: 0 0 0 1px #000, 0 30px 60px rgba(0,0,0,.6); }
.dv__screen { position: relative; aspect-ratio: var(--w) / var(--h); overflow: hidden; border-radius: 3px; background: #050505;
  transform: translateZ(1px); box-shadow: 0 0 0 1px #000; }
.dv__screen > img, .dv__screen > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.dv__screen > img { transition: opacity .7s ease; }
.dv__screen > img.is-out { opacity: 0; }
/* glass: a fixed sheen, a highlight that follows the pointer, and a glint that sweeps every few seconds */
.dv__glass { position: absolute; inset: var(--bz); border-radius: 3px; pointer-events: none; transform: translateZ(2px); overflow: hidden;
  background:
    radial-gradient(90% 70% at var(--gx) var(--gy), rgba(255,255,255,.10), rgba(255,255,255,0) 55%),
    linear-gradient(172deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 34%),
    linear-gradient(0deg, rgba(0,0,0,.18), rgba(0,0,0,0) 30%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 0 26px rgba(0,0,0,.55); }
.dv__glass::after { content: ''; position: absolute; inset: -20% -10%;
  background: linear-gradient(112deg, rgba(255,255,255,0) 40%, rgba(255,255,255,.20) 47%, rgba(255,255,255,.05) 51%, rgba(255,255,255,0) 57%);
  background-size: 260% 100%; background-repeat: no-repeat; background-position: 160% 0;
  animation: dv-glint 9s cubic-bezier(.45,.05,.25,1) infinite; animation-delay: var(--gd, 0s); }
@keyframes dv-glint { 0%, 74% { background-position: 160% 0; } 100% { background-position: -70% 0; } }
.dv__cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 15px; letter-spacing: 2px; color: var(--dim); text-transform: uppercase; }
.dv__cap b { font-weight: 400; color: var(--text); }
.dv__cap i { font-style: normal; color: var(--teal); }
/* soft light the screen throws on the surface below it */
.dv__spill { position: absolute; left: 12%; right: 12%; bottom: -34px; height: 40px; pointer-events: none;
  background: radial-gradient(closest-side, var(--glow), rgba(0,0,0,0)); opacity: .55; filter: blur(6px); }
.dv--thin { --bz: 7px; --rad: 8px; }
.dv--usb { --bz: 9px; --rad: 9px; }
.dv[data-tilt] .dv__body { cursor: grab; }

/* a layout of real widget clips inside a screen, drawn at the screen's own pixel size and scaled to fit */
.lay { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #050607; }
.lay > video, .lay > img { position: absolute; display: block; mix-blend-mode: lighten; }
.lay--bg { background: radial-gradient(120% 90% at 30% 10%, #101418, #050607 60%); }

/* clips are filmed on #0c0c0c; "lighten" lets the stage show through the clip's own background */
.clip { mix-blend-mode: lighten; display: block; }

/* ── widget tiles ──────────────────────────────────────────────────────── */
.wt { position: relative; display: flex; flex-direction: column; min-width: 0; background: #0c0c0c; border: 1px solid var(--line);
  color: inherit; text-decoration: none; text-align: left; font: inherit; padding: 0; cursor: pointer;
  transition: border-color .25s, transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.wt:hover, .wt:focus-visible { border-color: rgba(64,220,165,.55); transform: translateY(-4px); box-shadow: 0 24px 50px -24px rgba(64,220,165,.35); outline: none; }
.wt__stage { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 16px; overflow: hidden;
  background: radial-gradient(90% 80% at 50% 35%, #15181b, #0c0c0c 70%); }
.wt--wide .wt__stage { aspect-ratio: 16 / 7; }
.wt__stage video, .wt__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.wt__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px 11px; border-top: 1px solid #1a1a1a;
  font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.wt__meta b { font-weight: 400; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt__meta span { color: var(--dim); white-space: nowrap; }
.tag-new { display: inline-block; padding: 2px 6px 1px; font-size: 12px; letter-spacing: 2px; color: #06110e; background: var(--teal); vertical-align: 2px; }
.tag-free { display: inline-block; padding: 2px 6px 1px; font-size: 12px; letter-spacing: 2px; color: var(--teal); border: 1px solid rgba(64,220,165,.5); vertical-align: 2px; }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chip { font: inherit; font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); background: transparent;
  border: 1px solid var(--line-2, #333); padding: 7px 12px 6px; cursor: pointer; }
.chip:hover { color: var(--text); border-color: #555; }
.chip[aria-pressed="true"] { color: #06110e; background: var(--teal); border-color: var(--teal); }

/* ── TAP buttons you can press ─────────────────────────────────────────── */
.tap { position: relative; display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer;
  transition: transform .12s ease, filter .2s; -webkit-tap-highlight-color: transparent; }
.tap img { width: 100%; height: auto; display: block; pointer-events: none; filter: drop-shadow(0 18px 24px rgba(0,0,0,.55)); }
.tap:hover { filter: brightness(1.08); }
.tap.is-down { transform: scale(.93); filter: brightness(1.25) drop-shadow(0 0 18px rgba(166,107,255,.55)); }
.tap::after { content: ''; position: absolute; left: 50%; top: 50%; width: 40%; aspect-ratio: 1; border-radius: 50%; translate: -50% -50%;
  border: 2px solid rgba(166,107,255,.9); opacity: 0; pointer-events: none; }
.tap.is-ping::after { animation: tap-ping .6s ease-out; }
@keyframes tap-ping { from { opacity: .9; scale: .6; } to { opacity: 0; scale: 2.2; } }
.readout { font-size: 18px; letter-spacing: 2px; color: var(--teal); min-height: 1.4em; }
.readout::before { content: '> '; color: var(--faint); }

/* ── spotlight (one widget, big, on a screen) ─────────────────────────── */
.spot { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid #2a2a2a; background: #0a0a0a; color: var(--text);
  font-family: 'CLU Display UI', 'VT323', 'Courier New', monospace; }
.spot::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.spot__in { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 32px; padding: 34px; align-items: center; }
.spot__x { position: absolute; right: 10px; top: 8px; font: inherit; font-size: 26px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.spot__x:hover { color: var(--text); }
.spot h3 { margin: 6px 0 10px; font-size: 34px; font-weight: 400; letter-spacing: 2px; }
.spot p { margin: 0 0 14px; color: #b8b8b8; font-size: 17px; line-height: 1.6; font-family: Arial, sans-serif; }
.spot__pack { font-size: 15px; letter-spacing: 3px; color: var(--teal); text-transform: uppercase; }
.spot__from { display: block; margin-top: 4px; font-size: 13px; letter-spacing: 3px; color: var(--dim); }
.spot__packimg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 8px 0 14px; border: 1px solid #2a2a2a; }
.spot .dv__screen { display: grid; place-items: center; background: radial-gradient(100% 90% at 50% 40%, #121518, #0c0c0c 70%); }
.spot .dv__screen > * { grid-area: 1 / 1; }
.spot .dv__screen video, .spot .dv__screen .ph { position: static; width: auto; height: auto; max-width: 86%; max-height: 82%; }
@media (max-width: 760px) { .spot__in { grid-template-columns: 1fr; padding: 22px; gap: 18px; } .spot h3 { font-size: 28px; } }

/* body copy here uses the site's own body face where refresh.css does */
.mk-prose { font-family: Arial, sans-serif; font-size: 17px; line-height: 1.65; color: #b8b8b8; }
.mk-prose strong { color: var(--text); font-weight: 400; }

@media (prefers-reduced-motion: reduce) {
  .dv__glass::after { animation: none; }
  .dv__body, .wt { transition: none; }
}

@media (max-width: 900px) { .a-hero { padding-top: 40px !important; } }
@media (max-width: 1100px) { .r-strip .dv__tag { display: none; } }

/* homepage: the drop-ins are screens now (bezel, glass), so the old card frame goes */
.rf-drop.has-dv { border: 0; background: none; box-shadow: none; }
.rf-drop.has-dv .dv { --bz: 7px; --rad: 8px; }
.rf-drop.has-dv .dv__screen > img { object-fit: cover; }

/* homepage: the dropped-in screens are a little larger than the old pictures (MR.CLU, 18 Nov) */
.rf-drop--tape.has-dv { left: -12%; top: -17%; width: 52%; }
.rf-drop--prism.has-dv { right: -9%; top: -15%; width: 48%; }
.rf-drop--kowloon.has-dv { right: -11%; top: 18%; width: 17.5%; }
.rf-drop--fathom.has-dv { left: -11%; bottom: -20%; width: 40%; }

/* clip loading: a still of the clip's first frame holds the place; the video fades in over it once it is playing,
   then the still is hidden (kept in the layout). If the video never plays, the still stays. */
video[data-clip], video[data-live], .spot video { transition: opacity .35s ease; }
video.is-wait { opacity: 0; }
img.ph { transition: visibility 0s linear .35s; }
img.ph.is-under { visibility: hidden; }
.wt__stage > .ph, .wt__stage > video, .b-chip span:first-child > *, .b-slot > * { grid-area: 1 / 1; }

/* square, logo-only Discord and Reddit buttons (Community hero, footer, /cluview) and their longer form (homepage) */
.soc-long { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 51px; padding: 0 20px; border: 2px solid var(--line-2, #333);
  background: #0c0c0c; color: #fff; font-family: inherit; font-size: 18px; letter-spacing: 2px; text-transform: uppercase; text-decoration: none; transition: border-color .2s, background .2s; }
.soc-long svg { width: 26px; height: 26px; flex: 0 0 26px; }
.soc-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
@media (max-width: 520px) { .soc-row .soc-long { flex: 1 1 100%; } }

/* /cluview: running templates in bezels around the editor picture (the editor itself stays flat) */
.cvz { position: absolute; z-index: 4; }
.cvz .dv { --bz: 7px; --rad: 8px; }
.cvz--strip { right: -6%; top: -13%; width: 15%; }
.cvz--bar { left: -7%; bottom: -13%; width: 50%; }
.cvz--ten { right: -4%; bottom: -15%; width: 44%; z-index: 5; }
@media (max-width: 1100px) { .cvz--strip { right: -2%; } .cvz--bar { left: -3%; } .cvz--ten { right: -2%; } }
/* the buttons under the downloads: outlined so they can be seen, and a row for Community, Discord and Reddit */
.cv-more .rf-btn { font-size: 16px; letter-spacing: 1px; }
/* the secondary buttons are the site's standard ghost buttons (grey, lighting up white on hover, as on the homepage),
   with solid black behind them so a busy background never shows through; the homepage's get the same backing */
.cv-more .rf-btn, .cv-social .rf-btn, .rf-dl--more .rf-btn--ghost { background: #080808; }
.cv-social { display: grid; grid-template-columns: minmax(0, 1fr) 46px 46px; gap: 12px; width: 100%; max-width: 470px; margin-top: -4px; }
.cv-social .rf-btn { width: 100%; min-height: 46px; font-size: 16px; letter-spacing: 1.5px; }
.cv-social .c-social { width: 46px; height: 46px; flex-basis: 46px; }
.cv-social .c-social svg { width: 24px; height: 24px; }
.rf-templates__card .soc-row { justify-content: center; }

/* CLU VIEW hero: the template wall behind it was too bright to read the copy and see the screens.
   Darker shade across the whole wall, darkest behind the text, plus a dark pool behind the editor and screens. */
.cv-hero .rf-wall::after { background:
  radial-gradient(ellipse 46% 62% at 68% 52%, rgba(8,8,8,0.9) 0%, rgba(8,8,8,0.6) 60%, transparent 100%),
  linear-gradient(to right, rgba(8,8,8,0.97) 0%, rgba(8,8,8,0.95) 42%, rgba(8,8,8,0.84) 72%, rgba(8,8,8,0.88) 100%),
  linear-gradient(to bottom, #080808 0%, transparent 16%, transparent 80%, #080808 100%); }
@media (max-width: 900px) { .cv-hero .rf-wall::after { background: rgba(8,8,8,0.94); } }

/* articles: running templates on 3D screens where the articles had still pictures */
.tz .dv__screen, .az .dv__screen, .az-body .dv__screen { border: 0; padding: 0; }
.dv-stage .tz { position: absolute; }
.dv-stage .tz .dv { --bz: 7px; --rad: 8px; }
.dv-stage .tz--a { left: 0; top: 16%; width: 44%; z-index: 2; }
.dv-stage .tz--b { left: 22%; bottom: 0; width: 54%; z-index: 3; }
.dv-stage .tz--c { right: 2%; top: 4%; width: 26%; z-index: 1; }
.tz__cap { margin-top: 10px; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); text-align: center; }
/* the 800x480 screen covers the space under the 480x320 one, so that size label sits above its screen */
.dv-stage .tz--a .tz__cap { position: absolute; left: 0; right: 0; top: -28px; margin: 0; }
.ar-collage .az { position: absolute; z-index: 4; }
.ar-collage .az .dv { --bz: 7px; --rad: 8px; }
.az--tape { left: -6%; bottom: 4px; width: 46%; }
.az--ten { right: -3%; bottom: -10px; width: 40%; z-index: 5; }
.az--strip { right: -4%; top: -5%; width: 13%; }
.az-body { padding: 14px 22px 26px; }
.rf-reveal:has(> .az-body) { border: 0 !important; }
@media (max-width: 600px) {
  .dv-stage .tz--a { left: 2%; top: 20%; }
  .dv-stage .tz--c { right: 4%; top: 12%; }
  .dv-stage .tz--c .tz__cap { position: absolute; left: -40%; right: -40%; top: -28px; margin: 0; }
  .az--tape { left: -2%; } .az--ten { right: -1%; } .az--strip { right: -1%; }
  .az-body { padding: 10px 12px 20px; }
}
