/* ============================================================
   Kariera - design system
   Koncepcja: "Business press premium" - atramentowy granat +
   mosiądz + ciepła kość słoniowa. Edytorska typografia
   (Spectral display + Manrope body). WCAG 2.1 AA.
   ============================================================ */

:root {
  /* Light theme - "business press" */
  --bg: #f6f3ec;
  --surface: #fffdf7;
  --surface-2: #efece2;
  --text: #1d2733;
  --muted: #5a6470;
  --navy: #1e3a5f;
  --navy-deep: #16293f;
  --navy-soft: #e8edf3;
  --brass: #a3822f;
  --brass-strong: #7c5f16;
  --brass-soft: #f2ead4;
  --ok: #2f6b3c;
  --warn: #9a4a12;
  --line: rgba(29, 39, 51, 0.14);
  --line-strong: rgba(29, 39, 51, 0.28);
  --shadow-card: 0 1px 2px rgba(29, 39, 51, 0.05), 0 6px 24px -12px rgba(29, 39, 51, 0.16);
  --shadow-card-hover: 0 2px 4px rgba(29, 39, 51, 0.06), 0 14px 34px -14px rgba(30, 58, 95, 0.28);
  --header-bg: rgba(246, 243, 236, 0.86);
  --accent-light: rgba(163, 130, 47, 0.5);
  --accent-subtle: rgba(163, 130, 47, 0.55);

  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --header-height: 64px;
  --sidebar-w: 300px;
  --radius: 14px;
  --radius-sm: 9px;
  --transition: 0.2s ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121a24;
    --surface: #1a2531;
    --surface-2: #202c3a;
    --text: #e8e2d4;
    --muted: #a6aeb8;
    --navy: #33598c;
    --navy-deep: #0d1420;
    --navy-soft: #23344a;
    --brass: #c9a84c;
    --brass-strong: #d4b45c;
    --brass-soft: #2e2a1c;
    --ok: #6fbf80;
    --warn: #e08a4a;
    --line: rgba(232, 226, 212, 0.14);
    --line-strong: rgba(232, 226, 212, 0.3);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px -12px rgba(0, 0, 0, 0.5);
    --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 14px 34px -14px rgba(0, 0, 0, 0.7);
    --header-bg: rgba(18, 26, 36, 0.86);
    --accent-light: rgba(201, 168, 76, 0.4);
    --accent-subtle: rgba(201, 168, 76, 0.4);
  }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { 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(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at -8% -6%, var(--accent-light) 0%, transparent 55%),
    radial-gradient(900px 480px at 108% 104%, var(--accent-light) 0%, transparent 52%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; text-wrap: balance; margin: 0 0 0.5em; }
h1 { font-size: 2.35rem; font-weight: 600; letter-spacing: -0.015em; }
h2 { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.22rem; font-weight: 600; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  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(--accent-subtle), transparent);
  opacity: 0.35; pointer-events: none;
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 16px;
}
.menu-btn {
  display: none; background: none; border: 1px solid var(--line); border-radius: 9px;
  width: 42px; height: 42px; cursor: pointer; flex-shrink: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: var(--surface);
}
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.2s; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
  color: #f2ead4; flex-shrink: 0;
}
.brand-name { font-family: var(--font-display); font-size: 1.32rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-name em { font-style: normal; color: var(--brass-strong); }
.header-tagline {
  margin-left: auto; font-size: 0.82rem; color: var(--muted); white-space: nowrap;
  font-weight: 600; letter-spacing: 0.02em;
}
.search-wrap { position: relative; width: min(340px, 38vw); margin-left: auto; }
.header-tagline + .search-wrap { margin-left: 0; }
.search-input {
  width: 100%; height: 42px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-family: var(--font-body); font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 120;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card-hover); overflow: hidden; display: none;
}
.search-results.open { display: block; }
.search-item { display: block; padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface-2); text-decoration: none; }
.si-title { font-weight: 700; font-size: 0.95rem; }
.si-section { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.search-empty { padding: 14px 16px; color: var(--muted); font-size: 0.9rem; }

/* ---------- Layout ---------- */
.layout { max-width: 1280px; margin: 0 auto; padding: calc(var(--header-height) + 24px) 20px 48px; display: flex; gap: 32px; align-items: flex-start; }
.sidebar {
  position: sticky; top: calc(var(--header-height) + 24px);
  width: var(--sidebar-w); flex-shrink: 0;
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 14px 24px; box-shadow: var(--shadow-card);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.side-group { margin-bottom: 14px; }
.side-group-title {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--brass-strong); margin: 0 8px 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
}
.sidebar-link {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.9rem; line-height: 1.35; color: var(--text);
  padding: 6px 8px; border-radius: 8px; margin-bottom: 1px;
  transition: background 0.15s, transform 0.15s;
}
.sidebar-link:hover { background: var(--surface-2); text-decoration: none; transform: translateX(2px); }
.sidebar-link.active { background: var(--navy-soft); color: var(--navy); font-weight: 700; }
.sidebar-link.active .s-icon { color: var(--brass-strong); }
.s-icon { font-size: 0.95rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-overlay { display: none; }

.main-content { flex: 1; min-width: 0; }
.app-content { animation: fadeUp 0.26s ease-out; }

/* ---------- Hero ---------- */
.home-hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(720px 300px at 88% -20%, rgba(163, 130, 47, 0.22), transparent 60%),
    linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 62%, #274768 100%);
  color: #f3efe2;
  padding: 52px 48px 0;
  display: flex; gap: 36px; align-items: flex-end; justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-card-hover);
}
.home-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.16;
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 26px 26px;
}
.hero-inner { position: relative; max-width: 620px; padding-bottom: 44px; }
.hero-eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: #d9bc6a; margin-bottom: 14px; padding: 5px 12px; border: 1px solid rgba(217, 188, 106, 0.45);
  border-radius: 999px; background: rgba(217, 188, 106, 0.08);
}
.home-hero h1 { color: #fff; font-size: 2.6rem; margin-bottom: 14px; }
.home-hero h1 em { font-style: italic; color: #d9bc6a; }
.hero-sub { color: #d9d4c4; font-size: 1.06rem; max-width: 54ch; margin-bottom: 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 0.98rem;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, background 0.18s;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: #f3efe2; color: var(--navy-deep); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22); }
.btn-primary:hover { background: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.btn-ghost { background: transparent; color: #f3efe2; border-color: rgba(243, 239, 226, 0.4); }
.btn-ghost:hover { background: rgba(243, 239, 226, 0.1); }
.hero-stats { display: flex; gap: 34px; margin-top: 32px; }
.hero-stat .hs-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: #d9bc6a; line-height: 1.1; }
.hero-stat .hs-label { font-size: 0.8rem; color: #b9b3a2; margin-top: 2px; }

/* Signature: 4 kroki kariery */
.hero-steps { position: relative; flex-shrink: 0; padding-bottom: 8px; }
.hero-steps svg { display: block; width: 340px; height: 240px; }
.hs-node circle { fill: rgba(243, 239, 226, 0.06); stroke: #d9bc6a; stroke-width: 1.6; }
.hs-node circle.hl { fill: #d9bc6a; }
.hs-node text.num { fill: #d9bc6a; font-family: var(--font-display); font-size: 21px; font-weight: 700; text-anchor: middle; }
.hs-node circle.hl + text.num { fill: #16293f; }
.hs-node text.lbl { fill: #f3efe2; font-family: var(--font-body); font-size: 13px; font-weight: 700; text-anchor: middle; }
.hs-node text.sub { fill: #a8a292; font-family: var(--font-body); font-size: 10.5px; text-anchor: middle; }
.hs-path { fill: none; stroke: rgba(217, 188, 106, 0.4); stroke-width: 2; stroke-dasharray: 5 6; }
.hs-arrow { fill: #d9bc6a; }

/* ---------- Home sections ---------- */
.home-section { margin-top: 46px; }
.home-section h2 {
  display: flex; align-items: baseline; gap: 12px; font-size: 1.5rem;
  padding-bottom: 10px; border-bottom: 2px solid var(--line);
}
.sec-count {
  font-family: var(--font-body); font-size: 0.82rem; font-weight: 800; color: #fff;
  background: var(--brass); padding: 3px 8px; border-radius: 6px; letter-spacing: 0.03em;
}
.sec-desc { color: var(--muted); font-size: 0.98rem; margin: 10px 0 20px; max-width: 70ch; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.home-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px 16px; color: var(--text);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s;
}
.home-card::before {
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 3px;
  background: linear-gradient(90deg, var(--brass), var(--navy));
  border-radius: 0 0 4px 4px; opacity: 0; transition: opacity 0.2s;
}
.home-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: var(--line-strong); text-decoration: none; }
.home-card:hover::before { opacity: 1; }
.hc-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 4px; }
.home-card h3 { font-size: 0.95rem; margin: 0; line-height: 1.4; }
.home-card p { font-size: 0.85rem; color: var(--muted); margin: 0; line-height: 1.55; flex: 1; }
.hc-more { font-size: 0.78rem; font-weight: 800; color: var(--navy); margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; }
.hc-more .arrow { transition: transform 0.2s; }
.home-card:hover .hc-more .arrow { transform: translateX(4px); }

/* ---------- Article ---------- */
.article-header { margin-bottom: 26px; }
.breadcrumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--navy); font-weight: 600; }
.breadcrumbs .sep { margin: 0 7px; color: var(--brass); }
.article-header h1 { font-size: 2.2rem; margin-bottom: 10px; }
.article-excerpt { font-size: 1.1rem; color: var(--muted); max-width: 70ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; font-size: 0.82rem; color: var(--muted); }
.tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--brass-soft); color: var(--brass-strong); font-weight: 800; font-size: 0.78rem;
  border: 1px solid transparent;
}

.article-body { max-width: 780px; }
.article-body p { line-height: 1.72; }
.article-body ul, .article-body ol { line-height: 1.7; padding-left: 1.4em; margin: 0 0 1.2em; }
.article-body li { margin-bottom: 0.4em; }
.article-body h2 { margin-top: 2em; padding-top: 0.4em; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-height) + 20px); }
.article-body h3 { margin-top: 1.6em; color: var(--navy); }
.article-body strong { color: var(--text); }
.article-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--brass); text-decoration-thickness: 1.5px; }
.article-body a:hover { color: var(--brass-strong); }

.article-toc {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 26px;
  box-shadow: var(--shadow-card);
}
.article-toc summary { cursor: pointer; font-weight: 800; font-size: 0.95rem; color: var(--navy); }
.article-toc ol { margin: 10px 0 2px; padding-left: 1.3em; font-size: 0.92rem; }
.article-toc li { margin-bottom: 5px; }
.article-toc a { color: var(--text); }

.info-box {
  background: var(--brass-soft); border: 1px solid rgba(163, 130, 47, 0.4); border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 1.4em 0; font-size: 0.97rem;
}
.info-box strong { color: var(--brass-strong); }
.warn-box {
  background: rgba(154, 74, 18, 0.1); border: 1px solid rgba(154, 74, 18, 0.35); border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 1.4em 0; font-size: 0.97rem;
}
.warn-box strong { color: var(--warn); }

.table-responsive { overflow-x: auto; margin: 1.4em 0; border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; background: var(--surface); }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--navy); color: #fff; font-weight: 700; font-size: 0.88rem; }
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--surface-2); }
tbody tr:hover { background: var(--navy-soft); }
.compare-table th:first-child, .compare-table td:first-child { font-weight: 700; color: var(--navy); white-space: nowrap; }
.compare-table td.yes { color: var(--ok); font-weight: 700; }
.compare-table td.no { color: var(--warn); font-weight: 700; }

