/* ============================================================
   Fit - style.css
   Koncept: "Siłownia o zmierzchu"
   Ciemny grafit + volt-lime (energia) + ember (akcja)
   Typografia: Bebas Neue (display) + Rubik (body) + IBM Plex Mono (etykiety)
   ============================================================ */

/* ---------- tokeny ---------- */
:root {
  --bg: #f4f1e8;            /* ciepły krem (jasny) */
  --surface: #ffffff;
  --surface-2: #ece8db;
  --text: #1d1c18;
  --dim: #5c5a52;
  --line: #ddd6c5;
  --volt: #4c6100;          /* tekstowy volt (ciemna oliwka) na jasnym */
  --volt-bright: #a3b81c;   /* dekoracyjny */
  --ember: #b04a08;         /* tekstowy ember na jasnym */
  --ember-soft: #e8a06a;
  --ink: #141412;           /* grafit */
  --header-bg: rgba(244, 241, 232, 0.92);
  --hero-grad-1: rgba(76, 97, 0, 0.10);
  --hero-grad-2: rgba(176, 74, 8, 0.10);
  --shadow: 0 1px 2px rgba(29, 28, 24, 0.06), 0 8px 24px rgba(29, 28, 24, 0.07);
  --shadow-hover: 0 2px 4px rgba(29, 28, 24, 0.08), 0 14px 34px rgba(29, 28, 24, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Rubik', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --header-h: 62px;
  --sidebar-w: 300px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1e1d1a;
    --surface-2: #262420;
    --text: #ece9e0;
    --dim: #b0ac9e;
    --line: #33302a;
    --volt: #c9e636;
    --volt-bright: #c9e636;
    --ember: #f0913a;
    --ember-soft: #f0913a;
    --ink: #f4f1e8;
    --header-bg: rgba(20, 20, 18, 0.9);
    --hero-grad-1: rgba(201, 230, 54, 0.12);
    --hero-grad-2: rgba(240, 145, 58, 0.10);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- reset / baza ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at -10% -5%, var(--hero-grad-1), transparent 60%),
    radial-gradient(ellipse 800px 480px at 110% 105%, var(--hero-grad-2), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
img { max-width: 100%; height: auto; }
a { color: var(--volt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ember); }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; border-radius: 3px; }

.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 300;
  background: var(--volt); color: var(--ink);
  font-weight: 600; padding: 10px 16px; border-radius: 8px;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

h1, h2, h3 { text-wrap: balance; line-height: 1.2; }

/* ---------- header ---------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--volt-bright), transparent);
  opacity: .3; pointer-events: none;
}
.header-inner {
  max-width: 1320px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 22px; padding: 0 22px;
}
.mark { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.mark-svg { color: var(--volt); }
.mark-text { font-family: var(--font-display); font-size: 1.55rem; letter-spacing: .04em; line-height: 1; padding-top: 3px; }
.mark-text em { font-style: normal; color: var(--volt); }

.header-search { position: relative; flex: 1; max-width: 430px; margin-left: auto; }
.header-search input {
  width: 100%; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-size: .95rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.header-search input:focus { outline: none; border-color: var(--volt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--volt) 22%, transparent); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 220;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); overflow: hidden; max-height: 380px; overflow-y: auto;
}
.sr-item { display: block; padding: 10px 14px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--surface-2); }
.sr-title { font-weight: 600; font-size: .92rem; }
.sr-meta { font-size: .78rem; color: var(--dim); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }
.sr-empty { padding: 12px 14px; color: var(--dim); font-size: .9rem; }

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 10px; cursor: pointer; }
.burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- layout ---------- */
.layout {
  max-width: 1320px; margin: 0 auto;
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0; padding: 0 22px;
}
.sidebar {
  position: fixed; top: calc(var(--header-h) + 18px); bottom: 18px;
  width: var(--sidebar-w); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 12px 12px;
  scrollbar-width: thin;
}
.side-group { margin-bottom: 18px; }
.side-group-title {
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--dim);
  margin: 0 0 6px; padding: 0 8px;
}
.side-links { display: flex; flex-direction: column; gap: 1px; }
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 7px;
  font-size: .9rem; line-height: 1.35; color: var(--text); text-decoration: none;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.sidebar-link:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.sidebar-link.active { background: color-mix(in srgb, var(--volt) 16%, var(--surface)); color: var(--text); font-weight: 600; }
.sl-ic { font-size: .85rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-foot { border-top: 1px solid var(--line); margin-top: 8px; padding: 12px 8px 4px; }
.sidebar-foot p { font-size: .78rem; color: var(--dim); margin: 0; line-height: 1.55; }

.main { grid-column: 2; min-width: 0; padding: calc(var(--header-h) + 26px) 0 60px 30px; }
.main:focus { outline: none; }

.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 150;
}

