/* layout.css — структура сторінки: контейнер, хедер, секції, сітки, футер. */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

section { padding-block: var(--section-py); }

.section-head { text-align: center; max-width: 760px; margin-inline: auto; margin-bottom: 3rem; }
.section-head h2 { font-size: var(--fs-h2); color: var(--primary); }
.section-head p { color: var(--on-surface-muted); margin-top: 0.75rem; }

/* ── Header / Nav ── */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-header);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  transition: box-shadow var(--transition), background var(--transition);
}
.header.scrolled { box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
/* Лого гри — біле, тож на світлій темі лягає на синю підкладку */
.nav__logo { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--radius); background: var(--logo-bg); }
.nav__logo img { height: 30px; width: auto; display: block; }
.nav__links { display: flex; align-items: center; gap: 1.1rem; }
.nav__links a { font-weight: 500; font-size: 0.95rem; white-space: nowrap; color: var(--on-surface); transition: color var(--transition); }
.nav__links a:hover { color: var(--primary-light); }
/* Кнопка ГРАТИ! у шапці: блідо-блакитний напис за замовчуванням, білий при наведенні */
.nav__links a.btn--primary { color: #bfdbfe; font-weight: 700; }
.nav__links a.btn--primary:hover { color: #fff; }
/* Перемикач теми */
.theme-toggle { font-size: 1.2rem; line-height: 1; padding: 6px 10px; border-radius: 50%; transition: background var(--transition); }
.theme-toggle:hover { background: var(--border-soft); }
.nav__burger { display: none; flex-direction: column; gap: 5px; width: 28px; }
.nav__burger span { height: 3px; border-radius: 2px; background: var(--primary); transition: var(--transition); }

/* ── Hero ── */
.hero {
  position: relative; min-height: 100vh; display: grid; align-items: center;
  background: var(--gradient-hero); color: #fff; padding-top: 68px; overflow: hidden;
}
/* Фонове відео (варіант 1) */
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero__overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(105deg, rgba(15,31,61,0.88) 0%, rgba(15,31,61,0.55) 55%, rgba(15,31,61,0.25) 100%); }
.hero .container { position: relative; z-index: 2; }
.hero__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; align-items: center; }
.hero__title { font-size: var(--fs-h1); text-shadow: 0 2px 12px rgba(0,0,0,0.35); }
.hero__title em { color: var(--accent); font-style: normal; }
.hero__subtitle { font-size: var(--fs-h3); font-weight: 400; opacity: 0.95; margin-top: 1rem; text-shadow: 0 1px 8px rgba(0,0,0,0.3); }
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
/* Варіант 2: відео праворуч у рамці (вмикається класом .hero--split на секції) */
.hero__media { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.hero__media video, .hero__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero--split .hero__video, .hero--split .hero__overlay { display: none; }
.hero--split { background: var(--gradient-hero); }
.hero:not(.hero--split) .hero__media { display: none; }
.hero:not(.hero--split) .hero__grid { grid-template-columns: minmax(0, 760px); }

/* ── Countdown ── */
.countdown { background: var(--bg-dark); color: #fff; text-align: center; }
.countdown__label { font-size: var(--fs-h3); color: var(--accent); }
.countdown__timer { display: flex; justify-content: center; gap: clamp(0.75rem, 3vw, 2rem); margin-block: 1.75rem; }
.cd-unit { min-width: 84px; }
.cd-unit__num { font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 800; line-height: 1; }
.cd-unit__lbl { display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7; margin-top: 0.5rem; }
.countdown__date { opacity: 0.85; }

/* ── 2-колонкові секції ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.two-col img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

/* ── Сітки карток ── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }

/* ── Кроки (Як це працює) ── */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }

/* ── Таймлайн ── */
.timeline { position: relative; max-width: 820px; margin-inline: auto; }
.timeline::before {
  content: ""; position: absolute; left: 28px; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--accent-green), var(--primary-light), #d1d5db);
}
.tl-item { position: relative; padding-left: 76px; padding-bottom: 2.5rem; }
.tl-item__dot {
  position: absolute; left: 16px; top: 2px; width: 28px; height: 28px; border-radius: 50%;
  background: #d1d5db; display: grid; place-items: center; font-size: 0.9rem; border: 3px solid #fff; box-shadow: var(--shadow-sm);
}

