:root {
  --sd-ink: #f4efe4;
  --sd-muted: rgba(244, 239, 228, 0.74);
  --sd-dim: rgba(244, 239, 228, 0.52);
  --sd-line: rgba(212, 160, 84, 0.24);
  --sd-panel: rgba(15, 13, 10, 0.72);
  --sd-panel-strong: rgba(17, 15, 12, 0.88);
  --sd-accent: #d4a054;
  --sd-accent-bright: #f0c878;
  --sd-teal: #4ecdc4;
  --sd-blue: #6fa8ff;
}

html {
  scroll-padding-top: 96px;
  background: #080706;
}

body {
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  letter-spacing: 0 !important;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--sd-accent-bright);
  outline-offset: 4px;
}

img {
  overflow: hidden;
}

.hero-orb {
  display: none !important;
}

.noise-overlay {
  opacity: 0.035 !important;
}

.scroll-progress {
  height: 3px !important;
  background: linear-gradient(90deg, var(--sd-accent), var(--sd-teal), var(--sd-blue)) !important;
  box-shadow: 0 0 18px rgba(78, 205, 196, 0.25);
}

.site-nav,
.site-nav.is-visible {
  top: 18px !important;
  width: min(980px, calc(100% - 28px));
  justify-content: center;
  gap: 4px !important;
  padding: 8px !important;
  border: 1px solid rgba(244, 239, 228, 0.1) !important;
  border-radius: 8px !important;
  background: rgba(8, 7, 6, 0.78) !important;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}

.site-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px !important;
  color: var(--sd-muted) !important;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover {
  color: var(--sd-ink) !important;
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.hero-section {
  min-height: min(860px, 94svh) !important;
  padding-top: 96px;
  display: flex;
  align-items: center;
}

.hero-section img {
  filter: brightness(0.28) contrast(1.08) saturate(0.86) !important;
  transform: scale(1.05) !important;
  object-position: center 44%;
}

.hero-section:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 7, 6, 0.78), rgba(8, 7, 6, 0.18) 45%, rgba(8, 7, 6, 0.72)),
    linear-gradient(180deg, rgba(8, 7, 6, 0.62), transparent 34%, rgba(8, 7, 6, 0.94));
}

.hero-section > .relative {
  max-width: 980px !important;
}

.hero-badge span {
  border-radius: 8px !important;
  background: rgba(8, 7, 6, 0.7) !important;
  color: var(--sd-accent-bright) !important;
}

.hero-section h1 {
  max-width: 960px;
  margin-inline: auto;
  text-wrap: balance;
  text-shadow: 0 18px 70px rgba(0, 0, 0, 0.75);
}

.hero-sub {
  margin-bottom: 26px !important;
}

.hero-sub p {
  color: rgba(244, 239, 228, 0.84) !important;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 auto 48px;
}

.hero-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid rgba(244, 239, 228, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--sd-ink);
  font-family: var(--font-display), system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.hero-action:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 200, 120, 0.55);
  background: rgba(255, 255, 255, 0.1);
}

.hero-action-primary {
  border-color: rgba(240, 200, 120, 0.5);
  background: linear-gradient(135deg, rgba(212, 160, 84, 0.95), rgba(151, 93, 47, 0.88));
  color: #120d08;
}

.marquee-section {
  background: linear-gradient(90deg, rgba(78, 205, 196, 0.08), rgba(212, 160, 84, 0.08), rgba(111, 168, 255, 0.08));
}

.narrative-band {
  background: linear-gradient(180deg, #080706, #11100e 52%, #080706);
}

.narrative-band img {
  filter: brightness(0.18) contrast(1.12) saturate(0.55) !important;
}

.editorial-quote {
  color: rgba(244, 239, 228, 0.92);
  text-shadow: 0 8px 46px rgba(0, 0, 0, 0.72);
}

.stat-inline,
.project-showcase,
.project-info-card,
#artykuly-historyczne-home .article-card,
.card,
.empty,
.index-note {
  border-radius: 8px !important;
}

.stat-inline {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)) !important;
  border: 1px solid rgba(244, 239, 228, 0.1) !important;
}

.project-showcase {
  min-height: min(820px, 92svh) !important;
  isolation: isolate;
}

.project-showcase-bg img,
.project-showcase img {
  filter: brightness(0.56) contrast(1.08) saturate(0.88) !important;
}

.project-cta,
.atlas-cta,
.social-link,
.nav-pill,
.content .film-link {
  border-radius: 8px !important;
}

