:root {
  --bg-color: #030407;
  --panel-bg: rgba(5, 7, 12, 0.94);
  --border-color: rgba(255, 255, 255, 0.2);
  --text-main: #f2f4f8;
  --text-dim: #7f8899;
  --accent: #2b6bff;
  --tape-yellow: #f4d03f;
  --font-pixel: 'Silkscreen', 'Courier New', monospace;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

#reactive-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}

#reactive-canvas:active {
  cursor: grabbing;
}

.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0px,
    rgba(255, 255, 255, 0) 2px,
    rgba(0, 0, 0, 0.16) 3px
  );
}

/* HUD Górny i Dolny */
.hud-top, .hud-bottom {
  position: fixed;
  left: 0;
  width: 100%;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.hud-top { top: 0; }
.hud-bottom {
  bottom: 0;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(to top, rgba(3, 4, 7, 0.9), transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
  cursor: pointer;
  color: #ffffff;
  transition: color 0.25s ease;
}

.brand:hover {
  color: var(--accent);
}

.pixel-logo {
  height: 36px;
  width: auto;
  display: block;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.7);
  color: var(--text-dim);
  letter-spacing: 0.12em;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.hud-nav {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hud-btn {
  background: rgba(3, 4, 7, 0.84);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
  text-decoration: none;
  white-space: nowrap;
}

.hud-btn:hover, .hud-btn.active {
  border-color: var(--accent);
  color: #030407;
  background: var(--accent);
  font-weight: 600;
}

/* Przycisk zmiany języka z małą flagą SVG */
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.flag-icon {
  width: 15px;
  height: 10px;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.tape-strip {
  display: inline-block;
  background: var(--tape-yellow);
  color: #050505;
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  transform: rotate(-0.8deg);
}

/* Panel boczny projektu (Drawer) */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--panel-bg);
  border-left: 2px solid var(--accent);
  backdrop-filter: blur(16px);
  z-index: 20;
  padding: 28px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  user-select: text;
  -webkit-user-select: text;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.mono-accent {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: color 0.3s ease;
}

.drawer-content h2 {
  font-family: var(--font-pixel);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 12px;
  color: #ffffff;
}

.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.video-btn {
  display: inline-block;
  border-color: var(--accent);
  color: var(--accent);
}

.drawer-description {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  color: #d0d5df;
  margin-bottom: 28px;
}

.drawer-specs h4 {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.drawer-specs ul {
  list-style: none;
  border-top: 1px solid var(--border-color);
}

.drawer-specs li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* Widok listy (Indeks) */
.overlay-view {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 7, 0.94);
  backdrop-filter: blur(12px);
  z-index: 15;
  padding: 100px 28px 70px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hidden {
  display: none !important;
}

.list-container {
  max-width: 980px;
  margin: 0 auto;
}

.list-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}

.section-header, .project-row {
  display: grid;
  grid-template-columns: 90px 2fr 1.6fr 95px;
  padding: 15px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  align-items: center;
}

.section-header {
  color: var(--text-dim);
  font-family: var(--font-pixel);
  font-size: 10px;
}

.project-row {
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-row:hover {
  background: rgba(255, 255, 255, 0.06);
  padding-left: 22px;
}

/* Modal BIO / CV */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(10px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  width: 680px;
  max-width: 100%;
  max-height: 86dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--panel-bg);
  border: 2px solid var(--accent);
  padding: 28px;
  user-select: text;
  -webkit-user-select: text;
}

.modal-box h3 {
  font-family: var(--font-pixel);
  font-size: 18px;
  margin-bottom: 14px;
}

.modal-box p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  color: #d0d5df;
  margin-bottom: 24px;
}

.contact-block {
  font-size: 12px;
  line-height: 1.9;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.contact-block a {
  text-decoration: none;
}

/* ==========================================
   RESPONSYWNOŚĆ — TELEFONY I TABLETY
   ========================================== */
@media (max-width: 768px) {
  .hint, .status-badge, #active-signal {
    display: none;
  }

  .hud-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(to bottom, rgba(3, 4, 7, 0.92), transparent);
  }

  .pixel-logo {
    height: 28px;
  }

  .hud-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .hud-btn {
    padding: 8px 4px;
    font-size: 10px;
    text-align: center;
  }

  .lang-btn {
    gap: 5px;
  }

  .flag-icon {
    width: 13px;
    height: 9px;
  }

  .hud-bottom {
    padding: 10px 14px;
    font-size: 10px;
    justify-content: center;
  }

  .overlay-view {
    padding: 112px 14px 64px;
  }

  .list-topbar .hud-btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .section-header, .project-row {
    grid-template-columns: 64px 1fr 72px;
    padding: 14px 8px;
  }

  .section-header span:nth-child(3),
  .project-row span:nth-child(3) {
    display: none;
  }

  .drawer {
    width: 100%;
    border-left: none;
    border-top: 2px solid var(--accent);
    padding: 18px 16px 36px;
  }

  .drawer-header .hud-btn,
  .modal-box .hud-btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .drawer-content h2 {
    font-size: 18px;
  }

  .drawer-specs li {
    flex-direction: column;
    gap: 4px;
  }

  .drawer-specs li .mono-accent {
    text-align: left !important;
  }

  .video-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 12px;
    font-size: 11px;
    white-space: normal;
  }

  .modal {
    padding: 10px;
  }

  .modal-box {
    padding: 18px 16px;
    max-height: 92dvh;
  }
}