/* ════════════════════════════════════════════════════════════════════════════
   MATHrix v2 — Stylesheet
   Fonts: Space Grotesk (headings) · Inter (body)
   Icons: Font Awesome 6.4.2
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── 1. THEME VARIABLES ─────────────────────────────────────────────────── */

[data-theme="dark-premium"] {
  --bg:            #06060f;
  --bg-alt:        #0d0d1a;
  --bg-card:       #111128;
  --bg-card-h:     #16163a;
  --border:        rgba(255,255,255,0.06);
  --border-h:      rgba(124,58,237,0.5);
  --accent:        #7c3aed;
  --accent-2:      #3b82f6;
  --gradient:      linear-gradient(135deg, #7c3aed, #3b82f6);
  --grad-text:     linear-gradient(135deg, #a78bfa, #60a5fa);
  --text:          #f1f5f9;
  --text-2:        #94a3b8;
  --text-3:        #475569;
  --glow:          rgba(124,58,237,0.22);
  --glow-2:        rgba(59,130,246,0.14);
  --nav-bg:        rgba(6,6,15,0.88);
  --badge-bg:      rgba(124,58,237,0.12);
  --badge-text:    #a78bfa;
  --check:         #a78bfa;
  --shadow-card:   0 0 0 1px rgba(255,255,255,0.04), 0 8px 32px rgba(0,0,0,0.45);
  --shadow-card-h: 0 0 0 1px rgba(124,58,237,0.35), 0 20px 48px rgba(124,58,237,0.14);
  --hero-orb-1:    rgba(124,58,237,0.2);
  --hero-orb-2:    rgba(59,130,246,0.12);
  --footer-bg:     #030308;
  --footer-text:   #64748b;
  --tab-active-bg: rgba(124,58,237,0.15);
  --table-stripe:  rgba(255,255,255,0.02);
  --table-border:  rgba(255,255,255,0.06);
  --pdf-color:     #ef4444;
}

[data-theme="dark-matrix"] {
  --bg:            #030a04;
  --bg-alt:        #061009;
  --bg-card:       #091410;
  --bg-card-h:     #0e1e15;
  --border:        rgba(0,200,83,0.08);
  --border-h:      rgba(0,200,83,0.4);
  --accent:        #00c853;
  --accent-2:      #00bcd4;
  --gradient:      linear-gradient(135deg, #00c853, #00bcd4);
  --grad-text:     linear-gradient(135deg, #69f0ae, #40c4ff);
  --text:          #e8f5e9;
  --text-2:        #a5d6a7;
  --text-3:        #4caf50;
  --glow:          rgba(0,200,83,0.18);
  --glow-2:        rgba(0,188,212,0.1);
  --nav-bg:        rgba(3,10,4,0.92);
  --badge-bg:      rgba(0,200,83,0.1);
  --badge-text:    #69f0ae;
  --check:         #69f0ae;
  --shadow-card:   0 0 0 1px rgba(0,200,83,0.06), 0 8px 32px rgba(0,0,0,0.55);
  --shadow-card-h: 0 0 0 1px rgba(0,200,83,0.3), 0 20px 48px rgba(0,200,83,0.1);
  --hero-orb-1:    rgba(0,200,83,0.1);
  --hero-orb-2:    rgba(0,188,212,0.06);
  --footer-bg:     #010603;
  --footer-text:   #4caf50;
  --tab-active-bg: rgba(0,200,83,0.12);
  --table-stripe:  rgba(0,200,83,0.03);
  --table-border:  rgba(0,200,83,0.08);
  --pdf-color:     #ff5252;
}

[data-theme="light-modern"] {
  --bg:            #ffffff;
  --bg-alt:        #f8fafc;
  --bg-card:       #f1f5f9;
  --bg-card-h:     #eef2ff;
  --border:        rgba(15,23,42,0.08);
  --border-h:      rgba(79,70,229,0.35);
  --accent:        #4f46e5;
  --accent-2:      #7c3aed;
  --gradient:      linear-gradient(135deg, #4f46e5, #7c3aed);
  --grad-text:     linear-gradient(135deg, #4f46e5, #7c3aed);
  --text:          #0f172a;
  --text-2:        #475569;
  --text-3:        #94a3b8;
  --glow:          rgba(79,70,229,0.12);
  --glow-2:        rgba(124,58,237,0.08);
  --nav-bg:        rgba(255,255,255,0.92);
  --badge-bg:      rgba(79,70,229,0.08);
  --badge-text:    #4f46e5;
  --check:         #4f46e5;
  --shadow-card:   0 1px 3px rgba(15,23,42,0.07), 0 8px 24px rgba(15,23,42,0.06);
  --shadow-card-h: 0 0 0 1px rgba(79,70,229,0.2), 0 20px 48px rgba(79,70,229,0.1);
  --hero-orb-1:    rgba(79,70,229,0.06);
  --hero-orb-2:    rgba(124,58,237,0.04);
  --footer-bg:     #0f172a;
  --footer-text:   #64748b;
  --tab-active-bg: rgba(79,70,229,0.08);
  --table-stripe:  rgba(15,23,42,0.02);
  --table-border:  rgba(15,23,42,0.07);
  --pdf-color:     #dc2626;
}

[data-theme="light-warm"] {
  --bg:            #fefdf8;
  --bg-alt:        #f4f1e6;
  --bg-card:       #ffffff;
  --bg-card-h:     #fffcf0;
  --border:        rgba(28,28,46,0.08);
  --border-h:      rgba(10,31,63,0.25);
  --accent:        #0a1f3f;
  --accent-2:      #c9830a;
  --gradient:      linear-gradient(135deg, #0a1f3f, #c9830a);
  --grad-text:     linear-gradient(135deg, #0a1f3f, #c9830a);
  --text:          #1c1c2e;
  --text-2:        #4a4a6a;
  --text-3:        #9090a8;
  --glow:          rgba(201,131,10,0.14);
  --glow-2:        rgba(10,31,63,0.06);
  --nav-bg:        rgba(254,253,248,0.94);
  --badge-bg:      rgba(201,131,10,0.1);
  --badge-text:    #92400e;
  --check:         #0a1f3f;
  --shadow-card:   0 1px 3px rgba(28,28,46,0.06), 0 8px 24px rgba(28,28,46,0.06);
  --shadow-card-h: 0 0 0 1px rgba(201,131,10,0.2), 0 20px 48px rgba(201,131,10,0.08);
  --hero-orb-1:    rgba(201,131,10,0.1);
  --hero-orb-2:    rgba(10,31,63,0.04);
  --footer-bg:     #0a1f3f;
  --footer-text:   #8a9ab8;
  --tab-active-bg: rgba(201,131,10,0.1);
  --table-stripe:  rgba(28,28,46,0.02);
  --table-border:  rgba(28,28,46,0.07);
  --pdf-color:     #dc2626;
}

/* Logo SVG: ikona + wordmark HTML */
.logo-icon {
  height: 60px;
  width: auto;
  flex-shrink: 0;
}

.logo-wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  white-space: nowrap;
}

.logo-rix {
  font-weight: 500;
}

/* Logo obrazkowe zamiast wordmark */
.logo-img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

[data-theme="dark-premium"] .logo-img,
[data-theme="dark-matrix"]  .logo-img,
[data-theme="dark-premium"] .footer-logo,
[data-theme="dark-matrix"]  .footer-logo {
  filter: brightness(0) invert(1);
}

[data-theme="light-modern"] .footer-logo,
[data-theme="light-warm"]   .footer-logo {
  filter: brightness(0) invert(1);
}

/* Dark matrix: subtle grid background on hero */
[data-theme="dark-matrix"] .hero-bg {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(0,200,83,0.04) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(0,200,83,0.04) 40px);
}


/* Hero: dwukolumnowy układ */
.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero-content {
  max-width: 560px;
  flex: 1;
}

.hero-visual {
  position: absolute;
  top: 0px;
  right: 0px;
  z-index: 1;
}

.hero-visual-icon {
  width: clamp(240px, 30vw, 448px);
  height: auto;
  opacity: 0.55;
  filter: drop-shadow(0 0 24px var(--glow));
  transition: opacity 0.35s, filter 0.35s;
}

/* Logo nad sigmą */
.hero-sigma-logo {
  position: absolute;
  right: 18%;
  top: 14%;
  width: clamp(200px, 22vw, 340px);
  height: auto;
  opacity: 0.7;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  transition: filter 0.35s;
}

[data-theme="dark-premium"] .hero-sigma-logo,
[data-theme="dark-matrix"]  .hero-sigma-logo {
  filter: brightness(0) invert(1);
}

@media (max-width: 860px) {
  .hero-sigma-logo { display: none; }
}

/* Znak sumy — dekoracja u dołu */
.hero::after {
  content: '∑';
  position: absolute;
  right: 16%;
  bottom: 22%;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(9.6rem, 17.6vw, 22.4rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 3px var(--accent);
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  transition: -webkit-text-stroke-color 0.35s;
}

@media (max-width: 900px) {
  .hero-visual { display: none; }
}

@media (max-width: 768px) {
  .hero::after { display: none; }
}


/* ─── 2. BASE RESET & GLOBAL ─────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.65;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.12;
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover { opacity: 0.8; }

img { display: block; max-width: 100%; }

strong { font-weight: 600; color: var(--text); }

ul { list-style: none; }

/* Color transitions for theme switching */
header, nav, section, footer, .card, .kurs-card, .review-card,
.team-card, .tab-panel, table, th, td, .btn, .tab-btn,
.kontakt-item, .kontakt-icon, .stats-strip {
  transition:
    background-color 0.35s ease,
    border-color     0.35s ease,
    color            0.35s ease,
    box-shadow       0.35s ease;
}


/* ─── 3. LAYOUT ──────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

.section {
  padding: 112px 0;
}

.section-alt {
  background-color: var(--bg-alt);
}

.section-header {
  margin-bottom: 64px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-tag::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  flex-shrink: 0;
}

.section-title {
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 18px;
}

.section-lead {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.7;
}

.accent-link {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
.accent-link:hover { opacity: 0.75; text-decoration: underline; }

.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hide-mobile { display: inline; }
.show-mobile { display: none; }
.nav-link-phone { display: none; }


/* ─── 4. BUTTONS ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 16px var(--glow);
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--border-h);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--border-h);
}

.btn-outline:hover {
  background: var(--badge-bg);
  transform: translateY(-1px);
}

.btn-full {
  width: 100%;
}

.btn-nav-cta {
  background: var(--gradient);
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 10px var(--glow);
}

.btn-nav-cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}


/* ─── 5. HEADER & NAV ────────────────────────────────────────────────────── */

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

#header.scrolled {
  background-color: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gradient);
  transition: width 0.25s ease;
}

.nav-link:hover {
  color: var(--text);
  opacity: 1;
}

.nav-link:hover::after { width: 100%; }

/* Nav meta — wersje + gęstość w jednej kolumnie */
.nav-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* DEV: version switcher */
.dev-versions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.dev-versions__btn {
  font-size: 0.7rem;
  font-family: monospace;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--text-3);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
  line-height: 1.4;
}

.dev-versions__btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.dev-versions__btn:not(.active):hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Density switcher */
.density-switcher {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.density-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px 7px;
  line-height: 1;
  transition: color 0.15s, background-color 0.15s;
}

.density-btn:nth-child(1) { font-size: 14px; }
.density-btn:nth-child(2) { font-size: 11px; }
.density-btn:nth-child(3) { font-size: 9px;  }

.density-btn.active {
  background: var(--accent);
  color: #fff;
}

.density-btn:not(.active):hover {
  color: var(--accent);
  background: var(--badge-bg);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Theme toggle */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 78px;
  height: 38px;
  padding: 5px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}

.theme-toggle i {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.3s;
  z-index: 1;
  pointer-events: none;
}

.theme-toggle__thumb {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* Light theme: thumb slides to sun (right) */
[data-theme="light-modern"] .theme-toggle__thumb,
[data-theme="light-warm"]   .theme-toggle__thumb {
  transform: translateX(40px);
}

/* Active icon highlight */
[data-theme="dark-premium"] .theme-toggle .fa-moon,
[data-theme="dark-matrix"]  .theme-toggle .fa-moon,
[data-theme="dark-premium"] .theme-toggle .fa-sun,
[data-theme="dark-matrix"]  .theme-toggle .fa-sun {
  color: #fff;
}

[data-theme="light-modern"] .theme-toggle .fa-sun,
[data-theme="light-warm"]   .theme-toggle .fa-sun {
  color: var(--accent);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px;
  transition: border-color 0.2s, background-color 0.2s;
}

.hamburger:hover {
  border-color: var(--border-h);
  background: var(--badge-bg);
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open { border-color: var(--border-h); }
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }


/* ─── 6. HERO ────────────────────────────────────────────────────────────── */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 80px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 65% at 85% 35%, var(--hero-orb-1) 0%, transparent 65%),
    radial-gradient(ellipse 35% 45% at 10% 80%, var(--hero-orb-2) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.hero .container { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 24px;
  background: var(--badge-bg);
  border: 1px solid var(--border-h);
  font-size: 13px;
  font-weight: 500;
  color: var(--badge-text);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
  box-shadow: 0 0 20px var(--glow);
}

.hero-badge i { font-size: 11px; }

.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 28px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 44px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}


/* ─── 7. STATS ───────────────────────────────────────────────────────────── */

.stats-strip {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
}

.stats-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  padding: 8px 24px;
  text-align: center;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat:last-child { border-right: none; }

.stat-number {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.stat-count,
.stat-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-sfx {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
}


/* ─── 8. CARDS (Dlaczego) ────────────────────────────────────────────────── */

.cards-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  cursor: default;
  transition:
    background-color 0.25s,
    border-color     0.25s,
    transform        0.25s,
    box-shadow       0.25s;
}

.card:hover {
  background: var(--bg-card-h);
  border-color: var(--border-h);
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-h);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--badge-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 22px;
  transition: background-color 0.35s, color 0.35s;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.card p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
}


/* ─── 9. KURSY MATURALNE ─────────────────────────────────────────────────── */

.kursy-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.kursy-left {
  display: flex;
  flex-direction: column;
}

.kursy-left .section-header {
  margin-bottom: 32px;
  text-align: left;
}

.kursy-features {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.kursy-features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.65;
}

.kursy-features li i {
  color: var(--check);
  margin-top: 3px;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--badge-bg);
  padding: 5px;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kursy-features strong { color: var(--text); }

.kursy-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kurs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: background-color 0.35s, border-color 0.35s;
}

.kurs-featured {
  border-color: var(--border-h);
}

.kurs-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
}

.kurs-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.kurs-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.kurs-card-label { flex: 1; }

.kurs-card-price-wrap {
  text-align: right;
  flex-shrink: 0;
}

.kurs-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0;
}

