/* marclensch.com — arcade one-pager, hand-built, no dependencies */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/space-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/space-mono-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #060607;
  --ink: #e8e6e0;
  --dim: #6f7a71;
  --line: #1b1f1c;
  --phos: #7dff9a;
  --phos-dim: #2e5c3d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Mono", monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---- masthead: second one = sender verification ---- */
.mast {
  text-align: center;
  /* clear the iOS status bar — viewport-fit=cover pulls us underneath it */
  padding: calc(env(safe-area-inset-top, 0px) + clamp(18px, 4.5vh, 44px)) 16px 0;
  user-select: none;
}
.wordmark {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 4.2vw, 2.1rem);
  letter-spacing: .38em;
  margin-right: -.38em; /* optical centering of tracked caps */
  color: var(--ink);
}
.mail {
  display: inline-block;
  margin-top: .55em;
  font-size: clamp(.72rem, 2.4vw, .85rem);
  letter-spacing: .08em;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.mail:hover, .mail:focus-visible { color: var(--phos); border-color: var(--phos-dim); }
.tag {
  margin-top: .5em;
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--dim);
}

/* ---- the cabinet ---- */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 10px calc(12px + env(safe-area-inset-right, 0px)) 10px calc(12px + env(safe-area-inset-left, 0px));
  min-height: 0;
}
/* optical centre: 2/5 above, 3/5 below — the spacers collapse first on short viewports */
.stage::before { content: ""; flex: 2 1 0; }
.stage::after { content: ""; flex: 3 1 0; }
@media (max-height: 380px) {
  body { overflow-y: auto; } /* scroll safety net on very short (landscape) viewports */
}
.cab {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #08090a;
  box-shadow: 0 0 60px rgba(125, 255, 154, .045), inset 0 0 22px rgba(0, 0, 0, .7);
}
/* bezel: the machine's own read-out strip, above the screen */
.bezel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 3px 6px 9px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--dim);
  user-select: none;
  transition: opacity .3s;
}
.bezel.dim { opacity: .45; }

.screen { position: relative; }

.cab canvas {
  display: block;
  background: #0a0c0b;
  border-radius: 3px;
  cursor: pointer;
  touch-action: none;
}

/* CRT scanlines + vignette overlay */
.scan {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, .26) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .20) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 0 1px rgba(125, 255, 154, .10); /* faint screen edge */
}
@media (prefers-reduced-motion: no-preference) {
  .scan { animation: flicker 5.4s infinite; }
  @keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: .86; }
    94% { opacity: 1; }
  }
}

/* sound toggle, sits in the bezel */
.snd {
  position: relative; /* anchors the ::after touch target */
  font-family: "Space Mono", monospace;
  font-size: .6rem;
  letter-spacing: .12em;
  color: var(--dim);
  background: rgba(6, 6, 7, .72);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 8px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.snd[aria-pressed="true"] { color: var(--phos); border-color: var(--phos-dim); }
.snd:hover { color: var(--phos); }
.snd::after { content: ""; position: absolute; inset: -12px; } /* ~48px touch target, same look */

/* highscore name entry, overlays the screen */
.entry[hidden] { display: none; } /* class display would defeat the hidden attribute */
.entry {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(6, 6, 7, .88);
  text-align: center;
}
.entry-score {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: clamp(.9rem, 3vw, 1.2rem);
  letter-spacing: .18em;
  color: var(--phos);
}
.entry-label {
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}
.entry input {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  font-size: clamp(1rem, 4vw, 1.4rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  text-align: center;
  color: var(--phos);
  background: #0a0c0b;
  border: 1px solid var(--phos-dim);
  border-radius: 3px;
  padding: 8px 4px 8px 12px;
  width: min(64vw, 300px);
  caret-color: var(--phos);
  outline: none;
}
.entry input:focus { border-color: var(--phos); }
.entry-row { display: flex; gap: 10px; }
.entry-row button {
  font-family: "Space Mono", monospace;
  font-size: .66rem;
  letter-spacing: .14em;
  color: var(--dim);
  background: rgba(6, 6, 7, .72);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 14px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.entry-row button[type="submit"] { color: var(--phos); border-color: var(--phos-dim); }
.entry-row button:hover { color: var(--phos); border-color: var(--phos-dim); }

.hint {
  margin-top: 10px;
  font-size: .62rem;
  letter-spacing: .14em;
  color: var(--dim);
  text-transform: uppercase;
  min-height: 1em;
  user-select: none;
}

/* ---- footer ---- */
.foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 calc(clamp(12px, 2.5vh, 22px) + env(safe-area-inset-bottom, 0px));
  font-size: .62rem;
  letter-spacing: .12em;
}
.foot-sep { color: #3d423e; user-select: none; }
.lang {
  background: none;
  border: none;
  padding: 0;
  font-family: "Space Mono", monospace;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  cursor: pointer;
}
.lang:hover, .lang:focus-visible { color: var(--ink); }
.foot a {
  color: var(--dim);
  text-decoration: none;
  text-transform: uppercase;
}
.foot a:hover, .foot a:focus-visible { color: var(--ink); }

.noscript {
  padding: 24px;
  color: var(--dim);
  font-size: .8rem;
  text-align: center;
}

/* ---- impressum page ---- */
.legal {
  max-width: 34rem;
  padding: 12vh 24px calc(12vh + env(safe-area-inset-bottom, 0px));
  line-height: 1.75;
  font-size: .8rem;
  color: var(--dim);
}
.legal h2 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: .3em;
  font-size: .95rem;
  color: var(--ink);
  margin-bottom: 1.6em;
}
.legal h2 + .legal h2, .legal p + h2 { margin-top: 2.6em; }
.legal strong { color: var(--ink); font-weight: 700; }
.legal p + p { margin-top: 1em; }
.legal a { color: var(--phos); text-decoration: none; }
.legal a:hover { border-bottom: 1px solid var(--phos-dim); }
.legal .back { display: inline-block; margin-top: 3em; color: var(--dim); }
body.page { overflow: auto; justify-content: flex-start; align-items: center; }