/* ---------- home: hero ---------- */
.home-hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  padding: 44px 44px 36px; margin-bottom: 42px;
}
.home-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 640px 300px at 88% -10%, color-mix(in srgb, var(--volt-bright) 18%, transparent), transparent 65%),
    radial-gradient(ellipse 420px 260px at -8% 108%, color-mix(in srgb, var(--ember-soft) 16%, transparent), transparent 60%);
}
.hero-eyebrow {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim);
}
.home-hero h1 {
  font-family: var(--font-display); font-size: clamp(3rem, 6.4vw, 4.8rem);
  font-weight: 400; letter-spacing: .015em; margin: 10px 0 6px; color: var(--text);
}
.home-hero h1 .hl { color: var(--volt); }
.hero-lead { font-size: 1.12rem; color: var(--dim); max-width: 620px; margin: 0 0 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 1rem;
  text-decoration: none; transition: transform .18s var(--ease), box-shadow .18s ease, background-color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--volt); color: var(--ink); }
.btn-primary:hover { box-shadow: 0 10px 24px color-mix(in srgb, var(--volt) 35%, transparent); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--volt); color: var(--volt); }
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.hs-num { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; color: var(--volt); }
.hs-label { font-size: .8rem; color: var(--dim); margin-top: 3px; }

/* hero-art: sztanga z nabijanymi talerzami (signature) */
.hero-art { position: absolute; right: 34px; top: 50%; transform: translateY(-50%); width: 380px; opacity: 1; }
.barbell-wrap { position: relative; }
.barbell-svg { width: 100%; height: auto; display: block; }
.bb-bar {
  stroke: var(--volt); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 340; stroke-dashoffset: 340;
  animation: bbDraw 1.1s var(--ease) .1s forwards;
}
.bb-plate { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.6; }
.bb-plate-in { fill: var(--ember-soft); }
.bb-plate-l { animation: bbSlideL .8s var(--ease) .5s both; }
.bb-plate-r { animation: bbSlideR .8s var(--ease) .5s both; }
.bb-collar { fill: var(--ember); }
.bb-label {
  font-family: var(--font-mono); font-size: 13px; fill: var(--dim);
  letter-spacing: .1em;
}
.bb-label.hl { fill: var(--volt); font-weight: 600; }
.bb-pulse {
  fill: var(--volt); opacity: 0;
  animation: bbPulse 2.4s ease-in-out 1.6s infinite;
}
@keyframes bbDraw { to { stroke-dashoffset: 0; } }
@keyframes bbSlideL { from { transform: translateX(-46px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes bbSlideR { from { transform: translateX(46px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes bbPulse { 0%, 100% { opacity: 0; } 50% { opacity: .9; } }
.spec-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.spec-chip {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim); background: var(--bg);
}
.spec-chip b { color: var(--volt); font-weight: 600; }

/* ---------- home: sekcje i karty ---------- */
.home-section { margin-bottom: 40px; scroll-margin-top: calc(var(--header-h) + 20px); }
.home-section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.home-section-head h2 {
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 400;
  letter-spacing: .02em; margin: 0; color: var(--text);
}
.home-section-head h2::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--volt); margin-right: 12px; transform: rotate(45deg); }
.sec-count { font-family: var(--font-mono); font-size: .75rem; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.home-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 18px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--text);
  transition: transform .2s var(--ease), box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.home-card::after {
  content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px;
  background: var(--volt); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.home-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--volt) 40%, var(--line)); }
.home-card:hover::after { transform: scaleX(1); }
.hc-icon { font-size: 1.3rem; line-height: 1; }
.hc-title { font-weight: 600; font-size: .95rem; line-height: 1.4; }
.hc-excerpt { font-size: .85rem; color: var(--dim); line-height: 1.5; }
.hc-arrow { position: absolute; top: 16px; right: 16px; color: var(--volt); font-size: 1rem; opacity: 0; transform: translateX(-6px); transition: all .22s var(--ease); }
.home-card:hover .hc-arrow { opacity: 1; transform: translateX(0); }

/* ---------- artykuł ---------- */
.page-enter { animation: fadeUp .3s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.crumbs { font-size: .85rem; color: var(--dim); margin-bottom: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--volt); }
.crumb-sep { opacity: .6; }

.article-head { margin-bottom: 26px; }
.article-tag {
  display: inline-block; font-family: var(--font-mono); font-size: .75rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--volt);
  border: 1px solid color-mix(in srgb, var(--volt) 45%, var(--line));
  border-radius: 999px; padding: 4px 12px; margin-bottom: 14px;
}
.article-head h1 { font-family: var(--font-display); font-size: clamp(2.3rem, 4.6vw, 3.4rem); font-weight: 400; letter-spacing: .01em; margin: 0 0 14px; color: var(--text); }
.article-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: .85rem; color: var(--dim); }
.am-icon { font-size: 1rem; }

.toc {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 14px 18px; margin-bottom: 30px;
}
.toc summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.toc ol { margin: 10px 0 2px; padding-left: 22px; display: grid; gap: 6px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--volt); }

