/* ===========================================
   BASE STYLES
   =========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Oswald', sans-serif;
  background-color: #000;
  color: #fff;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  max-width: var(--canvas-max-width);  /* TEST: constrain entire page to canvas width */
  margin-left: auto;
  margin-right: auto;
  /* Slajd w górę: zwija się bardzo wolno na początku, potem szybko przyspiesza (ease-in-quart) */
  transition: transform 0.6s cubic-bezier(0.5, 0, 0.75, 0);
}

body.kpo-pushed #app {
  /* Slajd w dół: mocno zwalnia w ostatniej fazie rozwijania, miękko osiadając na celu (ease-out-quint) */
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transform: translateY(90px);
}

/* Brak paska przewijania podczas animacji KPO – unikamy przeskoku layoutu */
html.kpo-pushed,
body.kpo-pushed,
html.kpo-closing,
body.kpo-closing {
  overflow-y: hidden;
}

/* KPO banner strip – fixed at top, revealed when #app slides down */
.kpo-banner-strip {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--canvas-max-width);  /* TEST: match #app constraint */
  height: 90px;
  background: #fff;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpo-banner-img {
  height: 90px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0;
  /* Elegancki fade-in zwalniający pod koniec */
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.kpo-banner-strip.kpo-banner-visible .kpo-banner-img {
  opacity: 1;
}

/* Header - full-width bg, content limited to canvas width */
#header {
  width: 100%;
  min-height: 112px;
  height: 112px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--header-bg-color);
  position: relative;
  z-index: 10;
}

.header-inner {
  width: 100%;
  max-width: var(--canvas-max-width);
  padding: var(--header-padding);
  display: flex;
  align-items: center;
  gap: 34px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  height: 72px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* Single-line variant — visible only at ultrawide (>1920px); see media query below. */
.header-logo-wide {
  display: none;
}

.header-logo-fallback {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--header-text-color);
}

/* Layout wrapper – no border, no padding (pills are now independent) */
.header-outer-pill {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Hidden for now – may be re-enabled later */
.header-lang {
  visibility: hidden;
  color: var(--header-text-color);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-0.07em);
}

.header-center {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.date-navigation {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
  flex-shrink: 1;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 72px;
  padding: 0 30px;
  color: var(--header-text-color);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 44px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  font-family: var(--font-primary);
}

.date-pill:hover:not(:disabled) {
  opacity: 0.9;
}

.date-pill:active:not(:disabled) {
  opacity: 0.7;
}

.date-pill:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.date-pill-icon {
  width: 85px;
  height: 8px;
  flex-shrink: 0;
}

.date-pill-label {
  min-width: 9ch;
  text-align: center;
}

.date-arrow {
  line-height: 1;
}

.date {
  font-size: 34px;
  font-weight: 400;
  color: var(--header-text-color);
  min-width: 10ch;
  text-align: center;
  line-height: 1;
  transform: translateY(-0.07em);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.header-fullscreen,
.header-sound {
  color: var(--header-text-color);
  font-weight: 400;
  font-size: 17px;
  line-height: 1;
  transform: translateY(-0.07em);
  font-family: var(--font-primary);
  letter-spacing: 0.02em;
}

.header-sound,
.header-fullscreen {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

/* Sound toggle: "SOUND:" label + sliding pill */
.header-sound {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sound-pill {
  position: relative;
  display: inline-block;
  width: 4.25em;   /* ≈72px at 17px — scales with font-size */
  height: 1.59em;  /* ≈27px at 17px */
  border: 1px solid currentColor;
  border-radius: 44px;
  overflow: hidden;
  flex-shrink: 0;
}

.sound-pill-off,
.sound-pill-on {
  position: absolute;
  top: 50%;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
  white-space: nowrap;
  line-height: 1;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease;
}

/* OFF: left side, visible by default */
.sound-pill-off {
  left: 0.6em;
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}

/* ON: right side, hidden until active — starts from left (OFF side) */
.sound-pill-on {
  right: 0.6em;
  transform: translateY(-50%) translateX(-0.5em);
  opacity: 0;
}

/* Active (sound ON) state — OFF slides right (toward ON), ON slides in from left */
#sound-toggle[aria-pressed="true"] .sound-pill-off {
  transform: translateY(-50%) translateX(0.5em);
  opacity: 0;
}

#sound-toggle[aria-pressed="true"] .sound-pill-on {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}

.header-about {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 72px;
  border: 1px solid var(--header-text-color);
  border-radius: 44px;
  color: var(--header-text-color);
  font-weight: 400;
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
  font-family: var(--font-primary);
  letter-spacing: 0.02em;
  transition: opacity var(--transition-fast);
}

.header-fullscreen:hover {
  text-decoration: underline;
}

.header-sound:hover .sound-label {
  text-decoration: underline;
}

.header-sound:hover .sound-pill {
  opacity: 0.8;
}

.header-about:hover {
  opacity: 0.85;
}

.header-sound:focus-visible,
.header-fullscreen:focus-visible,
.header-about:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