.kurs-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 2px;
}

.kurs-price span {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.kurs-rate {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 0;
}

.kurs-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 20px;
}

.kurs-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.kurs-details li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
}

.kurs-details li i {
  color: var(--accent);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  font-size: 13px;
}


/* ─── 10. CENNIK / TABS ──────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.tab-btn:hover {
  border-color: var(--border-h);
  color: var(--text);
}

.tab-btn.active {
  background: var(--tab-active-bg);
  border-color: var(--border-h);
  color: var(--accent);
  font-weight: 600;
}

.tabs-content {
  display: grid;
}

.tab-panel {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.tab-panel.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  animation: tabFadeIn 0.22s ease both;
}

@keyframes tabFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.tab-note {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-2);
  font-family: 'Space Grotesk', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-note i { color: var(--accent); font-size: 13px; }

.price-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--table-border);
  margin-bottom: 20px;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
  font-family: 'Space Grotesk', sans-serif;
  -webkit-font-smoothing: antialiased;
  table-layout: fixed;
}

.price-table th {
  width: 33.333%;
  background: var(--bg-card);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--table-border);
  letter-spacing: 0.02em;
  white-space: normal;
}

.price-table td {
  padding: 14px 20px;
  color: var(--text);
  border-bottom: 1px solid var(--table-border);
  font-size: 16px;
  font-weight: 500;
}

.price-table tbody tr:last-child td { border-bottom: none; }

.price-table tbody tr:nth-child(odd) td {
  background: var(--table-stripe);
}

.price-cell {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text) !important;
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  margin-top: auto;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.pdf-link:hover {
  border-color: var(--border-h);
  color: var(--text);
  background: var(--badge-bg);
  opacity: 1;
}

.pdf-link i {
  color: var(--pdf-color);
  font-size: 16px;
}


/* ─── 11. TEAM ───────────────────────────────────────────────────────────── */

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: visible;
  box-shadow: var(--shadow-card);
  transition:
    background-color 0.25s,
    border-color     0.25s,
    transform        0.25s,
    box-shadow       0.25s;
}

