/* ─── Шрифт ─────────────────────────────────────────────────────────────────
   Handjet — точечная матрица, одно семейство на латиницу и кириллицу.
   Раньше было два разных шрифта (VT323 + Pixelify Sans), причём в Pixelify
   Sans отсутствуют заглавные «О» и «П», поэтому они подставлялись из
   Courier New и выглядели «из другого языка». Здесь покрытие полное:
   66 букв кириллицы + 62 символа латиницы.
   Файл лежит локально в src/fonts/, без обращений к CDN.
   ────────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Handjet';
  src: url('fonts/handjet.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --site-font: 'Handjet', 'Courier New', monospace;
  --site-font-size: 22px;
}

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

:root {
  --white: #e0e0e0;
  --white-dim: #888;
  --green: #39ff14;
  --green-dim: #1a7a0a;
  --green-glow: rgba(57, 255, 20, 0.4);
  --bg: #0a0a0a;
  --bg-light: #111;
  --gray: #555;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--site-font);
  font-size: var(--site-font-size);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  cursor: none;
}

/* ===== CUSTOM CURSOR ===== */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--white);
  box-shadow: 0 0 10px var(--white), 0 0 20px rgba(255, 255, 255, 0.3);
  pointer-events: none;
  z-index: 99998;
  transition: transform 0.1s;
  image-rendering: pixelated;
}

/* ===== CRT OVERLAY ===== */
.crt-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.crt-overlay::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0, 0, 0, 0.15) 2px, rgba(0, 0, 0, 0.15) 4px
  );
  animation: scanlines 0.1s linear infinite;
}

.crt-overlay::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.6) 100%);
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* ===== FLICKER ===== */
.screen-flicker { animation: flicker 4s infinite; }

@keyframes flicker {
  0%, 97%, 100% { opacity: 1; }
  98% { opacity: 0.85; }
  99% { opacity: 0.92; }
}

/* ===== MATRIX RAIN ===== */
.matrix-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.15;
  pointer-events: none;
}

/* ===== GREEN FLOATING DOTS ===== */
.dots-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.g-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--green);
  box-shadow: 0 0 6px var(--green), 0 0 12px var(--green-glow);
  border-radius: 0;
  animation: dotFloat linear infinite;
  image-rendering: pixelated;
}

@keyframes dotFloat {
  0% { transform: translateY(110vh) scale(1); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(0.5); opacity: 0; }
}

.flash-dot {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
  animation: flashDot 2s steps(1) infinite;
}

@keyframes flashDot {
  0%, 30% { opacity: 0; }
  31%, 35% { opacity: 1; }
  36%, 70% { opacity: 0; }
  71%, 75% { opacity: 1; }
  76%, 100% { opacity: 0; }
}

/* ===== MOUSE PARTICLES ===== */
.mouse-particle {
  position: fixed;
  width: 3px;
  height: 3px;
  background: var(--white);
  box-shadow: 0 0 8px var(--white);
  pointer-events: none;
  z-index: 99996;
  image-rendering: pixelated;
}

/* ===== MAIN CONTENT ===== */
.content {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== HEADER ===== */
.header {
  border: 2px solid var(--white-dim);
  padding: 30px;
  margin-top: 40px;
  position: relative;
  background: rgba(0, 0, 0, 0.8);
}

.header::before {
  content: '┌── SYSTEM BOOT ──────────────────────────────────────┐';
  position: absolute;
  top: -12px;
  left: 10px;
  color: var(--white-dim);
  font-size: 14px;
  letter-spacing: 1px;
}

.header-title {
  font-size: 48px;
  color: var(--white);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 255, 255, 0.2);
  letter-spacing: 4px;
  margin-bottom: 10px;
}

.header-sub {
  color: var(--gray);
  font-size: 18px;
}

.header-sub span { color: var(--white); }

.cursor-blink {
  display: inline-block;
  width: 12px;
  height: 22px;
  background: var(--white);
  animation: blink 1s steps(1) infinite;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.typing-roles {
  margin-top: 15px;
  color: var(--white);
  font-size: 22px;
  min-height: 30px;
}

/* ===== LANG TOGGLE ===== */
.lang-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 10px;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--white-dim);
  color: var(--gray);
  padding: 5px 12px;
  font-family: var(--site-font);
  font-size: 16px;
  cursor: none;
  transition: all 0.3s;
}

.lang-btn:hover, .lang-btn.active {
  border-color: var(--white);
  color: var(--white);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* ===== NAV ===== */
.nav {
  margin-top: 30px;
  padding: 15px 0;
  border-top: 1px solid var(--white-dim);
  border-bottom: 1px solid var(--white-dim);
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 20px;
  transition: all 0.2s;
  position: relative;
  padding: 2px 0;
  cursor: none;
}

.nav a::before {
  content: '> ';
  color: var(--white-dim);
}

.nav a:hover {
  color: var(--white);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.nav a:hover::before { color: var(--white); }

/* ===== SECTIONS ===== */
.section {
  margin-top: 60px;
  padding: 30px;
  border: 1px solid #333;
  background: rgba(0, 0, 0, 0.7);
  position: relative;
}

.section::before {
  content: attr(data-label);
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--bg);
  padding: 0 10px;
  color: var(--white);
  font-size: 16px;
  letter-spacing: 2px;
}

.section-title {
  font-size: 32px;
  color: var(--white);
  margin-bottom: 20px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.section-title::before {
  content: '# ';
  color: var(--white-dim);
}

.section p {
  margin-bottom: 15px;
  color: var(--white);
}

.section p .hl {
  color: var(--white);
  font-weight: bold;
}

/* ===== TERMINAL PROMPT ===== */
.terminal-prompt {
  color: var(--white);
  margin-bottom: 5px;
}

.terminal-prompt .path { color: var(--white); }
.terminal-prompt .arrow { color: var(--white-dim); }

.terminal-output {
  margin-left: 20px;
  margin-bottom: 15px;
  color: var(--white);
}

.t-link {
  color: var(--white);
  text-decoration: none;
  transition: all 0.3s;
  cursor: none;
  border-bottom: 1px solid var(--white-dim);
}

.t-link:hover {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  border-bottom-color: var(--white);
}

/* ===== DEVICES TABS ===== */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--white-dim);
  color: var(--gray);
  padding: 8px 16px;
  font-family: var(--site-font);
  font-size: 18px;
  cursor: none;
  transition: all 0.3s;
}

