/* === Общие стили === */
body {
  margin: 0;
  font-family: "Geologica", sans-serif;
  color: #111;
  background: radial-gradient(circle at 50% 40%, #f7f9fb 0%, #e8ebf0 40%, #d1d6db 100%);
  transition: background 0.3s ease;
  min-height: 100vh;
  position: relative;
}

/* чтобы тема могла перекрывать основной фон */
body.light,
body.dark,
body.creamy {
  background: none;
}

/* лёгкое затемнение по краям, чтобы добавить глубины */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 45%,
    rgba(255,255,255,0) 0%,
    rgba(0,0,0,0.05) 70%,
    rgba(0,0,0,0.15) 100%
  );
  mix-blend-mode: multiply;
  z-index: 0;
}

/* === Темы === */
body.light {
  background: radial-gradient(circle at 50% 40%, #f7f9fb 0%, #e8ebf0 40%, #d1d6db 100%);
  color: #111;
}

body.dark {
  background: radial-gradient(circle at 50% 40%, #1c1e22 0%, #141517 60%, #0e0f10 100%);
  color: #fff;
}

body.creamy {
  background: radial-gradient(circle at 50% 40%, #fff8f0 0%, #f2e7d8 50%, #e0d2bf 100%);
  color: #2b1c0f;
}

/* === Кнопка переключения темы === */
.theme-btn {
  margin-top: 10px;
  background: rgba(0,0,0,0.05);
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.theme-btn:hover {
  background: rgba(0,0,0,0.1);
}

/* === Шапка === */
header {
  text-align: center;
  padding: 40px 20px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  backdrop-filter: blur(10px);
}

header h1 {
  margin: 0;
  font-size: 2rem;
  color: #111;
}

header p {
  color: #555;
  margin-top: 8px;
  font-size: 1rem;
}

/* === Контейнер карточек === */
#portfolio {
  display: grid;
  grid-template-columns: repeat(2, minmax(400px, 1fr));
  justify-content: center;
  gap: 50px;
  padding: 60px 5%;
  max-width: 1100px;
  margin: 0 auto;
}

/* === Карточка проекта === */
.project {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;  
  text-align: center;
  padding-bottom: 25px;
}

/* === Фоновая картинка из JSON === */
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--background, none);
  background-size: cover;
  background-position: center;
  filter: brightness(0.65) blur(1.5px);
  z-index: 0;
  transition: filter 0.4s ease;
}

/* Эффект при наведении — фон чуть темнее */
.project:hover::before {
  filter: brightness(0.55) blur(2.5px);
}

/* === Контент карточки (поверх фона) === */
.project * {
  position: relative;
  z-index: 1;
}

/* === Превью === */
.project img {
  width: 100%;
  object-fit: cover;
  border-bottom: 3px solid rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.project:hover img {
  transform: scale(1.03);
}

/* === ✅ Текст поверх фонового изображения === */
.project h2,
.project p {
  color: #fff; /* делаем белым для контраста */
  text-shadow: 0 2px 6px rgba(0,0,0,0.5); /* мягкая тень для читаемости */
}

/* можно задать другой шрифт именно для заголовков */
.project h2 {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 1.6rem;
}

/* описание чуть светлее */
.project p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* если нужно центрировать текст над фоном */
.project h2, 
.project p {
  text-align: center;
}

/* === Кнопки === */
.project .buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.project a {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 30px;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  background: #666;
  transition: all 0.3s ease;
}

.project:hover {
  transform: scale(1.07);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* === Адаптивность === */
@media (max-width: 900px) {
  #portfolio {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .project img {
    height: 220px;
  }
}

/* === Подвал === */
footer {
  text-align: center;
  background: rgba(255,255,255,0.85);
  padding: 20px;
  color: #333;
  font-size: 0.9rem;
  box-shadow: 0 -1px 5px rgba(0,0,0,0.05);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.05);
  transition: background 0.3s ease;
}

/* Эффект при смене темы */
body.dark footer {
  background: rgba(30,30,30,0.85);
  color: #eee;
  box-shadow: 0 -1px 8px rgba(255,255,255,0.05);
}

body.creamy footer {
  background: rgba(255,248,240,0.85);
  color: #3b2b1a;
}
