/* Smul: a schoolboy's 2003 Photoshop page. Flat blue, WordArt, bevel buttons. */
@font-face { font-family: "Comic Neue"; src: url("/fonts/comicneue-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cousine"; src: url("/fonts/cousine.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #0000f5; --ink: #fff200; --accent: #fff200;
  --font-display: "Comic Neue", "Comic Sans MS", cursive;
  --font-body: "Comic Neue", "Comic Sans MS", cursive;
  --shadow: 3px 3px 0 #000;
  --key-h: clamp(64px, 8.4vh, 92px);
}

html, body { height: 100%; }
body {
  -webkit-user-select: none; user-select: none;
  background: var(--bg); color: var(--ink); overflow: hidden;
  font-weight: 700; text-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
}

#world { position: fixed; inset: 0; width: 100vw; height: 100svh; z-index: 1; touch-action: none; display: block; }

/* top: wordmark, ticker, lore straight on the blue, behind Smul */
.top {
  position: fixed; z-index: 0; top: var(--s3); left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  pointer-events: none; padding-inline: var(--s2);
}
.wm { margin: 0; line-height: 0; transform-origin: 50% 70%; }
.wm img { width: min(54vw, 620px, 62vh); height: auto; image-rendering: auto; transform: rotate(-3deg); }
.tick { margin: calc(-1 * var(--s1)) 0 0; font-size: clamp(26px, 2.6vw, 40px); color: #3cff00; transform: rotate(2deg) translateX(26%); line-height: 1.1; }
.lore { margin: var(--s1) 0 0; font-size: clamp(18px, 1.5vw, 24px); line-height: 1.3; max-width: 44ch; color: #fff; }
.hint { color: #ff2a2a; white-space: nowrap; }

/* bottom: the bevel keys are the floor Smul lands on, the CA under them */
.bottom {
  position: fixed; z-index: 2; left: 0; right: 0; bottom: 0;
  padding: 0 var(--s3) var(--s2); pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
}
.keys { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); gap: var(--s3); width: min(1500px, 100%); }
.keys > *, .ca > * { pointer-events: auto; }

.key {
  display: flex; align-items: center; justify-content: center; gap: .45em;
  min-height: var(--key-h); padding: 0 1em;
  border-style: solid; border-width: 18px; border-image-slice: 22 fill; border-image-width: 18px; border-image-repeat: stretch;
  background: none; color: #111; text-shadow: 1px 1px 0 rgba(255,255,255,.55);
  font: 700 clamp(18px, 1.5vw, 26px)/1 var(--font-display); text-decoration: none; letter-spacing: .02em;
  cursor: pointer; transition: filter .25s; will-change: transform;
  position: relative; overflow: hidden; transform-origin: 50% 100%;
}
/* a cheap 2003 shine that sweeps across the bevel on hover */
.key::after {
  content: ""; position: absolute; top: -20px; bottom: -20px; left: 0; width: 38%; pointer-events: none;
  background: linear-gradient(100deg, transparent 0, rgba(255,255,255,.0) 20%, rgba(255,255,255,.75) 50%, rgba(255,255,255,0) 80%, transparent 100%);
  transform: translateX(-160%) skewX(-18deg); transition: transform 0s;
}
.key:hover::after, .key:focus-visible::after { transform: translateX(330%) skewX(-18deg); transition: transform .65s cubic-bezier(.2,.7,.2,1); }
.key img { will-change: transform; -webkit-user-drag: none; pointer-events: none; }
.key { -webkit-user-drag: none; }
.key span { position: relative; top: .04em; white-space: nowrap; }
.key .pre { font-style: normal; }
.key img { width: 1.5em; height: 1.5em; flex: none; object-fit: contain; }
.key-grey { border-image-source: url("/img/s/btn-grey.webp"); }
.key-green { border-image-source: url("/img/s/btn-green.webp"); font-size: clamp(22px, 2.1vw, 38px); }
.key-green img { width: 1.6em; height: 1.6em; }
.key:hover { filter: brightness(1.12) saturate(1.15); }
.key:active { filter: brightness(.86); }
.key.is-off { opacity: 1; cursor: not-allowed; }
.key:focus-visible { outline: 4px dashed #fff200; outline-offset: 4px; }

.ca {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--s1) var(--s2);
  width: min(1500px, 100%); font-size: clamp(16px, 1.25vw, 21px); color: #fff;
}
.ca-lab { color: #fff200; }
.ca code { -webkit-user-select: all; user-select: all; font: 700 1em/1.3 "Cousine", monospace; color: #fff; opacity: 1; text-shadow: 2px 2px 0 #000; min-width: 0; }
.key-copy { border-image-source: url("/img/s/btn-copy.webp"); min-height: 48px; min-width: 104px; font-size: 18px; border-width: 12px; border-image-width: 12px; border-image-slice: 18 fill; }

@media (max-width: 760px) {
  .top { top: var(--s2); }
  .wm img { width: min(82vw, 460px); }
  .tick { transform: rotate(2deg) translateX(18%); }
  .lore { font-size: 17px; max-width: 30ch; }
  .bottom { padding: 0 var(--s2) var(--s2); gap: var(--s1); }
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s1) var(--s2); }
  .key-green { grid-column: 1 / -1; grid-row: 1; }
  .key { min-height: 58px; font-size: 18px; }
  .key-green { font-size: 22px; }
  .ca { font-size: 16px; gap: 4px var(--s1); }
  .ca code { flex: 1 1 100%; text-align: center; }
}
@media (max-width: 380px) {
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s1); }
  .key { min-width: 0; padding: 0 .2em; border-width: 14px; border-image-width: 14px; font-size: 16px; gap: .3em; }
  .key-green { font-size: 19px; }
  .key .pre { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hint { display: none; } }
@media (max-width: 760px) and (max-height: 700px) {
  .wm img { width: min(64vw, 340px); }
  .tick { font-size: 22px; margin-top: -4px; }
  .lore { font-size: 16px; margin-top: 2px; }
  .key { min-height: 50px; }
}
@media (max-height: 700px) and (min-width: 761px) {
  .lore { display: none; }
}

/* 404 */
.four {
  display: block; font: 700 clamp(96px, 16vw, 220px)/1 var(--font-display); font-style: italic; letter-spacing: -.02em;
  background: linear-gradient(90deg, #ff2020, #ff9a00, #fff200, #3cff00, #00f0ff); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(6px 6px 0 #000); transform: rotate(-4deg);
}
.keys-one { grid-template-columns: minmax(0, 560px); justify-content: center; }
.keys-one .key-green { grid-column: auto; }