.team-card:hover {
  border-color: var(--border-h);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-h);
}

.team-photo-wrap {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 16px 16px 0 0;
}

.team-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}

.team-card:hover .team-photo { transform: scale(1.03); }

.team-info {
  padding: 20px 20px 0;
}

.team-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.team-role {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 14px;
}

.team-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 20px;
  transition: opacity 0.2s;
}

.team-toggle i {
  font-size: 11px;
  transition: transform 0.3s ease;
}

.team-toggle[aria-expanded="true"] i { transform: rotate(180deg); }

.team-toggle:hover { opacity: 0.75; }

.team-bio {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
  padding: 0 20px;
}

.team-card.bio-open {
  border-color: var(--border-h);
  box-shadow: var(--shadow-card-h);
}

.team-card.bio-open .team-bio {
  max-height: 800px;
  padding: 0 20px 20px;
}

.team-bio p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}


/* ─── 12. REVIEWS ────────────────────────────────────────────────────────── */

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: background-color 0.35s, border-color 0.35s;
}

.review-stars {
  font-size: 16px;
  color: #f59e0b;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.review-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 18px;
  font-style: italic;
}

.review-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.review-extra {
  display: none;
}

.reviews-grid.expanded .review-extra {
  display: flex;
}

.reviews-more {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reviews-google-btn {
  gap: 8px;
}

.reviews-google-btn i { color: var(--accent); }

#reviews-toggle i {
  transition: transform 0.3s ease;
}

