/* ============================================================
   Общие стили сайта «Внеурочная деятельность школы»
   ============================================================ */

/* ---------- CSS-переменные (тема) ---------- */
:root {
  --color-navy: #1A237E;
  --color-navy-light: #2E3A9E;
  --color-bg: #F5F7FA;
  --color-text: #1F2937;
  --color-muted: #6B7280;
  --color-white: #FFFFFF;

  /* Цвета направлений */
  --color-football: #2E7D32;
  --color-football-light: #A5D6A7;
  --color-theater: #6A1B9A;
  --color-theater-light: #CE93D8;
  --color-museum: #8D6E63;
  --color-museum-light: #D7CCC8;

  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .10);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .18);
  --transition: .3s cubic-bezier(.4, 0, .2, 1);
  --container: 1200px;
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Open Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3 {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Шапка сайта ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(26, 35, 126, 0);
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.is-scrolled {
  background: rgba(26, 35, 126, .97);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-white);
}

.brand__logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-white);
  display: grid; place-items: center;
  font-weight: 800; color: var(--color-navy);
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.brand__logo img { width: 100%; height: 100%; object-fit: contain; }

.brand__name { font-weight: 700; font-size: 15px; line-height: 1.2; }

.nav { display: flex; gap: 28px; }
.nav a {
  color: rgba(255, 255, 255, .9);
  font-weight: 500;
  font-size: 15px;
  position: relative;
  transition: color var(--transition);
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 2px; background: var(--color-white);
  transition: width var(--transition);
}
.nav a:hover { color: var(--color-white); }
.nav a:hover::after { width: 100%; }

/* Бургер для мобилки */
.burger {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; gap: 5px;
  align-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
}
.burger span {
  display: block; width: 20px; height: 2px;
  background: var(--color-white);
  transition: var(--transition);
}
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--color-white);
  overflow: hidden;
  padding: 120px 24px 80px;
}

.hero__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: -2;
}
.hero__bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(26,35,126,.75) 0%,
    rgba(26,35,126,.55) 50%,
    rgba(26,35,126,.85) 100%);
}

.hero__inner { max-width: 900px; animation: fadeUp 1s ease both; }

.hero__eyebrow {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 100px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 64px);
  margin-bottom: 20px;
}

.hero p {
  font-size: clamp(16px, 2vw, 20px);
  opacity: .9;
  max-width: 640px;
  margin: 0 auto 40px;
}

.scroll-down {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  color: var(--color-white);
  animation: bounce 2s infinite;
  transition: var(--transition);
}
.scroll-down:hover { background: rgba(255,255,255,.15); }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

/* ---------- Приветствие директора ---------- */
.welcome {
  padding: 100px 0;
  background: var(--color-white);
}

.welcome__inner {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 60px;
  align-items: center;
}

.welcome__photo {
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 6px solid var(--color-bg);
  background: var(--color-bg);
  position: relative;
}
.welcome__photo img { width: 100%; height: 100%; object-fit: cover; }

.welcome__quote {
  position: relative;
  padding-left: 60px;
}
.welcome__quote::before {
  content: '“';
  position: absolute;
  left: 0; top: -30px;
  font-family: Georgia, serif;
  font-size: 120px;
  line-height: 1;
  color: var(--color-navy);
  opacity: .15;
}
.welcome__quote blockquote {
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.5;
  font-style: italic;
  color: var(--color-text);
  margin-bottom: 24px;
}
.welcome__author { font-weight: 700; color: var(--color-navy); }
.welcome__author small { display: block; font-weight: 400; color: var(--color-muted); font-size: 14px; margin-top: 4px; }

/* ---------- Карточки-развилки ---------- */
.directions {
  padding: 100px 0;
}

.section-title { text-align: center; margin-bottom: 56px; }
.section-title h2 { font-size: clamp(28px, 4vw, 44px); color: var(--color-navy); }
.section-title p { color: var(--color-muted); margin-top: 12px; max-width: 560px; margin-inline: auto; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--color-white);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  isolation: isolate;
}

.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.card__bg {
  position: absolute; inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  transition: transform .6s ease;
}
.card:hover .card__bg { transform: scale(1.08); }

.card::after {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 30%,
    rgba(0,0,0,.85) 100%);
}

.card__icon {
  position: absolute;
  top: 32px; left: 32px;
  width: 56px; height: 56px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 28px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  transition: var(--transition);
}
.card:hover .card__icon { transform: rotate(-8deg) scale(1.1); }

.card h3 { font-size: 26px; margin-bottom: 8px; }
.card p { font-size: 14px; opacity: .85; margin-bottom: 20px; }

.card__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--color-white);
  padding: 10px 0;
  transition: gap var(--transition);
}
.card__btn:hover { gap: 14px; }

.card--football:hover .card__btn { color: var(--color-football-light); }
.card--theater:hover  .card__btn { color: var(--color-theater-light); }
.card--museum:hover   .card__btn { color: var(--color-museum-light); }

.card--football { border-top: 4px solid var(--color-football); }
.card--theater  { border-top: 4px solid var(--color-theater); }
.card--museum   { border-top: 4px solid var(--color-museum); }

/* ---------- Появление при скролле ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Футер ---------- */
.site-footer {
  background: var(--color-navy);
  color: rgba(255,255,255,.8);
  padding: 48px 0 32px;
  margin-top: 60px;
}
.site-footer a { color: rgba(255,255,255,.8); }
.site-footer a:hover { color: var(--color-white); }

.site-footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.site-footer h4 { color: var(--color-white); margin-bottom: 12px; font-size: 16px; }
.site-footer p, .site-footer li { font-size: 14px; line-height: 1.7; }
.site-footer ul { list-style: none; }

.site-footer__bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255,255,255,.6);
}

.footer-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 100px;
  font-size: 13px;
  transition: var(--transition);
}
.footer-login:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }

/* ---------- Тост-уведомления ---------- */
.toast {
  position: fixed;
  right: 24px; bottom: 24px;
  padding: 14px 22px;
  background: #1F2937;
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
}
.toast.is-show { opacity: 1; transform: none; }
.toast--error { background: #B91C1C; }
.toast--success { background: #15803D; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .welcome__inner { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .welcome__photo { width: 220px; margin: 0 auto; }
  .welcome__quote { padding-left: 0; }
  .welcome__quote::before { position: static; display: block; font-size: 80px; line-height: .8; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 340px; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 720px) {
  .nav { 
    position: fixed; inset: 0 0 0 auto;
    width: 260px; padding: 100px 24px 24px;
    background: var(--color-navy);
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }
  .nav.is-open { transform: none; }
  .burger { display: flex; }
  .hero { padding-top: 100px; }
}