/* ВАРІАНТ 1 — Мінімалізм: багато повітря, велика жирна типографіка, чорно-біле + єдиний національний акцент */
@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@500;700;900&family=Manrope:wght@400;500;700;800&family=PT+Mono&display=swap');

:root {
  --paper: #fafaf7;
  --paper-dark: #f0efe9;
  --ink: #111111;
  --stamp-red: #9c2b26;
  --index-blue: #0057b7;
  --gold: #8a7a4a;
  --line: #d8d5cd;
  --card-bg: #ffffff;
  --flag-blue: #0057b7;
  --flag-yellow: #ffd700;
  --teal: #2f6f62;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  line-height: 1.6;
}
a { color: var(--index-blue); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* ---------- Nav ---------- */
nav.tabs {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink);
  border-bottom: none;
}
nav.tabs .wrap { display: flex; gap: 2px; overflow-x: auto; }
nav.tabs a {
  flex: 0 0 auto;
  display: block;
  padding: 18px 20px;
  color: #fff;
  text-decoration: none;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
nav.tabs a:hover { opacity: 0.55; }

/* ---------- Header ---------- */
header.masthead {
  padding: 70px 0 50px;
  border-bottom: 1px solid var(--ink);
  position: relative;
}
.flag-ribbon {
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--flag-blue) 50%, var(--flag-yellow) 50%);
}
.header-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
  gap: 24px;
}
.header-center { text-align: center; }
.header-side-label {
  font-family: 'Manrope', sans-serif;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: #999; margin-bottom: 14px;
}
.header-participants-block .header-side-label { text-align: left; }
.header-stats-block .header-side-label { text-align: right; }
.header-participants, .header-stats { display: flex; flex-wrap: wrap; gap: 14px; }
.header-participants { justify-content: space-between; }
.header-stats { justify-content: space-between; }
.mini-loading { font-size: 12px; color: #999; margin: 0; }

.mini-avatar { display: flex; flex-direction: column; align-items: center; flex: 1 1 0; min-width: 56px; }
.mini-avatar-img {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; border: none;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 15px;
  color: #fff; background: var(--ink);
}
.mini-avatar-name { font-family: 'Manrope', sans-serif; font-size: 10px; color: #777; margin-top: 6px; text-align: center; }

.mini-stat { display: flex; flex-direction: column; align-items: center; padding: 4px 8px; flex: 1 1 0; min-width: 56px; }
.mini-stat-value { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 22px; color: var(--ink); line-height: 1; }
.mini-stat-label { font-family: 'Manrope', sans-serif; font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: #999; margin-top: 5px; text-align: center; }

header.masthead .kicker {
  font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--index-blue);
}
header.masthead h1 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: clamp(30px, 5.4vw, 58px);
  margin: 12px 0 0;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

@media (max-width: 760px) {
  .header-grid { grid-template-columns: 1fr; text-align: center; }
  .header-participants, .header-stats { justify-content: center; }
  .header-participants-block .header-side-label, .header-stats-block .header-side-label { text-align: center; }
}

/* ---------- Signature stitch divider (thin, monochrome) ---------- */
.stitch-divider {
  height: 5px;
  background-image:
    repeating-linear-gradient(45deg, var(--ink) 0, var(--ink) 3px, transparent 3px, transparent 6px);
  opacity: 0.15;
  border: none;
}

/* ---------- Sections ---------- */
section { padding: 70px 0; }
section h2 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 34px;
  margin: 0 0 6px;
  display: inline-block;
  border-bottom: none;
  padding-bottom: 0;
}
section .section-num {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #aaa;
  letter-spacing: 0.14em;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--ink);
  padding: 32px;
  position: relative;
  box-shadow: none;
}
.card + .card { margin-top: 18px; }
.stamp {
  position: absolute; top: 24px; right: 24px;
  border: 1px solid var(--ink); color: var(--ink);
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: 0.1em; padding: 5px 12px; transform: none; border-radius: 0; background: none;
}
.stamp-next { border-color: var(--index-blue); color: var(--index-blue); }
.card-next-empty { display: flex; align-items: center; min-height: 90px; }
.empty-note { color: #999; font-style: italic; margin: 0; }
.card .meta-row { font-family: 'Manrope', sans-serif; font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.card h3 { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 24px; margin: 0 0 8px; }
.card .subtitle { color: var(--index-blue); font-weight: 700; margin: 0 0 12px; }

/* ---------- Quiz ---------- */
#quiz-content, #quiz-result, #quiz-reset { max-width: 640px; margin-left: auto; margin-right: auto; display: block; }
.quiz-progress { font-family: 'Manrope', sans-serif; font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.quiz-q { margin-bottom: 14px; }
.quiz-q p.q-text { font-weight: 800; font-size: 19px; margin: 0 0 16px; }
.quiz-q .opt {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 14px 4px; margin-bottom: 0; cursor: pointer;
  font-family: 'Manrope', sans-serif; font-size: 16px; color: var(--ink);
  transition: padding-left 0.15s ease, color 0.15s ease;
}
.quiz-q .opt:hover { padding-left: 12px; color: var(--index-blue); }
.quiz-q .opt.correct { color: #2f7a3f; font-weight: 700; border-color: #2f7a3f; }
.quiz-q .opt.wrong { color: var(--stamp-red); text-decoration: line-through; border-color: var(--stamp-red); }
.quiz-q .opt[disabled] { cursor: default; }
.next-q-btn { display: block; }
#quiz-result { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 15px; margin-top: 20px; padding: 18px; border: 1px solid var(--ink); display: none; }

.quiz-title-result { text-align: center; padding: 32px 20px; }
.quiz-title-emoji { font-size: 56px; line-height: 1; margin-bottom: 10px; }
.quiz-title-name { font-family: 'Unbounded', sans-serif; font-weight: 900; font-size: 26px; margin-bottom: 8px; }
.quiz-title-score { font-family: 'Manrope', sans-serif; font-size: 14px; color: #666; margin-bottom: 6px; }
.quiz-title-hint { font-family: 'Manrope', sans-serif; font-size: 12px; color: #999; font-style: italic; }

button.reset-btn {
  font-family: 'Manrope', sans-serif; font-weight: 700; background: var(--ink); color: #fff;
  border: none; padding: 12px 22px; cursor: pointer; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 16px;
  transition: opacity 0.2s ease;
}
button.reset-btn:hover { opacity: 0.75; }

/* ---------- Archive list ---------- */
.archive-item { display: flex; gap: 16px; align-items: baseline; border-bottom: 1px solid var(--line); padding: 16px 0; }
.archive-item .num { font-family: 'Manrope', sans-serif; font-weight: 700; color: #999; font-size: 13px; flex: 0 0 60px; }
.archive-item .date { font-family: 'Manrope', sans-serif; font-size: 12px; color: #999; flex: 0 0 90px; }
.archive-item a { font-weight: 700; text-decoration: none; }
.archive-item a:hover { text-decoration: underline; }

/* ---------- Figures carousel ---------- */
.section-lead { color: #888; margin-top: -6px; }
.carousel { display: flex; align-items: center; gap: 16px; margin-top: 24px; }
.carousel-track { position: relative; flex: 1; min-height: 240px; }
.figure-card { display: none; background: var(--card-bg); border: 1px solid var(--ink); padding: 32px; box-shadow: none; text-align: center; }
.figure-card.active { display: block; }
.figure-avatar {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 20px;
  color: #fff; background: var(--ink);
}
.figure-avatar-photo { object-fit: cover; border: none; filter: grayscale(100%); }
.figure-card h3 { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 22px; margin: 0 0 4px; }
.figure-years { font-family: 'Manrope', sans-serif; font-size: 12px; color: #999; margin-bottom: 14px; }
.figure-note { margin: 0 0 8px; }
.figure-quote { font-style: italic; color: var(--index-blue); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.carousel-btn {
  flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--ink);
  background: none; color: var(--ink); font-size: 18px; cursor: pointer; transition: background 0.2s ease, color 0.2s ease;
}
.carousel-btn:hover { background: var(--ink); color: #fff; }
.carousel-dots { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--ink); background: transparent; cursor: pointer; padding: 0; }
.dot.active { background: var(--ink); }

/* ---------- Timeline (horizontal) ---------- */
.timeline-h { display: flex; gap: 0; overflow-x: auto; padding: 40px 4px 10px; position: relative; }
.timeline-h::before { content: ""; position: absolute; left: 4px; right: 4px; top: 54px; height: 1px; background: var(--line); z-index: 0; }
.timeline-h-item { position: relative; flex: 0 0 190px; padding: 0 16px; text-align: center; }
.timeline-h-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); margin: 0 auto 14px; position: relative; z-index: 1; }
.timeline-h-period { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: 0.06em; }
.timeline-h-item h3 { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 16px; margin: 6px 0 8px; }
.timeline-h-item p { font-size: 12px; margin: 0; color: #555; }
.timeline-title-link { text-decoration: none; color: inherit; }
.timeline-title-link h3 { color: var(--index-blue); }
.timeline-title-link:hover h3 { text-decoration: underline; }
@media (max-width: 700px) { .timeline-h-item { flex: 0 0 150px; } }

/* ---------- Footer (emblem reservation) ---------- */
footer { border-top: 1px solid var(--ink); padding: 50px 0; background: var(--paper-dark); }
.emblem-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: start;
  text-align: center;
}
.emblem-slot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.emblem-icon { width: 56px; height: 56px; color: var(--ink); }
.emblem-caption {
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; color: #888;
}
.emblem-slot-empty {
  justify-content: center;
  min-height: 76px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 10px;
}
.emblem-reserved {
  font-family: 'Manrope', sans-serif; font-size: 11px; color: #aaa; font-style: italic;
}
@media (max-width: 700px) {
  .emblem-footer { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 560px) {
  .archive-item { flex-wrap: wrap; }
  .carousel-btn { width: 36px; height: 36px; font-size: 16px; }
}
