/* ── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm: .375rem;
  --radius-md: .5rem;
  --radius-lg: .75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --content-default: 960px;
  --content-wide: 1200px;
  /* Landing navbar: .navbar-inner (56px) + border (1px) - pierwszy ekran hero pod sticky bar */
  --site-navbar-offset: calc(56px + 1px);
  font-display: swap;
}

/* ── LIGHT THEME TOKENS ─────────────────────────────────── */
html.light-theme,
html[data-theme="light"] {
  --color-bg: #f7f6f2;
  --color-surface: #f9f8f5;
  --color-surface-2: #fbfbf9;
  --color-surface-offset: #f3f0ec;
  --color-surface-dynamic: #e6e4df;
  --color-divider: #dcd9d5;
  --color-border: #d4d1ca;
  --color-text: #28251d;
  --color-text-muted: #7a7974;
  --color-text-faint: #bab9b4;
  --color-text-inverse: #f9f8f4;
  --color-primary: #01696f;
  --color-primary-hover: #0c4e54;
  --color-primary-highlight: #cedcd8;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
}

/* ── DARK THEME TOKENS ──────────────────────────────────── */
html.dark-theme,
html[data-theme="dark"],
html:not(.light-theme):not([data-theme="light"]) {
  --color-bg: #171614;
  --color-surface: #1c1b19;
  --color-surface-2: #201f1d;
  --color-surface-offset: #1d1c1a;
  --color-surface-dynamic: #2d2c2a;
  --color-divider: #262523;
  --color-border: #393836;
  --color-text: #cdccca;
  --color-text-muted: #797876;
  --color-text-faint: #5a5957;
  --color-text-inverse: #2b2a28;
  --color-primary: #4f98a3;
  --color-primary-hover: #227f8b;
  --color-primary-highlight: #313b3b;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}


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

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  background-color: var(--color-bg);
  /* Instant - matches body */
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  /* NO transition here - applied via JS after first paint */
}

body.lang-switching {
  opacity: 0;
}

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

button,
input,
select {
  font: inherit;
  color: inherit
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.15;
  font-family: var(--font-display)
}

p,
li {
  text-wrap: pretty;
  max-width: 72ch
}

a,
button,
[role="button"],
input {
  transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition)
}

button {
  cursor: pointer;
  background: none;
  border: none
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm)
}

::selection {
  background: oklch(from var(--color-primary) l c h / 0.2);
  color: var(--color-text)
}

/* ── INPUT type=number: bez natywnych strzałek (spinner) ─────────────
   Chrome / Edge / Safari: ::-webkit-inner/outer-spin-button
   Firefox: -moz-appearance: textfield */
input[type='number'] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── INPUT type=range: czytelny tor i kciuk (dark mode, wszystkie narzędzia) ─ */
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2rem;
  background: transparent;
  cursor: pointer;
}

input[type='range']:focus {
  outline: none;
}

input[type='range']:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

input[type='range']::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: var(--color-border);
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-surface-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

input[type='range']:active::-webkit-slider-thumb {
  cursor: grabbing;
}

input[type='range']::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: var(--color-border);
}

input[type='range']::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-surface-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

input[type='range']::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--color-primary) 45%, var(--color-border));
}

/* ── LAYOUT ────────────────────────────────────────────── */
.container {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-6)
}

.container-wide {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6)
}

/* ── NAV ───────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider)
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-4)
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text)
}

.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: -.02em
}

.nav-logo span {
  color: var(--color-primary)
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1)
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md)
}

.nav-link:hover {
  color: var(--color-text);
  background: var(--color-surface-dynamic)
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2)
}

.btn-theme {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border)
}

.btn-theme:hover {
  color: var(--color-text);
  background: var(--color-surface-dynamic)
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  text-decoration: none;
  white-space: nowrap
}

.btn-primary:hover {
  background: var(--color-primary-hover)
}

.nav-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border)
}

.nav-hamburger:hover {
  background: var(--color-surface-dynamic)
}

/* ── HERO ──────────────────────────────────────────────── */
.hero {
  padding: clamp(var(--space-12), 5vw, var(--space-20)) 0 clamp(var(--space-8), 4vw, var(--space-16));
}

