:root{
  --page-bg: #A27C00;    /* фон страницы — "пшеничный", более тёмный */
  --card-bg: #e2d6b0;    /* цвет карточек, хедера, футера (светлее страницы) */
  --accent: #b99f5f;     /* кнопки / небольшие акценты */
  --accent-hover: #ccb677;
  --text-dark: #1b1307;
  --hero-blur: 6px;
}

/* --- base reset --- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background:var(--page-bg);
  color:var(--text-dark);
}

/* --- header --- */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  background:var(--card-bg);    /* header как карточки */
  padding:10px 28px;
  position:sticky;
  top:0;
  z-index:40;
  box-shadow:0 2px 0 rgba(0,0,0,0.08);
}

.header-left {
  margin-top: -5px;
  align-items: center;
}
/* logo */
.logo{
  font-weight:700;
  font-size:1.15rem;
  color:var(--text-dark);
}

/* center nav (group 1) */
.header-center { flex:1; display:flex; justify-content:center; }
.nav-left{ display:flex; gap:28px; align-items:center; }
.header-center a {
  position: relative;
  left: 60px;
}

/* right group */
.header-right { display:flex; gap:16px; align-items:center; }

/* links styling */
.header a{
  color:var(--text-dark);
  text-decoration:none;
  padding:6px 4px;
  transition:transform .18s ease, opacity .18s;
}
.header a:hover{ transform:translateY(-2px); opacity:.9; }

/* special login link spacing */
.login{ font-weight:600; }

/* button style */
.btn{
  display:inline-block;
  background:var(--accent);
  color:var(--text-dark);
  padding:8px 14px;
  border-radius:8px;
  text-decoration:none;
  font-weight:700;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
  transition:transform .18s ease, box-shadow .18s ease, background .18s;
}
.btn:hover{
  transform:translateY(-4px) scale(1.03);
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
  background:var(--accent-hover);
}

/* hero (размытая пшеница) */
.hero{
  position:relative;
  max-width:980px;
  margin:28px auto 8px;
  border-radius:12px;
  overflow:hidden;
  height:360px;              /* увеличена высота, чтобы влезла кнопка */
}

/* размытый фон (пшеница) */
.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background: url("wheat.png") center/cover no-repeat;
  filter: blur(var(--hero-blur));
  transform: scale(1.04);
  z-index:0;
}

/* тёмный полупрозрачный слой поверх фоновой картинки — чтобы фон был темнее хедера */
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(rgba(0,0,0,0.18), rgba(0,0,0,0.18));
  z-index:1;
}