.section-header p,
.project-description,
.articles-lead,
.article-excerpt,
.content,
.content p,
.card p {
  color: var(--sd-muted) !important;
}

#artykuly-historyczne-home {
  background: linear-gradient(180deg, rgba(78, 205, 196, 0.05), rgba(8, 7, 6, 0));
}

#artykuly-historyczne-home .articles-head {
  max-width: 760px !important;
}

#artykuly-historyczne-home .articles-grid {
  gap: 18px !important;
}

#artykuly-historyczne-home .article-card,
.card {
  border-color: rgba(244, 239, 228, 0.11) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.24)),
    linear-gradient(90deg, rgba(212, 160, 84, 0.08), rgba(78, 205, 196, 0.045)) !important;
}

.content img,
.content video,
.content iframe,
.youtube-player-container,
.instagram-player-container,
.detail-image,
.fun-fact-card,
.era-stat-card,
.narrator-inline-card {
  border-radius: 8px !important;
}

body.sd-history-page,
body.sd-history-page * {
  cursor: auto !important;
}

body.sd-history-page {
  background:
    radial-gradient(circle at 20% 0%, rgba(78, 205, 196, 0.08), transparent 28rem),
    radial-gradient(circle at 80% 12%, rgba(212, 160, 84, 0.11), transparent 32rem),
    #0a0806;
}

body.sd-history-page .fixed.top-0.left-0.pointer-events-none.z-\[9999\] {
  display: none !important;
}

.sd-history-tools {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  border-radius: 8px;
  background: rgba(8, 7, 6, 0.78);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.sd-history-tools a,
.sd-history-tools button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(244, 239, 228, 0.86);
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.sd-history-tools button {
  background: rgba(212, 160, 84, 0.92);
  color: #120d08;
}

.sd-history-tools a:hover,
.sd-history-tools button:hover {
  border-color: rgba(240, 200, 120, 0.55);
}

body.sd-history-page main > .fixed.inset-0.z-50 button {
  border-radius: 8px !important;
  background: rgba(212, 160, 84, 0.12);
}

.timeline-nav-row {
  border-top: 1px solid rgba(244, 239, 228, 0.08);
  background: rgba(8, 7, 6, 0.86) !important;
}

.timeline-nav-tooltip {
  border: 1px solid rgba(244, 239, 228, 0.12);
  background: rgba(8, 7, 6, 0.92) !important;
}

.chapter-content,
.chapter-scroll-content,
.m-body-over {
  color: var(--sd-ink);
}

.chapter-scroll-content p,
.mobile-body-text,
.m-highlight-text,
.detail-section p,
.fun-fact-text,
.hq-text {
  color: rgba(244, 239, 228, 0.78) !important;
  line-height: 1.82 !important;
}

.historical-quote {
  padding: 18px 20px !important;
  border-left-width: 2px !important;
  background: rgba(255, 255, 255, 0.035);
}

.fun-fact-card,
.narrator-inline-card,
.era-stat-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.28)) !important;
  border-color: rgba(244, 239, 228, 0.12) !important;
}

.youtube-player-container,
.instagram-player-container {
  border-width: 1px !important;
  border-color: rgba(244, 239, 228, 0.14) !important;
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.38) !important;
}

.youtube-player-label,
.instagram-player-label,
.m-section-label {
  letter-spacing: 0.18em !important;
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 72px;
  }

  .site-nav,
  .site-nav.is-visible {
    top: auto !important;
    right: 12px !important;
    bottom: 12px !important;
    left: 12px !important;
    width: auto;
    justify-content: flex-start;
    overflow-x: auto;
    transform: none !important;
  }

  .site-nav a {
    flex: 0 0 auto;
    font-size: 11px !important;
  }

  .hero-section {
    min-height: 92svh !important;
    padding-top: 72px;
    padding-bottom: 88px;
  }

  .hero-section h1 {
    font-size: clamp(2.35rem, 13vw, 4.4rem) !important;
  }

  .hero-badge span {
    white-space: normal;
    line-height: 1.6;
    letter-spacing: 0.16em !important;
  }

  .hero-actions {
    width: 100%;
    margin-bottom: 30px;
  }

  .hero-action {
    width: min(100%, 320px);
  }

  .project-showcase {
    min-height: auto !important;
  }

  .sd-history-tools {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: 12px;
    justify-content: space-between;
  }

  .sd-history-tools a,
  .sd-history-tools button {
    flex: 1;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