.tab-btn:hover, .tab-btn.active {
  border-color: var(--white);
  color: var(--white);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.tab-content {
  display: none;
  border: 1px solid #333;
  padding: 20px;
  background: rgba(0,0,0,0.5);
}

.tab-content.active { display: block; }

.device-list { list-style: none; }

.device-list li {
  padding: 8px 0;
  border-bottom: 1px solid #1a1a1a;
  color: var(--white);
}

.device-list li::before {
  content: '[■] ';
  color: var(--white-dim);
}

.device-list li:hover {
  color: var(--white);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.device-list li:hover::before { color: var(--white); }

/* ===== ASCII ART ===== */
.ascii-art {
  color: var(--white-dim);
  font-size: 12px;
  line-height: 1.2;
  margin: 20px 0;
  opacity: 0.6;
  white-space: pre;
  overflow-x: auto;
}

/* ===== GLITCH TEXT ===== */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.glitch::before {
  color: #ff0040;
  animation: glitch1 3s infinite;
  clip-path: inset(0 0 80% 0);
}

.glitch::after {
  color: var(--green);
  animation: glitch2 3s infinite;
  clip-path: inset(80% 0 0 0);
}

@keyframes glitch1 {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-3px, 1px); }
  94% { transform: translate(3px, -1px); }
  96% { transform: translate(-2px, 2px); }
}

@keyframes glitch2 {
  0%, 90%, 100% { transform: translate(0); }
  91% { transform: translate(3px, 1px); }
  93% { transform: translate(-3px, -1px); }
  95% { transform: translate(2px, 2px); }
}

/* ===== PIXEL BORDER ===== */
.pixel-border { position: relative; }

.pixel-border::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 0;
  width: 100%; height: 2px;
  background: repeating-linear-gradient(
    90deg, var(--white-dim) 0px, var(--white-dim) 4px,
    transparent 4px, transparent 8px
  );
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
  text-align: center;
  margin-top: 30px;
  color: var(--white-dim);
  font-size: 16px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ===== STATUS BAR ===== */
.status-bar {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  background: #111;
  border-top: 1px solid var(--white-dim);
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--white-dim);
  z-index: 100;
}

.status-bar .status-online {
  color: var(--green);
  animation: statusPulse 2s ease infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--white-dim);
  border: 1px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--white); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .header-title { font-size: 32px; }
  .section-title { font-size: 24px; }
  body { font-size: 17px; }
  .nav { gap: 15px; }
  .ascii-art { font-size: 8px; }
  .tabs { gap: 5px; }
  .tab-btn { padding: 6px 12px; font-size: 16px; }
}


/* ===== ПРОЕКТЫ ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.project-card {
  border: 1px solid #333;
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: repeating-linear-gradient(
    90deg, var(--white-dim) 0px, var(--white-dim) 4px,
    transparent 4px, transparent 8px
  );
  opacity: 0.6;
  transition: opacity 0.3s;
}

.project-card:hover {
  border-color: var(--white-dim);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.project-card:hover::before { opacity: 1; }

.pc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pc-name {
  font-size: 26px;
  color: var(--white);
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

.pc-name::before {
  content: './';
  color: var(--white-dim);
}

.pc-tag {
  font-size: 14px;
  color: var(--white-dim);
  border: 1px solid #333;
  padding: 1px 8px;
  white-space: nowrap;
}

.pc-desc {
  color: var(--white);
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
}

.pc-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pc-chip {
  font-size: 14px;
  color: var(--white-dim);
  border: 1px solid #2a2a2a;
  padding: 1px 7px;
  background: rgba(255, 255, 255, 0.03);
}

.pc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: auto;
  padding-top: 4px;
}

.pc-link {
  color: var(--white);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px solid var(--white-dim);
  transition: all 0.3s;
  cursor: none;
}

.pc-link:hover {
  border-bottom-color: var(--white);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@media (max-width: 600px) {
  .pc-name { font-size: 22px; }
  .pc-desc { font-size: 15px; }
  .pc-link { font-size: 14px; }
}

/* ===== BOOT ANIMATION ===== */
.boot-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.5s;
}

.boot-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-text {
  color: var(--white);
  font-size: 18px;
  text-align: left;
  max-width: 500px;
  width: 90%;
}

.boot-text .line {
  opacity: 0;
  animation: bootLine 0.3s forwards;
}

@keyframes bootLine { to { opacity: 1; } }

/* ===== SECTION REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== MOUSE GLOW EFFECT ===== */
.mouse-glow {
  position: fixed;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
  opacity: 0.3;
  transition: opacity 0.3s;
}
