/* ============================================================
   Magazyn Energii PRO — design system
   "technical / engineering authority"
   ============================================================ */

:root {
  --navy-900: #0f172a;   /* slate-900 */
  --navy-800: #1e293b;   /* slate-800 */
  --navy-700: #334155;
  --ink: #1e293b;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --paper: #f8fafc;
  --white: #ffffff;

  --accent: #c2780f;        /* technical copper / amber */
  --accent-dark: #9a5f0b;
  --accent-tint: #fbf3e6;
  --accent-line: #e7d4b3;

  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --r: 5px;
  --r-sm: 4px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  color: var(--navy-800);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  color: var(--navy-900);
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

.font-mono, .mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.font-sans { font-family: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif; }
.font-serif { font-family: 'IBM Plex Serif', Georgia, serif; }

a { color: inherit; text-decoration: none; }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

/* ---------- eyebrow / labels ---------- */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-dark);
}
.eyebrow--muted { color: var(--slate-500); }

/* reference / citation tag */
.ref-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--slate-600);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 3px 8px;
  white-space: nowrap;
}
.ref-tag::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(45deg);
  flex: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600; font-size: 15px; line-height: 1;
  padding: 13px 20px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-dark { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.btn-dark:hover { background: var(--navy-800); }
.btn-outline { background: #fff; color: var(--navy-900); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--slate-400); background: var(--slate-100); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.25); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 24px; font-size: 16px; }

/* ---------- cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.card-pad { padding: 24px; }

/* ---------- forms ---------- */
.field-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 7px;
}
.input, .select {
  width: 100%;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  color: var(--navy-900);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194,120,15,0.14);
}
.input.mono { font-family: 'IBM Plex Mono', monospace; }
.help { font-size: 12px; color: var(--slate-500); margin-top: 6px; line-height: 1.45; }

/* checkbox tiles */
.check-tile {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  font-size: 14px; font-weight: 500; color: var(--slate-600);
  cursor: pointer; user-select: none;
  background: #fff;
  transition: border-color .15s, background .15s, color .15s;
}
.check-tile:hover { border-color: var(--slate-400); }
.check-tile .box {
  width: 18px; height: 18px; flex: none;
  border: 1.5px solid var(--slate-400);
  border-radius: 3px;
  display: grid; place-items: center;
  color: transparent;
  transition: all .15s;
}
.check-tile.is-on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark); }
.check-tile.is-on .box { background: var(--accent); border-color: var(--accent); color: #fff; }

/* range slider */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; height: 24px; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  height: 20px; width: 20px; border-radius: 3px;
  background: var(--navy-900); border: 2px solid var(--accent);
  margin-top: -7px; cursor: pointer;
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 2px; }
input[type="range"]::-moz-range-thumb {
  height: 20px; width: 20px; border-radius: 3px;
  background: var(--navy-900); border: 2px solid var(--accent); cursor: pointer;
}

/* ---------- spec / data tables ---------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spec-table th, .spec-table td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}
.spec-table thead th {
  background: var(--navy-900);
  color: #fff;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.spec-table tbody tr:nth-child(even) { background: var(--slate-100); }
.spec-table tbody tr:hover { background: var(--accent-tint); }
.spec-table .num { font-family: 'IBM Plex Mono', monospace; text-align: right; white-space: nowrap; }
.spec-table .col-name { font-weight: 600; color: var(--navy-900); }
.spec-table caption {
  caption-side: bottom; text-align: left;
  font-size: 12px; color: var(--slate-500);
  padding-top: 10px;
}
/* sortable headers */
.spec-table th[data-sort] { cursor: pointer; user-select: none; }
.spec-table th[data-sort] .arrow { opacity: 0.4; font-size: 10px; margin-left: 4px; }
.spec-table th[aria-sort="ascending"] .arrow,
.spec-table th[aria-sort="descending"] .arrow { opacity: 1; color: var(--accent); }

/* small key-value spec sheet */
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv th, .kv td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.kv th { font-weight: 500; color: var(--slate-600); width: 46%; }
.kv td { font-family: 'IBM Plex Mono', monospace; color: var(--navy-900); }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }

/* ---------- authority components ---------- */
.byline {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--white);
  padding: 14px 16px;
}
.byline .avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: var(--navy-900) repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.06) 6px 12px);
  color: #fff; display: grid; place-items: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 600;
}
.byline .who { font-size: 14px; }
.byline .who b { color: var(--navy-900); }
.byline .who span { color: var(--slate-500); font-size: 13px; display: block; }

.stamp {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  color: var(--slate-500);
}
.stamp b { color: var(--navy-800); font-weight: 500; }
.stamp .dot { width: 6px; height: 6px; border-radius: 50%; background: #16a34a; flex: none; }

/* table of contents */
.toc { border: 1px solid var(--line); border-radius: var(--r); background: var(--white); padding: 18px 20px; }
.toc h4 { font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-500); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0; }
.toc a { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--slate-600); border-bottom: 1px dashed var(--line); }
.toc li:last-child a { border-bottom: 0; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: 'IBM Plex Mono', monospace; color: var(--accent); font-size: 12px; }
.toc a:hover { color: var(--navy-900); }