/* Tylko landing (index): hero wypełnia widok pod navbar - sekcja #tools zaczyna się po scrollu */
#hero.hero {
  min-height: calc(100vh - var(--site-navbar-offset));
  min-height: calc(100svh - var(--site-navbar-offset));
  min-height: calc(100dvh - var(--site-navbar-offset));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Ten sam padding góra/dół - nadpisuje asymetryczny .hero, żeby pustka była równo nad i pod treścią */
  padding-top: clamp(var(--space-8), 3vw, var(--space-16));
  padding-bottom: clamp(var(--space-8), 3vw, var(--space-16));
}

#hero.hero > .container {
  width: 100%;
  flex-shrink: 0;
  /* Wyśrodkowanie pionowe w dostępnej przestrzeni (pewniejsze niż sam justify-content przy paddingu z .hero) */
  margin-top: auto;
  margin-bottom: auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-5);
  letter-spacing: .04em;
  text-transform: uppercase
}

.hero-badge svg {
  width: 12px;
  height: 12px
}

.hero h1 {
  /* Mniejszy max niż --text-3xl (5rem): długie tłumaczenia (PL/DE) mieszczą się w pierwszym ekranie */
  font-size: clamp(2rem, 1.35rem + 2.75vw, 3.85rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.07;
  margin-bottom: var(--space-4);
  text-wrap: balance;
  hyphens: auto;
  overflow-wrap: break-word;
}

.hero .hero-content h1 em {
  font-style: normal;
  color: var(--color-primary);
}

.hero-desc {
  font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.375rem);
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: var(--space-6);
  max-width: 44ch
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none
}

.btn-hero:hover {
  background: var(--color-primary-hover)
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border)
}

.btn-ghost:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted)
}

.hero-stats {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider)
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  display: block;
  line-height: 1
}

.hero-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: .05em
}

/* Hero visual */
.hero-visual {
  position: relative
}

.hero-card-stack {
  display: grid;
  gap: var(--space-3)
}

.calc-preview {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-md)
}

.calc-preview-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4)
}

.calc-preview-icon {
  width: 36px;
  height: 36px;
  background: var(--color-primary-highlight);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0
}

.calc-preview-icon svg {
  width: 18px;
  height: 18px
}

.calc-preview-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text)
}

.calc-preview-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted)
}

.calc-preview-result {
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.calc-preview-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em
}

.calc-preview-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  font-variant-numeric: tabular-nums
}

.hero-floating {
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  animation: float 3s ease-in-out infinite
}

@keyframes float {

  0%,
  100% {
    transform: translateY(-50%) translateY(0)
  }

  50% {
    transform: translateY(-50%) translateY(-6px)
  }
}

/* ── AD SLOT (top banner) ──────────────────────────────── */
.ad-banner {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-3) 0
}

.ad-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 90px
}

.ad-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  position: absolute;
  top: var(--space-2);
  right: var(--space-3)
}

.ad-slot {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: var(--color-surface-offset);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden
}

.ad-slot-text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic
}

/* Hide ad placeholders until a real ad is rendered */
:root:not(.ads-ready) .ad-sidebar,
:root:not(.ads-ready) .ad-banner,
:root:not(.ads-ready) .ad-horizontal,
:root:not(.ads-ready) .ad-slot,
:root:not(.ads-ready) .ad-slot-728,
:root:not(.ads-ready) .ad-slot-horizontal,
:root:not(.ads-ready) .ad-box {
  display: none !important;
}

/* ── SECTION TITLES ────────────────────────────────────── */
.section-header {
  margin-bottom: var(--space-10)
}

.section-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--space-2)
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1
}

.section-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  max-width: 52ch
}

/* ── TOOLS GRID ────────────────────────────────────────── */
.tools-section {
  padding: clamp(var(--space-12), 6vw, var(--space-20)) 0
}

.tools-filter {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-8)
}

.filter-btn {
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface);
  cursor: pointer
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary)
}

.filter-btn.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary)
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-4)
}

/* Tool card */
.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition)
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-primary)
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3)
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.tool-card-icon svg {
  width: 22px;
  height: 22px
}

.tool-card-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  letter-spacing: .03em
}

.badge-new {
  background: color-mix(in oklch, var(--color-primary) 15%, transparent);
  color: var(--color-primary)
}

.badge-hot {
  background: color-mix(in oklch, oklch(0.6 0.2 40) 15%, transparent);
  color: oklch(0.55 0.18 40)
}

.tool-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.2
}

.tool-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  flex: 1
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider)
}