.faq-item { margin: 0 0 18px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); }
.faq-item h3 { margin: 0 0 8px; font-size: 1.08rem; color: var(--navy); }
.faq-item p { margin: 0; }

dl.glossary { margin: 1.2em 0; }
dl.glossary dt { font-weight: 800; color: var(--navy); margin-top: 1.1em; font-size: 1.02rem; }
dl.glossary dt::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--brass); border-radius: 2px; margin-right: 9px; }
dl.glossary dd { margin: 0.25em 0 0 17px; }

.article-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-nav a { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; transition: transform 0.18s, box-shadow 0.18s; }
.article-nav a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.article-nav .an-label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brass-strong); margin-bottom: 4px; }
.article-nav .an-title { font-weight: 700; font-size: 0.95rem; color: var(--text); line-height: 1.4; }
.article-nav a.next { text-align: right; }

/* ---------- Footer ---------- */
.app-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 60px; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 36px 20px 44px; }
.footer-inner p { font-size: 0.92rem; color: var(--muted); max-width: 90ch; }
.footer-note { font-size: 0.82rem !important; }
.footer-copy { margin-top: 18px; font-size: 0.85rem; font-weight: 700; color: var(--text) !important; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dashMove { to { stroke-dashoffset: -44; } }
.hs-path { animation: dashMove 14s linear infinite; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.reveal.in { opacity: 1; transform: translateY(0); }

@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; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .menu-btn { display: flex; }
  .header-tagline { display: none; }
  .search-wrap { margin-left: 0; width: 100%; }
  .header-inner { gap: 12px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 150;
    width: min(320px, 86vw); max-height: none; border-radius: 0;
    transform: translateX(-102%); transition: transform 0.26s ease-out;
    padding-top: calc(var(--header-height) + 10px);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(13, 20, 32, 0.55); z-index: 140; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  .layout { padding: calc(var(--header-height) + 16px) 14px 40px; }
  .home-hero { flex-direction: column; padding: 40px 26px 26px; align-items: stretch; }
  .hero-steps svg { width: 100%; max-width: 380px; margin: 0 auto; height: auto; }
  .hero-stats { gap: 22px; flex-wrap: wrap; }
  .home-hero h1 { font-size: 2.05rem; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .article-header h1 { font-size: 1.85rem; }
}

@media (max-width: 600px) {
  body { font-size: 16.5px; }
  .brand-name { font-size: 1.18rem; }
  .search-input { height: 40px; }
  .home-hero { padding: 32px 20px 20px; border-radius: 10px; }
  .home-hero h1 { font-size: 1.75rem; }
  .hero-sub { font-size: 0.98rem; }
  .btn { width: 100%; justify-content: center; }
  .hero-cta { flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
  .article-nav { flex-direction: column; }
  .article-nav a.next { text-align: left; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.45rem; }
  .app-footer { margin-top: 40px; }
}
