/* Firma Bez Chaosu - Main Stylesheet */
/* Mobile-first, plain CSS */

:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F3EF;
  --bg-dark: #1A1A2E;
  --text-primary: #1A1A2E;
  --text-secondary: #4A4A5A;
  --text-light: #E8E4DD;
  --accent: #1a56db;
  --accent-hover: #1547b8;
  --cta: #D64045;
  --cta-hover: #b8343a;
  --border: #DDD8D0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --cat-muzeum: #8B5E3C;
  --cat-chaos: #2D6A4F;
  --cat-konkurencja: #7B2D8B;
  --cat-fomo: #C25700;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* Focus visible - a11y */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.6rem;
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 700;
}

p {
  margin-bottom: 1.2rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navigation */
.nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-family: 'Source Serif 4', Georgia, serif;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ========================================
   HERO SECTION — grain + staggered reveal
   ======================================== */
.hero {
  background: var(--bg-dark);
  padding: 3.5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(26, 86, 219, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(214, 64, 69, 0.10) 0%, transparent 60%);
  pointer-events: none;
}

/* Grain/noise overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
  opacity: 0.5;
}

/* Accent line under hero */
.hero-accent-line {
  display: block;
  width: 60px;
  height: 3px;
  background: var(--cta);
  margin: 0 auto 1.5rem;
  border-radius: 2px;
  animation: accent-grow 0.8s ease-out 0.6s both;
}

@keyframes accent-grow {
  from { width: 0; opacity: 0; }
  to { width: 60px; opacity: 1; }
}

/* Staggered text reveal */
@keyframes hero-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  font-size: 1.8rem;
  margin-bottom: 1.2rem;
  color: var(--bg-primary);
  position: relative;
  animation: hero-fade-up 0.7s ease-out 0.1s both;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.7;
  position: relative;
  animation: hero-fade-up 0.7s ease-out 0.3s both;
}

.hero .cta-button {
  position: relative;
  animation: hero-fade-up 0.7s ease-out 0.5s both;
}

/* ========================================
   CATEGORY CARDS — tint hover + icon scale
   ======================================== */
.categories {
  padding: 4rem 0;
  background: var(--bg-secondary);
}

.categories h2 {
  text-align: center;
  margin-top: 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.category-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: all 0.25s ease;
  display: block;
  color: var(--text-primary);
  border-top: 3px solid var(--border);
}

.category-card:nth-child(1) { border-top-color: var(--cat-muzeum); }
.category-card:nth-child(2) { border-top-color: var(--cat-chaos); }
.category-card:nth-child(3) { border-top-color: var(--cat-konkurencja); }
.category-card:nth-child(4) { border-top-color: var(--cat-fomo); }

.category-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  text-decoration: none;
}

