@font-face { font-family: "Silkscreen"; src: url("./art/Silkscreen-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "VT323"; src: url("./art/VT323-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "WC Digits"; src: url("./art/WCDigits-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0c0d0f; --ink: #141416; --paper: #f0f0f0; --muted: #9a9aa2;
  --lime: #b3fa03; --yel: #ffe14a; --cya: #38f0ff; --red: #ff3434;
  --rb: linear-gradient(90deg, #ff453a, #ff9f0a, #ffe900, #64ff00, #00eadb, #008cff 72%, #ff49cf 72%);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--paper); overflow: hidden; }
body { font: 500 17px/1.4 "Space Grotesk", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }

/* ---- the wall, in layers ---- */
#stage { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
.layer { position: absolute; inset: -4%; pointer-events: none; }
.far { background: radial-gradient(120% 80% at 50% 40%, #1a1c22 0%, #0b0c0f 60%, #050506 100%); }
.near { background:
    radial-gradient(70% 60% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .035) 44%, transparent 50%); }
.wall { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; will-change: transform; }
.plate { position: absolute; left: 0; top: 0; user-select: none; pointer-events: none; }
.wall [data-layer] { will-change: transform; }
.plate.off { opacity: 0; animation: neon 9s infinite steps(1); }   /* the sign flickers off now and then */
#cubes { position: absolute; inset: 0; }
.plate[data-layer^="neon"], .plate[data-layer="front"] { z-index: 1; }
@keyframes neon { 0%, 61%, 63%, 64.5%, 100% { opacity: 0; } 61.5%, 63.5% { opacity: 1; } }

.cube { position: absolute; }
.cube .shade { position: absolute; inset: 2px; background: rgba(4, 4, 6, .72); transition: background .5s; pointer-events: none; }
.cube .pet { position: absolute; background-size: 300% 300%; image-rendering: pixelated; pointer-events: none; }
.cube .eyes { position: absolute; background-size: 100% 100%; image-rendering: pixelated; pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, .9)) drop-shadow(0 0 6px rgba(255, 240, 160, .6)); opacity: 0; transition: opacity .3s; }
.cube.dark .pet { filter: brightness(.12) saturate(.4); }
.cube.dark .eyes { opacity: .85; animation: blink 6s infinite; }
.cube.lit .shade { background: transparent; }
.cube.lit .pet { filter: drop-shadow(-3px 0 4px rgba(255, 0, 70, .6)) drop-shadow(3px 0 4px rgba(0, 234, 255, .6)); }
.cube.lit { cursor: pointer; }
.cube.lit .tag { position: absolute; left: 50%; bottom: 4px; transform: translate(-50%, 0); white-space: nowrap;
  font: 13px "Silkscreen", monospace; color: var(--ink); background: var(--lime); padding: 1px 6px; pointer-events: none; z-index: 2; }
.cube.lit.mine .tag { background: var(--yel); }
.cube.lit:hover .pet, .cube.lit:focus-visible .pet { filter: drop-shadow(-4px 0 6px rgba(255, 0, 70, .85)) drop-shadow(4px 0 6px rgba(0, 234, 255, .85)); }
.cube .hit { position: absolute; inset: 0; background: none; border: 0; padding: 0; cursor: inherit; }
.cube .hit:focus-visible { outline: 3px solid var(--yel); outline-offset: 4px; }
.cube.won .tag { background: var(--red); color: #fff; }
@keyframes blink { 0%, 46%, 49%, 100% { transform: scaleY(1); } 47.5% { transform: scaleY(.1); } }

/* ---- the GPT UI kit (art/ui, 04/11): every key, panel and sign is art; only the words are HTML ---- */
.key { --k: url("./art/ui/key-lime.png"); --kd: url("./art/ui/key-lime-down.png");
  font: 16px "Silkscreen", monospace; color: #10140a; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 22px 4px; background: none; white-space: nowrap; letter-spacing: .5px;
  border-style: solid; border-width: 14px 20px 18px; border-image: var(--k) 40 58 52 fill / 14px 20px 18px stretch; image-rendering: pixelated; }
.key > * { pointer-events: none; }
.key:hover { filter: brightness(1.08) drop-shadow(0 0 8px rgba(179, 250, 3, .45)); }
.key:active, .key.down { border-image-source: var(--kd); transform: translateY(2px); }
.key.dark { --k: url("./art/ui/key-dark.png"); --kd: url("./art/ui/key-dark-down.png"); color: #f0f0f0; }
.key.dark:hover { filter: brightness(1.15) drop-shadow(0 0 8px rgba(56, 240, 255, .35)); }
.key[disabled], .key[aria-disabled="true"] { border-image-source: url("./art/ui/key-off.png"); color: #3a3d46; cursor: default; filter: none; transform: none; }
.close { position: absolute; z-index: 3; right: -6px; top: -10px; width: 46px; height: 46px; border: 0; padding: 0; cursor: pointer;
  background: url("./art/ui/key-close.png") center / contain no-repeat; image-rendering: pixelated; }
.close:hover { filter: brightness(1.3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* HUD: the hanging LED sign + the keys */
.hud { position: fixed; left: 12px; right: 12px; top: 0; display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; z-index: 5; }
.hud > * { pointer-events: auto; }
.sign { position: relative; width: 340px; aspect-ratio: 2.646; margin-top: -18px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .6)); }
.sign img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.led { position: absolute; left: 11.5%; right: 7%; top: 59%; bottom: 12%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font: 13px "Silkscreen", monospace; color: #8ffcff; text-shadow: 0 0 6px rgba(56, 240, 255, .8); padding: 0 6px; overflow: hidden; }
.led b { font: 26px "WC Digits", "VT323", monospace; color: #ffe14a; text-shadow: 0 0 8px rgba(255, 225, 74, .85); letter-spacing: 1px; }
.hud-keys { display: flex; gap: 8px; margin-top: 12px; }
.hint { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; text-align: center; z-index: 4;
  width: max-content; max-width: calc(100% - 24px); color: #f0f0f0; font-size: 16px; padding: 2px 26px 6px;
  border-style: solid; border-width: 14px 20px 18px; border-image: url("./art/ui/key-dark.png") 40 58 52 fill / 14px 20px 18px stretch; }
.cube.lit .tag { background: none; color: #10140a; padding: 0 8px 2px; border-style: solid; border-width: 5px 7px 7px;
  border-image: url("./art/ui/key-lime.png") 40 58 52 fill / 5px 7px 7px stretch; }
.cube.lit.mine .tag { color: #f0f0f0; border-image-source: url("./art/ui/key-dark.png"); }

/* sheets: dialogs with no box of their own, the art is the panel */
dialog.sheet { background: none; border: 0; padding: 18px 8px 8px; color: #f0f0f0; overflow: visible; width: min(880px, calc(100% - 24px)); max-height: calc(100% - 16px); }
dialog.sheet.wide { width: min(820px, calc(100% - 24px)); text-align: center; }
dialog::backdrop { background: radial-gradient(circle at 50% 40%, rgba(5, 8, 16, .72), rgba(2, 3, 6, .92)); }
dialog[open] { animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.folder { position: relative; width: 100%; aspect-ratio: 1.5255; background: url("./art/ui/file.png") center / 100% 100% no-repeat; image-rendering: pixelated;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .65)); }
.folder .photo { position: absolute; left: 13.6%; top: 13.7%; width: 27.6%; height: 75.8%; display: grid; place-items: center; overflow: hidden; }
#file-card { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.folder .paper { position: absolute; left: 55%; top: 16%; right: 10%; bottom: 14%; color: #1d1f27; overflow: auto; }
.folder h2 { font: 30px "Silkscreen", monospace; margin: 0 0 10px; color: #1d1f27; }
.folder p { margin: 0; font-size: 19px; line-height: 1.4; font-weight: 500; }
.below { display: grid; gap: 10px; justify-items: center; margin-top: 14px; }
.tag-field { position: relative; width: min(460px, 100%); aspect-ratio: 4.2485; background: url("./art/ui/tag.png") center / 100% 100% no-repeat; image-rendering: pixelated; }
.tag-field label { position: absolute; left: 15.5%; top: 26%; font: 12px "Silkscreen", monospace; color: #ffe9a8; letter-spacing: 1px; }
.tag-field input { position: absolute; left: 15.5%; right: 6%; top: 42%; bottom: 20%; width: auto; background: none; border: 0; outline: none;
  color: #fff6d8; font: 700 26px "Pixelify Sans", system-ui, sans-serif; text-shadow: 0 2px 0 #3a2400; padding: 0; }
.tag-field input::placeholder { color: rgba(255, 233, 168, .45); }
.tag-field:focus-within { filter: drop-shadow(0 0 10px rgba(255, 225, 74, .6)); }
.err { color: #ff8a7a; min-height: 1.2em; margin: 0; text-align: center; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.glow { font: 26px "Silkscreen", monospace; margin: 0 0 10px; color: #b3fa03; text-shadow: 0 0 12px rgba(179, 250, 3, .5); }
.note { color: #c9ccd6; margin: 10px auto; max-width: 640px; text-align: center; }
#papers-img { display: block; width: 100%; height: auto; image-rendering: auto; aspect-ratio: 1200 / 630; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .7));
  background: url("./art/ui/papers-base.png") center / 100% 100%; }

/* the calendar: the cork board with nine pinned cards */
#cal.sheet { width: min(520px, calc(100% - 24px)); }
.board { position: relative; aspect-ratio: .7155; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .65)); }
.board > img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#cal-list { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
#cal-list li { position: absolute; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; color: #1d1f27; text-align: center; padding: 7% 3% 6%; }
#cal-list .d { font: 13px "Silkscreen", monospace; }
#cal-list li.today .d { color: #c2331f; }
#cal-list .heads { display: flex; gap: 0; align-items: center; justify-content: center; width: 100%; }
#cal-list .head { width: 33%; aspect-ratio: 1; background-size: 300% 300%; background-position: 50% 50%; image-rendering: pixelated; position: relative; }
#cal-list li.soon .head { filter: brightness(.25) saturate(.3); }
#cal-list .head.won { filter: drop-shadow(0 0 4px #b3fa03); }
#cal-list .s { font-size: 15px; line-height: 1; }
#cal-list li.today { filter: drop-shadow(0 0 6px rgba(179, 250, 3, .9)); }
.toast { position: fixed; left: 50%; top: 96px; transform: translate(-50%, -20px); opacity: 0; transition: .25s; color: #10140a; z-index: 9;
  font: 14px "Silkscreen", monospace; padding: 0 16px 3px; pointer-events: none; max-width: calc(100% - 32px);
  border-style: solid; border-width: 12px 18px 16px; border-image: url("./art/ui/key-lime.png") 40 58 52 fill / 12px 18px 16px stretch; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 700px) {
  body { font-size: 18px; }
  .hud { left: 6px; right: 6px; }
  .sign { width: 220px; margin-top: -12px; }
  .led { font-size: 9px; } .led b { font-size: 17px; }
  .hud-keys { margin-top: 8px; } .hud-keys .ghost { display: none; }
  .key { font-size: 12px; min-height: 40px; padding: 0 12px 3px; border-width: 10px 14px 13px; border-image-width: 10px 14px 13px; }
  .hint { font-size: 16px; padding: 0 14px 4px; }
  .folder h2 { font-size: 16px; margin-bottom: 4px; }
  .folder p { font-size: 13px; }
  .folder .paper { top: 15%; bottom: 10%; }
  .tag-field input { font-size: 22px; }
  .tag-field label { font-size: 8px; }
  #cal-list .d { font-size: 9px; } #cal-list .s { font-size: 11px; }
  .glow { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .cube.dark .eyes { animation: none; } .toast { transition: none; } }

/* calendar card: the three heads inside the card's own picture square, the day and the status under it */
#cal-list li { display: block; padding: 0; }
#cal-list .heads { position: absolute; left: 24%; right: 24%; top: 17%; height: 30%; width: auto; }
#cal-list .head { width: 33.3%; }
#cal-list .d { position: absolute; left: 0; right: 0; top: 56%; }
#cal-list .s { position: absolute; left: 4%; right: 4%; top: 72%; }
body:has(dialog[open]) .hint { visibility: hidden; }
.close:focus { outline: none; }
.close:focus-visible { outline: 3px solid #b3fa03; outline-offset: 2px; }
#cal-list .head { background-size: 560% 560%; background-position: 50% 56%; }
#cal-list .heads { left: 22%; right: 22%; }

/* Netto 04/11: the thin VT323 was hard to read; running text is Space Grotesk, typed names Pixelify Sans */
.note { font-size: 16px; line-height: 1.45; }
#cal-list .s { font: 500 13px/1.1 "Space Grotesk", system-ui, sans-serif; }
@media (max-width: 700px) { .folder p { font-size: 12px; line-height: 1.35; } .hint { font-size: 14px; } #cal-list .s { font-size: 10px; } .note { font-size: 14px; } }

/* ---- UX review 04/11 (Fable): the file's right page holds the whole adoption (name tag, keys, the rule) on wide screens;
   on phones the page is too narrow, so the same block moves under the folder (shelter.js moves #file-more).
   The clock says what it counts, the HUD keys hide behind an open sheet (the close key sat on top of CALENDAR). ---- */
.led { justify-content: flex-start; }
.led { justify-content: space-between; }
.led .lbl { display: flex; flex-direction: column; gap: 3px; white-space: nowrap; line-height: 1; }
.led .sub { font-size: 7px; color: #5ec9d0; text-shadow: 0 0 4px rgba(56, 240, 255, .5); letter-spacing: .5px; }
body:has(dialog[open]) .hud-keys { visibility: hidden; }
.close { right: 2px; top: -4px; }
.folder .paper { display: flex; flex-direction: column; gap: 6px; scrollbar-width: none; }
.folder .paper::-webkit-scrollbar { display: none; }
.folder h2 { font-size: 24px; margin-bottom: 2px; }
.folder p { font-size: 16px; line-height: 1.35; }
.folder .paper { top: 15%; bottom: 11%; }
.more { display: grid; gap: 8px; margin-top: 2px; }
.paper .below { margin-top: 2px; justify-items: stretch; gap: 8px; }
.paper .tag-field { width: 100%; }
.paper .tag-field label { font-size: 10px; top: 24%; }
.paper .tag-field input { font-size: 22px; }
.paper .row { flex-direction: column; align-items: stretch; gap: 6px; }
.paper .key { font-size: 14px; min-height: 46px; padding: 0 12px 4px; border-width: 12px 18px 16px; border-image-width: 12px 18px 16px; }
.paper .err { min-height: 0; }
.paper .err:empty { display: none; }
.rules { margin: auto 0 0; padding: 6px 27% 0 0; font-size: 12px; line-height: 1.3; color: #5a5d68; border-top: 2px dashed rgba(29, 31, 39, .18); }
.rules:empty { display: none; }
.rules b { color: #1d1f27; font-weight: 700; }
dialog.sheet .more.out { margin-top: 12px; }
dialog.sheet .more.out .rules { color: #c9ccd6; border-top: 0; padding: 0; text-align: center; max-width: 520px; margin: 0 auto; font-size: 14px; }
dialog.sheet .more.out .rules b { color: #f0f0f0; }
#file.sheet { padding-top: 14px; }
@media (max-width: 700px) {
  .led .sub { display: none; }
  .cube.lit .tag { font-size: 12px; }
  .folder h2 { font-size: 16px; }
  .folder p { font-size: 12px; }
  .folder .paper { gap: 2px; }
}

/* ---- Netto 04/11: Smoke (the founder, no cigar) behind the desk between the stamp and the lamp, head only, eyes on the cursor;
   he rides the front layer's depth so the desk (front plate) keeps hiding his paws while the wall drifts ---- */
/* no filter, no transform animation and no will-change on Smoke: each of those made Chrome composite his box as a layer that
   painted a faint square over the cork board while he hopped (owner 04/11 "sombra quadrada"); the bob and the hop move `top` */
#me { position: absolute; pointer-events: none; will-change: auto; }
#me .pet { position: absolute; inset: 0; background-size: 300% 300%; image-rendering: pixelated; background-image: url("./art/sprites/smoke.webp");
  animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { top: 0; } 50% { top: 1px; } }
#me.hopping .pet { animation: hop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hop { 40% { top: -9px; } }
@media (prefers-reduced-motion: reduce) { #me .pet, #me.near .pet { animation: none; } }
/* the rainbow cursor of the promo films (shelter.js draws the frames; every element inherits it, text fields keep the I-beam) */
body.rb-cursor, body.rb-cursor * { cursor: inherit; }
body.rb-cursor input { cursor: text; }

/* the papers sheet fits short screens: the card shrinks before the keys fall off the bottom (owner 04/11: caption cut) */
#papers-img { width: auto; max-width: 100%; max-height: calc(100vh - 270px); margin: 0 auto; }
#papers .note { max-width: 560px; }

/* ---- calendar notes v2 (owner 04/11): big pets in a fan over the note's photo square, the day and status below in pixel type.
   A sprite cell is mostly air (the cat is ~half its width), so the cells are drawn larger than the note and overflow it ---- */
#cal-list .heads { left: 3%; right: 3%; top: 0; height: 58%; display: block; }
#cal-list .head { position: absolute; bottom: 0; width: 84%; aspect-ratio: 1; background-size: 300% 300%; background-position: 50% 50%;
  image-rendering: pixelated; filter: drop-shadow(-1px 0 1px rgba(255, 0, 70, .55)) drop-shadow(1px 0 1px rgba(0, 234, 255, .55)); }
#cal-list .head.l { left: -18%; transform: translateY(4%) rotate(-7deg); z-index: 1; }
#cal-list .head.r { right: -18%; transform: translateY(4%) rotate(7deg); z-index: 1; }
#cal-list .head.mid { left: 50%; width: 108%; transform: translate(-50%, 6%); z-index: 2; }
/* locked: flat silhouettes; the wrapper draws a thin paper-coloured edge so the three read apart */
#cal-list li.soon .head.sil { filter: drop-shadow(1.5px 0 0 #fbefcf) drop-shadow(-1.5px 0 0 #fbefcf) drop-shadow(0 1.5px 0 #fbefcf) drop-shadow(0 -1.5px 0 #fbefcf); }
#cal-list .head.sil i { position: absolute; inset: 0; background: #3a3e4c; -webkit-mask: var(--m) 50% 50% / 300% 300% no-repeat; mask: var(--m) 50% 50% / 300% 300% no-repeat; }
#cal-list .head.sil.mid i { background: #22252e; }
/* the reveal: the pets flick on like a bulb, from silhouette to colour */
#cal-list li.lightup .head { animation: lightup 1.1s steps(1) .35s both; }
#cal-list li.lightup .head em { animation: stampin .35s cubic-bezier(.3, 1.6, .5, 1) 1.5s both; }
@keyframes lightup { 0% { filter: brightness(0); } 30% { filter: brightness(1.6); } 38% { filter: brightness(0); } 55% { filter: brightness(1.3); } 62% { filter: brightness(.2); } 75%, 100% { filter: none; } }
@keyframes stampin { from { transform: translateX(-50%) rotate(-10deg) scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #cal-list li.lightup .head, #cal-list li.lightup .head em { animation: none; } }
#cal-list .q { position: absolute; right: 7%; top: 4%; font: 16px "Press Start 2P", monospace; color: #c2331f; z-index: 4; }
#cal-list .head.won { filter: drop-shadow(0 0 5px rgba(255, 52, 52, .8)); }
#cal-list .head em { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%) rotate(-10deg); font: 7px "Press Start 2P", monospace; font-style: normal;
  color: #c2331f; border: 2px solid #c2331f; padding: 2px 3px 1px; background: rgba(255, 246, 220, .85); white-space: nowrap; }
#cal-list .d { top: 68%; font: 11px "Press Start 2P", monospace; }
#cal-list .s { top: 81%; font: 9px/1.2 "Press Start 2P", monospace; }
#cal-list li.soon .s { color: #6b6e78; }
@media (max-width: 700px) { #cal-list .d { font-size: 8px; } #cal-list .s { font-size: 6px; } #cal-list .q { font-size: 11px; } #cal-list .head em { font-size: 5px; } }

/* the ♪ key (music of the room): a square key; crossed out when off */
.key.mute { min-width: 52px; padding: 0 10px 4px; font-size: 20px; position: relative; }
.key.mute.off { color: #6b6e78; }
.key.mute.off::after { content: ""; position: absolute; left: 30%; right: 30%; top: 50%; height: 3px; background: #ff3434; transform: rotate(-35deg); }
@media (max-width: 700px) { .key.mute { min-width: 40px; font-size: 16px; } }

/* Astra art on the calendar (04/11): the red "?" sticker on locked notes, the wrapped gift on the FINAL note */
#cal-list img.q { position: absolute; right: 2%; top: 0; width: 24%; height: auto; font: inherit; image-rendering: pixelated; z-index: 4; transform: rotate(8deg); }
#cal-list img.gift { position: absolute; left: 50%; bottom: 2%; width: 78%; height: auto; transform: translateX(-50%); image-rendering: pixelated; z-index: 2; }
