/* ============================================================
   «Вкусный диктант» — стили проекта
   Светлая «бумажная» тема: тёплый фон, тёмные чернила,
   апельсиново-терракотовый акцент. Без градиентов и свечений.
   ============================================================ */

:root {
  /* primitive */
  --paper: #f5f1e8;
  --card: #fffdf9;
  --ink: #231d15;
  --ink-2: #6d6353;
  --red: #c8662d;
  --red-dark: #a94f20;
  --olive: #697c43;
  --line: #e3dac7;
  --line-strong: #cfc3a9;
  --zebra: #f1ebdd;
  --danger: #b3261e;
  --success-bg: #f3e8dc;
  --success-text: #7a4a12;

  /* semantic */
  --bg: var(--paper);
  --surface: var(--card);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --accent: var(--red);
  --accent-hover: var(--red-dark);
  --on-accent: #fffdf9;

  /* component */
  --radius: 8px;
  --radius-sm: 6px;
  --font-display: "PT Serif", Georgia, "Times New Roman", serif;
  --font-body: "PT Sans", "Segoe UI", Arial, sans-serif;
  --container: 1160px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

button { cursor: pointer; font-family: inherit; }

/* ---------- контейнер ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- навигация ---------- */
.navbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 20px 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}
.brand:hover { color: var(--accent); }
.brand svg { flex: 0 0 auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 9px 15px;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 46px; height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  align-items: center;
  justify-content: center;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 150px 0 80px;
  background: var(--bg);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-logos {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.hero-logos img { height: 74px; width: auto; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 700;
  line-height: 1.25;
  max-width: 22ch;
}

.hero h2 {
  margin-top: 18px;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 44ch;
}

.hero-date {
  margin-top: 32px;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 54px);
  font-weight: 700;
  color: var(--accent);
}

.hero-figure {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  padding: 10px;
}
.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-block;
  padding: 15px 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  transition: background-color 150ms ease;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:active { background: var(--red-dark); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-ghost:hover {
  color: var(--on-accent);
  background: var(--accent);
}

.hero .btn { margin-top: 36px; }

/* ---------- секции ---------- */
.section { padding: 80px 0; }

.section-tint { background: var(--card); }

.section-title {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
}
.section-title::after {
  content: "";
  display: block;
  width: 46px; height: 3px;
  margin: 16px auto 0;
  background: var(--accent);
}

/* ---------- таблица победителей ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.winners-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 16px;
}

.winners-table th {
  padding: 15px 18px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: var(--accent);
  background: var(--paper);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.winners-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
}
.winners-table tbody tr:nth-child(odd) { background: var(--zebra); }
.winners-table tbody tr:hover { background: #ece4d2; }
.winners-table tbody tr:last-child td { border-bottom: 0; }
.winners-table td:first-child { color: var(--text-2); }

/* ---------- карточки партнёров ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 180ms ease;
}
.card:hover { border-color: var(--accent); }
.card-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--zebra); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 24px; }
.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
}
.card-link svg { transition: transform 180ms ease; }
.card:hover .card-link svg { transform: translateX(4px); }

/* ---------- текстовый контент ---------- */
.prose { max-width: 76ch; margin: 0 auto; }
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  margin: 52px 0 22px;
}
.prose h2:first-child { margin-top: 0; }
.prose p { margin-bottom: 20px; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 22px 22px; }
.prose li { margin-bottom: 14px; }
.prose strong { color: var(--accent-hover); }

/* ---------- формы ---------- */
.form-panel {
  max-width: 640px;
  margin: 0 auto;
  padding: 42px 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.form-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 34px;
}

.form-group { margin-bottom: 22px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.form-control::placeholder { color: #a99f8c; }
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 102, 45, 0.16);
}
textarea.form-control { min-height: 150px; resize: vertical; }

.form-hint {
  display: block;
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--text-2);
}

.invalid-feedback {
  display: none;
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--danger);
}
.form-group.invalid .invalid-feedback { display: block; }
.form-group.invalid .form-control { border-color: var(--danger); }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}
.checkbox-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin-top: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkbox-row label {
  margin: 0;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-2);
  cursor: pointer;
}
.checkbox-row a { text-decoration: underline; text-underline-offset: 3px; }

.form-submit { width: 100%; margin-top: 6px; }

.form-success {
  display: none;
  margin-top: 24px;
  padding: 17px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  color: var(--success-text);
  text-align: center;
}
.form-success.show { display: block; }

/* ---------- контакты ---------- */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
  align-items: start;
}

.contacts-info h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  margin-bottom: 22px;
}

.contact-line {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.contact-line:last-of-type { border-bottom: 0; }
.contact-line svg { flex: 0 0 auto; margin-top: 4px; color: var(--accent); }
.contact-line .k {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}
.contact-line .v { font-size: 17px; color: var(--text); }
.contact-line a { color: var(--text); }
.contact-line a:hover { color: var(--accent-hover); }

/* блок организационной поддержки (Костис) */
.support-note {
  margin-top: 28px;
  padding: 20px 22px;
  border-left: 3px solid var(--accent);
  background: #f7efe4;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.support-note p { margin: 0; }
.support-note a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.support-note a:hover { color: var(--accent-hover); }

/* ---------- модальное окно ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(35, 29, 21, 0.5);
}
.modal.open { display: flex; }

.modal-dialog {
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  animation: modal-in 200ms ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 0;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}
.modal-close {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  font-size: 22px;
  line-height: 1;
  transition: color 150ms ease, border-color 150ms ease;
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); }
.modal-body { padding: 20px 28px 28px; }

/* ---------- подвал ---------- */
.footer {
  background: var(--ink);
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-mail {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--paper);
  font-size: 16.5px;
}
.footer-mail:hover { color: var(--gold-300, #e8c98a); }
.footer-mail svg { color: #e8c98a; flex: 0 0 auto; }
.footer-copy { font-size: 14px; color: #a99f8c; }

/* ---------- адаптив ---------- */
@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-figure { max-width: 540px; margin: 0 auto; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .contacts-grid { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 768px) {
  body { font-size: 16px; }
  .navbar { padding: 14px 0; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%; left: 16px; right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--card);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 15px; }
  .hero { padding: 126px 0 56px; }
  .section { padding: 56px 0; }
  .form-panel { padding: 32px 22px; }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .hero-logos img { height: 58px; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