.tool-card-cat {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: .04em
}

.tool-card-arrow {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-surface-dynamic);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: background var(--transition), color var(--transition)
}

.tool-card:hover .tool-card-arrow {
  background: var(--color-primary);
  color: var(--color-text-inverse)
}

.tool-card-arrow svg {
  width: 14px;
  height: 14px
}

/* Category colors */
.icon-finance {
  background: color-mix(in oklch, var(--color-primary) 12%, var(--color-surface));
  color: var(--color-primary)
}

.icon-tax {
  background: color-mix(in oklch, oklch(0.6 0.18 145) 12%, var(--color-surface));
  color: oklch(0.48 0.15 145)
}

.icon-hr {
  background: color-mix(in oklch, oklch(0.6 0.18 240) 12%, var(--color-surface));
  color: oklch(0.45 0.15 240)
}

.icon-tech {
  background: color-mix(in oklch, oklch(0.6 0.2 300) 12%, var(--color-surface));
  color: oklch(0.5 0.17 300)
}

.icon-currency {
  background: color-mix(in oklch, oklch(0.65 0.18 60) 12%, var(--color-surface));
  color: oklch(0.52 0.16 60)
}

.icon-health {
  background: color-mix(in oklch, oklch(0.62 0.2 15) 14%, var(--color-surface));
  color: oklch(0.55 0.18 18)
}

.icon-math {
  background: color-mix(in oklch, oklch(0.58 0.16 250) 14%, var(--color-surface));
  color: oklch(0.48 0.14 250)
}

/* ── AD SIDEBAR SLOT ───────────────────────────────────── */
.tools-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-8);
  align-items: start
}

.ad-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4)
}

.ad-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative
}

.ad-box-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-divider)
}

.ad-box-slot {
  width: 100%;
  min-height: 250px;
  background: var(--color-surface-offset);
  display: flex;
  align-items: center;
  justify-content: center
}

.ad-box-slot span {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic
}

.ad-box-tall {
  min-height: 600px
}

/* ── HOW IT WORKS ──────────────────────────────────────── */
.how-section {
  padding: clamp(var(--space-12), 6vw, var(--space-20)) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider)
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-10)
}

.step {
  position: relative
}

.step-num {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  color: var(--color-primary-highlight);
  line-height: 1;
  margin-bottom: var(--space-3);
  user-select: none
}

html.dark-theme .step-num {
  color: var(--color-surface-dynamic)
}

.step h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2)
}

.step p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 28ch
}

/* ── CATEGORIES ────────────────────────────────────────── */
.cats-section {
  padding: clamp(var(--space-12), 5vw, var(--space-20)) 0
}

.cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--space-3);
  margin-top: var(--space-8)
}

.cat-chip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition)
}

.cat-chip:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  border-color: var(--color-primary)
}

.cat-chip-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.cat-chip-icon svg {
  width: 18px;
  height: 18px
}

.cat-chip-count {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--color-text-faint)
}

/* ── AD HORIZONTAL (between sections) ─────────────────── */
.ad-horizontal {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-divider)
}

.ad-horizontal-inner {
  display: flex;
  justify-content: center
}

.ad-slot-728 {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative
}

/* ── ADVERTISE CTA ─────────────────────────────────────── */
.advertise-section {
  padding: clamp(var(--space-12), 5vw, var(--space-20)) 0
}

.advertise-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: clamp(var(--space-8), 4vw, var(--space-16));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  align-items: center
}

.advertise-card h2 {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: var(--space-3)
}

.advertise-card p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 52ch
}

.advertise-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5)
}

.adv-feat {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  color: var(--color-text-muted)
}

.advertise-cta-block {
  text-align: center;
  flex-shrink: 0
}

.advertise-cta-block .btn-primary {
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-8)
}

.advertise-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2)
}

.btn-more-tools {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: all var(--transition);
  margin-top: var(--space-10);
}

.btn-more-tools:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-dynamic);
  transform: translateY(-1px);
}

/* ── LOGO ─────────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-any {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.2rem;
}

.logo-serv {
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.2rem;
}

.logo img {
  display: block;
}

/* ── NAVBAR ───────────────────────────────────────────── */
.navbar {
  width: 100%;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
}

.navbar-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.navbar-nav {
  display: flex;
  gap: 32px;
  justify-content: center;
}

.navbar-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 150ms;
}

