:root {
  --ink: #172033;
  --navy: #15233b;
  --navy-soft: #263957;
  --paper: #f3efe5;
  --paper-light: #fbf8f0;
  --white: #fffdf8;
  --red: #a53a32;
  --red-dark: #7d2722;
  --gold: #b58a45;
  --muted: #6f706d;
  --line: #d6cfc0;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 1240px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% 8%, rgba(181, 138, 69, .08), transparent 23rem),
    var(--paper-light);
  font-family: var(--sans);
  line-height: 1.6;
}
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: .7rem 1rem;
  background: var(--white);
  color: var(--navy);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.site-header {
  min-height: 82px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  letter-spacing: .11em;
}
.brand-abceo { font-weight: 900; font-size: 1.05rem; }
.brand-divider { width: 1px; height: 1.7rem; background: var(--red); }
.brand-name { font-family: var(--serif); font-size: .9rem; }
.site-nav { display: flex; align-items: center; gap: 2rem; font-size: .84rem; font-weight: 700; }
.site-nav a { text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--red); }

.hero {
  max-width: var(--max);
  min-height: 590px;
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .75fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 8rem);
  overflow: hidden;
}
.eyebrow {
  margin: 0 0 .9rem;
  color: var(--red);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.hero h1, .detail-title h1, .method-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .98;
}
.hero h1 { max-width: 760px; font-size: clamp(4rem, 8vw, 7.4rem); }
.hero h1 span { color: var(--red); font-style: italic; }
.hero h1 b { font: inherit; }
.hero-lead { max-width: 650px; margin: 2rem 0; color: #4f5360; font-size: 1.12rem; }
.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 1.7rem;
  padding: .9rem 1.1rem;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .03em;
  transition: background .2s, transform .2s;
}
.primary-button:hover, .primary-button:focus-visible { background: var(--red-dark); transform: translateY(-2px); }
.primary-button.dark { margin-top: 2rem; background: var(--navy); }
.hero-date {
  position: relative;
  aspect-ratio: 1 / 1.08;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--navy);
  color: var(--white);
  box-shadow: 24px 24px 0 rgba(165, 58, 50, .12);
}
.hero-date::before, .hero-date::after {
  content: "";
  position: absolute;
  inset: 1.2rem;
  border: 1px solid rgba(255, 255, 255, .16);
}
.hero-date::after { inset: 2rem; border-color: rgba(181, 138, 69, .35); }
.hero-roman { font-family: var(--serif); font-size: clamp(7rem, 14vw, 12rem); line-height: .8; color: #fff; }
.hero-month { margin-top: 1.7rem; color: #d8c49c; font-size: .76rem; font-weight: 800; letter-spacing: .32em; text-transform: uppercase; }
.hero-stats { position: absolute; bottom: 3.1rem; font-size: .7rem; color: rgba(255, 255, 255, .64); }

.intro-band {
  padding: 1.25rem max(1.5rem, calc((100vw - var(--max)) / 2 + 1.5rem));
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  background: var(--navy);
  color: rgba(255,255,255,.76);
  font-size: .85rem;
}
.intro-band p { margin: 0; max-width: 800px; }
.intro-band strong { color: #fff; }
.intro-band a { flex: none; color: #e5cf9d; font-weight: 800; text-underline-offset: .25em; }

.calendar-section, .events-section, .context-section, .detail-page, .method-page {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.calendar-section { padding-top: 6rem; padding-bottom: 4rem; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.month-switcher { margin: 2rem 0 1.2rem; display: flex; flex-wrap: wrap; gap: .55rem; }
.month-link { padding: .55rem .9rem; border: 1px solid var(--line); color: var(--navy); font-size: .75rem; font-weight: 800; text-decoration: none; }
.month-link:hover, .month-link:focus-visible, .month-link.is-active { border-color: var(--red); background: var(--red); color: #fff; }
.months-page { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 7rem 0 8rem; }
.months-header { max-width: 720px; margin-bottom: 3rem; }
.months-header h1 { margin: .35rem 0 1rem; font-family: var(--serif); font-size: clamp(4rem, 9vw, 8rem); font-weight: 400; line-height: .9; }
.months-header > p:last-child { color: var(--muted); font-size: 1.05rem; }
.months-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.month-card { min-height: 330px; padding: 2rem; display: flex; flex-direction: column; background: var(--white); color: var(--navy); text-decoration: none; }
.month-card:hover, .month-card:focus-visible { background: var(--navy); color: #fff; }
.month-card-number { margin-bottom: auto; color: var(--red); font-family: var(--serif); font-size: 5rem; line-height: 1; }
.month-card strong { margin: .5rem 0 1rem; font-family: var(--serif); font-size: 2.6rem; font-weight: 400; }
.month-card > span:last-child { color: var(--muted); font-size: .8rem; font-weight: 700; }
.month-card:hover > span:last-child, .month-card:focus-visible > span:last-child { color: #d9deea; }
.section-heading h2, .context-copy h2, .source-card h2, .method-source h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4.7rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.04em;
}
.reset-button {
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: .2rem 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
}
.calendar-help { margin: 2rem 0 1rem; color: var(--muted); font-size: .82rem; }
.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.day {
  position: relative;
  min-height: 105px;
  padding: .85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.35);
  cursor: default;
}
.day.has-events { background: var(--white); cursor: pointer; }
.day.has-events::after { content: ""; position: absolute; right: .8rem; top: .8rem; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.day.has-events:hover, .day.has-events:focus-visible { z-index: 2; outline: 2px solid var(--red); outline-offset: -2px; }
.day.is-active { background: var(--red); color: #fff; outline: 2px solid var(--red-dark); outline-offset: -2px; }
.day.is-active::after { background: #fff; }
.day-number { font-family: var(--serif); font-size: 1.7rem; line-height: 1; }
.day-count, .day-empty { font-size: .68rem; color: var(--muted); }
.day.is-active .day-count { color: #fff; }
.day-empty { opacity: .55; }
.calendar-legend { display: flex; gap: 2rem; margin-top: 1.1rem; color: var(--muted); font-size: .7rem; }
.calendar-legend span { display: inline-flex; align-items: center; gap: .5rem; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.legend-dot.has-content { background: var(--red); }

.events-section { padding-top: 4rem; padding-bottom: 7rem; }
.events-heading { padding-bottom: 1.7rem; border-bottom: 1px solid var(--line); }
.result-count { margin: 0; color: var(--muted); font-size: .8rem; }
.result-count strong { color: var(--ink); font-family: var(--serif); font-size: 2rem; font-weight: 400; }
.filters { margin: 1rem 0 2.5rem; display: flex; flex-wrap: wrap; gap: .55rem; }
.filter { padding: .5rem .85rem; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: .72rem; font-weight: 800; }
.filter:hover, .filter:focus-visible, .filter.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.event-card { position: relative; min-height: 405px; padding: 1.5rem; display: flex; flex-direction: column; background: var(--white); overflow: hidden; }
.event-card[hidden] { display: none; }
.event-card-top { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.event-date { color: var(--red); font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.certainty { display: inline-block; padding: .24rem .42rem; border: 1px solid currentColor; color: var(--muted); font-size: .58rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.certainty-wnioskowana { color: #8b6628; }
.certainty-bez-dnia { color: var(--red); }
.event-year { position: absolute; right: -.12em; top: .16em; color: rgba(21, 35, 59, .045); font-family: var(--serif); font-size: 5.1rem; line-height: 1; pointer-events: none; }
.event-category { margin: 4.8rem 0 .5rem; color: var(--muted); font-size: .66rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.event-card h3 { position: relative; margin: 0; font-family: var(--serif); font-size: 1.7rem; font-weight: 400; line-height: 1.12; }
.event-card h3 a { text-decoration: none; }
.event-card h3 a::after { content: ""; position: absolute; inset: -12rem -2rem -12rem; }
.event-card h3 a:hover { color: var(--red); }
.event-card > p:not(.event-category) { position: relative; margin: 1rem 0 1.4rem; color: #5c5d60; font-size: .85rem; }
.read-more { position: relative; z-index: 2; margin-top: auto; align-self: flex-start; color: var(--red); font-size: .73rem; font-weight: 900; text-decoration: none; }
.read-more span { display: inline-block; margin-left: .4rem; transition: transform .2s; }
.read-more:hover span { transform: translateX(.25rem); }
.empty-state { padding: 5rem 1.5rem; border: 1px solid var(--line); text-align: center; background: var(--white); }
.empty-state span { color: var(--red); font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
.empty-state h3 { margin: .6rem 0; font: 400 2rem var(--serif); }
.empty-state p { max-width: 570px; margin: 0 auto; color: var(--muted); }

.context-section {
  position: relative;
  max-width: none;
  padding: 6rem max(1.5rem, calc((100vw - var(--max)) / 2 + 1.5rem));
  display: grid;
  grid-template-columns: .6fr .8fr 1.25fr;
  align-items: center;
  gap: 3rem;
  background: var(--paper);
  overflow: hidden;
}
.context-number { color: rgba(165,58,50,.11); font-family: var(--serif); font-size: clamp(9rem, 18vw, 18rem); line-height: .7; }
.context-copy p:last-child { color: var(--muted); }
.context-cards { border: 1px solid var(--line); }
.context-cards .event-card { min-height: 380px; }

.site-footer {
  padding: 3rem max(1.5rem, calc((100vw - var(--max)) / 2 + 1.5rem));
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  background: var(--navy);
  color: rgba(255,255,255,.65);
}
.brand-footer { color: #fff; font: 700 .8rem var(--serif); letter-spacing: .13em; }
.site-footer p { margin: .5rem 0 0; font-size: .8rem; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; font-size: .76rem; }
.footer-links a { color: #fff; text-underline-offset: .25em; }

.detail-page { padding-top: 2rem; padding-bottom: 6rem; }
.breadcrumbs { display: flex; gap: .6rem; color: var(--muted); font-size: .72rem; }
.breadcrumbs a { color: var(--red); }
.detail-header { min-height: 500px; padding: 5rem 0; display: grid; grid-template-columns: 230px 1fr; gap: clamp(2rem, 7vw, 7rem); align-items: start; border-bottom: 1px solid var(--line); }
.detail-date-block { position: sticky; top: 2rem; display: flex; flex-direction: column; padding: 1.5rem; background: var(--navy); color: #fff; }
.detail-date-block span { color: #d6c59f; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-date-block strong { margin-top: 1rem; font: 400 3.7rem var(--serif); }
.detail-title .event-category { margin: 0 0 1rem; }
.detail-title h1 { max-width: 850px; font-size: clamp(3.6rem, 7vw, 6.8rem); }
.detail-lead { max-width: 780px; margin: 2rem 0 1.3rem; color: #4e5260; font: 400 clamp(1.2rem, 2vw, 1.55rem) var(--serif); line-height: 1.5; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(3rem, 8vw, 7rem); padding: 5rem 0; align-items: start; }
.detail-body { max-width: 720px; }
.detail-body > p { margin: 0 0 1.5rem; font: 400 1.12rem/1.85 var(--serif); }
.detail-body > p:first-child::first-letter { float: left; margin: .12em .12em 0 0; color: var(--red); font-size: 4.8rem; line-height: .7; }
.editorial-note { margin-top: 3rem; padding: 1.5rem; border-left: 3px solid var(--red); background: var(--paper); }
.editorial-note span { color: var(--red); font-size: .65rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.editorial-note p { margin: .5rem 0 0; color: #595c63; font-size: .84rem; }
.source-card { padding: 1.7rem; border-top: 3px solid var(--navy); background: var(--paper); }
.source-card h2 { font-size: 2rem; }
.source-card dl { margin: 1.5rem 0; }
.source-card dl div { padding: .9rem 0; border-top: 1px solid var(--line); }
.source-card dt { color: var(--muted); font-size: .62rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.source-card dd { margin: .3rem 0 0; font: 400 .95rem/1.4 var(--serif); }
.source-card a { color: var(--red); font-size: .72rem; font-weight: 900; }
.detail-back { padding-top: 2rem; border-top: 1px solid var(--line); }
.detail-back a { color: var(--red); font-size: .8rem; font-weight: 900; text-decoration: none; }

.method-page { padding-top: 5rem; padding-bottom: 7rem; }
.method-hero { max-width: 980px; padding-bottom: 5rem; }
.method-hero h1 { font-size: clamp(4rem, 9vw, 8rem); }
.method-hero > p:last-child { max-width: 680px; margin-top: 2rem; color: var(--muted); font: 400 1.35rem/1.55 var(--serif); }
.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.method-grid section { min-height: 300px; padding: 2rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.35); }
.method-grid span { color: var(--red); font: 400 2.7rem var(--serif); }
.method-grid h2 { margin: 2rem 0 .6rem; font: 400 1.9rem var(--serif); }
.method-grid p { margin: 0; max-width: 470px; color: var(--muted); }
.method-source { margin-top: 5rem; padding: 3rem; display: grid; grid-template-columns: .6fr 1.4fr; gap: 3rem; background: var(--paper); }
.method-source p:last-child { margin: 0; color: #565962; }

@media (max-width: 900px) {
  .hero { min-height: 0; grid-template-columns: 1fr; padding-top: 4rem; }
  .hero-date { max-width: 520px; width: 100%; justify-self: center; }
  .events-grid { grid-template-columns: repeat(2, 1fr); }
  .context-section { grid-template-columns: .45fr 1fr; }
  .context-cards { grid-column: 1 / -1; }
  .detail-header { grid-template-columns: 180px 1fr; gap: 2rem; }
  .detail-layout { grid-template-columns: 1fr; }
  .source-card { max-width: 600px; }
}

@media (max-width: 680px) {
  .site-header { min-height: 72px; }
  .site-nav a:not(:last-child) { display: none; }
  .brand-name { font-size: .76rem; }
  .hero { padding-top: 3rem; padding-bottom: 3rem; }
  .hero h1 { font-size: clamp(3.5rem, 18vw, 5rem); }
  .hero-lead { font-size: 1rem; }
  .intro-band { display: block; }
  .intro-band a { display: inline-block; margin-top: .8rem; }
  .calendar-section { padding-top: 4rem; }
  .days-grid { grid-template-columns: repeat(4, 1fr); }
  .day { min-height: 82px; }
  .calendar-legend { flex-direction: column; gap: .4rem; }
  .events-grid { grid-template-columns: 1fr; }
  .event-card { min-height: 370px; }
  .context-section { grid-template-columns: 1fr; gap: 2rem; padding-top: 4rem; }
  .context-number { position: absolute; right: -.2em; top: .3em; }
  .context-copy { position: relative; }
  .site-footer { flex-direction: column; }
  .detail-header { min-height: 0; grid-template-columns: 1fr; padding: 3rem 0; }
  .detail-date-block { position: static; max-width: 210px; }
  .detail-title h1 { font-size: clamp(3rem, 14vw, 4.6rem); }
  .detail-layout { padding: 3rem 0; }
  .method-page { padding-top: 3rem; }
  .method-grid { grid-template-columns: 1fr; }
  .method-source { padding: 2rem; grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .site-header, .site-footer, .filters, .primary-button, .intro-band { display: none; }
  body { background: #fff; }
  .hero { min-height: 0; padding: 2rem 0; }
  .hero-date { box-shadow: none; }
}
