:root {
  --navy: #1d3455;
  --slate: #53647a;
  --red: #ac1f35;
  --line: rgba(29, 52, 85, 0.18);
  --paper: #ffffff;
  --map: #f6f7f9;
  --serif: 'EB Garamond', Garamond, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 160px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

.only-narrow { display: none; }

/* Navbar */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}
.nav nav { display: flex; gap: 36px; }
.nav nav a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.nav nav a:hover { border-bottom-color: var(--red); }
.nav nav { margin-left: auto; }
.nav__fb { display: flex; margin-left: 36px; padding: 4px; color: var(--navy); }
.nav__fb:hover { color: var(--red); }

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px var(--gutter) 0;
  text-align: center;
}
.hero__kicker,
.kicker,
.label,
.facts dt {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero__kicker { color: var(--slate); }
.hero__title {
  margin-top: 14px;
  font: 400 clamp(44px, 8.2vw, 118px)/1 var(--serif);
  text-transform: uppercase;
}
.hero__art {
  width: min(974px, 100%);
  margin-top: -47px;
}
.hero__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  width: 100%;
  max-width: 1120px;
  margin-top: -100px;
  font: 400 22px/1.25 var(--serif);
}
.hero__side { text-align: left; }
.hero__side--right { text-align: right; }
.hero__date time {
  display: block;
  font-size: 34px;
  font-weight: 500;
}
.hero__date em { color: var(--slate); font-size: 20px; }

/* Sections */
.section { padding: 150px var(--gutter) 0; }
.kicker { color: var(--red); }
h2 { font: 400 52px/1.05 var(--serif); }
h3 { font-size: 19px; font-weight: 600; line-height: 1.35; }
.muted, .prose p { color: var(--slate); }

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  text-align: center;
}
.intro__lead { max-width: 880px; font: 400 36px/1.3 var(--serif); }
.intro__body { max-width: 700px; font-size: 18px; line-height: 1.65; color: var(--slate); }

.facts { padding-top: 110px; }
.facts__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--navy);
  border-bottom: 1px solid var(--navy);
}
.facts__grid > div { padding: 36px 24px 36px 32px; border-left: 1px solid var(--line); }
.facts__grid > div:first-child { padding-left: 0; border-left: 0; }
.facts dt { font-size: 12px; letter-spacing: 0.16em; color: var(--slate); }
.facts dd { margin-top: 10px; font-size: 15px; color: var(--slate); }
.facts dd strong {
  display: block;
  margin-bottom: 10px;
  font: 500 30px/1.15 var(--serif);
  color: var(--navy);
}

/* Two-column sections */
.split {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 80px;
  align-items: start;
}
.split__head { display: flex; flex-direction: column; gap: 24px; }
.split__head .muted { max-width: 360px; }
.art { width: 100%; }
.art--rounded { border-radius: 16px; }
address { font: 400 26px/1.3 var(--serif); font-style: normal; }

.timeline { list-style: none; padding: 0; border-top: 1px solid var(--navy); border-bottom: 1px solid var(--navy); }
.timeline li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 28px 0;
}
.timeline li + li { border-top: 1px solid var(--line); }
.timeline__time { font: 500 28px/1.15 var(--serif); }
.timeline p { margin-top: 8px; color: var(--slate); }

.prose { display: flex; flex-direction: column; gap: 24px; font-size: 18px; line-height: 1.65; }
.prose hr { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--line); }

/* Prize card – double rule like the poster */
.prize {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 56px 120px 88px;
  border: 1.7px solid var(--navy);
  text-align: center;
}
.prize::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1.1px solid var(--red);
  pointer-events: none;
}
.prize h2 { max-width: 760px; font-size: 56px; }
.prize .muted { max-width: 720px; font-size: 18px; line-height: 1.65; }
.prize__art { width: min(600px, 100%); }
.prize__note { font: italic 400 24px/1.3 var(--serif); color: var(--red); }

/* Map */
.map { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.map__frame {
  display: block;
  width: 100%;
  height: 460px;
  border: 1px solid var(--line);
  background: var(--map);
  filter: grayscale(0.55) contrast(1.05);
}
.map__links { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; }
.map__links a { color: var(--navy); text-decoration-color: var(--red); text-underline-offset: 4px; }
.map__links a:hover { color: var(--red); }

/* Partners */
.partners { display: flex; flex-direction: column; align-items: center; gap: 40px; text-align: center; }
.partners__group { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; }
.label { font-size: 12px; letter-spacing: 0.16em; color: var(--slate); }
.partners__org { display: flex; align-items: center; gap: 16px; font-weight: 600; line-height: 1.3; text-align: left; }
.logos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  width: 100%;
  padding: 0;
  list-style: none;
}
.logos li { display: flex; align-items: center; justify-content: center; height: 128px; }
.logos img { max-height: 64px; width: auto; }
.slot {
  border: 1px dashed rgba(29, 52, 85, 0.25);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
}

/* Footer */
.footer { padding: 150px 40px 40px; }
.footer__rule { height: 9.7px; border-top: 1.7px solid var(--navy); border-bottom: 1px solid var(--red); }
.footer__bye {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 0 40px;
}
.footer__bye p { font: italic 400 30px/1.2 var(--serif); }
.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 14px;
  line-height: 1.5;
}
.footer__club { display: flex; align-items: center; gap: 16px; }
.footer__copy { font-size: 12px; color: var(--slate); }

/* Tablet */
@media (max-width: 1200px) {
  :root { --gutter: 64px; }
  .split { grid-template-columns: 360px 1fr; gap: 56px; }
  .prize { padding-left: 64px; padding-right: 64px; }
}

