/* ============ TOKENS ============ */
:root {
  --bg: #16131f;
  --surface: #1e1a2b;
  --border: #2a2439;
  --text: #ddd6f0;
  --muted: #716b8a;
  --accent: #a78bfa;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ============ RESET & BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
  radial-gradient(circle at 80% 0%, rgba(167, 139, 250, 0.07) 0%, transparent 50%),
  repeating-linear-gradient(45deg, rgba(167, 139, 250, 0.02) 0px, rgba(167, 139, 250, 0.02) 1px, transparent 1px, transparent 40px),
  repeating-linear-gradient(-45deg, rgba(167, 139, 250, 0.02) 0px, rgba(167, 139, 250, 0.02) 1px, transparent 1px, transparent 40px);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
.accent { color: var(--accent); }

/* ============ HEADER ============ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(22, 19, 31, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
  font-size: 0.95rem;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 8px; display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, transform 0.3s;
}
.settings-btn:hover { color: var(--accent); transform: rotate(90deg); }

/* ============ LAYOUT ============ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; width: 100%; }
.page-content { padding-top: 104px; padding-bottom: 64px; flex: 1; }

.hero { display: flex; align-items: center; gap: 32px; margin-bottom: 64px; }
.avatar {
  width: 120px; height: 120px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #a78bfa, #7c5ce0);
  box-shadow: 0 0 40px rgba(167, 139, 250, 0.2);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; line-height: 1.1; margin-bottom: 12px; }
.hero-sub { font-size: 1.1rem; color: var(--muted); }

.layout { display: grid; grid-template-columns: 320px 1fr; gap: 64px; align-items: start; }
.section-label {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
  margin-bottom: 24px; text-transform: lowercase;
}

/* ============ LINKS COLUMN ============ */
.col-links { position: sticky; top: 104px; }
.links { display: flex; flex-direction: column; margin-bottom: 48px; }
.links a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  transition: padding 0.2s, color 0.2s;
}
.links a:first-child { border-top: 1px solid var(--border); }
.links a:hover { padding-left: 12px; color: var(--accent); }
.link-name { display: flex; align-items: baseline; gap: 12px; font-size: 1.05rem; }
.link-hint { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.link-arrow { font-family: var(--font-mono); color: var(--muted); transition: transform 0.2s; }
.links a:hover .link-arrow { transform: translate(2px, -2px); color: var(--accent); }
.support-text { font-size: 0.95rem; color: var(--muted); margin-bottom: 8px; }

/* ============ ABOUT SECTION ============ */
.about-text { font-size: 1.1rem; color: var(--text); margin-bottom: 32px; }

/* Facts */
.facts { display: flex; flex-direction: column; margin-bottom: 48px; }
.fact {
  display: grid; grid-template-columns: 140px 1fr; gap: 16px;
  font-size: 0.95rem; padding: 14px 0; border-bottom: 1px solid var(--border);
}
.fact:first-child { border-top: 1px solid var(--border); }
.fact-key { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); padding-top: 2px; }

/* Activities */
.about-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
.about-item { padding: 24px 0; border-bottom: 1px solid var(--border); }
.about-item-title { font-size: 1.05rem; font-weight: 500; margin-bottom: 8px; }
.about-item-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