.navbar-nav a:hover {
  color: var(--color-text);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}

.navbar-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.navbar-link:hover {
  color: var(--color-text);
}

/* App variant */
.navbar--app .navbar-inner {
  display: flex;
  justify-content: space-between;
}

/* Ensure interactive navbar controls are always clickable */
.lang-switcher,
.theme-toggle {
  pointer-events: all;
  cursor: pointer;
  position: relative;
  z-index: 101;
}

.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  user-select: none;
  color: var(--color-text);
  transition: border-color 150ms;
  flex-shrink: 0;
}

.lang-switcher:hover {
  border-color: var(--color-text-muted);
}

.lang-arrow {
  opacity: 0.6;
  font-size: 0.7rem;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px 0;
  margin: 0;
  list-style: none;
  min-width: 100px;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.lang-dropdown li {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--color-text);
}

.lang-dropdown li:hover {
  background: var(--color-surface-dynamic);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 150ms;
}

.theme-toggle:hover {
  border-color: var(--color-text-muted);
}

/* App navbar: keep "All tools" aligned on mobile */
.navbar--app .navbar-right {
  margin-left: auto;
  min-width: 0;
}

.navbar--app .navbar-link {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .navbar--app .navbar-inner {
    padding: 0 var(--space-3);
    gap: 8px;
  }

  .navbar--app .navbar-right {
    gap: 8px;
  }

  .navbar--app .navbar-link {
    display: block;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    font-size: 0.8rem;
  }
}

/* ── FOOTER ENHANCEMENTS ──────────────────────────────── */
.footer-col-title {
  color: var(--color-primary);
  /* teal/accent color */
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.footer-all-tools {
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
}

.footer-all-tools:hover {
  text-decoration: underline;
}

/* ── TOOLS DIRECTORY FILTERS ────────────────────────────── */
.tools-filter-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  margin-bottom: var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.filter-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-faint);
}

.filter-select-group {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.filter-select {
  flex: 1;
  min-width: 200px;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--color-primary);
}

/* ── FOOTER ────────────────────────────────────────────── */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  padding: 48px 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .nav-logo-text {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
  display: block;
}

.footer-desc {
  font-size: .82rem;
  color: var(--color-text-muted);
  max-width: 32ch;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-faint);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.footer-link {
  font-size: .82rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--color-primary);
}

.footer-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.footer-tools-grid .footer-links {
  flex: 1;
}

.footer-col-anyserv {
  justify-self: end;
  align-items: flex-start;
  text-align: left;
}

.footer-bottom {
  border-top: 1px solid var(--color-divider);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: .7rem;
  color: var(--color-text-faint);
}

.footer-legal-links {
  display: flex;
  gap: 1rem;
}

.footer-legal-links a {
  font-size: .7rem;
  color: var(--color-text-faint);
  text-decoration: none;
}

/* ── MOBILE OVERRIDES ──────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Wąski lub niski viewport (laptop): mniejszy hero, żeby statystyki nie wychodziły poza pierwszy ekran */
@media (min-width: 901px) and (max-height: 900px) {
  .hero {
    padding-top: clamp(var(--space-8), 2.5vw, var(--space-12));
    padding-bottom: clamp(var(--space-6), 2vw, var(--space-10));
  }

  .hero h1 {
    font-size: clamp(1.85rem, 1rem + 2.1vw, 3rem);
    line-height: 1.06;
    margin-bottom: var(--space-3);
  }

  .hero-badge {
    margin-bottom: var(--space-3);
  }

  .hero-desc {
    margin-bottom: var(--space-5);
    font-size: clamp(1rem, 0.9rem + 0.35vw, 1.25rem);
    line-height: 1.5;
  }

  .hero-stats {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    gap: var(--space-6);
  }
}

