/* ---------- Base / variables ---------- */
:root {
  --bg: #0a0b0d;
  --bg-alt: #131519;
  --bg-card: #1b1e23;
  --border: #2a2d33;
  --blue: #0057ff;
  --blue-light: #4d8dff;
  --yellow: #f4c430;
  --text: #f4f5f7;
  --text-muted: #9aa0a8;
  --font-display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 100px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.accent-yellow { color: var(--yellow); }

.todo {
  color: var(--yellow);
  font-style: italic;
  font-size: 0.85em;
  opacity: 0.85;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 2px solid transparent;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 87, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(0, 87, 255, 0.5); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--yellow); color: var(--yellow); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

/* The mark sits above the "321", so the pair is stacked and nudged down a
   touch to sit optically centred against the nav links. */
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
  margin-top: 4px;
}
.logo:hover { color: var(--yellow); }
.logo-mark {
  height: 64px;
  width: auto;
  display: block;
}
.logo-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--blue-light);
  letter-spacing: 0.12em;
}

@media (max-width: 420px) {
  .logo-mark { height: 50px; }
  .logo-num { font-size: 0.95rem; }
}

.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  transition: color 0.15s ease;
}
.nav-link:hover { color: var(--yellow); }

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.lang-toggle:hover { border-color: var(--yellow); }
.lang-opt { color: var(--text-muted); }
.lang-opt.active { color: var(--yellow); }
.lang-sep { color: var(--border); }

.nav-toggle {
  display: none;
  flex-direction: column;
  /* the UA stylesheet forces align-items:center on <button>, which collapses
     empty bars to zero width — so give them an explicit width below */
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
  padding-top: var(--header-h);
}

/* The on-track shot sits behind DIMITAR KOLEV and the portrait. The source is
   1600px wide, so it gets upscaled on large screens — the slight blur and the
   dark wash hide that and keep the headline readable. */
.hero-bg {
  position: absolute;
  inset: -3%;
  background: url("../images/hero/hero-bg.jpg") center 45% / cover no-repeat;
  filter: blur(2px);
  opacity: 0.65;
  z-index: 0;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, rgba(10, 11, 13, 0.90) 0%, rgba(10, 11, 13, 0.62) 45%, rgba(10, 11, 13, 0.28) 100%),
    linear-gradient(180deg, rgba(10, 11, 13, 0.75) 0%, transparent 30%, rgba(10, 11, 13, 0.88) 100%),
    radial-gradient(circle at 15% 20%, rgba(0, 87, 255, 0.20), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(244, 196, 48, 0.10), transparent 40%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  align-items: center;
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 40px;
}

.eyebrow {
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 0.98;
  margin: 0;
  letter-spacing: 0.01em;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.65);
}

