/* KreativWeiche · "Werkstatt" look: pegboard slate, filament orange, stepped pixel borders.
   Layout: full-screen canvas game with HUD overlays; classic view is one readable column. */

@font-face { font-family: "Silkscreen"; src: url("../assets/fonts/silkscreen-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../assets/fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../assets/fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../assets/fonts/plexmono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #d9e2e6;
  --surface: #f4f7f8;
  --ink: #16232a;
  --muted: #4a5c66;
  --line: #b4c3ca;
  --accent: #d9561a;
  --accent-text: #b4440f;
  --on-accent: #ffffff;
  --shadow: rgba(22, 35, 42, .2);
  --scrim: rgba(16, 23, 27, .45);

  --f-pixel: "Silkscreen", "Courier New", monospace;
  --f-body: "Atkinson Hyperlegible", Verdana, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --px: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #10171b; --surface: #19232a; --ink: #d8e3e8; --muted: #8ea1ab; --line: #2a3a42;
    --accent: #ff8a4c; --accent-text: #ff9a63; --on-accent: #10171b; --shadow: rgba(0, 0, 0, .45); --scrim: rgba(4, 8, 10, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10171b; --surface: #19232a; --ink: #d8e3e8; --muted: #8ea1ab; --line: #2a3a42;
  --accent: #ff8a4c; --accent-text: #ff9a63; --on-accent: #10171b; --shadow: rgba(0, 0, 0, .45); --scrim: rgba(4, 8, 10, .6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 17px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* stepped pixel border: four flat edges, no corners, plus a hard drop shadow */
.pixbox {
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    calc(2 * var(--px)) calc(2 * var(--px)) 0 0 var(--shadow);
}

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 400 15px/1 var(--f-pixel); letter-spacing: .02em; }
.logo img { image-rendering: pixelated; }

/* ---------- view switching ---------- */
.game { display: none; }
html.view-game, html.view-game body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.view-game .game { display: block; }
html.view-game .classic { display: none; }
.hud-btn.js-only { display: none; }
html.view-classic .hud-btn.js-only { display: inline-flex; }

/* ---------- game layer ---------- */
#room {
  position: fixed; left: 0; top: 0;
  image-rendering: pixelated; image-rendering: crisp-edges;
  touch-action: none; cursor: default; outline: none;
}
#room.hover { cursor: pointer; }
.hud { position: fixed; z-index: 9; pointer-events: none; }  /* above open cards: the menu always works */
.hud > * { pointer-events: auto; }
.hud-top {
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}
.nameplate {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--surface); color: var(--ink);
  padding: 7px 12px 7px 9px; margin: var(--px); flex: none;
  box-shadow: 0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink), calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink);
}
.nameplate img { image-rendering: pixelated; }
.np-text { display: grid; gap: 4px; }
.np-text b { font: 700 16px/1 var(--f-body); letter-spacing: -.01em; white-space: nowrap; }
.np-text span { font: 400 10px/1 var(--f-pixel); color: var(--accent-text); white-space: nowrap; }

.hud-menu { display: flex; align-items: center; gap: 22px; }
.hud-nav { display: flex; align-items: center; gap: 14px; }
.hud-btn.menu-btn { display: none; }
.hud-nav [aria-current="true"] { background: var(--accent); color: var(--on-accent); }
.nav-drop { position: relative; }
.drop {
  display: none; position: absolute; top: calc(100% + 12px); left: 0; z-index: 7;
  list-style: none; margin: var(--px); padding: 6px; min-width: 170px;
  background: var(--surface);
}
.nav-drop.open .drop { display: grid; gap: 2px; }
.drop a { display: block; padding: 9px 10px; font: 400 12px/1 var(--f-pixel); color: var(--ink); text-decoration: none; }
.drop a:hover, .drop a:focus-visible { background: var(--accent); color: var(--on-accent); outline: none; }

/* phones and small tablets: everything behind one "Menü" button */
@media (max-width: 940px) {
  .hud-btn.menu-btn { display: inline-flex; margin-left: auto; }
  .hud-menu {
    display: none; position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(100% + 10px);
    width: min(300px, calc(100vw - 32px)); flex-direction: column; align-items: stretch; gap: 14px;
    background: var(--surface); padding: 12px; margin: var(--px);
    box-shadow: 0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink), calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink), calc(2 * var(--px)) calc(2 * var(--px)) 0 0 var(--shadow);
  }
  .hud-top.menu-open .hud-menu { display: flex; }
  .hud-nav { flex-direction: column; align-items: stretch; gap: 2px; }
  .hud-nav .hud-btn, #btn-projects { display: none; }
  .hud-nav > a.hud-btn { display: block; box-shadow: none; margin: 0; padding: 11px 10px; font-size: 12px; text-align: left; background: transparent; }
  .hud-nav > a.hud-btn:hover { background: var(--accent); }
  .drop { display: grid; position: static; box-shadow: none; margin: 0; padding: 0; min-width: 0; gap: 2px; }
  .drop a { padding: 11px 10px; }
  .hud-menu .hud-btns { justify-content: flex-start; border-top: 2px dashed var(--line); padding-top: 12px; gap: 10px; flex-wrap: wrap; }
}

