:root {
  --bg-page: #121316;
  --bg-panel: #1c1d21;
  --bg-card: #25262c;
  --bg-code: #0d0e10;
  --text-main: #c1c2c5;
  --text-muted: #909296;
  --text-bright: #ffffff;
  --border-color: #2c2e33;
  --accent-gray: #373a40;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-page) !important;
  color: var(--text-main) !important;
  font-family: 'JetBrains Mono', SFMono-Regular, Consolas, Menlo, monospace !important;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

/* Шапка сайта */
header {
  width: 100%;
  background-color: var(--bg-panel) !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Логотип */
.gradient-logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  text-decoration: none !important;
  background: linear-gradient(to right, #00d2ff 0%, #3a7bd5 50%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  transition: opacity 0.2s ease;
}

.gradient-logo:hover {
  opacity: 0.85;
}

/* Ссылки соцсетей */
.social-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.social-links a i {
  font-size: 1rem;
  color: #00d2ff;
}

.social-links a:hover {
  background-color: var(--border-color);
  color: var(--text-bright);
  border-color: #00d2ff;
  transform: translateY(-1px);
}

/* Главный контейнер */
main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-bright) !important;
  margin-top: 0;
  overflow-wrap: break-word;
}

a {
  color: #a0a0a0;
  text-decoration: underline;
}

a:hover {
  color: #ffffff;
}

/* Карточка контента */
.card, article {
  width: 100%;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Двухколоночный макет */
.hero-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 2rem;
}

/* Терминал */
.terminal-container {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.terminal-window {
  width: 100%;
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.terminal-header {
  background: var(--bg-panel);
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: 10px;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-body {
  padding: 1.2rem;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-main);
  overflow-x: auto;
}

.user { color: #00d2ff; }
.path { color: #3a7bd5; }
.active-text { color: #27c93f; }
.muted-text { color: var(--text-muted); }
.highlight-text { color: #00d2ff !important; font-weight: bold; }

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #00d2ff;
  vertical-align: middle;
  animation: blinkCursor 0.8s infinite;
}

.line {
  opacity: 0;
  animation: typeLine 10s infinite;
  word-break: break-word;
}

.line-1  { animation-delay: 0s; }
.line-2  { animation-delay: 0.4s; }
.line-3  { animation-delay: 0.7s; }
.line-4  { animation-delay: 1.0s; }
.line-5  { animation-delay: 1.8s; }
.line-6  { animation-delay: 2.2s; }
.line-7  { animation-delay: 2.6s; }
.line-8  { animation-delay: 3.0s; }
.line-9  { animation-delay: 3.8s; }
.line-10 { animation-delay: 4.2s; }
.line-11 { animation-delay: 4.6s; }
.line-12 { animation-delay: 5.0s; }

@keyframes typeLine {
  0% { opacity: 0; }
  5% { opacity: 1; }
  85% { opacity: 1; }
  95% { opacity: 0; }
  100% { opacity: 0; }
}

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

/* Карточка разработчика справа */
.dev-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dev-card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dev-card p {
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.dev-specs {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem 0;
}

.dev-specs li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.dev-specs li span {
  color: #00d2ff;
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

.whoami-block {
  background: var(--bg-page);
  border-left: 2px solid #00d2ff;
  padding: 6px 12px;
  margin: 4px 0 10px 0;
  font-size: 0.9rem;
  word-break: break-word;
}

/* Сетка проектов */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}

.project-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.project-card h3 {
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  flex-grow: 1;
}

/* Кнопки */
.btn, .project-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--accent-gray);
  color: var(--text-bright) !important;
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none !important;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
  width: fit-content;
}

.btn:hover, .project-card .btn:hover {
  background-color: var(--border-color);
  border-color: #00d2ff;
}

/* Блоки кода */
code {
  background-color: var(--bg-code) !important;
  color: #e0e0e0 !important;
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  word-break: break-word;
}

pre {
  width: 100%;
  background-color: var(--bg-code) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}

pre code {
  background-color: transparent !important;
  border: none;
  padding: 0;
}

/* Футер */
footer {
  width: 100%;
  background-color: var(--bg-panel) !important;
  border-top: 1px solid var(--border-color) !important;
  color: var(--text-muted) !important;
  padding: 1.5rem;
  text-align: left;
}

/* Мобильная адаптация */
@media (max-width: 992px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .social-links {
    width: 100%;
  }

  .social-links a {
    flex: 1 1 auto;
    justify-content: center;
  }

  main {
    padding: 1.2rem 1rem;
  }

  .card, article, .dev-card {
    padding: 1.2rem;
  }

  .terminal-body {
    padding: 1rem 0.8rem;
    font-size: 0.85rem !important;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .project-card .btn {
    width: 100%;
  }
}