.hero-title {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: #c8cdd4;
  font-weight: 600;
  margin: 18px 0 32px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-photo {
  position: relative;
  display: flex;
  justify-content: center;
}

.photo-frame {
  width: min(100%, 340px);
  aspect-ratio: 4 / 5;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.photo-real {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.bib-number {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.4rem;
  padding: 8px 24px;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 87, 255, 0.4);
}

/* ---------- Sections ---------- */
.section {
  padding: 100px 0;
}
.section-alt { background: var(--bg-alt); }

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  text-transform: uppercase;
  margin: 0 0 48px;
  letter-spacing: 0.02em;
}
.section-title .accent-yellow {
  font-size: 0.7em;
  margin-right: 8px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
}

.about-photo {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}
.about-photo img {
  width: 100%;
  /* the width/height attributes land as presentational hints, so height has to
     be released explicitly before aspect-ratio can take over */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 26%;
}

.about-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.about-facts li {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.about-facts li:last-child { border-bottom: none; }
.fact-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fact-value {
  font-weight: 700;
}
/* Windows ships no flag emoji — 🇧🇬 renders there as the letters "BG", so the
   flag is drawn inline instead. */
.fact-value-flag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.flag {
  width: 21px;
  height: 13px;
  flex: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* Achievements */
.achievements-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.achievement {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-left: 4px solid var(--blue);
}
/* the national title should not read as just another round */
.achievement.featured {
  border-left-color: var(--yellow);
  border-left-width: 6px;
  padding: 32px;
  background:
    linear-gradient(120deg, rgba(244, 196, 48, 0.10), transparent 55%),
    var(--bg-card);
  box-shadow:
    0 0 0 1px rgba(244, 196, 48, 0.16),
    0 18px 44px rgba(0, 0, 0, 0.35);
}
.achievement-head {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  align-items: baseline;
}
.achievement-year {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--yellow);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.achievement.featured .achievement-year { font-size: 1.5rem; }
.achievement-body h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  line-height: 1.35;
}
.achievement.featured .achievement-body h3 { font-size: 1.4rem; }
.achievement-body p {
  margin: 0;
  color: var(--text-muted);
}

/* Per-event photo strip.
   Flex rather than a fixed 5-column grid so a set of one or two photos stays
   centred under its card instead of hugging the left edge. */
.photo-set {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.photo-item {
  position: relative;
  flex: 1 1 150px;
  /* generous cap so sets of one or two photos don't look lost in a wide card;
     rows of five are still constrained by the available width */
  max-width: 260px;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
  cursor: pointer;
  display: block;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.photo-item:hover,
.photo-item:focus-visible {
  border-color: var(--blue-light);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  transform: translateY(-3px);
  outline: none;
}
.photo-item picture {
  display: block;
  width: 100%;
  height: 100%;
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.photo-item:hover img { transform: scale(1.06); }

/* Magnifier hint, so it reads as "click to enlarge" */
.photo-item::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(10, 11, 13, 0.72) center / 13px 13px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E");
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.photo-item:hover::after,
.photo-item:focus-visible::after { opacity: 1; }

/* The "+N" tile shows the next photo dimmed rather than an empty dashed box */
.photo-more::after { content: none; }
.photo-more-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 11, 0.66);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.03em;
  transition: background 0.15s ease, color 0.15s ease;
}
.photo-more:hover .photo-more-label,
.photo-more:focus-visible .photo-more-label {
  background: rgba(8, 9, 11, 0.48);
  color: var(--yellow);
}

/* Wide media — an official record or a landscape still, shown whole rather
   than cropped into the 4:5 tiles the regular photo sets use. */
.photo-set-wide .photo-item {
  flex: 1 1 100%;
  max-width: 760px;
  aspect-ratio: 1316 / 525;
}

/* Video sits in a card the same way a photo set does: divided off, centred. */
.video-embed {
  margin: 22px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.video-embed video {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  margin: 0 auto;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.media-note {
  max-width: 760px;
  margin: 12px auto 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: center;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 6, 0.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-stage {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 1100px);
}
.lightbox-img {
  max-width: min(92vw, 1100px);
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.lightbox-img.is-switching {
  opacity: 0;
  transform: scale(0.97);
}
.lightbox-caption {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  max-width: 60ch;
  line-height: 1.4;
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 22, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.lightbox-close {
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 1.9rem;
  padding: 0 0 4px;
}
.lightbox-close:hover {
  color: var(--yellow);
  border-color: var(--yellow);
  transform: scale(1.06);
}
.lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  width: 56px;
  height: 56px;
}
.lightbox-arrow:hover {
  background: rgba(0, 87, 255, 0.85);
  border-color: var(--blue-light);
  transform: translateY(-50%) scale(1.08);
}
.lightbox-arrow[hidden] { display: none; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 22, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 16px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.lightbox-counter[hidden] { display: none; }

@media (max-width: 600px) {
  .lightbox-arrow { width: 44px; height: 44px; font-size: 1.1rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 1.6rem; }
  .lightbox-img { max-height: 70vh; }
  .lightbox-caption { font-size: 0.8rem; padding: 0 16px; }
}

/* Sponsorship */
.section-sponsor {
  background:
    linear-gradient(180deg, rgba(0,87,255,0.08), transparent 60%),
    var(--bg-alt);
  text-align: center;
}
.sponsor-inner { max-width: 760px; }
.sponsor-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 36px;
}
.sponsor-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
}
/* an address set in uppercase Arial Black is unreadable — opt this one out */
.btn-email {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.92rem;
}
.sponsor-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.footer-social {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s ease;
}
.social-link svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.social-link:hover { color: var(--yellow); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-cta { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }

  /* stacked hero: darken top-to-bottom instead of left-to-right */
  .hero::after {
    background:
      linear-gradient(180deg, rgba(10, 11, 13, 0.92) 0%, rgba(10, 11, 13, 0.72) 45%, rgba(10, 11, 13, 0.95) 100%),
      radial-gradient(circle at 15% 20%, rgba(0, 87, 255, 0.20), transparent 45%),
      radial-gradient(circle at 85% 80%, rgba(244, 196, 48, 0.10), transparent 40%);
  }
}

@media (max-width: 720px) {
  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav.open { max-height: 400px; }
  .nav-link {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: flex; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .achievement-head { grid-template-columns: 1fr; gap: 6px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  /* long values like the Brunssum line crush the label column — stack instead */
  .about-facts li {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
}

@media (max-width: 520px) {
  .photo-set { gap: 8px; }
  .photo-item { flex-basis: 96px; max-width: 140px; }
  .section { padding: 72px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .photo-item,
  .photo-item img,
  .lightbox,
  .lightbox-img { transition: none; }
  .photo-item:hover { transform: none; }
  .photo-item:hover img { transform: none; }
}
