:root {
  --bg: #060708;
  --bg-2: #0b0d0e;
  --panel: #0f1213;
  --panel-2: #141819;
  --line: #22292a;
  --line-2: #2f3839;
  --text: #c8ccc3;
  --text-dim: #7d857e;
  --text-mute: #4c5450;
  --accent: #d8d2bf;
  --red: #c21d24;
  --red-glow: rgba(194, 29, 36, .45);
  --amber: #d6a02c;
  --green: #4fae74;
  --cyan: #6fb7c2;
  --safe: #4fae74;
  --euclid: #d6a02c;
  --keter: #c21d24;
  --restricted: #8f6bd8;
  --mono: "IBM Plex Mono", "Consolas", "Courier New", monospace;
  --head: "Oswald", "Impact", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse at 50% -20%, #131a1a 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,.012) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.012) 39px 40px),
    var(--bg);
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--red); color: #fff; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-2); }
::-webkit-scrollbar-thumb:hover { background: #475050; }

[hidden] { display: none !important; }

button { font-family: inherit; }

/* ---------- efekty ekranu ---------- */

.fx { position: fixed; inset: 0; pointer-events: none; z-index: 900; }

.fx-scan {
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  animation: flicker 6s infinite steps(1);
}

.fx-noise {
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noise .4s steps(3) infinite;
}

.fx-vignette {
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
}

@keyframes noise {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-12px, 8px); }
  66% { transform: translate(9px, -14px); }
  100% { transform: translate(0, 0); }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: .85; }
  48% { opacity: 1; }
  82% { opacity: .9; }
  83% { opacity: 1; }
}

.blink {
  position: fixed; inset: 0; background: #000; z-index: 950;
  opacity: 0; pointer-events: none;
}
.blink.on { opacity: 1; }

/* ---------- ekran startowy ---------- */

.boot {
  position: fixed; inset: 0; z-index: 800;
  display: flex; padding: 24px clamp(22px, 6vw, 44px);
  overflow-y: auto;
  background: #030404;
  cursor: pointer;
  transition: opacity .6s ease;
}
.boot.out { opacity: 0; pointer-events: none; }

.boot-inner { width: min(720px, 100%); margin: auto; }

.boot-log .acro { color: #e2f7e4; text-shadow: 0 0 9px rgba(160,240,170,.6); }
.boot-log.reveal .acro { color: #000; background: #9fe0ae; text-shadow: none; box-shadow: 0 0 12px rgba(160,240,170,.8); }

.gate { margin-top: 22px; padding: 18px 20px; border: 1px solid #2a3a2e; background: rgba(8,14,10,.9); cursor: auto; }
.gate-h { font-size: 11px; letter-spacing: .3em; color: var(--amber); margin-bottom: 8px; }
.gate p { margin: 0 0 14px; color: #b9c9b9; font-size: 14px; }
.gate p b { color: #e8f5e8; letter-spacing: .06em; }
.gate-row { display: flex; align-items: center; gap: 10px; }
.gate-row > span { color: #9fe0ae; }
.gate input {
  flex: 1; min-width: 0; padding: 10px 12px;
  background: #030504; color: #d9f2dc; border: 1px solid #2a3a2e; outline: none;
  font-family: var(--mono); font-size: 16px; letter-spacing: .15em; text-transform: uppercase;
}
.gate input:focus { border-color: #9fe0ae; box-shadow: 0 0 14px rgba(160,240,170,.15); }
.gate button {
  padding: 10px 16px; cursor: pointer; background: transparent; color: #9fe0ae; border: 1px solid #9fe0ae;
  font-family: var(--mono); font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
}
.gate button:hover { background: #9fe0ae; color: #000; }
.gate input:disabled, .gate button:disabled { opacity: .5; cursor: default; }
.gate-msg { min-height: 22px; margin-top: 10px; font-size: 13px; }
.gate-msg.err { color: #ff6a6f; }
.gate-msg.ok { color: #9fe0ae; letter-spacing: .1em; }
.gate-hint { font-size: 12px; color: var(--amber); }

@media (max-width: 480px) {
  .boot .boot-log { font-size: 11.5px; }
  .gate-row { flex-wrap: wrap; }
  .gate button { width: 100%; }
}

.boot-logo {
  display: block; width: 92px; height: 92px; margin: 0 0 22px;
  opacity: .9; filter: drop-shadow(0 0 18px rgba(216,210,191,.25));
  animation: pulse 2.4s ease-in-out infinite;
}

.boot-log {
  margin: 0; min-height: 280px;
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  color: #9fb39f; white-space: pre-wrap; word-break: break-word;
  text-shadow: 0 0 6px rgba(120,200,140,.35);
}
.boot-log .ok { color: var(--green); }
.boot-log .warn { color: var(--amber); }
.boot-log .err { color: #ff4a50; }
.boot-log .dim { color: var(--text-mute); }

.boot-bar { height: 3px; margin-top: 18px; background: #111; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width .2s linear; }

.boot-skip { margin: 14px 0 0; font-size: 11px; color: var(--text-mute); letter-spacing: .08em; }

@keyframes pulse {
  0%, 100% { opacity: .9; }
  50% { opacity: .55; }
}

.caret::after {
  content: "_"; animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---------- glitch ---------- */

.glitch { animation: glitch .35s steps(2) 3; }
@keyframes glitch {
  0% { transform: translate(0); filter: none; }
  20% { transform: translate(-4px, 2px); filter: hue-rotate(40deg) saturate(3); }
  40% { transform: translate(4px, -2px); clip-path: inset(10% 0 55% 0); }
  60% { transform: translate(-2px, 1px); clip-path: inset(60% 0 8% 0); }
  80% { transform: translate(3px, 0); filter: invert(1); clip-path: none; }
  100% { transform: translate(0); filter: none; }
}

.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97) 2; }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 0); }
  20%, 80% { transform: translate(4px, 1px); }
  30%, 50%, 70% { transform: translate(-7px, -1px); }
  40%, 60% { transform: translate(7px, 1px); }
}

@media (prefers-reduced-motion: reduce) {
  .fx-noise, .fx-scan, .boot-logo { animation: none; }
  .glitch, .shake { animation: none; }
}