#reviews-toggle[aria-expanded="true"] i { transform: rotate(180deg); }


/* ─── 13. KONTAKT ────────────────────────────────────────────────────────── */

.kontakt-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: stretch;
}

.kontakt-left {
  display: flex;
  flex-direction: column;
}

.kontakt-left .section-header {
  margin-bottom: 32px;
  text-align: left;
}

.kontakt-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.kontakt-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.kontakt-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--badge-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.kontakt-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

.kontakt-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 2px;
}

.kontakt-line a {
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.kontakt-line a:hover { color: var(--accent); opacity: 1; }

.kontakt-sub {
  font-size: 14px;
  color: var(--text-3);
  margin-top: 2px;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
  line-height: 1;
}

.copy-btn:hover {
  color: var(--accent);
  background: var(--badge-bg);
}

.copy-btn.copied {
  color: #22c55e;
}

.kontakt-map {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.map-iframe {
  width: 100%;
  flex: 1;
  display: block;
  min-height: 340px;
  border: none;
  /* Ciemny filtr pasujący do dark themes — inwertuje mapę i obraca odcień */
  filter: invert(92%) hue-rotate(180deg) saturate(0.6) brightness(0.88);
}

/* Na jasnych motywach przywracamy naturalny wygląd mapy */
[data-theme="light-modern"] .map-iframe,
[data-theme="light-warm"]   .map-iframe {
  filter: none;
}


/* ─── 14. FOOTER ─────────────────────────────────────────────────────────── */

.footer {
  background-color: var(--footer-bg);
  padding: 64px 0 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr auto;
  gap: 48px;
  margin-bottom: 52px;
  align-items: start;
}

.footer-logo {
  height: 38px;
  width: auto;
  margin-bottom: 12px;
}

.footer-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--footer-text);
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
}

