/* ============================================================
   KomputeryProsto - design system
   Koncept: "Miedź i PCB" - chłodzenie, radiatory, płytka drukowana
   Paleta: miedź #b45309/#e08a3c + zieleń PCB #1e5c46/#4a9d76
           + złote styki #d9a441 + ciepły papier #f6f3ec
   Typografia: Space Grotesk (display) + IBM Plex Sans (body)
               + IBM Plex Mono (specyfikacje: GB, GHz, kody błędów)
   Inspiracje: Wirecutter (czysty layout, spis treści, sekcje zaufania),
               PCWorld (ciemny header + jasna treść), Tom's Hardware (chipy spec)
   ============================================================ */

:root {
  --bg: #f6f3ec;
  --bg-soft: #ece7dc;
  --bg-card: #fffdf8;
  --ink: #1c241f;
  --ink-soft: #3a443e;
  --muted: #575f57;
  --accent: #b45309;
  --accent-strong: #92400e;
  --accent-soft: rgba(180, 83, 9, 0.09);
  --accent-line: rgba(180, 83, 9, 0.3);
  --pcb: #1e5c46;
  --pcb-bright: #2e7d5d;
  --pcb-soft: rgba(30, 92, 70, 0.1);
  --pcb-line: rgba(30, 92, 70, 0.32);
  --gold: #8a6414;
  --gold-bright: #d9a441;
  --gold-soft: rgba(217, 164, 65, 0.14);
  --border: #e2dccf;
  --ok: #1d7a4f;
  --ok-bg: rgba(29, 122, 79, 0.09);
  --warn: #8a5a12;
  --warn-bg: rgba(217, 164, 65, 0.16);
  --bad: #b03a48;
  --bad-bg: rgba(176, 58, 72, 0.09);
  --header-bg: #101612;
  --header-text: #eef2ec;
  --header-muted: #9aa79b;
  --header-h: 62px;
  --sidebar-w: 292px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(28, 36, 31, 0.05), 0 4px 18px rgba(28, 36, 31, 0.05);
  --shadow-card-hover: 0 2px 4px rgba(28, 36, 31, 0.06), 0 12px 30px rgba(180, 83, 9, 0.13);
  --font-display: "Space Grotesk", "Arial", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --transition: all 0.2s ease-out;
  --body-grad-1: radial-gradient(620px 420px at 92% -60px, rgba(180, 83, 9, 0.09), transparent 70%);
  --body-grad-2: radial-gradient(720px 520px at -10% 110%, rgba(30, 92, 70, 0.1), transparent 70%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c110e;
    --bg-soft: #121814;
    --bg-card: #151c17;
    --ink: #e6eae3;
    --ink-soft: #c2c9c0;
    --muted: #9aa79b;
    --accent: #e08a3c;
    --accent-strong: #f0a45c;
    --accent-soft: rgba(224, 138, 60, 0.13);
    --accent-line: rgba(224, 138, 60, 0.34);
    --pcb: #4a9d76;
    --pcb-bright: #5fb98a;
    --pcb-soft: rgba(74, 157, 118, 0.12);
    --pcb-line: rgba(74, 157, 118, 0.34);
    --gold: #e3b34d;
    --gold-bright: #f0c56a;
    --gold-soft: rgba(227, 179, 77, 0.13);
    --border: #232c25;
    --ok: #6fcf9d;
    --ok-bg: rgba(111, 207, 157, 0.12);
    --warn: #f0c05a;
    --warn-bg: rgba(240, 192, 90, 0.12);
    --bad: #f08a94;
    --bad-bg: rgba(240, 138, 148, 0.12);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.35);
    --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 30px rgba(224, 138, 60, 0.15);
    --body-grad-1: radial-gradient(620px 420px at 92% -60px, rgba(224, 138, 60, 0.1), transparent 70%);
    --body-grad-2: radial-gradient(720px 520px at -10% 110%, rgba(74, 157, 118, 0.08), transparent 70%);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--body-grad-1), var(--body-grad-2);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; text-wrap: balance; margin: 0 0 0.55em; letter-spacing: 0.005em; }
