:root {
  --green: #023128;
  --gold: #b79445ff;
  --graphite: #323232;
  --white: #ffffff;
  --gray-50: #f8f8f7;
  --gray-100: #f1f1f0;
  --gray-200: #e2e2df;
  --gray-300: #d1d1ce;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.08);
  --shadow-tiny: 0 8px 18px rgba(0, 0, 0, 0.06);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Brygada 1918", serif;
  color: var(--graphite);
  background: var(--gray-50);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

main a:not(.btn):not(.nav-links a):not(.fb-link):not(.dot-link):not(.link-button) {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 22px 0 14px;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--green);
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-tiny);
}

.nav-toggle i {
  font-size: 1rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.95rem;
}

.nav-links a {
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  padding-bottom: 72px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/images/hero.jpg");
  background-size: cover;
  background-position: right center;
  opacity: 0.9;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(248, 248, 247, 0.94);
  clip-path: polygon(0 0, 68% 0, 54% 100%, 0 100%);
  box-shadow: 60px 0 80px rgba(248, 248, 247, 0.8);
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
  padding: 40px 0 10px;
  max-width: 720px;
}

.hero-copy {
  display: grid;
  gap: 0;
}

.hero-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 12px;
}

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

h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 0 0 10px;
  color: var(--green);
  line-height: 1.1;
}

.subtitle {
  font-size: 1.1rem;
  margin: 0 0 18px;
}

.lead {
  margin: 0 0 22px;
  max-width: 60ch;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-tiny);
}

.btn i {
  font-size: 0.95rem;
}

.btn.primary {
  background: var(--green);
  color: var(--white);
}

.btn.ghost {
  background: var(--white);
  color: var(--green);
  border-color: var(--gray-300);
}

.btn:hover {
  transform: translateY(-1px);
}

.image-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-tiny);
}

.image-card img {
  width: 100%;
  height: auto;
  display: block;
}

.image-card figcaption {
  padding: 12px 16px;
  font-size: 0.92rem;
  color: var(--graphite);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}

.section {
  padding: 80px 0;
}

.section-muted {
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 18px;
  color: var(--green);
}

.section-head h2 {
  margin: 0;
}

p {
  margin: 0 0 18px;
}

.map-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: stretch;
}

.map-card {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.map-card img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  background: var(--gray-50);
}

.dot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.dot-item {
  position: relative;
  padding: 14px 16px 14px 44px;
  border-radius: 14px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  box-shadow: var(--shadow-tiny);
}

.dot-item::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot);
  left: 18px;
  top: 20px;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.dot-title {
  display: block;
  font-weight: 700;
  color: var(--graphite);
  margin-bottom: 6px;
}

.dot-meta {
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--graphite);
}

.dot-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--green);
}

.dot-link-text {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.age-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 28px 0 32px;
}

.age-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 16px;
  min-height: 120px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  color: var(--green);
  box-shadow: var(--shadow-tiny);
}

.age-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 0;
  background: transparent;
}

.age-text {
  display: grid;
  gap: 6px;
}

.age-title {
  font-weight: 600;
  color: var(--green);
}

.age-range {
  font-weight: 400;
  color: var(--graphite);
  font-size: 0.95rem;
}

.join-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: stretch;
}

.join-text {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-tiny);
  height: 100%;
}

.join-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.join-logo {
  width: 120px;
  height: auto;
  margin-top: 16px;
}

.fb-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  justify-items: center;
  box-shadow: var(--shadow-tiny);
  align-self: stretch;
  height: 100%;
}

.fb-card iframe {
  width: 100%;
  max-width: 340px;
  height: 100%;
  min-height: 420px;
  border: 0;
}

.fb-link {
  font-size: 0.85rem;
  color: var(--graphite);
  word-break: break-all;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.join-gallery {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.join-gallery .image-card img {
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

.donation-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.donation-text {
  display: grid;
  gap: 12px;
}

.donation-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-tiny);
  display: grid;
  gap: 8px;
  align-content: start;
}

.donation-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.04em;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.links-group {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-tiny);
  display: grid;
  gap: 16px;
}

.links-group h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.links-group h3 i {
  color: var(--gold);
  font-size: 1rem;
}

.links-buttons {
  display: grid;
  gap: 10px;
}

.link-button {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--green);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  box-shadow: var(--shadow-tiny);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.link-button:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
}

.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--graphite);
  font-size: 0.9rem;
  text-align: center;
}

.footer-stars {
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  color: var(--gold);
  margin-bottom: 6px;
}

.footer-copy {
  font-size: 0.9rem;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.patron-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 32px;
  align-items: center;
}

.portrait img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.komenda-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.komenda-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  align-items: stretch;
}

.info-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-tiny);
}

