/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --green: #072821;
  --burgundy: #7e2625;
  --cream: #f5efdf;
  --muted-cream: rgba(245, 239, 223, 0.76);
  --olive: #8a9a5b;
  --line-dark: rgba(245, 239, 223, 0.16);
  --line-soft: rgba(245, 239, 223, 0.08);

  --font-serif: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --page-x: clamp(1.125rem, 4.5vw, 4rem);
  --page-y: clamp(0.875rem, 2vw, 1.5rem);
  --container-max: 1320px;
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--green);
  background-image:
    radial-gradient(900px 500px at 85% 15%, rgba(138, 154, 91, 0.14), transparent 60%),
    radial-gradient(700px 700px at 12% 95%, rgba(126, 38, 37, 0.16), transparent 70%),
    url('../assets/bg-dark.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: clamp(0.9375rem, 0.2vw + 0.875rem, 1rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -190px auto auto -220px;
  width: min(820px, 76vw);
  height: min(460px, 42vw);
  background:
    linear-gradient(45deg, rgba(245, 239, 223, 0.20) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(245, 239, 223, 0.20) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(245, 239, 223, 0.20) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(245, 239, 223, 0.20) 75%);
  background-size: 88px 88px;
  background-position: 0 0, 0 44px, 44px -44px, -44px 0;
  filter: blur(7px);
  opacity: 0.12;
  transform: rotate(-12deg);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; display: block; }

.top, .stage, .ribbon { position: relative; z-index: 1; }

/* ============================================================
   Header
   ============================================================ */
.top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--page-y) var(--page-x);
}

.top__brand { display: inline-flex; }
.top__brand img {
  width: clamp(7rem, 13vw, 12.8125rem);
  height: auto;
  filter: brightness(0) saturate(100%) invert(95%) sepia(14%) saturate(401%) hue-rotate(342deg) brightness(102%) contrast(92%);
}

.top__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  font-family: var(--font-mono);
  font-size: clamp(0.5625rem, 0.3vw + 0.5rem, 0.6875rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 239, 223, 0.75);
  white-space: nowrap;
  background: rgba(7, 40, 33, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.top__meta--link {
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.top__meta--link:hover,
.top__meta--link:focus-visible {
  color: var(--cream);
  border-color: rgba(245, 239, 223, 0.45);
  background: rgba(245, 239, 223, 0.08);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 0 4px rgba(138, 154, 91, 0.20);
  animation: pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(138, 154, 91, 0.20); }
  50%      { box-shadow: 0 0 0 9px rgba(138, 154, 91, 0); }
}

/* ============================================================
   Stage
   ============================================================ */
.stage {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding: clamp(1rem, 2vw, 2rem) var(--page-x) clamp(1.5rem, 3vw, 3rem);
}

.copy { max-width: 45rem; }

.eyebrow {
  position: relative;
  margin-bottom: clamp(0.75rem, 1.5vw, 1.5rem);
  padding-left: 40px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--olive);
}

.eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 28px;
  height: 1px;
  background: var(--olive);
  transform: translateY(-50%);
}