.footer-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 14px;
}

.footer-col p {
  font-size: 14px;
  color: var(--footer-text);
  line-height: 1.7;
  margin-bottom: 6px;
}

.footer-col p:last-child { margin-bottom: 0; }

.footer-text-link {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.footer-text-link:hover { color: var(--text); }

.footer-contact-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.footer-contact-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-left: 0;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.footer-links a {
  font-size: 14px;
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1.4;
}

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


.footer-social-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.footer-social {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--footer-text);
  font-size: 18px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.footer-social:hover {
  border-color: rgba(255,255,255,0.25);
  color: #fff;
  background: rgba(255,255,255,0.06);
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-bottom p {
  font-size: 13px;
  color: var(--text-3);
}

.footer-v-link {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.footer-v-link:hover { opacity: 1; }


/* ─── 15. SCROLL REVEAL ──────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero: staggered entrance */
.hero-badge   { transition-delay: 60ms;  }
.hero-title   { transition-delay: 200ms; }
.hero-sub     { transition-delay: 350ms; }
.hero-actions { transition-delay: 490ms; }

/* Stagger for card grids */
.cards-4 .card:nth-child(1) { transition-delay: 0ms; }
.cards-4 .card:nth-child(2) { transition-delay: 80ms; }
.cards-4 .card:nth-child(3) { transition-delay: 160ms; }
.cards-4 .card:nth-child(4) { transition-delay: 240ms; }

.team-grid .team-card:nth-child(1) { transition-delay: 0ms; }
.team-grid .team-card:nth-child(2) { transition-delay: 80ms; }
.team-grid .team-card:nth-child(3) { transition-delay: 160ms; }
.team-grid .team-card:nth-child(4) { transition-delay: 240ms; }

.reviews-grid .review-card:nth-child(1) { transition-delay: 0ms; }
.reviews-grid .review-card:nth-child(2) { transition-delay: 60ms; }
.reviews-grid .review-card:nth-child(3) { transition-delay: 120ms; }
.reviews-grid .review-card:nth-child(4) { transition-delay: 0ms; }
.reviews-grid .review-card:nth-child(5) { transition-delay: 60ms; }
.reviews-grid .review-card:nth-child(6) { transition-delay: 120ms; }

/* Scrollspy: active nav link */
.nav-link.active {
  color: var(--text);
}
.nav-link.active::after { width: 100%; }

/* Scroll offset for fixed header */
#hero, #stats, #dlaczego, #kursy,
#cennik, #o-nas, #opinie, #kontakt {
  scroll-margin-top: 70px;
}

/* Focus visible (keyboard nav) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-badge, .hero-title, .hero-sub, .hero-actions,
  .cards-4 .card, .team-grid .team-card, .reviews-grid .review-card {
    transition-delay: 0ms !important;
  }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* ─── 16. RESPONSIVE ─────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .cards-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .kursy-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .kursy-cards {
    flex-direction: row;
  }
  .kurs-card { flex: 1; }
}

@media (max-width: 900px) {
  .container { padding: 0 32px; }
  .nav-container { padding: 0 32px; }
  .stats-grid { padding: 0 32px; }

  .kontakt-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-social-col {
    grid-column: span 1;
  }

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

/* ─── Hamburger nav: pojawia się przy 1050px ────────────────────────────── */
@media (max-width: 860px) {

  /* Mobile nav */
  .nav-links {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 16px 0;
    z-index: 800;
  }

  .nav-links.open {
    display: flex;
    animation: mobileNavIn 0.22s ease both;
  }

  .nav-link {
    padding: 14px 32px;
    font-size: 16px;
    width: 100%;
  }

  .nav-link::after { display: none; }

  .hamburger { display: flex; }

  /* Telefon: chowany z nagłówka, widoczny w menu mobilnym */
  .nav-right .btn-nav-cta { display: none; }

  .nav-link-phone {
    display: block;
    border-top: 1px solid var(--border);
    padding: 12px 32px 4px;
    margin-top: 4px;
  }

  .nav-phone-mobile {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 10px;
  }
}

@media (max-width: 768px) {
  .hide-mobile { display: none; }
  .show-mobile { display: inline; }

  .section { padding: 80px 0; }
  .section-header { margin-bottom: 48px; }

  /* theme-switcher pozostaje widoczny na mobile */

  .hero-title {
    font-size: clamp(2.6rem, 11vw, 4rem);
  }

  .hero-sub { font-size: 1rem; }

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

  .stat {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px;
  }

  .stat:nth-child(odd) { border-right: 1px solid var(--border); }
  .stat:nth-child(3),
  .stat:nth-child(4) { border-bottom: none; }

  .cards-4 {
    grid-template-columns: 1fr;
  }

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

  .kursy-cards {
    flex-direction: column;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .nav-container { padding: 0 20px; }
  .stats-grid { padding: 0 20px; }

  /* Na bardzo wąskich ekranach zmniejszamy logo */
  .logo-img { height: 32px; }

  .hero { padding: 100px 0 60px; }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-direction: column;
  }

  .tab-btn { width: 100%; text-align: center; }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-brand { grid-column: auto; }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   DENSITY OVERRIDES
   Activated by data-density="compact" | "dense" on <html>
   ═══════════════════════════════════════════════════════════════════════════ */

/* zoom skaluje absolutnie wszystko (fonty, padding, ikony) —
   działa nawet na wartości px, w przeciwieństwie do font-size na :root */

[data-density="compact"] {
  zoom: 0.9;
}
/* Dodatkowa redukcja odstępów — żeby więcej się mieściło na ekranie */
[data-density="compact"] .section        { padding: 84px 0; }
[data-density="compact"] .section-header { margin-bottom: 48px; }
[data-density="compact"] .hero           { padding: 72px 0 64px; }
[data-density="compact"] .stats-strip    { padding: 44px 0; }

[data-density="dense"] {
  zoom: 0.8;
}
[data-density="dense"] .section          { padding: 60px 0; }
[data-density="dense"] .section-header   { margin-bottom: 32px; }
[data-density="dense"] .hero             { padding: 56px 0 48px; min-height: unset; }
[data-density="dense"] .stats-strip      { padding: 30px 0; }
