/* keitgen.de home - 02 Apps stage: scenes for the Mac apps (Hex Marks the Spot,
   Twinkle Lights, BentoSort). Loaded only on the home page, next to css/home.css,
   which carries the stage, the tabs and the iOS scenes. Animated by js/scene-*.js. */

/* ---------- Hex Marks the Spot: loupe over a pixel field, hex code, swatch history ---------- */
.hex { display: flex; flex-direction: column; gap: clamp(8px, 2.6%, 14px); }
.mbar { flex: none; display: flex; align-items: center; gap: 14px; height: 26px; padding: 0 12px; border: 1px solid #3A3632; border-radius: 6px; color: #8C867E; }
.mbar i { display: block; width: 30px; height: 4px; border-radius: 2px; background: #3A3632; }
.mbar i:first-child { width: 12px; height: 12px; border-radius: 50%; }
.mbar .sp { flex: 1; }
.mbar svg { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: color .3s ease; }
.mbar svg.on { color: var(--red); }
.mbar .clk { width: 38px; background: #4A4540; }
.hexwrap { position: relative; flex: 1 1 auto; min-height: 0; } /* takes what the square stage leaves, so nothing spills on phones */
.hexfield { display: grid; grid-template-columns: repeat(14, 1fr); grid-template-rows: repeat(9, 1fr); height: 100%; border-radius: 4px; overflow: hidden; }
.hexfield i, .lens i { display: block; }
.loupe { position: absolute; left: 50%; top: 50%; width: 32%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden;
  border: 2px solid #EDE9E3; box-shadow: 0 12px 30px rgba(0,0,0,.55); transition: left .9s cubic-bezier(.6,0,.2,1), top .9s cubic-bezier(.6,0,.2,1); }
.lens { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; width: 100%; height: 100%; background: #141312; }
.lens i.c { box-shadow: inset 0 0 0 2px var(--red); }
.hexread { flex: none; display: flex; align-items: center; gap: 10px; font: 500 15px var(--mono); color: #EDE9E3; letter-spacing: .06em; }
.hexread .sw { width: 22px; height: 22px; border-radius: 4px; border: 1px solid #3A3632; }
.hexread .chip { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--red); border: 1px solid var(--red); border-radius: 20px; padding: 2px 9px;
  opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease; }
.hexread .chip.on { opacity: 1; transform: none; }
.hexhist { flex: none; display: flex; gap: 10px; min-height: 48px; }
.hexhist span { display: flex; flex-direction: column; gap: 5px; font: 400 10.5px var(--mono); color: #7C766F; letter-spacing: .04em; animation: swin .35s ease; }
.hexhist i { display: block; height: 28px; border-radius: 4px; border: 1px solid #3A3632; }
@keyframes swin { from { transform: scale(.4); opacity: 0; } }

/* ---------- Twinkle Lights: bulbs along the top of a display, twinkling, light snow ---------- */
.tw { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mon { width: 100%; display: flex; flex-direction: column; align-items: center; }
.scr { position: relative; width: 100%; aspect-ratio: 16 / 10.5; border: 2px solid #4A4540; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #1E1B19, #0E0D0C 80%); }
.scr .win { position: absolute; border: 1px solid #2E2A27; border-radius: 6px; }
.scr .win::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 14px; border-bottom: 1px solid #2E2A27; }
.scr .w1 { left: 10%; top: 30%; width: 46%; height: 44%; }
.scr .w2 { left: 46%; top: 42%; width: 40%; height: 38%; background: #121110; }
.wire { position: absolute; left: 0; top: 0; width: 100%; height: 20%; overflow: visible; }
.wire path { fill: none; stroke: #5A544E; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bulb { position: absolute; width: 9px; height: 13px; margin-left: -4.5px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; background: #34302C; transition: background .3s ease, box-shadow .3s ease; }
.bulb::before { content: ''; position: absolute; left: 2px; right: 2px; top: -3px; height: 4px; border-radius: 1px; background: #5A544E; }
.bulb.lit { background: var(--c); box-shadow: 0 0 12px 2px var(--c); }
.scene.on .bulb.lit { animation: twinkle var(--d) ease-in-out var(--dl) infinite; }
@keyframes twinkle { 50% { opacity: .35; box-shadow: 0 0 2px 0 var(--c); } }
.flake { position: absolute; border-radius: 50%; background: #EDE9E3; opacity: .7; }
.scene.on .flake { animation: snow var(--d) linear var(--dl) infinite; }
@keyframes snow { from { top: -3%; transform: translateX(0); } 50% { transform: translateX(10px); } to { top: 100%; transform: translateX(0); } }
.pile { position: absolute; left: -4%; right: -4%; bottom: 0; height: 0; background: #DAD5CD; opacity: .9; border-radius: 45% 55% 0 0 / 100% 100% 0 0; }
.pile.on { height: 5%; transition: height 7s linear; }
.neck { width: 12%; height: 26px; border: 2px solid #4A4540; border-top: 0; border-bottom: 0; }
.foot { width: 34%; height: 2px; background: #4A4540; border-radius: 1px; }

/* ---------- BentoSort: file chips fly from a tray into labelled bento compartments ---------- */
.bento { display: flex; flex-direction: column; gap: 14px; }
.tray { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border: 1px dashed #3A3632; border-radius: 8px; }
.tray .lbl { font: 500 11px var(--mono); color: #7C766F; letter-spacing: .08em; text-transform: uppercase; margin-right: 6px; }
.file { font: 400 11px var(--mono); color: #EDE9E3; background: #24211E; border: 1px solid #3A3632; border-radius: 4px; padding: 3px 7px; white-space: nowrap; transition: opacity .2s ease; }
.file.gone { opacity: 0; }
.file.fly { position: absolute; z-index: 2; border-color: var(--red); box-shadow: 0 8px 20px rgba(0,0,0,.5); transition: transform .75s cubic-bezier(.5,0,.3,1), opacity .2s ease; }
.boxes { flex: 1; min-height: 0; display: grid; gap: 8px; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr;
  grid-template-areas: "a a b" "a a c" "d e f"; }
.box { position: relative; border: 1px solid #3A3632; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between; transition: border-color .2s ease, background .2s ease; }
.box:nth-child(1) { grid-area: a; } .box:nth-child(2) { grid-area: b; } .box:nth-child(3) { grid-area: c; }
.box:nth-child(4) { grid-area: d; } .box:nth-child(5) { grid-area: e; } .box:nth-child(6) { grid-area: f; }
.box span { font: 500 11px var(--mono); color: #8C867E; letter-spacing: .06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box b { font: 400 clamp(18px, 2.2vw, 26px) var(--mono); color: #EDE9E3; }
.box:nth-child(1) b { font-size: clamp(28px, 4vw, 48px); }
.box em { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 500 10.5px var(--mono); font-style: normal; color: #fff; background: var(--red); border-radius: 4px; padding: 3px 7px;
  max-width: 92%; width: max-content; text-align: center; opacity: 0; transition: opacity .2s ease; pointer-events: none; z-index: 3; }
.box.hover { border-color: var(--red); background: rgba(212,48,73,.08); }
.box.hover em { opacity: 1; }
.box.bump b { color: var(--red); }
