/* =============================================
   VARIABLES & RESET
   ============================================= */

:root {
  --bg:        #0a0a0a;
  --surface:   #111111;
  --border:    #222222;
  --accent:    #e8ff00;
  --accent-dim:#b8cc00;
  --text:      #f0f0f0;
  --muted:     #999999;
  --danger:    #ff3b3b;

  --font-display: 'Unbounded', sans-serif;
  --font-mono:    'Space Mono', monospace;
}

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

html, body {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}


/* =============================================
   NOISE OVERLAY
   ============================================= */

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: noise-shift 0.4s steps(2) infinite;
}

@keyframes noise-shift {
  0%   { transform: translate(0,   0); }
  25%  { transform: translate(-2px, 2px); }
  50%  { transform: translate(2px, -1px); }
  75%  { transform: translate(-1px, 1px); }
  100% { transform: translate(0,   0); }
}

/* =============================================
   SCANLINES
   ============================================= */

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.08) 3px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

/* =============================================
   HEADER
   ============================================= */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  border-bottom: 1px solid var(--border);
  animation: fade-down 0.6s ease both;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--text);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 12px;
  font-weight: 700;
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.6); }
}

/* =============================================
   MAIN
   ============================================= */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  gap: 28px;
}

/* =============================================
   GLITCH TITLE
   ============================================= */

.glitch-wrapper {
  animation: fade-up 0.7s 0.2s ease both;
}

.glitch {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 5.5rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  position: relative;
  user-select: none;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glitch::before {
  color: var(--danger);
  animation: glitch-before 3.5s infinite;
  clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
}

.glitch::after {
  color: var(--accent);
  animation: glitch-after 3.5s infinite;
  clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%);
}

@keyframes glitch-before {
  0%,  90%, 100% { transform: translate(0); opacity: 0; }
  91%            { transform: translate(-3px, 1px); opacity: 1; }
  93%            { transform: translate(3px, -1px); opacity: 1; }
  95%            { transform: translate(-1px, 2px); opacity: 1; }
  97%            { transform: translate(2px, 0);   opacity: 1; }
  99%            { transform: translate(0);         opacity: 0; }
}

@keyframes glitch-after {
  0%,  85%, 100% { transform: translate(0); opacity: 0; }
  86%            { transform: translate(4px, -2px); opacity: 1; }
  88%            { transform: translate(-2px, 1px); opacity: 1; }
  90%            { transform: translate(1px, -1px); opacity: 1; }
  92%            { transform: translate(-3px, 0);  opacity: 1; }
  94%            { transform: translate(0);         opacity: 0; }
}

/* =============================================
   SUBTITLE
   ============================================= */

.subtitle {
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  line-height: 1.9;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: fade-up 0.7s 0.35s ease both;
}

/* =============================================
   DIVIDER
   ============================================= */

.divider {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fade-up 0.7s 0.45s ease both;
}

.divider span {
  display: block;
  height: 1px;
  background: var(--border);
}

.divider span:nth-child(1) { width: 60px; }
.divider span:nth-child(2) {
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
}
.divider span:nth-child(3) { width: 60px; }

/* =============================================
   NOTE
   ============================================= */

.note {
  font-size: clamp(0.65rem, 1.5vw, 0.78rem);
  letter-spacing: 0.12em;
  color: #6d6d6d;
  text-transform: uppercase;
  animation: fade-up 0.7s 0.55s ease both;
}

/* =============================================
   PROGRESS BAR
   ============================================= */

.progress-bar {
  width: min(320px, 80vw);
  height: 2px;
  background: var(--border);
  position: relative;
  overflow: hidden;
  animation: fade-up 0.7s 0.65s ease both;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: progress-sweep 2.4s ease-in-out infinite;
}

@keyframes progress-sweep {
  0%   { left: -60%; }
  100% { left: 160%; }
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  animation: fade-up 0.7s 0.75s ease both;
}

.footer-sep {
  color: var(--border);
}

/* =============================================
   ENTRANCE ANIMATIONS
   ============================================= */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================
   RESPONSIVE — TABLET (max 768px)
   ============================================= */