/* ── CTA / статистика ── */
.cta { background: var(--gradient-hero); color: #fff; text-align: center; }
.cta__buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-block: 2rem; }
.stats { display: flex; gap: clamp(1.5rem, 5vw, 4rem); justify-content: center; flex-wrap: wrap; }
.stat__num { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: var(--accent); }
.stat__lbl { opacity: 0.85; }

/* ── Footer ── */
.footer { background: #0c1626; color: #cbd5e1; padding-block: 3.5rem 2rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
.footer h4 { color: #fff; margin-bottom: 1rem; }
.footer a { transition: color var(--transition); }
.footer a:hover { color: var(--accent); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 2.5rem; padding-top: 1.5rem; text-align: center; font-size: 0.875rem; opacity: 0.7; }
.footer__logos { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.25rem; }
.footer__logos img { height: 40px; width: auto; }
.footer__logos img:nth-child(1) { height: 30px; } /* методика — менше */
.footer__logos img:nth-child(2) { height: 52px; } /* ФРГС — більше */
.footer__logos img:nth-child(3) { height: 52px; } /* МФВ — більше */
.footer__fb, .footer__tg { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: var(--radius); background: #fff; color: #0c1626; vertical-align: middle; transition: background var(--transition), color var(--transition); }
.footer__fb svg, .footer__tg svg { display: block; fill: currentColor; }
.footer__fb:hover, .footer__tg:hover { background: var(--accent); color: #fff; }
.footer__fb:hover svg, .footer__tg:hover svg { fill: #fff; }
.footer__tg { margin-left: 6px; }
.footer__logos .logo-frgs-text { font-weight: 700; color: #fff; font-size: 0.9rem; line-height: 1.2; max-width: 180px; }

/* ── Ейнштейн у секції про ШІ ── */
.einstein { display: flex; justify-content: center; }
.einstein img { max-height: 420px; width: auto; filter: drop-shadow(0 16px 32px rgba(0,0,0,0.25)); }

/* ── ПОВНОЕКРАННИЙ КАУНТДАУН-ОВЕРЛЕЙ ── */
/* Поки активний — каунтдаун поверх напівпрозорого розмитого відео hero.
   Сам hero-текст («Гра, що вчить…») прихований і плавно з'являється після зняття. */
body.cd-locked { overflow: hidden; }
body.cd-locked .site-wrap { pointer-events: none; user-select: none; }
.hero__grid { transition: opacity 0.9s ease, transform 0.9s ease; }
body.cd-locked .hero__grid { opacity: 0; transform: translateY(24px); }

.cd-overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: grid; place-items: center; text-align: center; color: #fff;
  background: rgba(8, 15, 28, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 1; transition: opacity 0.6s ease;
}
/* М'яке згасання оверлею при знятті */
.cd-overlay--out { opacity: 0; }
.cd-overlay[hidden] { display: none; }
.cd-overlay__inner { padding: 2rem; }
.cd-overlay__label { font-family: 'Exo 2', sans-serif; font-weight: 700; font-size: 28px; color: var(--accent); letter-spacing: 1px; }
.cd-overlay__date { opacity: 0.9; margin-top: 0.5rem; }
.cd-overlay__timer { display: flex; justify-content: center; gap: clamp(0.6rem, 2.5vw, 1.6rem); margin-block: 2rem; }
/* Стиль цифр — Неон-HUD (варіант 3): однакові квадрати, світні цифри, без смикання */
.cd-overlay .cd-unit { min-width: 0; }
.cd-overlay .cd-unit__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: clamp(68px, 18vw, 92px); height: clamp(68px, 18vw, 92px);
  font-family: 'Orbitron', sans-serif; font-weight: 800;
  font-size: clamp(1.8rem, 6vw, 3.2rem); line-height: 1;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  color: #7fffd4;
  text-shadow: 0 0 8px rgba(16,185,129,.9), 0 0 22px rgba(16,185,129,.6);
  border: 1px solid rgba(16,185,129,.45); border-radius: 10px;
  background: rgba(16,185,129,.06);
}
.cd-overlay .cd-unit__lbl { color: #7fffd4; opacity: 0.8; }
/* Службове посилання «Пропуск» (тимчасове — приберемо в робочій версії) */
.cd-skip { display: inline-block; margin-top: 1rem; font-size: 0.85rem; color: rgba(255,255,255,0.6); text-decoration: underline; letter-spacing: 0.5px; }
.cd-skip:hover { color: #fff; }