/* ============ PROJECTS ============ */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.project:hover {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(167, 139, 250, 0.15);
}
.project-preview { aspect-ratio: 16/10; background: #1e1a2b; }
.project-preview img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 20px; }
.project-name { font-size: 1.05rem; font-weight: 500; margin-bottom: 8px; }
.project-hint { font-family: var(--font-mono); font-size: 0.65rem; color: var(--muted); margin-left: 6px; }
.project-desc {
  font-size: 0.85rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============ SETUP PAGE ============ */
.setup-layout { display: flex; flex-direction: column; gap: 64px; margin-top: 32px; }
.setup-category h2 {
  font-size: 1.4rem; font-weight: 500; margin-bottom: 24px;
  color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 12px;
}
.setup-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.setup-item {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.setup-item:hover { transform: translateY(-2px); border-color: var(--accent); }
.setup-item-image {
  width: 100%; height: 200px; border-radius: 8px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border); margin-bottom: 20px;
}
.setup-item-image img { width: 100%; height: 100%; object-fit: cover; }
.setup-item-content { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.setup-item-name { font-weight: 600; font-size: 1.2rem; color: var(--text); letter-spacing: -0.01em; }
.setup-specs { list-style: none; padding: 0; margin: 12px 0 0 0; display: flex; flex-direction: column; gap: 8px; }
.setup-specs li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; font-size: 0.85rem; line-height: 1.4; }
.spec-name { font-family: var(--font-mono); color: var(--muted); font-size: 0.75rem; padding-top: 2px; }
.spec-text { color: var(--text); font-weight: 500; word-break: break-word; }

/* ============ PETS SECTION ============ */
.pets-section {
  margin-top: 48px;
  padding-top: 0;
}
.pets-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.pet-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.pet-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.pet-image { position: relative; width: 100%; aspect-ratio: 16 / 10; background: var(--bg); }
.pet-image img { width: 100%; height: 100%; object-fit: cover; }
.birthday-badge {
  position: absolute; top: 12px; right: 12px; background: var(--accent); color: var(--bg);
  padding: 4px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 600;
  font-family: var(--font-mono); box-shadow: 0 4px 12px rgba(167, 139, 250, 0.4);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.pet-info { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.pet-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.pet-name { font-size: 1.2rem; font-weight: 600; color: var(--text); }
.pet-age { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }
.pet-species { font-size: 0.85rem; color: var(--muted); margin-bottom: 12px; }
.pet-desc { font-size: 0.95rem; color: var(--text); line-height: 1.5; margin-bottom: 16px; flex: 1; }
.pet-birthdate { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }

/* ============ MODALS ============ */
dialog.modal { margin: auto; border: none; background: transparent; padding: 0; width: 100%; max-width: 500px; outline: none; }
dialog.modal::backdrop { background: rgba(10, 8, 15, 0.7); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.3s ease; }
dialog.modal[open]::backdrop { opacity: 1; }

.modal-content {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px; position: relative; color: var(--text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(167, 139, 250, 0.1);
  animation: modalPopup 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  max-height: 90vh; overflow-y: auto;
}

@keyframes modalPopup {
  0% { opacity: 0; transform: scale(0.95) translateY(15px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute; top: 16px; right: 16px; background: var(--surface);
  border: 1px solid var(--border); color: var(--muted); font-size: 24px; line-height: 1;
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  z-index: 10; outline: none;
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); background: var(--bg); }

/* Settings Modal */
.form-group { margin: 24px 0; display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-weight: 500; font-size: 0.9rem; }
.form-group select {
  padding: 12px 16px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 1rem; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23716b8a%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.form-group select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2); }
.form-group select:disabled { opacity: 0.5; cursor: not-allowed; }
.text-muted { color: var(--muted); font-size: 0.8rem; }

.btn-primary {
  display: inline-block; padding: 14px 24px; background: var(--accent); color: #16131f;
  border: none; border-radius: 8px; font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: background 0.2s, transform 0.1s; text-align: center; width: 100%;
}
.btn-primary:hover { background: #c4b5fd; }
.btn-primary:active { transform: scale(0.98); }

/* Project Modal */
.project-modal-content { max-width: 800px; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.proj-image { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #1e1a2b; border-bottom: 1px solid var(--border); }
.proj-details { padding: 32px; }
.proj-details h2 { font-size: 1.8rem; margin-bottom: 16px; line-height: 1.2; }
.proj-details p { color: var(--muted); font-size: 1rem; margin-bottom: 32px; line-height: 1.6; }
.proj-links { display: flex; flex-wrap: wrap; gap: 12px; }
.proj-links .btn-primary { width: auto; }

/* ============ COOKIE BANNER ============ */
.cookie-banner {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 24px; display: flex; align-items: center; gap: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); z-index: 50; max-width: 90%;
}
.cookie-banner p { font-size: 0.9rem; margin: 0; }

/* ============ EASTER EGG & FOOTER ============ */
.easter-egg {
  text-align: center; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
  margin: 40px auto; max-width: 800px; padding: 0 24px; opacity: 0.35;
  transition: opacity 0.3s ease, color 0.3s ease; user-select: none;
}
.easter-egg:hover { opacity: 1; color: var(--accent); }

.footer {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); text-align: center;
}

/* ============ BURGER MENU ============ */
.burger-btn {
  display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 4px; z-index: 1001;
}
.burger-btn span {
  display: block; width: 24px; height: 2px; background-color: var(--text); transition: transform 0.3s, opacity 0.3s;
}
.mobile-menu-modal { max-width: 320px; margin: auto; }
.menu-modal-content { display: flex; flex-direction: column; padding: 48px 32px; text-align: center; }
.mobile-nav-links { display: flex; flex-direction: column; gap: 24px; }
.mobile-nav-links a { font-size: 1.5rem; font-weight: 500; color: var(--muted); transition: color 0.2s, transform 0.2s; }
.mobile-nav-links a.active, .mobile-nav-links a:hover { color: var(--accent); transform: scale(1.05); }

/* ============ ADAPTIVE ============ */
/* Вертикальная линия для сетки "Чем занимаюсь" на десктопе */
@media (min-width: 769px) {
  .about-item:nth-child(odd) {
    padding-right: 32px;
    border-right: 1px solid var(--border);
  }
  .about-item:nth-child(even) {
    padding-left: 32px;
  }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 48px; }
  .col-links { position: static; }
  .projects { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .burger-btn { display: flex; }
}

@media (max-width: 600px) {
  .header-inner { padding: 0 16px; height: 56px; flex-wrap: nowrap; }
  .header-left { gap: 12px; flex: 1; min-width: 0; }
  .logo { white-space: nowrap; }
  .nav-links { gap: 10px; white-space: nowrap; }
  .nav-links a { font-size: 0.85rem; }
  .settings-btn { padding: 4px; }
  .settings-btn svg { width: 18px; height: 18px; }

  .page-content { padding-top: 80px; }
  .container { padding-left: 16px; padding-right: 16px; }

  .hero { flex-direction: column; text-align: center; gap: 16px; }
  .about-grid { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .fact { grid-template-columns: 110px 1fr; }
  .pets-grid { grid-template-columns: 1fr; }

  .cookie-banner { flex-direction: column; text-align: center; width: calc(100% - 32px); bottom: 16px; }
  .easter-egg { font-size: 0.75rem; margin: 32px auto; opacity: 0.5; }
}

/* Должно быть в самом конце */
[hidden] { display: none !important; }