.hero-text{
  position:relative;
  z-index:2;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:18px;
  color:#fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

.hero-text h1{
  margin:0 0 6px;
  font-size:2rem;
  font-weight:800;
}

/* кнопка на картинке: цвет как у хедера (card-bg) */
.hero-btn{
  background:var(--card-bg);
  color:var(--text-dark);
  font-weight:700;
  padding:10px 18px;
  margin-top:12px;
  text-decoration:none; /* без underline */
  border-radius:8px;
  box-shadow:0 3px 0 rgba(0,0,0,0.08);
  transition: transform .18s, box-shadow .18s;
}
.hero-btn:hover{ transform: translateY(-4px) scale(1.02); box-shadow:0 8px 18px rgba(0,0,0,0.15); }

/* --- tasks --- */
.tasks{ max-width:980px; margin:34px auto 28px; padding:0 18px; text-align:center; }
.tasks h2{ color:#fff; margin:0 0 20px; font-size:1.6rem; text-shadow:0 2px 4px rgba(0,0,0,0.35); }

/* grid: ровный ряд карточек одинаковой высоты */
.tasks-grid{
  display:flex;
  gap:22px;
  align-items:stretch;     /* выравнивание высоты карточек */
  justify-content:center;
  flex-wrap:wrap;
}

/* карточки одинаковые */
.task-card{
  flex: 1 1 300px;         /* три карточки в ряд при достаточной ширине */
  max-width:320px;
  background:var(--card-bg);
  border-radius:12px;
  overflow:visible;
  display:flex;
  flex-direction:column;
  min-height:220px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
  transition: transform .18s, box-shadow .18s;
}

/* при hover всей карточки — чуть глубже тень (но сами половины масштабируются отдельно) */
.task-card:hover{ box-shadow: 0 12px 24px rgba(0,0,0,0.12); transform: translateY(-4px); }

/* половины внутри карточки */
.task-half{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  position:relative;
}

/* содержимое, которое масштабируется (чтобы не ломать высоту контейнера) */
.half-inner{
  transition: transform .22s cubic-bezier(.2,.9,.2,1), box-shadow .18s;
  transform-origin:center;
  width:100%;
  text-align:center;
}

/* при наведении увеличиваем только inner — визуально рост, но карточка остаётся того же размера */
.task-half:hover .half-inner{
  transform: scale(1.04);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* разделитель между половинами */
.divider{
  height:1px;
  background: rgba(0,0,0,0.12);
  width:100%;
  box-shadow: inset 0 1px rgba(255,255,255,0.25);
}

/* центрированная карточка (без разделения) */
.center-card{ justify-content:center; align-items:center; }
.center-card .single-inner{ margin:auto; padding:18px; }

/* заголовки в карточках */
.task-card h3{ margin:0 0 6px; font-size:1rem; font-weight:800; }

/* тексты */
.task-card p{ margin:6px 0; font-size:0.95rem; color:var(--text-dark); }

/* --- footer --- */
.footer{
  margin-top:36px;
  background:var(--card-bg);
  padding:18px 12px;
  border-top:1px solid rgba(0,0,0,0.06);
}
.footer-inner{ max-width:980px; margin:0 auto; text-align:center; color:var(--text-dark); }
.footer a{ margin:0 8px; color:var(--text-dark); text-decoration:none; font-size:0.95rem; }

/* --- responsive tweaks --- */
@media (max-width:920px){
  .tasks-grid{ gap:14px; }
  .task-card{ max-width:45%; flex:1 1 45%; }
}
@media (max-width:640px){
  .task-card{ max-width:100%; flex:1 1 100%; }
  .hero{ height:300px; }
}

/* =========================
   МОДАЛЬНЫЕ ОКНА — обновлено
   ========================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity .25s ease;
}
.modal.open {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--card-bg);
  color: var(--text-dark);
  padding: 28px 24px;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 16px 32px rgba(0,0,0,0.3);
  transform: scale(0.9);
  animation: modalFade .25s forwards;
}
@keyframes modalFade {
  to { transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: color .2s;
}
.modal-close:hover { color: var(--accent); }

.modal-dialog {
  background:var(--card-bg);
  color:var(--text-dark);
  border-radius:12px;
  padding:28px 24px;
  width:90%;
  max-width:400px;
  box-shadow:0 8px 24px rgba(0,0,0,0.25);
  animation:modalFade .25s ease;
}
.modal-dialog h2 {
  margin-top:0;
  text-align:center;
  font-weight:700;
}
.modal-dialog p, .modal-dialog a {
  font-size:1rem;
  margin:8px 0;
  color:var(--text-dark);
  text-decoration:none;
}

/* Доп. оформление страницы О нас */
.about-page {
  max-width:800px;
  margin:40px auto;
  padding:0 18px;
  color:var(--text-dark);
}
.about-hero h1 {
  font-size:2rem;
  margin-bottom:12px;
  text-align:center;
}
.about-content h2 {
  margin-top:30px;
  font-size:1.4rem;
}

/* ===================== */
/* --- Мобильные (<640px) --- */
@media (max-width: 640px) {
  /* Шапка */
  .header {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .logo {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }

  /* Фикс для центральных ссылок на мобильных */
  .header-center {
    display: flex !important;       /* показываем блок */
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    order: 0;                       /* чтобы было сверху под логотипом */
    margin-bottom: 8px;
  }
  .header-center a {
    position: relative;
    left: 0;                        /* сброс смещения */
    font-size: 0.95rem;
    padding: 6px 8px;
  }

  .header-left, .header-right {
    order: 1;
    width: 100%;
    justify-content: space-between;
  }

  /* Герой-секция */
  .hero {
    height: 260px;
    margin: 16px auto;
  }

  .hero-text h1 {
    font-size: 1.5rem;
  }
  .hero-text p {
    font-size: 0.95rem;
  }
  .hero-btn {
    padding: 10px 16px;
    font-size: 0.95rem;
  }

  /* Карточки задач — по одной в колонку */
  .tasks-grid {
    flex-direction: column;
    gap: 16px;
  }
  .task-card {
    max-width: 100%;
    min-height: auto;
  }

  /* Футер */
  .footer-inner {
    text-align: center;
    font-size: 0.9rem;
  }
  .footer a {
    display: block;
    margin: 6px 0;
  }

  /* Модалки — почти на весь экран */
  .modal-content {
    width: 90%;
    max-width: 400px;
    margin: 0 10px;
    padding: 16px;
  }

  /* Формы внутри модалок */
  .grain-form input,
  .modal-content input {
    font-size: 1rem;
    padding: 10px;
  }
  .modal-content button {
    width: 100%;
    font-size: 1rem;
    padding: 12px;
  }
}