@media (max-width: 768px) {
  .header {
    padding: 18px 24px;
  }

  .logo {
    font-size: 0.85rem;
  }

  .main {
    padding: 48px 24px;
    gap: 22px;
  }

  .footer {
    padding: 16px 24px;
    font-size: 0.55rem;
    gap: 8px;
  }
}

/* =============================================
   RESPONSIVE — MOBILE (max 480px)
   ============================================= */

@media (max-width: 480px) {
  .header {
    padding: 14px 18px;
  }

  .logo {
    font-size: 0.8rem;
  }

  .status-badge {
    font-size: 0.55rem;
    padding: 3px 8px;
  }

  .main {
    padding: 40px 18px;
    gap: 20px;
  }

  .glitch {
    letter-spacing: -0.03em;
  }

  .divider span:nth-child(1),
  .divider span:nth-child(3) {
    width: 36px;
  }

  .footer {
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    font-size: 0.5rem;
  }

  .footer-sep {
    display: none;
  }
}

/* =============================================
   REDUCED MOTION
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  .glitch::before,
  .glitch::after {
    animation: none;
  }

  .noise {
    animation: none;
  }

  .progress-fill {
    animation: none;
    left: 0;
    width: 100%;
    background: var(--accent);
    opacity: 0.3;
  }

  .dot {
    animation: none;
  }
}

.home-hero {
    width: 100%;
    max-width: 900px;
    text-align: left;
    margin-bottom: 80px;
    animation: fade-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.home-hero-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.2em;
    margin-bottom: 16px;
}

.home-title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 12vw, 7rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.05em;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.home-title-xs {
    color: var(--accent);
    /* Небольшое свечение для акцента */
    text-shadow: 0 0 20px rgba(232, 255, 0, 0.2);
}

.home-title-elid {
    color: var(--text);
}

.home-desc {
    font-family: var(--font-mono);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.6;
    color: #888;
    max-width: 500px;
    margin-bottom: 40px;
}

/* BUTTONS */
.home-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.home-btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 16px 32px;
    border: 1px solid var(--border);
    color: var(--text);
    transition: all 0.3s ease;
}

.home-btn--accent {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.home-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.home-btn--accent:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: 0 0 20px rgba(232, 255, 0, 0.3);
}

/* DIVIDERS */
.home-divider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 60px 0;
    opacity: 0.5;
}

.home-divider span:not(.home-divider-label) {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.home-divider-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.3em;
}

/* PROJECTS GRID */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    width: 100%;
    margin-bottom: 80px;
}

.project-card {
    background: rgba(13, 13, 13, 0.55);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    background: rgba(17, 17, 17, 0.8);
}

/* Декоративный уголок при наведении */
.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 15px 15px 0;
    border-color: transparent var(--accent) transparent transparent;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.project-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 4px 8px;
    letter-spacing: 0.1em;
}

.project-status {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.project-status--live {
    color: var(--accent);
}

.project-status--dev {
    color: #555;
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.project-desc {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    line-height: 1.7;
    color: #b0b0b0;
    margin-bottom: 18px;
    flex-grow: 1;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.project-meta span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted);
}

.project-btn {
    font-family: var(--font-mono);
    margin-top: auto;
    padding: 14px 26px;
    font-size: 0.7rem;
    color: var(--text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(17, 17, 17, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-card:hover .project-btn {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(232, 255, 0, 0.06);
    transform: translateY(-1px);
}

.project-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* BLOG PREVIEW SECTION */
.home-blog {
    text-align: center;
    padding: 40px 0 100px;
}

.home-blog-desc {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 32px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .home-hero {
        text-align: center;
    }
    .home-desc {
        margin-left: auto;
        margin-right: auto;
    }
    .home-links {
        justify-content: center;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Фоновый канвас */
#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* Самый дальний слой */
    pointer-events: none;
    opacity: 0.4;
}



/* Сглаживание для AOS */
[data-aos] {
    pointer-events: none;
}
.aos-animate {
    pointer-events: auto;
}