/* webinstytut.pl — site styles
   Palette mirrors the game (js/game.js → C). Dark-only by design. */

/* Fonts — self-hosted (OFL 1.1, see /fonts/LICENSE.md). latin + latin-ext subsets
   from Google Fonts; the browser only downloads a subset when the page uses it. */
/* IBM Plex Mono 400, latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-v20-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* IBM Plex Mono 400, latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-v20-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* IBM Plex Mono 500, latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-v20-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* IBM Plex Mono 500, latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-v20-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Silkscreen 400, latin-ext */
@font-face {
  font-family: 'Silkscreen';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/silkscreen-v6-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Silkscreen 400, latin */
@font-face {
  font-family: 'Silkscreen';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/silkscreen-v6-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Space Grotesk 400 700, latin-ext */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-v22-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Space Grotesk 400 700, latin */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-v22-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  --ink: #0b1020;
  --ink-2: #0f162b;
  --panel: #121a33;
  --panel-2: #172042;
  --line: rgba(154, 166, 199, 0.16);
  --line-strong: rgba(154, 166, 199, 0.3);
  --text: #e8ecf8;
  --muted: #9aa6c7;
  --mint: #3ee6b0;
  --amber: #ffb547;
  --coral: #ff5d6c;
  --violet: #9b7bff;
  --sky: #5cc8ff;

  --font-sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-pixel: 'Silkscreen', 'IBM Plex Mono', monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;

  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Smooth scrolling only after an in-page link click (the clicked link holds focus),
   not for the jump to a #fragment on page load — animating that delays LCP ~0.7 s. */
@media (prefers-reduced-motion: no-preference) {
  html:focus-within {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    radial-gradient(1200px 520px at 78% -8%, rgba(62, 230, 176, 0.1), transparent 65%),
    radial-gradient(900px 480px at -10% 30%, rgba(155, 123, 255, 0.08), transparent 60%),
    linear-gradient(rgba(154, 166, 199, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 166, 199, 0.045) 1px, transparent 1px);
  background-size:
    auto,
    auto,
    32px 32px,
    32px 32px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--mint);
  text-underline-offset: 3px;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.pixel {
  font-family: var(--font-pixel);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--mint);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8em 1.4em;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--mint);
  color: var(--ink);
}
.btn-primary:hover {
  background: #62efc2;
  box-shadow: 0 6px 24px -6px rgba(62, 230, 176, 0.55);
}

.btn-ghost {
  background: rgba(232, 236, 248, 0.04);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--mint);
  background: rgba(62, 230, 176, 0.08);
}

/* ── Header ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 16, 32, 0.78);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

/* A tiny CSS robot head — the same character as in the game. */
.logo-mark {
  position: relative;
  flex: none;
  width: 26px;
  height: 22px;
  border-radius: 6px;
  background: var(--mint);
  box-shadow: inset 0 -3px 0 rgba(11, 16, 32, 0.25);
}
.logo-mark::before {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  top: 6px;
  height: 7px;
  border-radius: 3px;
  background: var(--ink);
}
.logo-mark::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  width: 3px;
  height: 3px;
  background: var(--mint);
  box-shadow: 7px 0 0 var(--mint);
}

.logo-tld {
  color: var(--mint);
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}
.site-nav a:hover {
  color: var(--text);
  background: rgba(232, 236, 248, 0.06);
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.lang-switch button {
  min-width: 40px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
.lang-switch button:hover {
  color: var(--text);
}
.lang-switch button[aria-pressed='true'] {
  background: var(--mint);
  color: var(--ink);
}

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 0 12px;
    padding-top: 8px;
  }
  .lang-switch {
    margin-left: auto;
  }
  .site-nav {
    order: 3;
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav a {
    font-size: 0.9rem;
  }
  .site-nav,
  .hero,
  .section {
    --header-h: 104px;
  }
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  padding-block: clamp(48px, 9vw, 112px) clamp(40px, 7vw, 88px);
  scroll-margin-top: var(--header-h);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.eyebrow,
.kicker {
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 12px;
  border: 1px solid rgba(62, 230, 176, 0.3);
  border-radius: 999px;
  background: rgba(62, 230, 176, 0.06);
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
}
.hl {
  background: linear-gradient(90deg, var(--mint), var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 34em;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 32px;
}

/* Terminal card */
.terminal {
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--ink-2));
  box-shadow:
    0 30px 60px -30px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(62, 230, 176, 0.05);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(232, 236, 248, 0.03);
}
.dots {
  display: inline-flex;
  flex: none;
  gap: 6px;
}
.dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
}
.dots i:nth-child(2) {
  background: var(--amber);
}
.dots i:nth-child(3) {
  background: var(--mint);
}
.window-title {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.terminal-body {
  display: grid;
  gap: 10px;
  padding: 22px 20px 24px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
}
.terminal-body .cmd {
  color: var(--text);
  overflow-wrap: anywhere;
}
.terminal-body .ok {
  color: var(--muted);
}
.terminal-body .done {
  margin-top: 6px;
  color: var(--mint);
}
.prompt {
  color: var(--violet);
}
.tick {
  color: var(--mint);
}
.caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--mint);
}
@media (prefers-reduced-motion: no-preference) {
  .caret {
    animation: blink 1.1s steps(1) infinite;
  }
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Sections ─────────────────────────────────────────────────────── */
.section {
  padding-block: clamp(56px, 8vw, 104px);
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) - 1px);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.section-head h2,
.contact-card h2 {
  margin-top: 10px;
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
}
.section-lead {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ── Game window ──────────────────────────────────────────────────── */
.game-section {
  background: linear-gradient(180deg, rgba(18, 26, 51, 0.55), transparent 70%);
}

.game-window {
  position: relative;
  max-width: 960px;
  margin-inline: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--ink-2);
  box-shadow:
    0 40px 80px -40px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(62, 230, 176, 0.06),
    0 0 60px -20px rgba(62, 230, 176, 0.18);
  overflow: hidden;
}