.komenda-address {
  height: 100%;
  min-height: 320px;
  align-content: start;
}

.komenda-address-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 6px;
}

.komenda-map {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-tiny);
  height: 100%;
  min-height: 320px;
}

.komenda-map iframe {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
}

.role {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow-tiny);
}

.role-lead {
  grid-column: 1 / -1;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}

.role-content {
  display: grid;
  gap: 8px;
}

.role-desc {
  margin: 0;
  font-size: 0.98rem;
  color: var(--graphite);
}

.komendant-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

.role-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
}

.role-value {
  font-weight: 600;
}

.timeline {
  display: grid;
  gap: 20px;
  margin: 32px auto 0;
  max-width: 1000px;
  width: 100%;
}

.timeline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 4px;
}

.timeline-hint {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--green);
}

.timeline-controls {
  display: flex;
  gap: 10px;
}

.timeline-nav {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--green);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-tiny);
  transition: transform 0.2s ease;
}

.timeline-nav:hover {
  transform: translateY(-2px);
}

.timeline-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.timeline-nav:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.timeline-track {
  position: relative;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 20px 18px 28px;
  box-shadow: var(--shadow-tiny);
  overflow: hidden;
}

.timeline-track::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 38px;
  height: 2px;
  background: var(--gray-300);
  pointer-events: none;
}

.timeline-scroller {
  position: relative;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 8px 6px 16px;
  transition: transform 0.4s ease;
  will-change: transform;
}

.timeline-year {
  position: relative;
  flex: 0 0 clamp(200px, 22vw, 250px);
  padding: 56px 16px 16px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-tiny);
  display: grid;
  gap: 12px;
  min-height: 210px;
  align-content: start;
}

.timeline-year::before {
  content: "";
  position: absolute;
  top: 34px;
  left: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(183, 148, 69, 0.18);
  pointer-events: none;
}

.year-pill {
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--green);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  align-self: start;
  justify-self: start;
}

.timeline-events {
  display: grid;
  gap: 10px;
  align-content: start;
}

.timeline-event {
  position: relative;
  padding: 12px 14px 12px 34px;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--graphite);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  text-align: left;
  line-height: 1.4;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  min-height: 56px;
}

.timeline-event.is-komendant {
  background: #fff5f5;
  border-color: #e0a4a4;
}

.timeline-event.is-komendant::before {
  background: #b85757;
  opacity: 0.8;
}

.timeline-event.is-komendant.is-active {
  background: #ffecec;
  border-color: #c86a6a;
}

.timeline-event::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.6;
}

.timeline-event:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-tiny);
}

.timeline-event:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.timeline-event.is-active {
  background: var(--white);
  border-color: var(--gold);
}

.timeline-event.is-active::before {
  background: var(--gold);
  opacity: 1;
}

.timeline-detail {
  background: var(--white);
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-tiny);
  display: grid;
  gap: 10px;
  border-left: 4px solid var(--gold);
}

.detail-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
}

.detail-body {
  display: grid;
  gap: 8px;
}

.detail-year {
  font-weight: 600;
  color: var(--green);
}

.detail-text {
  margin: 0;
  font-size: 1rem;
}

@media (max-width: 900px) {
  .nav {
    gap: 12px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 8px;
  }

  .nav-links.is-open {
    display: flex;
  }

  .hero-grid,
  .map-grid,
  .join-grid,
  .split,
  .patron-grid,
  .donation-grid,
  .links-grid {
    grid-template-columns: 1fr;
  }

  .hero::after {
    clip-path: polygon(0 0, 85% 0, 70% 100%, 0 100%);
  }

  .komenda-top {
    grid-template-columns: 1fr;
  }

  .join-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .age-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .komenda-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    max-width: 100%;
  }

  .timeline-year {
    flex-basis: clamp(260px, 70vw, 360px);
  }
}

@media (max-width: 600px) {
  .map-card {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 10px;
    border-radius: 0;
  }

  .map-card img {
    width: 100%;
    height: auto;
    max-height: none;
  }

  .komenda-map,
  .komenda-map iframe {
    min-height: 380px;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .lead {
    font-size: 0.98rem;
  }

  .age-grid {
    grid-template-columns: 1fr;
  }

  .hero::after {
    clip-path: polygon(0 0, 92% 0, 78% 100%, 0 100%);
  }

  .join-gallery {
    grid-template-columns: 1fr;
  }

  .role-lead {
    grid-template-columns: 1fr;
  }

  .timeline-year {
    flex-basis: 85vw;
  }

  .nav {
    padding-bottom: 18px;
  }

  .nav-links {
    gap: 8px 14px;
  }

  .timeline-top {
    align-items: flex-start;
  }

  .timeline-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