@media (max-width: 900px) {
  .tools-layout {
    grid-template-columns: 1fr;
  }

  .ad-sidebar {
    position: static;
    top: auto;
    order: 2;
    display: flex;
    width: 100%;
    margin-top: var(--space-6);
  }

  /* On mobile keep ads below tool and less intrusive */
  .ad-sidebar .ad-box + .ad-box {
    display: none;
  }

  .ad-box-slot,
  .ad-box-tall {
    min-height: 250px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    display: none;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .advertise-card {
    grid-template-columns: 1fr;
  }

  .advertise-cta-block {
    text-align: left;
  }

  .nav-links,
  .navbar-nav {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-tools-grid {
    grid-template-columns: 1fr;
    gap: .45rem;
  }

  .footer-col-anyserv {
    justify-self: start;
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 600px) {
  .hero-stats {
    flex-wrap: wrap;
    gap: var(--space-6);
  }

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

/* ── MOBILE NAV DRAWER ─────────────────────────────────── */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.nav-drawer.open {
  display: block;
}

.nav-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(0.1 0 0 / 0.5);
}

.nav-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--color-surface);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
}

.nav-drawer-close {
  align-self: flex-end;
  margin-bottom: var(--space-4);
}

.nav-drawer-link {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  display: block;
}

.nav-drawer-link:hover {
  background: var(--color-surface-dynamic);
  color: var(--color-text);
}

/* ── ANIMATIONS ────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.hero-content {
  animation: fadeUp .5s ease both;
}

.hero-visual {
  animation: fadeUp .5s .15s ease both;
}

/* ── TRUST SECTION (GEO) ───────────────────────────────── */
.trust-section {
  padding: clamp(var(--space-12), 6vw, var(--space-16)) 0;
  border-top: 1px solid var(--color-divider);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-12);
}

.trust-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: transform var(--transition);
}

.trust-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

.trust-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-icon svg {
  width: 24px;
  height: 24px;
}

.trust-card h3 {
  font-size: var(--text-base);
  font-weight: 700;
}

.trust-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}


/* ── GLOSSARY SECTION (AEO/GEO) ────────────────────────── */
.glossary-section {
  padding: clamp(var(--space-12), 6vw, var(--space-16)) 0;
}

/* ── FAQ SECTION (AEO) ─────────────────────────────────── */
.faq-section {
  padding: clamp(var(--space-12), 6vw, var(--space-16)) 0;
  background: var(--color-surface-offset);
  border-top: 1px solid var(--color-divider);
}

.faq-container {
  max-width: 800px;
  margin-inline: auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-10);
}

.faq-details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-details[open] {
  border-color: var(--color-primary);
}

.faq-summary {
  list-style: none;
  padding: var(--space-4) var(--space-6);
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  font-size: var(--text-sm);
  color: var(--color-text);
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: '+';
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-primary);
  transition: transform var(--transition);
}

.faq-details[open] .faq-summary::after {
  transform: rotate(45deg);
}

.faq-content {
  padding: 0 var(--space-6) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

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

  .advertise-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .advertise-features {
    justify-content: center;
  }
}

/* ── CUSTOM SELECT (BEAUTIFUL DROPDOWN) ───────────────────── */
.custom-select {
  position: relative;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  user-select: none;
  width: 100%;
}
.cs-selected {
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  padding: 0 calc(var(--space-10) + var(--space-2)) 0 1rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 52px;
  display: flex;
  align-items: center;
}
.cs-selected::after {
  content: '';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  background-color: var(--color-text-muted);
  clip-path: polygon(100% 0%, 0 0%, 50% 100%);
  pointer-events: none;
  transition: transform var(--transition);
}
.custom-select.open .cs-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(1, 105, 111, 0.15);
}
.custom-select.open .cs-selected::after {
  transform: translateY(-50%) rotate(180deg);
}
.cs-options {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  padding: var(--space-2) 0;
}
.custom-select.open .cs-options {
  display: block;
}
.cs-option {
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  display: flex;
  align-items: center;
  font-weight: 500;
}
.cs-option:hover {
  background: var(--color-surface-dynamic);
  color: var(--color-primary);
}
/* Style dla sprytnego ukrycia ramek (np. w Salary Calculator przy kwocie) */
.custom-select.select-ghost .cs-selected {
  background: transparent;
  border: none;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  box-shadow: none !important;
}
.custom-select.select-ghost.open .cs-selected {
  border: none;
  box-shadow: none !important;
}

/* ── SCROLLBARS ─────────────────────────────────────────────── */
* {

  scrollbar-width: thin;
  scrollbar-color: var(--color-text-muted) var(--color-surface-2);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--color-surface-2);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--color-text-muted);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text);
}

/* ── Global tool disclaimer (injected via i18n.js) ─────────── */
.global-disclaimer-box {
  margin: 2rem auto 0;
  max-width: 800px;
  padding: 0.875rem 1.25rem;
  border-left: 3px solid var(--color-warning, #f59e0b);
  background: var(--color-surface);
  border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.field-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

