:root {
  --bg: #0f0f12;                  /* очень тёмный, почти чёрный */
  --primary: #dcdde1;             /* светлый серый для текста и заголовков */
  --text: #e6e6e6;                /* основной текст */
  --accent: #9b8eff;              /* минимальный фиолетовый акцент */
  --font: 'Fira Code', monospace;
  --blur-bg: rgba(20, 20, 28, 0.5); /* полупрозрачный фон карточек */
}


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

body {
  user-select: none;
  background: var(--bg) url('https://i.pinimg.com/736x/19/cb/92/19cb922a58544c6a5fcf9b9e1edb7e28.jpg') center/cover no-repeat fixed;
  font-family: var(--font);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s ease;
}

.container {
  width: min(95%, 1000px);
  padding: clamp(1.5rem, 3vw, 3rem);
  backdrop-filter: blur(14px);
  background-color: var(--blur-bg);
  border-radius: 16px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease-out;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

h1 {
  color: var(--accent);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  text-align: center;
  animation: glitch 1.5s infinite alternate;
}

.type {
  color: var(--primary);
  font-weight: 600;
  border-right: 2px solid var(--accent);
  white-space: nowrap;
  overflow: hidden;
  width: 0;
  animation: typing 2.8s steps(40, end) forwards, blink 0.8s steps(1) infinite 2.8s;
  text-align: center;
}

@keyframes blink {
  0%, 100% { border-color: transparent; }
  50% { border-color: var(--accent); }
}

@keyframes typing {
  to { width: 100%; }
}

@keyframes glitch {
  0%, 100% { text-shadow: 1px 0 red, -1px 0 cyan; }
  50% { text-shadow: -2px 0 red, 2px 0 cyan; }
}

.section {
  text-align: center;
}

.section h2 {
  color: var(--primary);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.projects {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.project {
  flex: 1 1 0px;
  max-width: 300px;
  min-height: 150px;
  background: rgba(10, 10, 15, 0.55);
  border: 1px solid rgba(162, 89, 255, 0.4);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.project:hover {
  transform: translateY(-6px);
  background: rgba(20, 20, 35, 0.65);
}

.project h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.project p {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 10px;
  flex-grow: 0;
}

.project button {
  background: var(--accent);
  border: none;
  color: #000;
  font-weight: bold;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: fit-content;
}

.project button:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: -1rem;
  margin-bottom: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease, transform 0.2s;
  font-size: 1.4rem;
}

.contact-item:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

footer {
  text-align: center;
  opacity: 0.6;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
}

@media (max-width: 820px) {
  .container {
    border-radius: 0;
    backdrop-filter: blur(8px);
    padding: 2rem 1rem;
  }

  .projects {
    flex-direction: column;
    gap: 1rem;
  }

  .project {
    max-width: none;
    width: 100%;
    max-height: none;
    min-height: 250px;
  }

  .project button {
    width: 100%;
  }

  .contact-item {
    font-size: 1rem;
  }
}
