/* goap: the license-office ID camera. Fonts: Fredoka (OFL), Inter (OFL), JetBrains Mono (OFL), self-hosted. */
@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JBMono"; src: url("/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #2b2c38; --ink: #3b3a38; --accent: #2233d6;
  --body-grey: #c9c6bf; --print: #6f6b64; --lcd: #b9d38a; --lcd-dim: #6f8350;
  --font-display: "Fredoka", ui-rounded, system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; color: var(--ink); font-family: var(--font-body);
  background: radial-gradient(120% 90% at 50% 0%, #3e4050 0%, #2b2c38 55%, #22232c 100%);
  -webkit-tap-highlight-color: transparent;
}
.room { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; --s: 1; }
.device { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; pointer-events: none; z-index: 2; }
.vf { position: absolute; z-index: 1; display: block; background: transparent; }
.vf3d { background: #1b22c8; pointer-events: none; }
.flash { position: absolute; z-index: 1; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { opacity: 1; transition: none; }
.flash.off { opacity: 0; transition: opacity .45s cubic-bezier(.2,.7,.3,1); }

/* the screen's own on-screen display */
.osd { position: absolute; z-index: 3; pointer-events: none; color: #fff; font: 700 max(16px, calc(var(--s) * 20px))/1.2 var(--font-body);
  letter-spacing: .03em; text-shadow: 0 1px 0 rgba(0,0,30,.55), 0 0 6px rgba(0,0,40,.35); }
.osd span { position: absolute; white-space: nowrap; }
.osd b { color: #ffe36b; font-weight: 700; padding: 0 .25em; }
.osd b.big { font-size: 1.45em; vertical-align: -.08em; }
.osd-top { left: 3.2%; top: 4%; }
.osd-rec { right: 3.2%; top: 4%; }
.osd-hint { left: 50%; bottom: 4.5%; transform: translateX(-50%); transition: opacity .4s; }
.osd-hint.gone { opacity: 0; }

/* print on the grey plastic */
.name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.ticker, .sample-label { position: absolute; z-index: 3; margin: 0; font-family: var(--font-display); font-weight: 700; color: #8f8a82;
  text-shadow: 0 calc(var(--s) * 1.5px) 0 rgba(255,255,255,.55), 0 calc(var(--s) * -1px) 0 rgba(0,0,0,.28); }
.ticker { font-size: max(16px, calc(var(--s) * 38px)); line-height: 1; display: flex; align-items: center; }
.sample-label { font-size: max(16px, calc(var(--s) * 27px)); line-height: 1.05; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; color: #7a766f; }
.tall .sample-label { flex-direction: row; gap: .3em; align-items: center; justify-content: center; font-size: max(16px, calc(var(--s) * 30px)); }

/* keys: caps from the parts sheet sit in the empty sockets of the body */
.key { position: absolute; z-index: 3; display: grid; place-items: center; align-content: center; gap: 0; padding: 0; margin: 0; border: 0;
  background: none; cursor: pointer; text-decoration: none; color: #4a4741; font: 700 max(16px, calc(var(--s) * 21px))/1 var(--font-display);
  transform: translateY(var(--ky, 0px)) scale(var(--kz, 1)); transition: transform .6s cubic-bezier(.2,1.6,.4,1); }
.key .cap { position: absolute; inset: 0; background: url("/img/parts.webp") no-repeat; z-index: -1; filter: drop-shadow(0 calc(var(--s)*3px) calc(var(--s)*3px) rgba(0,0,0,.45)); }
.key img { position: relative; width: 46%; height: auto; aspect-ratio: 1; object-fit: contain; pointer-events: none; }
.key .legend { position: relative; margin-top: 4%; letter-spacing: .03em; pointer-events: none; }
.key:hover { --ky: calc(var(--s) * -2px); --kz: 1.03; transition: transform .25s cubic-bezier(.3,1.8,.5,1); }
.key:active, .key.down { --ky: calc(var(--s) * 3px); --kz: .95; transition: transform .035s linear; }
.key:focus-visible { outline: 3px solid #ffe36b; outline-offset: 3px; border-radius: 12%; }
.key[aria-disabled="true"], .key:not([href]):is(a) { cursor: default; }
.tall .key img { width: 40%; }
.key.sq .cap { background-size: calc(2395 / 383 * 100%) calc(406 / 373 * 100%); background-position: calc(385 / (2395 - 383) * 100%) calc(4 / (406 - 373) * 100%); }
.key.copy .cap { background-size: calc(2395 / 217 * 100%) calc(406 / 227 * 100%); background-position: calc(772 / (2395 - 217) * 100%) calc(4 / (406 - 227) * 100%); }
.key.copy { font-size: max(16px, calc(var(--s) * 20px)); }
.key.copy::after { content: ""; position: absolute; inset: -30%; }
.key.shutter .cap { background-size: calc(2395 / 377 * 100%) calc(406 / 386 * 100%); background-position: 0 calc(4 / (406 - 386) * 100%); }
.key.shutter .legend { color: #fff; font-size: max(16px, calc(var(--s) * 26px)); text-shadow: 0 1px 2px rgba(0,0,40,.6); margin: 0; }
.key.shutter, .key.shutter:hover, .key.shutter:active, .key.shutter.down { --ky: 0px; --kz: 1; transform: none; transition: none; }
.key.shutter .cap3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.key.shutter::before { content: ""; position: absolute; inset: 13%; border-radius: 50%; } /* the press area is the cap */
.key.shutter:focus-visible { outline: none; } .key.shutter:focus-visible::before { outline: 3px solid #ffe36b; outline-offset: 2px; }
.key.shutter { clip-path: circle(37% at 50% 50%); }

/* the camera's own LCD carries the contract */
.lcd { position: absolute; z-index: 3; display: flex; flex-direction: column; justify-content: center; padding: 0 2.4%; box-sizing: border-box; color: #1d2a12; }
.lcd::before { content: ""; position: absolute; inset: 0; border-radius: 3px;
  background: linear-gradient(180deg, rgba(185,211,138,.88), rgba(160,190,112,.9)); box-shadow: inset 0 calc(var(--s)*3px) calc(var(--s)*6px) rgba(0,0,0,.35); z-index: -1; }
.lcd-label { font: 700 max(16px, calc(var(--s) * 19px))/1 var(--font-body); letter-spacing: .08em; color: #3f5228; display: flex; gap: .6em; }
.lcd-msg { color: #1d2a12; }
.lcd-ca { font-family: "JBMono", ui-monospace, monospace; font-weight: 500; line-height: 1.06; letter-spacing: -.035em; word-break: break-all; overflow-wrap: anywhere;
  user-select: all; -webkit-user-select: all; color: #142009; background: none; padding: 0; margin-top: .12em; text-shadow: 0 0 1px rgba(20,32,9,.35); }
.lcd.blink .lcd-ca { animation: lcdblink .5s steps(1) 2; }
@keyframes lcdblink { 50% { opacity: .15; } }

/* the card printer */
.slot { position: absolute; z-index: 4; overflow: hidden; pointer-events: none; }
.card { position: fixed; left: 0; top: 0; z-index: 10; outline: none; perspective: 1400px; transform-origin: 50% 50%; will-change: transform; cursor: pointer; }
.card[hidden] { display: none; }
.card-in { position: absolute; inset: 0; transform-style: preserve-3d; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 4.2% / 7.4%;
  background: url("/img/parts.webp") no-repeat; background-size: calc(2395 / 697 * 100%) calc(406 / 398 * 100%);
  box-shadow: 0 .6em 1.6em rgba(0,0,0,.35); overflow: hidden; }
.front { background-position: calc(993 / (2395 - 697) * 100%) calc(4 / (406 - 398) * 100%); }
.back { background-position: calc(1694 / (2395 - 697) * 100%) calc(4 / (406 - 398) * 100%); transform: rotateY(180deg); }
.photo { position: absolute; left: 5.6%; top: 24.4%; width: 26.7%; height: 50.2%; image-rendering: auto; }
.c-head { position: absolute; left: 5.4%; top: 6.5%; right: 5%; margin: 0; font: 700 2.05em/1 var(--font-display); color: var(--accent); letter-spacing: .01em; display: flex; align-items: baseline; justify-content: space-between; }
.c-head span { font: 700 .42em/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: #5160c9; }
.c-fields { position: absolute; left: 37%; top: 24%; right: 5%; margin: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .55em .9em; }
.c-fields div { min-width: 0; }
.c-fields .c-name, .c-fields .c-wide { grid-column: 1 / -1; }
.c-fields dt { font: 700 .62em/1 var(--font-body); letter-spacing: .12em; color: #6a74b8; }
.c-fields dd { margin: .2em 0 0; font: 700 1.12em/1.1 var(--font-body); color: #1e2240; text-transform: uppercase; }
.c-name dd { font: 700 2em/1 var(--font-display); color: #10154a; text-transform: none; }
.c-stamp { position: absolute; right: 6%; bottom: 7%; margin: 0; padding: .3em .55em; border: .16em solid #d1362f; border-radius: .4em; color: #d1362f;
  font: 700 .95em/1 var(--font-display); letter-spacing: .04em; opacity: .85; mix-blend-mode: multiply; }
.c-stamp[hidden] { display: none; }
.b-title { position: absolute; left: 6%; top: 39%; margin: 0; font: 700 .7em/1 var(--font-body); letter-spacing: .14em; color: #6a74b8; }
.b-ca { position: absolute; left: 6%; right: 6%; top: 45%; margin: 0; font: 500 1.02em/1.25 "JBMono", ui-monospace, monospace; color: #1e2240; word-break: break-all; user-select: all; }
.b-remarks { position: absolute; left: 6%; right: 6%; bottom: 8%; margin: 0; font: 400 .98em/1.32 var(--font-body); color: #2a2f55; }
.card-turn { position: absolute; inset: 0; background: none; border: 0; cursor: pointer; border-radius: 4%; }
.card-turn:focus-visible { outline: 3px solid #ffe36b; outline-offset: 4px; }
.card.in-slot { cursor: pointer; }
.card.in-slot .face { box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .key, .key:hover, .key:active { transition: none; }
}

.short, .tall .long { display: none; }
.tall .short { display: inline; }
.engr img[data-chart-mark] { display: none !important; }
.tall .key .legend { letter-spacing: 0; }
.tall .osd-rec, .tall .sample-label { display: none; }

/* links engraved into the camera's plastic: the official marks are the cut shapes */
.engr { position: absolute; z-index: 3; display: flex; align-items: center; justify-content: center; gap: .55em; padding: 0; margin: 0; border: 0; background: none;
  font: 700 max(16px, calc(var(--s) * 24px))/1 var(--font-display); letter-spacing: .04em; padding: .5em 1em; box-sizing: border-box; flex-direction: column; gap: .3em; text-decoration: none; cursor: pointer;
  --ink: rgba(46, 34, 27, .88); color: var(--ink); transition: color .25s ease-out, transform .6s cubic-bezier(.2,1.6,.4,1); }
.engr .legend { text-shadow: 0 1px 0 rgba(255,244,232,.38), 0 -1px 0 rgba(0,0,0,.4); }
.engr .em { display: block; flex: none; width: max(14px, min(calc(var(--s) * 40px), calc(var(--s) * 98px - 2.6em)));  aspect-ratio: 1; filter: drop-shadow(0 1px 0 rgba(255,244,232,.38)) drop-shadow(0 -1px 0 rgba(0,0,0,.42)); }
.engr .mk { display: block; width: 100%; height: 100%; background: var(--ink); transition: background .25s ease-out;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.engr .mk.lum { -webkit-mask-mode: luminance; mask-mode: luminance; }
.engr[data-place="k1"], .engr[data-place="k2"] { box-shadow: 0 1px 0 rgba(255,244,232,.22), inset 0 -1px 0 rgba(0,0,0,.22); }
.engr:is([href], button:not([disabled])):hover { --ink: rgba(34, 51, 214, .88); transform: translateY(calc(var(--s) * -1px)); transition: color .25s cubic-bezier(.3,1.8,.5,1), transform .25s cubic-bezier(.3,1.8,.5,1); }
.engr:is([href], button:not([disabled])):active { --ink: rgba(20, 30, 150, .95); transform: translateY(calc(var(--s) * 1px)); transition-duration: .035s; }
.engr:not([href]):is(a), .engr[disabled] { cursor: default; }
.engr:focus-visible { outline: 3px solid #ffe36b; outline-offset: 2px; border-radius: 6px; }
.engr.copy { font-size: max(16px, calc(var(--s) * 23px)); }
.engr.copy::after { content: ""; position: absolute; inset: -12%; }
.tall .engr { gap: .25em; padding: .5em .4em; font-size: max(16px, calc(var(--s) * 32px)); letter-spacing: 0; }
.tall .engr .em { width: max(14px, min(calc(var(--s) * 58px), calc(var(--s) * 146px - 2.6em))); }
.tall .engr[data-place="k1"], .tall .engr[data-place="k2"] { box-shadow: none; }
.tall .engr:not(:last-of-type) { }
.tall .engr.copy, .tall .engr[data-place="k1"], .tall .engr[data-place="k2"] { border-right: 1px solid rgba(0,0,0,.2); box-shadow: 1px 0 0 rgba(255,244,232,.2); }
.b-count { position: absolute; left: 6%; right: 6%; top: 62%; margin: 0; font: 700 .9em/1.2 var(--font-display); color: var(--accent); }

/* the room goes on past the picture on any window shape: the same photo, blurred, fills the viewport behind it,
   and the picture's own edges melt into it so no seam or page colour shows */
.room::before { content: ""; position: absolute; inset: -40px; z-index: 0; background: #2b2c38 url("/img/device-v2.webp") center 40% / cover no-repeat; filter: blur(18px) brightness(.82) saturate(.9); }
.tall .room::before { background-image: url("/img/device-tall-v2.webp"); }
.stage { z-index: 1; }
.stage .device { -webkit-mask-image: linear-gradient(to right, transparent, #000 2.2%, #000 97.8%, transparent), linear-gradient(to bottom, transparent, #000 2.2%, #000);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 2.2%, #000 97.8%, transparent), linear-gradient(to bottom, transparent, #000 2.2%, #000); mask-composite: intersect; }
