/* ==============================
   Szulakowski.PL — Case Studies
   Design Tokens & Styles
   ============================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colors */
  --navy: #1b2d4f;
  --navy-deep: #131a2b;
  --amber: #c8872e;
  --amber-light: #d9a35c;
  --amber-glow: rgba(200, 135, 46, 0.12);
  --bg: #f5f6f8;
  --bg-alt: #eceef2;
  --text-primary: #1b2d4f;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --white: #ffffff;
  --border: #d8dce6;
  --border-light: #e8ecf2;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);

  /* Layout */
  --max-width: 1200px;
  --content-padding: clamp(20px, 5vw, 48px);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 246, 248, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.nav--scrolled {
  box-shadow: 0 1px 8px rgba(27, 45, 79, 0.08);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--content-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--navy);
  transition: opacity 0.2s;
}

.nav__logo:hover { opacity: 0.75; }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.nav__link:hover { color: var(--navy); }

.nav__link--active {
  color: var(--amber);
  font-weight: 600;
  position: relative;
}

.nav__link--active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--amber);
  border-radius: 1px;
}

/* --- Hero --- */
.hero {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-20) var(--content-padding) var(--space-12);
  position: relative;
  background: var(--navy-deep);
  color: var(--white);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200, 135, 46, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(27, 45, 79, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

/* Subtle grid pattern */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200, 135, 46, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 135, 46, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 740px;
}

.hero__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: var(--space-3);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.35s forwards;
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--amber-light);
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.5s forwards;
}

.hero__desc {
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto var(--space-12);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.65s forwards;
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: var(--space-12);
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.8s forwards;
}

.hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__stat-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  line-height: 1;
}

.hero__stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--amber);
  line-height: 1.2;
}

.hero__stat-suffix {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--amber);
}

.hero__stat-label {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-1);
}

.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
  z-index: 1;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.7; transform: translateX(-50%) translateY(4px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Case Study --- */
.case {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-16) var(--content-padding);
}

.case__header {
  background: var(--white);
  border-radius: 16px;
  padding: clamp(var(--space-8), 5vw, var(--space-12));
  border: 1px solid var(--border-light);
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}

.case__header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--amber-light));
}

.case__header--dark {
  background: var(--navy-deep);
  border-color: rgba(200, 135, 46, 0.15);
  color: var(--white);
}

.case__header-inner {
  position: relative;
  z-index: 1;
}

.case__header-label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.case__number {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  color: var(--amber);
}

.case__industry {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  background: var(--bg);
  padding: var(--space-1) var(--space-3);
  border-radius: 4px;
}

.case__header--dark .case__industry {
  background: rgba(200, 135, 46, 0.12);
  color: var(--amber-light);
}

.case__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

.case__period {
  font-size: 1rem;
  font-weight: 500;
  color: var(--amber);
  margin-bottom: var(--space-1);
}

.case__client {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.case__header--dark .case__client {
  color: rgba(255, 255, 255, 0.6);
}

.case__key-metric {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--amber-glow);
  border-radius: 8px;
  border: 1px solid rgba(200, 135, 46, 0.15);
}

.case__key-metric-number {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--amber);
  line-height: 1;
}

.case__key-metric-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.case__header--dark .case__key-metric-label {
  color: rgba(255, 255, 255, 0.65);
}

/* Body: Sidebar + Content */
.case__body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-8);
  align-items: start;
}

.case__sidebar {
  background: var(--white);
  border-radius: 12px;
  padding: var(--space-6);
  border: 1px solid var(--border-light);
  position: sticky;
  top: 80px;
}

.case__sidebar-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  color: var(--navy);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--amber);
}

.case__metrics {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.case__metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.case__metric dt {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.case__metric dd {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--navy);
}

/* Content */
.case__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.case__section-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: var(--space-3);
}

.case__section-icon {
  font-size: 0.5rem;
}

.case__section p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 65ch;
}

.case__section p + p {
  margin-top: var(--space-4);
}

.case__results-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.case__results-list li {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: var(--space-6);
  position: relative;
}

.case__results-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.case__results-list li strong {
  color: var(--navy);
  font-weight: 600;
}

/* Tags */
.case__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-8);
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease-out);
}

.tag:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* --- Divider --- */
.divider {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

.divider__line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* --- CTA --- */
.cta {
  background: var(--navy-deep);
  padding: var(--space-20) var(--content-padding);
  text-align: center;
  margin-top: var(--space-16);
}

.cta__inner {
  max-width: 600px;
  margin: 0 auto;
}

.cta__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--white);
  margin-bottom: var(--space-4);
}

.cta__text {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.cta__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--amber);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.25s var(--ease-out);
  border: 2px solid var(--amber);
}

.cta__button:hover {
  background: transparent;
  color: var(--amber);
}

/* --- Footer --- */
.footer {
  background: var(--navy-deep);
  border-top: 1px solid rgba(200, 135, 46, 0.1);
  padding: var(--space-8) var(--content-padding);
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer__logo {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--amber);
}

.footer__copy {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer__legal {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

.footer__sep {
  color: rgba(255, 255, 255, 0.2);
}

/* --- Scroll Animations --- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .case__body {
    grid-template-columns: 1fr;
  }

  .case__sidebar {
    position: static;
    order: -1;
  }

  .case__metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 75vh;
    padding: var(--space-16) var(--content-padding) var(--space-10);
  }

  .hero__stats {
    gap: var(--space-8);
  }

  .case {
    padding: var(--space-10) var(--content-padding);
  }

  .case__header {
    padding: var(--space-6);
  }

  .case__key-metric {
    flex-direction: column;
    gap: var(--space-1);
  }

  .nav__links { gap: var(--space-3); }

  .nav__logo span { font-size: 0.9375rem; }

  .nav__logo svg { width: 26px; height: 26px; }

  .nav__link { font-size: 0.8125rem; }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__legal {
    flex-direction: column;
    gap: var(--space-1);
  }

  .footer__sep { display: none; }

  .hero__scroll-indicator { display: none; }
}

@media (max-width: 480px) {
  .case__metrics {
    grid-template-columns: 1fr;
  }

  .hero__stats {
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  [data-animate] {
    opacity: 1;
    transform: none;
  }
}