/* Mobile */
@media (max-width: 760px) {
  :root { --gutter: 24px; }
  body { font-size: 16px; }
  .only-wide { display: none; }
  .only-narrow { display: inline; }
  .hero__date em.only-narrow { display: block; }

  .nav { padding: 14px 20px; }
  .nav nav { display: none; }
  .nav__fb { margin-left: auto; }
  .brand { gap: 12px; font-size: 13px; }
  .brand img { width: 44px; height: 44px; }

  .hero { padding-top: 40px; }
  .hero__kicker { font-size: 11px; }
  .hero__title { margin-top: 10px; font-size: clamp(32px, 9.5vw, 54px); }
  .hero { overflow-x: clip; }
  .hero__art { width: calc(100% + 2 * var(--gutter) + 26px); max-width: none; margin-top: -6px; }
  .hero__row { display: block; margin-top: -40px; text-align: center; }
  .hero__side { display: none; }
  .hero__date time { font-size: 28px; }
  .hero__date em { font-size: 18px; }

  .section { padding-top: 72px; }
  .kicker, .label { font-size: 11px; }
  h2 { font-size: 36px; line-height: 1.08; }
  h3 { font-size: 17px; }

  .intro { gap: 20px; }
  .intro__lead { font-size: 25px; }
  .intro__body { font-size: 16px; line-height: 1.6; }

  .facts { padding-top: 48px; }
  .facts__grid { grid-template-columns: 1fr; }
  .facts__grid > div {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 16px;
    padding: 18px 0;
    border-left: 0;
  }
  .facts__grid > div + div { border-top: 1px solid var(--line); }
  .facts dt { font-size: 11px; padding-top: 6px; }
  .facts dd { margin-top: 0; font-size: 14px; }
  .facts dd strong { font-size: 22px; margin-bottom: 4px; }

  .split { grid-template-columns: 1fr; gap: 20px; }
  .split__head { gap: 20px; }
  .split__head .muted { max-width: none; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .timeline__time { font-size: 22px; }
  .timeline p { margin-top: 6px; font-size: 15px; }
  .prose { font-size: 16px; gap: 20px; }

  .prize { gap: 16px; padding: 32px 28px 48px; border-width: 1.4px; }
  .prize::before { inset: 6px; border-width: 1px; }
  .prize h2 { font-size: 36px; }
  .prize .muted { font-size: 16px; }
  .prize__note { font-size: 20px; }

  address { font-size: 22px; }
  .map__frame { height: 280px; }

  .partners { gap: 20px; }
  .logos { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .logos li { height: 88px; }

  .footer { padding: 80px 12px 32px; }
  .footer__bye { padding: 32px 0 20px; }
  .footer__bye img { width: 96px; height: 96px; }
  .footer__bye p { font-size: 26px; }
  .footer__row { flex-direction: column; gap: 20px; text-align: center; }
  .footer__club { flex-direction: column; gap: 12px; font-size: 13px; }
  .footer__copy { font-size: 11px; }
}

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

.page-404 { min-height: 80vh; justify-content: center; }

/* Animacje – tylko gdy użytkownik nie prosi o ograniczenie ruchu */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-5px) rotate(-0.6deg); }
  65% { transform: translateY(3px) rotate(0.5deg); }
}
@keyframes sway {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(2.5deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__kicker { animation: fade 0.9s ease-out both; }
  .hero__title { animation: rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both; }
  .hero__art {
    transform-origin: 50% 85%;
    animation:
      rise 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both,
      bob 7s ease-in-out 1.6s infinite;
  }
  .hero__row { animation: fade 1s ease-out 0.9s both; }

  .motion [data-reveal] { opacity: 0; transform: translateY(18px); }
  .motion [data-reveal].is-visible {
    opacity: 1;
    transform: none;
    transition:
      opacity 0.8s ease-out var(--reveal-delay, 0ms),
      transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0ms);
  }

  /* Linie rysowane od lewej */
  .motion .facts__grid[data-draw],
  .motion .timeline[data-draw] { border-color: transparent; position: relative; }
  .motion .facts__grid[data-draw]::before, .motion .facts__grid[data-draw]::after,
  .motion .timeline[data-draw]::before, .motion .timeline[data-draw]::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--navy);
    transform: scaleX(0);
    transform-origin: left;
  }
  .motion .facts__grid[data-draw]::before, .motion .timeline[data-draw]::before { top: -1px; }
  .motion .facts__grid[data-draw]::after, .motion .timeline[data-draw]::after { bottom: -1px; }
  .motion [data-draw].is-visible::before, .motion [data-draw].is-visible::after { transform: scaleX(1); transition: transform 1.2s cubic-bezier(0.6, 0, 0.2, 1); }
  .motion [data-draw].is-visible::after { transition-delay: 0.25s; }

  .motion .footer__rule[data-draw] { transform: scaleX(0); transform-origin: left; }
  .motion .footer__rule[data-draw].is-visible { transform: none; transition: transform 1.4s cubic-bezier(0.6, 0, 0.2, 1); }

  /* Ramka konkursu: czerwona ramka „dosuwa się” do granatowej */
  .motion .prize[data-draw]::before { opacity: 0; transform: scale(0.985); }
  .motion .prize[data-draw].is-visible::before { opacity: 1; transform: none; transition: opacity 1s ease-out 0.3s, transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s; }

  /* Ilustracje w sekcjach delikatnie kołyszą się na wodzie */
  .motion .prize__art.is-visible { animation: bob 8s ease-in-out 1s infinite; transform-origin: 50% 80%; }
  .motion .footer__bye img.is-visible { animation: sway 6s ease-in-out 1s infinite; transform-origin: 50% 0; }
}
