/* Main Styles */
* {
  box-sizing: border-box;
} 

body {
  font-family: "Nunito", sans-serif;
  font-style: normal;
  margin: 0; 
  line-height: 1.5; 
  min-height: 100vh; 
  display: flex; 
  flex-direction: column; 
  background: #0a0a0a; 
  color: #e2e8f0;
}

.wrapper { 
  max-width: 1200px;
  margin: 0 auto; 
  padding: 0 20px; 
}

main { 
  flex: 1; 
  padding: 4rem 0; 
}

a { 
  color: #bba9f0; 
  text-decoration: none; 
  transition: color 0.3s; 
}

a:hover { 
  color: #e6e5e7;
}

img { 
  max-width: 100%; 
  border-radius: 12px; 
  transition: transform 0.4s ease; 
}

span.attribution a {
  color: #e6e5e7;
  text-align: center;
}

span.attribution a:hover {
  color: #bba9f0;
}

/* --- HEADER --- */
.header {
  background: #0a0a0a;
  opacity: 0.9;
  position: sticky; 
  top: 0; 
  z-index: 100;
  border-bottom: 1px solid #27272a;
  margin-bottom: 35px;
}

.header .wrapper {
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 1rem 20px;
}

.logo { 
  font-size: 2rem; 
  font-weight: 700; 
  color: #fff; 
}

.logo span { 
  text-transform: uppercase;
  background: linear-gradient(135deg, #af9de6 0%, #643fba 50%, #a5a6df 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(217, 211, 230, 0.5));
}

.nav a {
  margin-left: 2rem; 
  font-weight: 500;
  position: relative;
}

.nav a:hover,
.active { 
  border-bottom: 2px solid #e6e5e7;
}

/* --- CONTENT: PAGE 1 (2 колоночный макет с прижатым футером) ---  */
.about {
  display: grid; 
  grid-template-columns: 320px 1fr;
  gap: 3rem;
}

/* Добавляем для интерактивности эффект переворота */
.flip-card {
  width: 300px;
  height: 300px;
  margin: 0 auto;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flip-card-back {
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: white;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ссылки на соцсети */
.social-links {
  text-align: center;
}

.social-links a {
  font-size: 2rem;
  display: inline-block;
  padding: 8px;                    /* маленькая «зона клика» */
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-links a:hover {
  transform: scale(1.35) translateY(-4px);
}

/* Добавляем адаптивность */
@media (min-width: 768px) {
  .about { grid-template-columns: 300px 1fr; }
}

.sidebar {
  text-align: center;
}

.skills ul { 
  text-align: left; 
  padding-left: 1.5rem; 
}

/* --- CONTENT: PAGE 2 - PORTFOLIO (3 колоночный макет с прижатым футером) ---  */
/* Задаем сначала базовый макет с одной колонкой (для мобильных устройств) */
.portfolio-grid {
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 2rem; 
  margin: 3rem 0;
}
/* С 768px — две колонки */
@media (min-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* С 1024px и выше — три колонки */
@media (min-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Добавляем небольшую анимацию для интерактивности */
.portfolio_move {
  display: inline-block;
  transition: transform 0.4s ease;
}

.portfolio_move:hover {
  transform: translateX(60px);
}

.portfolio_card {
  background: #18181b; 
  padding: 1.5rem; 
  border-radius: 16px;
  text-align: center; 
  transition: transform 0.4s, box-shadow 0.4s;
}

.portfolio_card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px #a78bfa;
}

.portfolio_card img { 
  height: 280px; 
  object-fit: cover; 
}

.portfolio_content p {
  color: #736892;
}

/* Table */
.table-wrapper { 
  overflow-x: auto; 
}

.favorites-table {
  width: 100%; 
  border-collapse: collapse; 
  margin: 2rem 0;
  background: #18181b; 
  border-radius: 12px; 
  overflow: hidden;
}

.favorites-table th {
  background: #a78bfa; 
  color: #000; 
  padding: 1rem;
}

.favorites-table td, .favorites-table th { 
  padding: 1rem; 
  text-align: left; 
  border-bottom: 1px solid #27272a; 
}

.favorites-table tr:hover { 
  background: #1f1f23; 
}

.table-wrapper table thead tr:first-child th {
  text-align: center;
  vertical-align: middle;
}

.page-title span {
  font-style: italic;
  color: #a78bfa;
}

/* --- CONTENT: PAGE 3 - CONTACT (1 колоночный макет с прижатым футером и формой связи) ---  */
/* Contact Form */

.contact_form_wrapper {
  max-width: 680px; 
  margin: 0 auto; 
  background: #18181b; 
  padding: 3rem; 
  border-radius: 16px;
}

.contact_form label { 
  display: block; 
  margin-bottom: 0.5rem; 
  font-weight: 500; 
}

.contact_form input, .contact_form textarea {
  width: 100%; 
  padding: 1rem; 
  border: none; 
  border-radius: 8px;
  background: #27272a; 
  color: #fff; 
  font: inherit;
}

.form_element,
.button {
  margin-top: 1rem;
}

.button {
  background: #a78bfa; 
  color: #000; 
  padding: 1rem 2rem; 
  border: none;
  border-radius: 8px; 
  font-weight: 600; 
  cursor: pointer; 
  font-size: 1.1rem;
  transition: all 0.3s;
}

.button:hover {
  background: #c4b5fd; 
  transform: scale(1.05);
}

.contact_form input:focus, 
.contact_form textarea:focus {
  outline: 2px solid #a78bfa;
}

/* ===== ADDITIONAL CODE ===== */
#outcome {
  color: #f2036c;
}

/* --- FOOTER --- */
.footer {
  background: #09090b; 
  padding: 2rem 0; 
  text-align: center; 
  font-size: 0.9rem;
  border-top: 1px solid #27272a;
}

/* Добавляем кнопку прокрутки наверх страницы */
html { 
  scroll-behavior: smooth; 
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px; height: 50px;
  background: #a78bfa;
  color: #000;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.4);
  transition: all 0.3s ease;
  z-index: 999;
}

.to-top:hover {
  background: #c4b5fd;
  transform: scale(1.1);
}

/* Адаптивность сайта */
/* =========================== */
/* Маленькие экраны (320–480px) */
@media (max-width: 480px) {
  .header .wrapper {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .logo {
    font-size: 1.8rem;
  }
  .nav a {
    margin: 0.5rem 0;
    display: block;
  }

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

  .flip-card {
    width: 260px;
    height: 260px;
  }

  h1 {
    font-size: 2rem;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .page-title span {
    display: block;
    font-size: 1.2rem;
  }

  .contact_form_wrapper {
    padding: 2rem 1.5rem;
  }

  .button {
    width: 100%;
  }
}

/* Телефоны (480–768px) */
@media (max-width: 767px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .portfolio_card img {
    height: 200px;
  }

  .favorites-table {
    font-size: 0.9rem;
  }

  .favorites-table th,
  .favorites-table td {
    padding: 0.75rem 0.5rem;
  }

  main {
    padding: 2rem 0;
  }

  .flip-card {
    width: 280px;
    height: 280px;
  }
}

/* Планшеты (768–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .wrapper {
    padding: 0 40px;
  }

  .about {
    grid-template-columns: 280px 1fr;
    gap: 3rem;
  }

  .flip-card {
    width: 260px;
    height: 340px;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio_card img {
    height: 240px;
  }

  .contact_form_wrapper {
    max-width: 600px;
  }
}