.content-article { max-width: 760px; }
.content-article > h2 {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 400;
  letter-spacing: .02em; color: var(--text); margin: 40px 0 14px;
  padding-left: 14px; border-left: 3px solid var(--volt);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.content-article h3 { font-size: 1.18rem; margin: 28px 0 10px; color: var(--text); scroll-margin-top: calc(var(--header-h) + 20px); }
.content-article p { margin: 0 0 16px; }
.content-article ul, .content-article ol { margin: 0 0 18px; padding-left: 24px; }
.content-article li { margin-bottom: 7px; }
.content-article li::marker { color: var(--volt); }
.content-article strong { color: var(--text); }
.content-article a { text-decoration: underline; }

.info-box {
  border: 1px solid color-mix(in srgb, var(--volt) 45%, var(--line));
  background: color-mix(in srgb, var(--volt) 9%, var(--surface));
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 20px 0;
}
.info-box p { margin: 0 0 8px; }
.info-box p:last-child { margin-bottom: 0; }
.info-box .ib-tag {
  display: block; font-family: var(--font-mono); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .12em; color: var(--volt);
  margin-bottom: 6px; font-weight: 600;
}

table.compare-table {
  width: 100%; border-collapse: collapse; margin: 22px 0 26px;
  font-size: .95rem; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.compare-table th, .compare-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare-table thead th {
  background: var(--surface-2); font-family: var(--font-mono); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text);
}
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody tr:hover td { background: color-mix(in srgb, var(--volt) 5%, transparent); }
.compare-table td:first-child { font-weight: 600; white-space: nowrap; }

.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item:first-of-type { padding-top: 6px; }
.faq-item h3 { margin: 0 0 8px; font-size: 1.08rem; }
.faq-item h3::before { content: 'Q: '; color: var(--volt); font-family: var(--font-mono); font-size: .85rem; }
.faq-item p { margin: 0; }
.faq-item p::first-letter { }

dl.glossary { margin: 0; }
.glossary dt {
  font-weight: 600; color: var(--text); margin-top: 18px;
  border-left: 3px solid var(--ember); padding-left: 12px;
}
.glossary dt::before { content: ''; }
.glossary dd { margin: 6px 0 0 15px; color: var(--dim); }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 44px; }
.pn-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; text-decoration: none; color: var(--text);
  transition: border-color .2s ease, transform .2s var(--ease), box-shadow .2s ease;
  min-height: 72px;
}
.pn-card:hover { border-color: var(--volt); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.pn-card.next { text-align: right; }
.pn-dir { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 4px; }
.pn-title { font-weight: 600; font-size: .95rem; line-height: 1.4; }

/* ---------- footer ---------- */
.app-footer { border-top: 1px solid var(--line); margin-top: 20px; background: var(--surface); }
.footer-inner { max-width: 1320px; margin: 0 auto; padding: 26px 22px; }
.footer-inner p { margin: 0 0 8px; font-size: .88rem; color: var(--dim); max-width: 820px; }
.footer-inner strong { font-family: var(--font-display); font-weight: 400; letter-spacing: .04em; color: var(--text); font-size: 1.05rem; }
.footer-inner strong em { font-style: normal; color: var(--volt); }
.footer-meta { font-family: var(--font-mono); font-size: .75rem !important; }

/* ---------- reveal / orbs / motion ---------- */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease-out, transform .5s var(--ease); }
.reveal.on { opacity: 1; transform: translateY(0); }

body.orb-on { position: relative; }
body.orb-on::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--ox, 50%) var(--oy, 30%), color-mix(in srgb, var(--volt) 5%, transparent), transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .bb-bar { stroke-dashoffset: 0; }
  .bb-plate-l, .bb-plate-r { transform: none; opacity: 1; }
}

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .hero-art { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 0 16px; }
  .main { grid-column: 1; padding: calc(var(--header-h) + 20px) 0 50px; }
  .sidebar {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: auto;
    width: auto; max-height: calc(100dvh - var(--header-h));
    border-radius: 0; border-left: none; border-right: none;
    transform: translateY(-110%); opacity: 0;
    transition: transform .3s var(--ease), opacity .25s ease;
    z-index: 160;
  }
  .sidebar.open { transform: translateY(0); opacity: 1; }
  .burger { display: flex; }
  .header-search { max-width: none; }
  .home-hero { padding: 30px 24px 26px; }
  .home-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .header-inner { padding: 0 14px; gap: 12px; }
  .mark-text { font-size: 1.35rem; }
  .header-search input { font-size: .88rem; padding: 8px 13px; }
  .home-grid { grid-template-columns: 1fr; }
  .home-hero h1 { font-size: 2.6rem; }
  .hero-cta { flex-direction: column; }
  .btn { justify-content: center; }
  .hero-stats { gap: 20px; }
  .prevnext { grid-template-columns: 1fr; }
  .compare-table { display: block; overflow-x: auto; white-space: nowrap; }
  .article-head h1 { font-size: 2.2rem; }
}