.game-bar .window-title {
  flex: 1;
  min-width: 0;
}

.game-tools {
  display: inline-flex;
  gap: 4px;
  margin-right: -6px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--text);
  background: rgba(232, 236, 248, 0.07);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* All inline icons are stroke-drawn. */
svg path,
svg rect,
svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Icons inside text buttons. These replace ▶ / → characters: none of the site's fonts
   has them, so the browser searched every system font for one — ~20 ms of the first
   layout on mobile, enough to cost a Lighthouse point. Prefer SVG over symbol glyphs. */
.btn-ico {
  flex: none;
  width: 1.05em;
  height: 1.05em;
}
.ico-play path {
  fill: currentColor;
  stroke-width: 1.2;
}

#btn-mute .ico-muted,
#btn-mute[aria-pressed='true'] .ico-sound {
  display: none;
}
#btn-mute[aria-pressed='true'] .ico-muted {
  display: block;
}
#btn-mute[aria-pressed='true'] {
  color: var(--coral);
}

/* Until JS boots the game, hide the controls — with visibility, not display, so their
   space is reserved and nothing below the game shifts when they appear. The title
   screen (#ov-title) is plain HTML and stays visible, so it paints with the page
   instead of after game.js runs (otherwise a late LCP on /#gra). The other overlays
   carry [hidden]; css/noscript.css removes title + controls when JS is off. */
.game-window:not(.is-ready) .game-tools,
.game-window:not(.is-ready) .touch-controls {
  visibility: hidden;
}

.game-stage {
  container: stage / inline-size;
  position: relative;
  background: #0b1424;
}

.game-stage canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 400 / 224;
  image-rendering: pixelated;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.noscript {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  text-align: center;
}

/* Toast (info blocks, checkpoints) */
.game-toast {
  position: absolute;
  left: 50%;
  top: 15%;
  z-index: 2;
  width: max-content;
  max-width: min(88%, 560px);
  padding: 0.6em 0.9em;
  border: 1px solid rgba(62, 230, 176, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(11, 16, 32, 0.9);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  font-size: clamp(11px, 2.6cqi, 16px);
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.game-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.game-toast:empty {
  display: none;
}

/* Overlays */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 12px;
  padding: clamp(8px, 3cqi, 28px);
  background: radial-gradient(ellipse at center, rgba(11, 16, 32, 0.72), rgba(11, 16, 32, 0.92));
  overflow-y: auto;
  overscroll-behavior: contain;
}
#ov-title {
  background: linear-gradient(180deg, rgba(11, 16, 32, 0.2), rgba(11, 16, 32, 0.8));
}

.ov-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  gap: clamp(5px, 1.6cqi, 14px);
  width: 100%;
  max-width: 620px;
  text-align: center;
}