h1 { font-size: 2.15rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; font-family: var(--font-body); font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; }
::selection { background: var(--pcb-soft); }

.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200;
  background: var(--header-bg); color: var(--header-text); padding: 10px 16px;
  border-radius: var(--radius-sm); font-weight: 600; transition: top 0.2s ease-out;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- header (zawsze ciemna zieleń PCB - wzorzec PCWorld/Tom's) ---------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.app-header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(224, 138, 60, 0.5), rgba(74, 157, 118, 0.45), transparent);
  opacity: 0.45; pointer-events: none;
}
.header-inner {
  max-width: 1440px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 20px;
  padding: 0 22px;
}
.mark { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.mark-svg { color: var(--accent); display: block; }
.mark-text {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em;
  color: var(--header-text); white-space: nowrap;
}
.mark-text em { font-style: normal; color: #e08a3c; }

.header-search { position: relative; flex: 1; max-width: 460px; margin: 0 auto; }
.header-search input {
  width: 100%; height: 40px; padding: 0 16px;
  font-family: var(--font-body); font-size: 0.95rem; color: var(--header-text);
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px; transition: var(--transition);
}
.header-search input::placeholder { color: var(--header-muted); }
.header-search input:focus { outline: none; border-color: #e08a3c; background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 3px rgba(224, 138, 60, 0.24); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 120;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card-hover);
  overflow: hidden;
}
.sr-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); transition: var(--transition); }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover { background: var(--accent-soft); }
.sr-title { font-weight: 600; color: var(--ink); font-size: 0.92rem; }
.sr-meta { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sr-empty { padding: 12px 14px; color: var(--muted); font-size: 0.9rem; }

.burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; border-radius: 8px; }
.burger span { display: block; width: 22px; height: 2.5px; background: var(--header-text); margin: 4px 0; border-radius: 2px; transition: var(--transition); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- layout ---------- */
.layout { display: flex; max-width: 1440px; margin: 0 auto; padding-top: var(--header-h); }
.sidebar {
  position: sticky; top: var(--header-h); align-self: flex-start;
  width: var(--sidebar-w); height: calc(100vh - var(--header-h));
  overflow-y: auto; padding: 20px 14px 24px 22px;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.side-group { margin-bottom: 18px; }
.side-group-title {
  font-family: var(--font-body); font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
  margin: 0 0 6px; padding-left: 8px;
}
.side-links { display: flex; flex-direction: column; }
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; line-height: 1.35; color: var(--ink-soft);
  padding: 5.5px 8px; border-radius: 8px; transition: var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: var(--accent-soft); color: var(--ink); }
.sidebar-link.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.sl-ic { font-size: 0.85rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-foot { margin-top: 22px; padding: 14px 8px; border-top: 1px solid var(--border); }
.sidebar-foot p { font-size: 0.8rem; color: var(--muted); margin: 0; line-height: 1.5; }

.main { flex: 1; min-width: 0; padding: 34px 42px 60px; }
.overlay { position: fixed; inset: 0; background: rgba(12, 17, 14, 0.55); z-index: 90; }

/* ---------- home hero: ciemny panel PCB + laptop z terminalem (signature) ---------- */
.home-hero {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--header-bg) 0%, #15201a 55%, #0f1f2b 100%);
  color: #f2f5f0;
  padding: 44px 44px 38px;
  margin-bottom: 38px;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(74, 157, 118, 0.05) 42% 43%, transparent 43% 100%),
    radial-gradient(500px 300px at 85% 15%, rgba(224, 138, 60, 0.15), transparent 70%),
    radial-gradient(420px 260px at 12% 95%, rgba(74, 157, 118, 0.09), transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: #e08a3c;
}
.home-hero h1 { font-size: 3rem; color: #f2f5f0; margin-bottom: 10px; }
.home-hero h1 .hl { color: #e08a3c; }
.hero-lead { font-size: 1.08rem; color: #c3ccbf; max-width: 560px; margin-bottom: 22px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.98rem;
  padding: 11px 22px; border-radius: 999px; transition: var(--transition);
  border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: #b45309; color: #fff; }
.btn-primary:hover { background: #d97706; color: #fff; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: #f2f5f0; border-color: rgba(242, 245, 240, 0.45); }
.btn-ghost:hover { border-color: #4ade80; color: #4ade80; transform: translateY(-2px); }
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.hs-num { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: #e08a3c; line-height: 1.1; }
.hs-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #97a39b; }

/* hero-art: laptop z terminalem i migającym kursorem */
.hero-art { margin-top: 30px; display: flex; align-items: flex-end; gap: 26px; flex-wrap: wrap; }
.laptop-wrap { flex-shrink: 0; }
.laptop-svg { width: 220px; height: 158px; display: block; filter: drop-shadow(0 0 22px rgba(224, 138, 60, 0.2)) drop-shadow(0 14px 34px rgba(0, 0, 0, 0.45)); }
.laptop-lid { fill: #18241d; stroke: rgba(255, 255, 255, 0.2); stroke-width: 1.4; }
.laptop-screen { fill: #0a0f0c; }
.laptop-term { fill: #101612; stroke: rgba(74, 157, 118, 0.4); stroke-width: 1; }
.laptop-base { fill: #1c2a21; stroke: rgba(255, 255, 255, 0.14); stroke-width: 1.4; }
.term-text { font-family: var(--font-mono); font-size: 8.5px; fill: #9fe3b8; letter-spacing: 0.02em; }
.term-text-dim { fill: #5f7a68; }
.term-cursor { animation: cursorBlink 1.1s step-end infinite; }
@keyframes cursorBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.spec-chips { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; }
.spec-chip {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: #c3ccbf;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px;
  padding: 6px 14px; background: rgba(255, 255, 255, 0.05);
}
.spec-chip b { color: #e08a3c; font-weight: 700; }
.spec-chip b.grn { color: #4ade80; }

/* ---------- home sections ---------- */
.home-section { margin-bottom: 48px; }
.home-section-head { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--border); padding-bottom: 8px; margin-bottom: 20px; }
.home-section-head h2 { margin: 0; font-size: 1.42rem; text-transform: uppercase; letter-spacing: 0.04em; }
.sec-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.home-card {
  position: relative; display: flex; flex-direction: column; gap: 5px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 17px 15px;
  transition: var(--transition);
}
.home-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: var(--accent-line); }
.home-card::before {
  content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold-bright));
  opacity: 0; transition: opacity 0.2s ease-out; border-radius: 0 0 4px 4px;
}
.home-card:hover::before { opacity: 1; }
.hc-icon { font-size: 1.15rem; }
.hc-title { font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; line-height: 1.35; color: var(--ink); }
.home-card:hover .hc-title { color: var(--accent); }
.hc-excerpt { font-size: 0.85rem; line-height: 1.5; color: var(--muted); }
.hc-arrow { position: absolute; right: 14px; top: 14px; color: var(--accent); opacity: 0; transform: translateX(-6px); transition: var(--transition); font-size: 1.05rem; }
.home-card:hover .hc-arrow { opacity: 1; transform: translateX(0); }

/* ---------- article ---------- */
.page-enter { animation: fadeUp 0.26s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumb-sep { margin: 0 7px; color: var(--border); }
.article-head { margin-bottom: 22px; }
.article-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}
.article-head h1 { font-size: 2.3rem; margin-bottom: 10px; }
.article-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); }
.article-meta .am-icon { font-size: 0.95rem; }

.toc {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); background: var(--bg-card);
  padding: 12px 18px; margin-bottom: 26px;
}
.toc summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.toc ol { margin: 10px 0 2px; padding-left: 22px; }
.toc li { margin: 4px 0; font-size: 0.92rem; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--accent); }

.content-article { max-width: 780px; }
.content-article h2 {
  font-size: 1.6rem; margin-top: 1.7em; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.content-article h3 { font-size: 1.12rem; margin-top: 1.4em; }
.content-article ul, .content-article ol { padding-left: 24px; margin-bottom: 1.1em; }
.content-article li { margin: 5px 0; }
.content-article strong { color: var(--ink); }
.content-article a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }

.info-box, .tip-box, .warning-box {
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 1.3em 0;
  font-size: 0.96rem; line-height: 1.6;
}
.info-box { background: var(--pcb-soft); border-left: 4px solid var(--pcb); }
.tip-box { background: var(--ok-bg); border-left: 4px solid var(--ok); }
.warning-box { background: var(--bad-bg); border-left: 4px solid var(--bad); }

.table-responsive { overflow-x: auto; margin: 1.3em 0; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--bg-card); }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 700; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--accent-soft); }

.compare-table th { background: var(--header-bg); color: #f2f5f0; }
.compare-table td:first-child { font-weight: 600; }

.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; margin: 12px 0; background: var(--bg-card); }
.faq-item h3 { margin: 0 0 6px; color: var(--accent); }

dl.glossary { margin: 1.2em 0; }
dl.glossary dt { font-weight: 700; color: var(--ink); margin-top: 1.1em; font-size: 1.02rem; }
dl.glossary dt::before { content: '▸ '; color: var(--accent); }
dl.glossary dd { margin: 3px 0 0 18px; color: var(--ink-soft); }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 42px; border-top: 1px solid var(--border); padding-top: 24px; }
.pn-card { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; transition: var(--transition); }
.pn-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.pn-card.next { text-align: right; }
.pn-dir { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 4px; }
.pn-title { font-weight: 600; color: var(--ink); font-size: 0.95rem; }

/* ---------- footer ---------- */
.app-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 20px; }
.footer-inner { max-width: 1440px; margin: 0 auto; padding: 26px 42px; }
.footer-inner p { font-size: 0.9rem; color: var(--muted); margin: 0 0 6px; max-width: 760px; }
.footer-inner strong { color: var(--ink); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.01em; }
.footer-inner strong em { font-style: normal; color: var(--accent); }
.footer-meta { font-family: var(--font-mono); font-size: 0.78rem !important; }

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

/* ---------- cursor glow (pointer: fine only) ---------- */
@media (pointer: fine) {
  body::before, body::after {
    content: ''; position: fixed; width: 340px; height: 340px; border-radius: 50%;
    left: var(--ox, 50vw); top: var(--oy, 30vh);
    pointer-events: none; z-index: 0; opacity: 0; transition: opacity 0.5s ease-out;
    background: radial-gradient(circle, rgba(180, 83, 9, 0.07), transparent 65%);
    transform: translate(-50%, -50%);
  }
  body::after { background: radial-gradient(circle, rgba(30, 92, 70, 0.06), transparent 65%); width: 260px; height: 260px; }
  body.orb-on::before, body.orb-on::after { opacity: 1; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 95;
    transform: translateX(-102%); transition: transform 0.24s ease-out;
    background: var(--bg); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    width: min(320px, 86vw);
  }
  .sidebar.open { transform: translateX(0); }
  .burger { display: block; }
  .main { padding: 24px 20px 50px; }
  .footer-inner { padding: 22px 20px; }
  .home-hero { padding: 32px 24px 28px; }
  .home-hero h1 { font-size: 2.2rem; }
}
@media (max-width: 600px) {
  .header-search { max-width: none; }
  .mark-text { font-size: 1.05rem; }
  .home-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .hs-num { font-size: 1.2rem; }
  .article-head h1 { font-size: 1.8rem; }
  .prevnext { grid-template-columns: 1fr; }
  .pn-card.next { text-align: left; }
  .toc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .page-enter { animation: none; }
}