.tip {
  position: fixed; z-index: 4; margin: 0; pointer-events: none;
  transform: translate(-50%, -100%);
  background: var(--ink); color: var(--surface);
  font: 400 11px/1 var(--f-pixel); padding: 6px 8px; white-space: nowrap;
}
html.dlg-open .tip { display: none; }

.hud-btns, .c-head-btns { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.hud-btn {
  font: 400 12px/1 var(--f-pixel);
  background: var(--surface); color: var(--ink);
  border: 0; margin: var(--px); padding: 9px 11px; min-height: 34px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.hud-btn:hover { background: var(--accent); color: var(--on-accent); }
.hud-btn:active { transform: translate(2px, 2px); }
.hud-btn.icon { width: 34px; padding: 0; }
.hud-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* pixel icons: inline SVG rects, toggled by state */
.ico { width: 15px; height: 15px; display: block; fill: currentColor; shape-rendering: crispEdges; }
.ico .moon, .ico .waves { display: none; }
:root[data-theme="dark"] .ico .sun { display: none; }
:root[data-theme="dark"] .ico .moon { display: inline; }
.hud-btn[aria-pressed="true"] .ico .waves { display: inline; }
.hud-btn[aria-pressed="true"] .ico .mute { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: -1px; }

.hint {
  position: fixed; z-index: 4; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  margin: 0; padding: 8px 12px; white-space: nowrap;
  background: var(--surface); color: var(--ink);
  font: 400 12px/1 var(--f-pixel);
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
}
.hint kbd { font: inherit; background: var(--accent); color: var(--on-accent); padding: 3px 6px; margin-right: 6px; }

.dlg {
  position: fixed; z-index: 6; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: min(720px, calc(100% - 2 * max(24px, env(safe-area-inset-left, 0px))));
  background: var(--surface); color: var(--ink);
  padding: 28px 24px 22px; cursor: pointer;
  font: 400 clamp(17px, 2.2vw, 20px)/1.5 var(--f-body);
}
.dlg .who { position: absolute; top: -16px; left: 18px; background: var(--accent); color: var(--on-accent); font: 400 13px/1 var(--f-pixel); padding: 8px 10px; }
.dlg .say { margin: 0; min-height: 3em; }
.dlg .more { position: absolute; right: 16px; bottom: 12px; display: flex; align-items: center; gap: 8px; }
.dlg .more kbd { font: 400 11px/1 var(--f-pixel); background: var(--accent); color: var(--on-accent); padding: 5px 7px; animation: bob 1s steps(2) infinite; }
.dlg .more-text { display: none; font: 400 11px/1 var(--f-pixel); color: var(--accent-text); }
.dlg.nudge .more-text { display: inline; }
.dlg.nudge .more kbd { animation: pulse .9s steps(2) infinite; }
.dlg.typing .more { visibility: hidden; }
@keyframes pulse { 50% { background: var(--ink); color: var(--surface); transform: scale(1.12); } }
.guide kbd { margin-right: 4px; }
.guide kbd:last-of-type { margin-right: 8px; }
@keyframes bob { 50% { transform: translateY(3px); } }

.panel-wrap {
  position: fixed; inset: 0; z-index: 8;
  background: var(--scrim);
  display: grid; place-items: center;
  padding: calc(72px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
.panel { position: relative; width: min(560px, 100%); max-height: 100%; overflow: auto; background: var(--surface); color: var(--ink); margin: var(--px); padding-top: 40px; }
.panel .card { box-shadow: none; margin: 0; padding-top: 6px; }
.panel-close {
  position: absolute; top: 0; right: 0;
  width: 40px; height: 40px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--surface); font: 400 16px/1 var(--f-pixel);
}
.panel-close:hover { background: var(--accent); color: var(--on-accent); }

.legal-mini {
  position: fixed; z-index: 10; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 12px; font: 500 11px/1 var(--f-mono);
}
.legal-mini a { color: var(--ink); background: var(--surface); padding: 4px 6px; text-decoration: none; opacity: .8; }
.legal-mini a:hover { opacity: 1; text-decoration: underline; }
html.dlg-open .hint { display: none; }   /* the legal links always stay visible (§ 5 DDG: "ständig verfügbar") */
.dlg .say { padding-right: 72px; }

/* ---------- cards (classic view + panels) ---------- */
.card { background: var(--surface); color: var(--ink); padding: 18px; margin: var(--px); display: grid; gap: 14px; }
.card img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; display: block; }
.kicker { font: 500 12px/1.2 var(--f-mono); color: var(--accent-text); }
.card h3 { margin: 0; font: 400 clamp(24px, 3vw, 30px)/1.05 var(--f-pixel); text-wrap: balance; }
.card p { margin: 0; max-width: 62ch; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 10px 0; list-style: none; border-block: 2px dashed var(--line); }
.stats b { display: block; font: 400 22px/1.1 var(--f-pixel); font-variant-numeric: tabular-nums; }
.stats span { font: 500 12px/1.3 var(--f-mono); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { font: 500 12px/1 var(--f-mono); border: 2px solid var(--ink); padding: 5px 7px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 10px 13px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--on-accent); font: 400 12px/1.1 var(--f-pixel);
}
.btn:hover { background: var(--ink); color: var(--surface); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px currentColor; }
.btn.ghost:hover { background: var(--ink); color: var(--surface); }
.btn.soon, .btn.soon:hover { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); cursor: default; }

/* MakerWorld card */
.mw-head { display: flex; align-items: center; gap: 14px; }
.card .mw-logo { width: 64px; height: 64px; aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--ink); background: #000; flex: none; }
.mw-name { display: grid; gap: 6px; }
.mw-handle { font: 500 13px/1 var(--f-mono); color: var(--muted); }
.mw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.mw-sub { font: 500 12px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mw-models { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mw-models a { display: grid; gap: 6px; text-decoration: none; color: var(--ink); }
.card .mw-models img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; border: 2px solid var(--ink); }
.mw-models a:hover img { border-color: var(--accent); }
.mw-model-name { font-size: 14px; line-height: 1.3; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mw-model-dl { font: 500 12px/1 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.mw-asof { font: 500 11px/1.4 var(--f-mono); color: var(--muted); }
@media (max-width: 420px) { .mw-models { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mw-models li:nth-child(3) { display: none; } }

.about { grid-template-columns: 160px minmax(0, 1fr); align-items: start; }
.about .about-text { display: grid; gap: 12px; }
.card .photo { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; border: 3px solid var(--ink); image-rendering: auto; }
.socials a { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.socials a span:last-child { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.soc-ico { width: 30px; height: 30px; display: grid; place-items: center; background: var(--ink); color: var(--surface); flex: none; }
.soc-ico svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.socials a:hover .soc-ico { background: var(--accent); color: var(--on-accent); }
.socials a:hover span:last-child { color: var(--accent-text); }
@media (max-width: 520px) { .about { grid-template-columns: minmax(0, 1fr); } .photo { max-width: 180px; } }

.mail { font: 400 clamp(15px, 3.4vw, 22px)/1.2 var(--f-pixel); color: var(--accent-text); word-break: break-all; }
.socials { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.socials li { display: flex; gap: 12px; align-items: center; font-weight: 700; }
.socials .note { font: 500 12px/1 var(--f-mono); color: var(--muted); font-weight: 500; }
.socials li.soon > span:first-child { color: var(--muted); }

/* ---------- classic view ---------- */
.classic {
  max-width: 880px; margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  display: grid; gap: 40px;
}
.c-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.classic main { display: grid; gap: 48px; }
.c-intro { display: grid; gap: 10px; padding-top: 16px; }
.eyebrow { margin: 0; font: 500 13px/1 var(--f-mono); color: var(--accent-text); text-transform: uppercase; letter-spacing: .08em; }
.c-intro h1 { margin: 0; font: 700 clamp(38px, 7vw, 68px)/1.02 var(--f-body); letter-spacing: -.025em; text-wrap: balance; }  /* Silkscreen draws ß like B */
.lead { margin: 0; font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 52ch; }
.c-section { display: grid; gap: 16px; }
.c-section h2 { margin: 0; font: 500 13px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.c-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; font: 500 13px/1.4 var(--f-mono); color: var(--muted); border-top: 2px dashed var(--line); padding-top: 18px; }

/* ---------- legal pages ---------- */
.legal { max-width: 760px; }
.legal h1 { margin: 0; font: 400 clamp(30px, 6vw, 48px)/1.05 var(--f-pixel); }
.legal h2 { margin: 18px 0 0; font: 700 20px/1.3 var(--f-body); }
.legal p, .legal li { max-width: 68ch; }
.legal .meta { font: 500 13px/1.4 var(--f-mono); color: var(--muted); }
.legal article { display: grid; gap: 10px; }
.legal address { font-style: normal; }


@media (max-width: 940px) {
  /* hints and dialogue sit above the legal links instead of covering them */
  .hint { bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
  .dlg { bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
}
.menu-legal { display: none; }
@media (max-width: 940px) {
  .menu-legal { display: flex; gap: 16px; border-top: 2px dashed var(--line); padding-top: 12px; font: 500 12px/1 var(--f-mono); }
  .menu-legal a { color: var(--ink); }
}
@media (max-width: 440px) {
  .np-text b { font-size: 14px; }
  .np-text span { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .dlg .more kbd, .dlg.nudge .more kbd { animation: none; }
  .hud-btn:active { transform: none; }
}