.ov-kicker {
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 12px;
  font-size: clamp(10px, 2.2cqi, 14px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ov-kicker.pixel {
  font-family: var(--font-pixel);
}
.ov-kicker:empty {
  display: none;
}

.ov-logo {
  color: var(--text);
  font-size: 34px;
  font-size: clamp(20px, 8cqi, 64px);
  line-height: 1;
  text-shadow:
    3px 3px 0 var(--ink),
    0 0 24px rgba(62, 230, 176, 0.35);
}

.ov-title {
  color: var(--text);
  font-size: 22px;
  font-size: clamp(15px, 4.4cqi, 32px);
  font-weight: 700;
  line-height: 1.15;
}
.ov-title.pixel {
  font-weight: 400;
}

.ov-text {
  max-width: 34em;
  color: var(--muted);
  font-size: 15px;
  font-size: clamp(12px, 2.6cqi, 17px);
  line-height: 1.45;
}

.ov-hint {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-size: clamp(10px, 2cqi, 13px);
}

.ov-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
}

.ov-card .btn {
  padding: 0.65em 1.3em;
  font-size: 15px;
  font-size: clamp(12px, 2.8cqi, 17px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 520px;
  margin: 0;
}
.stats > div {
  padding: 0.5em 0.4em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(18, 26, 51, 0.92);
}
.stats > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stats dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-size: clamp(8px, 1.8cqi, 12px);
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stats dd {
  margin: 2px 0 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 17px;
  font-size: clamp(11px, 3.4cqi, 22px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Small game window (phones): drop the long copy so everything fits. */
@container stage (max-width: 560px) {
  #ov-final .ov-text,
  .ov-hint {
    display: none;
  }
  .stats {
    gap: 4px;
  }
  .stats > div {
    padding: 0.35em 0.2em;
  }
}

/* Control hints: keyboard by default, touch on coarse pointers. */
.hint-touch {
  display: none;
}

.game-hint {
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: center;
}

.touch-controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: rgba(232, 236, 248, 0.02);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.touch-group {
  display: flex;
  gap: 12px;
}
.touch-btn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(232, 236, 248, 0.05);
  color: var(--text);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.touch-btn svg {
  width: 26px;
  height: 26px;
}
.touch-btn svg path {
  stroke-width: 2.6;
}
.touch-jump {
  width: 84px;
  border-color: rgba(62, 230, 176, 0.5);
  background: rgba(62, 230, 176, 0.12);
  color: var(--mint);
}
.touch-btn.is-down {
  border-color: var(--mint);
  background: rgba(62, 230, 176, 0.28);
  transform: translateY(1px);
}

@media (hover: none) and (pointer: coarse) {
  .hint-kbd {
    display: none;
  }
  .hint-touch {
    display: block;
  }
  .touch-controls {
    display: flex;
  }
}

/* Fullscreen: letterbox the canvas, keep the controls visible. */
.game-window:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: var(--ink);
}
.game-window:fullscreen .game-stage {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  background: var(--ink);
}
.game-window:fullscreen .game-stage canvas {
  width: min(100%, calc((100dvh - 140px) * 400 / 224));
}
.game-window:fullscreen .touch-controls {
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

/* ── Services ─────────────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  --accent: var(--mint);
  position: relative;
  padding: 26px 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 26, 51, 0.9), rgba(15, 22, 43, 0.7));
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.card::before {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.8;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-2px);
}
.card-amber {
  --accent: var(--amber);
}
.card-violet {
  --accent: var(--violet);
}
.card-coral {
  --accent: var(--coral);
}

.card-ico {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.card h3 {
  margin-top: 18px;
  font-size: 1.2rem;
}
.card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ── Process ──────────────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step {
  --accent: var(--mint);
  padding: 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(18, 26, 51, 0.6);
}
.step-2 {
  --accent: var(--amber);
}
.step-3 {
  --accent: var(--violet);
}
.step-num {
  display: block;
  color: var(--accent);
  font-size: 1.6rem;
  line-height: 1;
}
.step h3 {
  margin-top: 14px;
  font-size: 1.2rem;
}
.step p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.98rem;
}

@media (max-width: 820px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Contact ──────────────────────────────────────────────────────── */
.contact-card {
  position: relative;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid rgba(62, 230, 176, 0.28);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(600px 240px at 100% 0%, rgba(62, 230, 176, 0.14), transparent 70%),
    radial-gradient(500px 220px at 0% 100%, rgba(155, 123, 255, 0.12), transparent 70%),
    var(--panel);
}
.contact-card .section-lead {
  max-width: 36em;
}
.contact-mail {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}
.site-footer a {
  color: var(--muted);
}
.site-footer a:hover {
  color: var(--text);
}

/* ── 404 ──────────────────────────────────────────────────────────── */
.notfound {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h) - 90px);
  padding-block: 64px;
  text-align: center;
}
.notfound .code {
  color: var(--coral);
  font-size: clamp(2.2rem, 9vw, 4.5rem);
  line-height: 1;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}
.notfound h1 {
  margin-top: 22px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}
.notfound .lead {
  margin-inline: auto;
}
.notfound .cta-row {
  justify-content: center;
}

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
