/* KChat's features (ff.js): each tile holds KChat's real window (kchat/scene.html: the app's own components' markup
   and compiled CSS) playing a scene. A camera films it a few degrees off and leans toward each step; focus sits
   there; the lens darkens at its edges. */
.ffgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile.kc { --fx: 50%; --fy: 50%; --lx: 0; --ly: 0; --k: .4; background: #0b0b0d; perspective: 1100px; }
.tile.kc { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; font: inherit; }
.tile.kc .cam { position: absolute; inset: 0; display: grid; place-items: center; transform-style: preserve-3d;
  transform: rotateX(6deg) rotateY(-4deg);   /* the camera holds still, a few degrees off the screen */
}
.tile.kc .screen { display: block; position: relative; width: 88%; aspect-ratio: 960 / 620; overflow: hidden; border-radius: 6px; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 24px 60px -20px rgba(0,0,0,.85), 0 0 50px rgba(160,160,220,.07); }
.tile.kc .dof { position: absolute; inset: 0; pointer-events: none; -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
  -webkit-mask: radial-gradient(ellipse 40% 34% at var(--fx) var(--fy), transparent 45%, #000 100%); mask: radial-gradient(ellipse 40% 34% at var(--fx) var(--fy), transparent 45%, #000 100%); }
.tile.kc::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 62%, rgba(0,0,0,.4)); }

/* the window: KChat's own scene page (kchat/scene.html), drawn at 960 × 620 and scaled to the screen */
.tile.kc .screen iframe { position: absolute; left: 0; top: 0; width: 960px; height: 620px; border: 0; transform: scale(var(--k)); transform-origin: 0 0; pointer-events: none; background: #111; }

@media (max-width: 1080px) { .ffgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ffgrid { grid-template-columns: minmax(0, 1fr); } }
/* open it large: a hint in the corner, and the lift on hover */
.tile.kc .kc-zoom { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(237,224,202,.3); background: rgba(13,12,10,.6); color: #ede0ca; font: 400 15px/1 var(--sans); font-style: normal; opacity: .75; transition: opacity .2s; }
.tile.kc:hover .kc-zoom, .tile.kc:focus-visible .kc-zoom { opacity: 1; } .tile.kc:hover { box-shadow: var(--lift); }
/* the lightbox: the same window, large; it grows out of its tile and goes back into it */
.kclb { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(10,9,8,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.kclb[hidden] { display: none; }
.kclb-in { display: flex; flex-direction: column; gap: 14px; }
.kclb-win { position: relative; overflow: hidden; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 40px 100px -30px rgba(0,0,0,.9); transform-origin: 0 0; }
.kclb-win iframe { position: absolute; left: 0; top: 0; width: 960px; height: 620px; border: 0; transform-origin: 0 0; background: #111; }
.kclb-bar { display: flex; align-items: baseline; gap: 16px; color: #ede0ca; }
.kclb-bar b { font: 400 1.6rem/1.1 var(--serif); } .kclb-bar span { flex: 1; color: rgba(237,224,202,.7); font-size: .9375rem; }
.kclb-x { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: #ede0ca; font: 500 14px var(--sans); cursor: pointer; } .kclb-x i { font: 400 24px/1 var(--serif); font-style: normal; transition: transform .4s var(--ease-out-quint); } .kclb-x:hover i { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .tile.kc .dof { display: none; } .kclb-x i { transition: none; } }
