/* =========================================================
   1. БАЗОВЫЕ ПЕРЕМЕННЫЕ
   Я учу: дизайн — это система.
   Меняем переменные — меняется весь интерфейс.
   ========================================================= */

:root{
  --bg:#f5f7fa;
  --surface:#ffffff;
  --text:#1f2328;
  --primary:#2a7cff;
  --accent:#ffb300;
  --radius:14px;
}

/* Базовый сброс */
*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* Контейнер — центрирование */
.container{
  width:min(1200px, 100% - 40px);
  margin:0 auto;
}

/* =========================================================
   2. HEADER — FLEX ВЁРСТКА
   ========================================================= */

.header{
  background:var(--surface);
  position:sticky;
  top:0;
  z-index:10;
  box-shadow:0 4px 10px rgba(0,0,0,.05);
}

.header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:20px 0;
}

.logo{
  font-weight:700;
  text-decoration:none;
  color:var(--text);
}

.nav{
  display:flex;
  gap:20px;
}

.nav-link{
  text-decoration:none;
  color:var(--text);
  position:relative;
  transition:.2s;
}

/* Псевдоэлемент подчёркивания */
.nav-link::after{
  content:"";
  position:absolute;
  left:0;
  bottom:-4px;
  width:100%;
  height:2px;
  background:var(--primary);
  transform:scaleX(0);
  transition:.2s;
}

.nav-link:hover{
  color:var(--primary);
}

.nav-link:hover::after{
  transform:scaleX(1);
}

/* =========================================================
   3. HERO — ВЕСЬ ЭКРАН
   ========================================================= */

.hero{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;

  /* Фон */
  background:
    linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.5)),
    url('https://avatars.mds.yandex.net/i?id=5566f4bdbde3e6cee2088d9ef8c77a01_l-4340110-images-thumbs&n=13') center/cover;

  color:#fff;
}

.hero-content{
  max-width:600px;
  animation:fadeIn 1s ease forwards;
}

@keyframes fadeIn{
  from{ opacity:0; transform:translateY(20px); }
  to{ opacity:1; transform:translateY(0); }
}

.btn{
  display:inline-block;
  margin-top:20px;
  padding:12px 20px;
  background:var(--primary);
  color:#fff;
  text-decoration:none;
  border-radius:var(--radius);
  transition:.2s;
}

.btn:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 20px rgba(0,0,0,.2);
}

.btn-ghost{
  background:transparent;
  border:1px solid var(--primary);
  color:var(--primary);
}

/* =========================================================
   4. КАРТОЧКИ — FLEX + HOVER
   ========================================================= */

.section{
  padding:80px 0;
}

.section-title{
  text-align:center;
  margin-bottom:40px;
}

.cards{
  display:flex;
  flex-wrap:wrap;
  gap:20px;
  justify-content:center;
}

.card{
  background:var(--surface);
  border-radius:var(--radius);
  overflow:hidden;
  width:260px;
  display:flex;
  flex-direction:column;
  transition:.3s;
}

.card-image{
  height:180px;
  background:url('https://i.pinimg.com/originals/8c/99/c7/8c99c793d9389c83e9840bee0b83fede.jpg') center/cover;
}

.card h3{
  margin:20px;
}

.card p{
  margin:0 20px 20px;
  flex-grow:1;
}

.card-btn{
  margin:0 20px 20px;
  text-decoration:none;
  color:var(--primary);
  font-weight:600;
}

.card:hover{
  transform:translateY(-6px);
  box-shadow:0 20px 30px rgba(0,0,0,.15);
}

/* =========================================================
   5. ФОРМА
   ========================================================= */

.section-dark{
  background:#1f2328;
  color:#fff;
}

.form{
  max-width:700px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:20px;
}

.form-row{
  display:flex;
  gap:20px;
}

.form-field{
  flex:1;
  display:flex;
  flex-direction:column;
}

.form input,
.form select,
.form textarea{
  padding:10px;
  border-radius:8px;
  border:1px solid #ccc;
  margin-top:6px;
  font-size:14px;
}

/* состояние focus */
.form input:focus,
.form select:focus,
.form textarea:focus{
  outline:2px solid var(--accent);
}

.form-actions{
  display:flex;
  gap:10px;
}

/* =========================================================
   6. FOOTER
   ========================================================= */

.footer{
  background:#111;
  color:#ccc;
  padding:30px 0;
}

.footer-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.footer-links{
  display:flex;
  gap:20px;
}

.footer-links a{
  color:#ccc;
  text-decoration:none;
}

.footer-links a:hover{
  color:#fff;
}

/* 1) Планшеты и небольшие ноутбуки */
@media (max-width: 920px) {

  /* Шапка: меню в 2 строки, чтобы не давило */
  .header-row{
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .nav{
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Hero: меньше отступов, удобнее чтение */
  .hero{
    padding: 40px 0;
  }

  .hero-content{
    padding: 0 10px;
  }

  /* Карточки: пусть занимают больше ширины */
  .card{
    width: min(420px, 100%);
  }

  /* Форма: два поля в ряд на этом размере ещё можно,
     но делаем мягче и шире */
  .form{
    width: min(720px, 100%);
  }

  .form-row{
    gap: 14px;
  }
}


/* 2) Телефон */
@media (max-width: 680px) {

  /* Контейнер: больше воздуха по бокам */
  .container{
    width: min(1200px, 100% - 24px);
  }

  /* Навигация: компактнее, чтобы не занимала пол-экрана */
  .nav-link{
    padding: 6px 4px;
    font-size: 14px;
  }

  /* Hero: заголовок и текст меньше */
  .hero-content h1{
    font-size: 28px;
    line-height: 1.15;
  }

  .hero-content p{
    font-size: 15px;
    line-height: 1.55;
  }

  /* Карточки: одна в строку */
  .cards{
    gap: 16px;
  }

  .card{
    width: 100%;
  }

  .card-image{
    height: 200px;
  }

  /* ФОРМА: это главное — делаем в одну колонку */
  .form-row{
    flex-direction: column;
    gap: 14px;
  }

  .form-actions{
    flex-direction: column;
    gap: 10px;
  }

  .btn{
    width: 100%;
    text-align: center;
  }

  /* Footer: в колонку */
  .footer-row{
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }

  .footer-links{
    flex-direction: column;
    gap: 8px;
  }
}


/* 3) Очень маленькие экраны */
@media (max-width: 380px) {

  .hero-content h1{
    font-size: 24px;
  }

  .card-image{
    height: 180px;
  }
}