/* callout boxes */
.callout { border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; background: var(--white); }
.callout--amber { background: var(--accent-tint); border-color: #ecd9b3; }
.callout--navy { background: var(--navy-900); color: #cbd5e1; border-color: var(--navy-900); }
.callout--navy h3, .callout--navy strong { color: #fff; }
.callout__label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 6px; }

/* article prose */
.prose { color: var(--slate-600); font-size: 17px; line-height: 1.7; }
.prose > h2 { font-size: 26px; margin: 38px 0 14px; scroll-margin-top: 90px; }
.prose > h3 { font-size: 20px; margin: 28px 0 10px; scroll-margin-top: 90px; }
.prose > p { margin: 0 0 16px; }
.prose a.inref { color: var(--accent-dark); border-bottom: 1px solid var(--accent-line); font-weight: 500; }
.prose ul { margin: 0 0 16px; padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); }
.prose strong { color: var(--navy-900); }

/* figure placeholder */
.figph {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--paper) repeating-linear-gradient(135deg, transparent 0 11px, rgba(15,23,42,0.035) 11px 22px);
  display: grid; place-items: center;
  color: var(--slate-500);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  text-align: center; padding: 28px 20px;
}
figure { margin: 24px 0; }
figcaption { font-size: 13px; color: var(--slate-500); margin-top: 8px; font-style: italic; }

/* image placeholder generic */
.imgph {
  background: var(--navy-900) repeating-linear-gradient(135deg, transparent 0 13px, rgba(255,255,255,0.04) 13px 26px);
  color: #94a3b8; display: grid; place-items: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; text-align: center; padding: 16px;
}

/* pros / cons */
.pc { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pc h4 { font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; padding: 12px 16px; }
.pc ul { list-style: none; margin: 0; padding: 4px 16px 16px; }
.pc li { position: relative; padding-left: 24px; margin: 8px 0; font-size: 14.5px; color: var(--slate-600); }
.pc--pro h4 { background: #f0f7f1; color: #15803d; border-bottom: 1px solid #d7ead9; }
.pc--con h4 { background: #fbf0ef; color: #b4453a; border-bottom: 1px solid #ecd5d2; }
.pc--pro li::before { content: "+"; position: absolute; left: 6px; color: #15803d; font-weight: 700; font-family: 'IBM Plex Mono', monospace; }
.pc--con li::before { content: "−"; position: absolute; left: 6px; color: #b4453a; font-weight: 700; font-family: 'IBM Plex Mono', monospace; }

/* rating */
.rating-badge { display: inline-flex; align-items: baseline; gap: 6px; font-family: 'IBM Plex Mono', monospace; }
.rating-badge .big { font-size: 30px; font-weight: 600; color: var(--navy-900); }
.rating-badge .max { font-size: 14px; color: var(--slate-400); }

/* winner cards (ranking) */
.winner { border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 18px; }
.winner .tagrow { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-dark); }

/* divider with label */
.rule { display: flex; align-items: center; gap: 14px; color: var(--slate-400); }
.rule::before, .rule::after { content: ""; height: 1px; background: var(--line-strong); flex: 1; }
.rule span { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---------- header ---------- */
.topbar { background: var(--navy-900); color: #94a3b8; font-size: 12px; }
.topbar a:hover { color: #fff; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand .mark {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-sm);
  background: var(--navy-900); color: var(--accent);
  display: grid; place-items: center;
  border: 1px solid var(--navy-700);
}
.brand .name { font-family: 'IBM Plex Serif', serif; font-weight: 600; font-size: 18px; color: var(--navy-900); letter-spacing: -0.01em; }
.brand .name b { color: var(--accent); font-weight: 600; }
.nav-link { font-size: 14.5px; font-weight: 500; color: var(--slate-600); padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.nav-link:hover { color: var(--navy-900); }
.nav-link[aria-current="page"] { color: var(--navy-900); border-bottom-color: var(--accent); }

.breadcrumb { background: var(--white); border-bottom: 1px solid var(--line); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 10px 0; list-style: none; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--slate-500); }
.breadcrumb a:hover { color: var(--accent-dark); }
.breadcrumb li[aria-current] { color: var(--navy-800); }
.breadcrumb .sep { color: var(--slate-300); }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-900); color: #94a3b8; }
.site-footer h5 { font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #64748b; margin: 0 0 14px; }
.site-footer a { font-size: 14px; color: #cbd5e1; }
.site-footer a:hover { color: #fff; }

/* ---------- calculator result reveal ---------- */
.calc-result {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: max-height .24s ease, opacity .22s ease, transform .22s ease, margin .24s ease, padding .24s ease;
}
.calc-result.is-open {
  max-height: 1600px;
  opacity: 1;
  transform: translateY(0);
}

/* metric cards */
.metric { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; background: #fff; }
.metric--accent { background: var(--accent-tint); border-color: #ecd9b3; }
.metric .m-label { font-size: 12px; color: var(--slate-500); line-height: 1.3; }
.metric .m-value { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 23px; color: var(--navy-900); margin-top: 5px; line-height: 1; }
.metric--accent .m-value { color: var(--accent-dark); }
.metric .m-sub { font-size: 11.5px; color: var(--slate-500); margin-top: 6px; line-height: 1.35; }

/* utilities */
.section { padding: 64px 0; }
.section-sm { padding: 44px 0; }
[hidden] { display: none !important; }
.tabnum { font-variant-numeric: tabular-nums; }

@media (max-width: 880px) {
  .section { padding: 48px 0; }
  .prose { font-size: 16px; }
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .4s cubic-bezier(0.22,1,0.36,1) both; }

/* layout helpers */
@media (min-width: 1000px) {
  #hero-grid { grid-template-columns: 1.04fr 0.96fr; }
}
@media (max-width: 999px) {
  #hero-grid h1 { font-size: 38px !important; }
}
@media (max-width: 920px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 560px) {
  .site-footer .grid { grid-template-columns: 1fr !important; }
  h1 { font-size: 32px !important; }
}
details[open] > summary .font-mono { transform: rotate(45deg); display: inline-block; }

@media (min-width: 980px) {
  #article-grid { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 979px) {
  #toc-col { display: none; }
}
@media (min-width: 900px) {
  #brand-hero { grid-template-columns: 1.08fr 0.92fr; }
}