h1 {
  max-width: 14ch;
  margin: 0;
  color: var(--cream);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.625rem, 0.75rem + 3.1vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 em {
  color: var(--olive);
  font-style: italic;
  font-weight: 500;
}

.lead {
  max-width: 52ch;
  margin: clamp(0.875rem, 1.5vw, 1.75rem) 0 0;
  color: var(--muted-cream);
  font-size: clamp(0.9375rem, 0.3vw + 0.875rem, 1.125rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.opening-date {
  max-width: 33rem;
  margin-top: clamp(1rem, 2vw + 0.25rem, 2.5rem);
  padding: clamp(0.875rem, 1vw + 0.5rem, 1.375rem) clamp(1rem, 1vw + 0.75rem, 1.625rem);
  background: rgba(245, 239, 223, 0.05);
  border: 1px solid var(--line-dark);
  border-radius: 18px;
}

.label {
  margin-bottom: 6px;
  color: var(--olive);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.value {
  color: var(--cream);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.875rem, 1rem + 2.5vw, 4rem);
  line-height: 1;
}

/* ============================================================
   Countdown
   ============================================================ */
.countdown {
  display: flex;
  align-items: flex-start;
  gap: clamp(0.25rem, 1vw, 0.75rem);
  margin-top: 2px;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(2.75rem, 5.5vw, 4.75rem);
}

.countdown__num {
  color: var(--cream);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.875rem, 1rem + 2.5vw, 4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.countdown__cap {
  margin-top: 7px;
  color: rgba(245, 239, 223, 0.55);
  font-family: var(--font-mono);
  font-size: clamp(0.5rem, 0.2vw + 0.45rem, 0.625rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.countdown__sep {
  color: var(--olive);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 0.6rem + 1.6vw, 2.5rem);
  line-height: 1.15;
  opacity: 0.5;
}

/* Widoczne tylko dla czytnikow ekranu — cyfry aktualizuja sie co sekunde,
   wiec pelny komunikat podajemy osobno i rzadziej */
.countdown__live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.countdown__date {
  margin-top: clamp(0.75rem, 1.2vw, 1.125rem);
  padding-top: clamp(0.625rem, 1vw, 0.875rem);
  border-top: 1px solid var(--line-dark);
  color: var(--muted-cream);
  font-family: var(--font-mono);
  font-size: clamp(0.6875rem, 0.2vw + 0.625rem, 0.8125rem);
  letter-spacing: 0.08em;
}

/* Stan po otwarciu — licznik zastapiony komunikatem */
.opening-date.is-open .countdown,
.opening-date.is-open .countdown__date {
  display: none;
}

.countdown__open {
  color: var(--cream);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 0.8rem + 2vw, 3rem);
  line-height: 1.1;
}

.signature {
  margin-top: clamp(1rem, 2vw + 0.25rem, 2.25rem);
  color: rgba(245, 239, 223, 0.6);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.125rem, 0.3vw + 1rem, 1.375rem);
}

/* ============================================================
   Visual — mobile-first
   ============================================================ */
.visual {
  position: relative;
  display: block;
  border-radius: clamp(18px, 2vw, 28px);
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  background: rgba(245, 239, 223, 0.06);
  /* Grafika jest pionowa 2:3 i ma wypalone haslo w gornej czesci --
     ramka trzyma te proporcje, zeby cover nie obcial napisu */
  aspect-ratio: 2 / 3;
  width: 100%;
  max-width: 24rem;
  margin-inline: auto;
  margin-top: clamp(1.25rem, 3vw, 2rem);
}

.visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   Footer (ribbon)
   ============================================================ */
.ribbon {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: clamp(0.875rem, 1.5vw, 1.75rem) var(--page-x);
  border-top: 1px solid var(--line-soft);
  color: rgba(245, 239, 223, 0.62);
  font-size: clamp(0.75rem, 0.2vw + 0.7rem, 0.8125rem);
  background: rgba(7, 40, 33, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.ribbon h2 {
  margin: 0 0 4px;
  color: rgba(245, 239, 223, 0.45);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.ribbon p { margin: 0; line-height: 1.5; }

.ribbon a {
  color: var(--olive);
  border-bottom: 1px solid rgba(138, 154, 91, 0.4);
  padding-bottom: 1px;
  transition: color 160ms ease, border-color 160ms ease;
}

.ribbon a:hover,
.ribbon a:focus-visible {
  color: var(--cream);
  border-color: var(--cream);
}

/* ============================================================
   Social links
   ============================================================ */
.social {
  display: flex;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.social__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  color: rgba(245, 239, 223, 0.72);
  background: rgba(245, 239, 223, 0.05);
  font-family: var(--font-mono);
  font-size: clamp(0.625rem, 0.2vw + 0.5625rem, 0.6875rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.social__link:hover,
.social__link:focus-visible {
  color: var(--cream);
  border-color: rgba(138, 154, 91, 0.55);
  background: rgba(138, 154, 91, 0.14);
}

.social__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Footer <a> ma podkreslenie — tu go nie chcemy */
.ribbon .social__link {
  border-bottom: 1px solid var(--line-dark);
  padding-bottom: 6px;
}

.ribbon .social__link:hover,
.ribbon .social__link:focus-visible {
  border-color: rgba(138, 154, 91, 0.55);
}

.legal {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: rgba(245, 239, 223, 0.4);
  font-family: var(--font-mono);
  font-size: clamp(0.625rem, 0.2vw + 0.55rem, 0.71875rem);
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}

/* ============================================================
   Document pages
   ============================================================ */
.document-body {
  display: block;
}

.document-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) var(--page-x) clamp(2rem, 5vw, 4rem);
}

.document-card {
  padding: clamp(1.25rem, 3vw, 3rem);
  border: 1px solid var(--line-dark);
  border-radius: 18px;
  background: rgba(245, 239, 223, 0.94);
  color: var(--green);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.document-card h1 {
  max-width: none;
  margin: 0 0 0.5rem;
  color: var(--green);
  font-size: clamp(2.25rem, 5vw, 4.5rem);
}

.document-card h2 {
  margin: 2rem 0 0.625rem;
  color: var(--burgundy);
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 1.2vw + 1.1rem, 2rem);
  font-weight: 600;
  line-height: 1.18;
}

.document-card p {
  margin: 0.7rem 0;
  color: rgba(7, 40, 33, 0.82);
}

.document-card .doc-meta {
  margin: 0.15rem 0;
  color: rgba(7, 40, 33, 0.62);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.document-card table {
  display: block;
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  overflow-x: auto;
}

.document-card td {
  min-width: 180px;
  padding: 0.75rem;
  border: 1px solid rgba(7, 40, 33, 0.22);
  vertical-align: top;
}

.document-card td p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ============================================================
   Breakpoints
   ============================================================ */

/* Two-column footer when there's room */
@media (min-width: 30rem) {
  .ribbon { grid-template-columns: 1fr 1fr; gap: 14px clamp(1.25rem, 3vw, 2rem); }
  .col--contact { text-align: right; justify-self: end; }
  .col--contact .social { justify-content: flex-end; }
}

/* Tablet: hide image (single column with image would be too cramped) */
@media (min-width: 37.5rem) and (max-width: 59.9375rem) {
  .visual { display: none; }
}

/* Desktop: 2-column stage with image side-by-side */
@media (min-width: 60rem) {
  .stage {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
  .visual {
    /* Te same proporcje co grafika — max-width liczony z dostepnej
       wysokosci, zeby kadr nie wychodzil poza ekran */
    aspect-ratio: 2 / 3;
    width: 100%;
    max-width: min(100%, calc((100vh - 14rem) * 2 / 3));
    margin: 0;
  }
}

/* Wide desktop: more generous logo */
@media (min-width: 90rem) {
  .top__brand img { width: 12.8125rem; }
}

/* Very narrow screens (small phones in portrait): hide badge to keep header compact */
@media (max-width: 22.5rem) {
  .top__meta { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .dot { animation: none; }
}

/* Fallback for browsers without background-attachment: fixed support on mobile */
@supports not (background-attachment: fixed) {
  html { background-attachment: scroll; }
}
