/* --- ЗМІННІ КОЛЬОРІВ ТА СКЛА --- */
:root {
  --bg-color: #f9f9f0; /* Твій оригінальний колір фону */
  --text-main: #2c2c2c;
  --text-muted: #666;
  --accent-color: #CC3434; /* Твій оригінальний червоний */
  
  /* Світле матове скло: той самий #f9f9f0, але напівпрозорий */
  --glass-bg: rgba(249, 249, 240, 0.68);
  --glass-border: rgba(249, 249, 240, 0.82);
  --glass-shadow: 0 8px 32px rgba(44, 44, 44, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

html {
  scroll-behavior: smooth; /* Плавний скрол до якорів */
}

body {
  font-family: "Jost", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  position: relative;
  overflow-x: hidden;
}

/* --- ДЕКОРАТИВНІ ФОНОВІ ПЛЯМИ --- */
.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.5;
}
.shape-1 {
  width: 400px;
  height: 400px;
  background: rgba(204, 52, 52, 0.15); /* М'який червоний відтінок */
  top: -100px;
  left: -100px;
}
.shape-2 {
  width: 500px;
  height: 500px;
  background: rgba(100, 150, 255, 0.1);
  top: 40%;
  right: -150px;
}

/* --- LIGHT GLASS ШАПКА --- */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.header-container {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 2rem;
  box-sizing: border-box;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  height: 60px;
  cursor: pointer;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
  transition: transform 0.2s ease;
}
.logo:active {
  transform: scale(0.9);
}

.logo.is-spinning {
  animation: logo-flip 700ms ease-in-out;
}
@keyframes logo-flip {
  from { transform: perspective(500px) rotateY(0deg); }
  to { transform: perspective(500px) rotateY(-360deg); }
}

.brand-title {
  margin: 0 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
}

/* --- НАВІГАЦІЯ --- */
.nav-menu {
  margin-left: auto;
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-color);
}
.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* --- КОНТЕНТ ТА КАРТКИ --- */
.content {
  max-width: 1000px;
  margin: 4rem auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.section-container {
  scroll-margin-top: 100px;
}

.section-title {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.text-muted {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Glass панелі */
.glass-panel, .glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 20px;
  padding: 2.5rem;
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.small-card {
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.small-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* --- ПАРАЛАКС КАРТКА --- */
.parallax-card {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-style: preserve-3d;
}

.badge {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 10px rgba(204, 52, 52, 0.3);
}

/* --- ТЕГ ПРОЄКТУ (Для SpecWiki та cNotes) --- */
.project-tag {
  font-size: 0.9rem;
  background: var(--accent-color);
  color: #fff;
  padding: 0.2rem 0.8rem;
  border-radius: 12px;
  vertical-align: middle;
  margin-left: 10px;
  font-weight: 500;
}

/* --- ФУТЕР --- */
.glass-footer {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--glass-border);
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 4rem;
}

/* =========================================
   МОБІЛЬНЕ МЕНЮ ТА АДАПТИВНІСТЬ
   ========================================= */

/* Оверлей (темний фон при відкритому меню) */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  z-index: 998; 
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.menu-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Кнопка бургера */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  margin-left: auto;
  z-index: 1002;
}

.mobile-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--text-main);
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}

/* Анімація перетворення бургера на хрестик */
.mobile-toggle.is-active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.mobile-toggle.is-active span:nth-child(2) {
  opacity: 0;
}
.mobile-toggle.is-active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: rgba(249, 249, 240, 0.82); /* #f9f9f0 з прозорістю для glass-ефекту */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 6rem 0 2rem 0;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    
    /* Анімація виїзду */
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1001;
  }
  
  .nav-menu.is-active {
    transform: translateX(0);
  }
  
  .nav-link {
    padding: 1rem 2rem;
    width: 100%;
    box-sizing: border-box;
    font-size: 1.2rem;
  }
  
  .mobile-toggle {
    display: flex;
  }
}