.category-card:nth-child(1):hover { background: #8B5E3C0A; }
.category-card:nth-child(2):hover { background: #2D6A4F0A; }
.category-card:nth-child(3):hover { background: #7B2D8B0A; }
.category-card:nth-child(4):hover { background: #C257000A; }

.category-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  transition: transform 0.25s ease;
}

.category-card:hover .category-icon {
  transform: scale(1.2);
}

.category-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.category-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ========================================
   ARTICLES LIST — editorial numbers + hover
   ======================================== */
.articles-section {
  padding: 4rem 0;
}

.articles-section h2 {
  margin-top: 0;
  text-align: center;
}

.articles-list {
  margin-top: 1.5rem;
  counter-reset: article-counter;
}

.article-item {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
  transition: all 0.15s ease;
  counter-increment: article-counter;
}

.article-item:first-child {
  padding-top: 0;
}

.article-item:last-child {
  border-bottom: none;
}

.article-item a {
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.article-item a::before {
  content: counter(article-counter, decimal-leading-zero);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem;
  color: var(--border);
  flex-shrink: 0;
  min-width: 2rem;
  transition: color 0.2s ease;
}

.article-item a:hover {
  text-decoration: none;
}

.article-item a:hover::before {
  color: var(--accent);
}

.article-item a:hover .article-title {
  color: var(--accent);
}

.article-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  transition: color 0.15s ease;
  position: relative;
}

/* Slide-in accent underline on hover */
.article-item a:hover .article-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
  from { width: 0; }
  to { width: 100%; }
}

.article-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.article-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  color: #fff;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.article-tag--muzeum { background: var(--cat-muzeum); }
.article-tag--chaos { background: var(--cat-chaos); }
.article-tag--konkurencja { background: var(--cat-konkurencja); }
.article-tag--fomo { background: var(--cat-fomo); }

/* Scroll-triggered fade-in */
.article-item {
  opacity: 0;
  transform: translateY(12px);
  animation: fade-in-up 0.5s ease-out forwards;
}

.article-item:nth-child(1)  { animation-delay: 0.05s; }
.article-item:nth-child(2)  { animation-delay: 0.10s; }
.article-item:nth-child(3)  { animation-delay: 0.15s; }
.article-item:nth-child(4)  { animation-delay: 0.20s; }
.article-item:nth-child(5)  { animation-delay: 0.25s; }
.article-item:nth-child(6)  { animation-delay: 0.30s; }
.article-item:nth-child(7)  { animation-delay: 0.35s; }
.article-item:nth-child(8)  { animation-delay: 0.40s; }
.article-item:nth-child(9)  { animation-delay: 0.45s; }
.article-item:nth-child(10) { animation-delay: 0.50s; }

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Article Page */
.article-header {
  padding: 2rem 0 1.5rem;
  background: var(--bg-secondary);
}

.article-header h1 {
  font-size: 1.7rem;
  margin-bottom: 0.5rem;
}

.article-category {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  font-family: 'Source Serif 4', Georgia, serif;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  color: #fff;
}

.article-category--muzeum { background: var(--cat-muzeum); }
.article-category--chaos { background: var(--cat-chaos); }
.article-category--konkurencja { background: var(--cat-konkurencja); }
.article-category--fomo { background: var(--cat-fomo); }

.article-content {
  padding: 2rem 0 3rem;
}

.article-content h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}

.article-content h3 {
  font-size: 1.15rem;
  margin-top: 2rem;
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content strong {
  font-weight: 700;
}

/* Article Navigation (prev/next) */
.article-nav {
  display: flex;
  gap: 1rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.article-nav a {
  flex: 1;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: background 0.15s ease;
}

.article-nav a:hover {
  background: var(--border);
  text-decoration: none;
}

.article-nav-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.article-nav-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 0.95rem;
}

.article-nav--next {
  text-align: right;
}

/* CTA Box */
.cta-box {
  background: var(--bg-secondary);
  border-left: 4px solid var(--cta);
  padding: 1.5rem;
  margin: 2.5rem 0;
  border-radius: 0 8px 8px 0;
}

.cta-box p {
  margin-bottom: 0;
  font-size: 1rem;
}

.cta-box a.cta-button {
  margin-top: 0.75rem;
}

/* CTA Button — no !important */
.cta-button {
  display: inline-block;
  background: var(--cta);
  color: var(--bg-primary);
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.95rem;
  margin-top: 1rem;
  transition: background 0.2s ease, transform 0.15s ease;
}

a.cta-button,
a.cta-button:visited,
a.cta-button:active {
  color: var(--bg-primary);
  text-decoration: none;
}

.cta-button:hover {
  background: var(--cta-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ========================================
   FOOTER CTA — diagonal stripe pattern
   ======================================== */
.footer-cta {
  background: var(--bg-dark);
  color: var(--bg-primary);
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Diagonal stripe texture */
.footer-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 20px,
    rgba(255, 255, 255, 0.015) 20px,
    rgba(255, 255, 255, 0.015) 40px
  );
  pointer-events: none;
}

/* Subtle glow from bottom */
.footer-cta::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 120px;
  background: radial-gradient(ellipse, rgba(214, 64, 69, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.footer-cta h2 {
  color: var(--bg-primary);
  margin-top: 0;
  margin-bottom: 0.75rem;
  position: relative;
}

.footer-cta p {
  opacity: 0.85;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  font-size: 0.95rem;
  position: relative;
}

.footer-cta .cta-button {
  font-size: 1rem;
  padding: 0.9rem 1.75rem;
  position: relative;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.footer-links {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  margin: 0 0.75rem;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Breadcrumb */
.breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  margin: 0 0.4rem;
  opacity: 0.5;
}

/* Case Study Box */
.case-study {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.case-study-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

/* Responsive - Tablet */
@media (min-width: 640px) {
  .container {
    padding: 0 2rem;
  }

  .hero {
    padding: 5rem 0;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

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

  .article-header h1 {
    font-size: 2rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.7rem;
  }
}

/* Responsive - Desktop */
@media (min-width: 900px) {
  .container {
    max-width: 760px;
  }

  .hero h1 {
    font-size: 2.7rem;
  }

  .hero-subtitle {
    font-size: 1.15rem;
  }

  .categories-grid {
    gap: 1.25rem;
  }

  .article-header h1 {
    font-size: 2.3rem;
  }
}

/* Reduced motion — respect user preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .nav, .footer-cta, .cta-box, .article-nav {
    display: none;
  }

  body {
    font-size: 12pt;
  }

  a {
    color: var(--text-primary);
  }
}
