/* teslawbloku.eu — editorial design tokens */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,500&family=Geist:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Palette — warm editorial paper */
  --paper: #F4F1EA;
  --paper-2: #EAE5DA;
  --paper-3: #DDD6C7;
  --ink: #121210;
  --ink-2: #2B2A26;
  --ink-3: #595650;
  --ink-4: #8A857A;
  --line: #D6D0C2;
  --accent: #B4411E;    /* muted terracotta */
  --accent-dim: #E3C7B9;
  --signal: #0E3A2E;    /* deep forest for confirmations / tags */

  /* Type */
  --serif: 'Newsreader', 'Charter', 'Georgia', serif;
  --sans: 'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;

  /* Scale */
  --step--1: clamp(0.82rem, 0.78rem + 0.2vw, 0.88rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 1.9rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 2.8rem);
  --step-4:  clamp(2.6rem, 2rem + 3vw, 4.2rem);
  --step-5:  clamp(3.2rem, 2.4rem + 4vw, 5.6rem);

  /* Measure */
  --measure: 68ch;
  --measure-wide: 78ch;

  /* Radius (very subtle — editorial) */
  --r-1: 2px;
  --r-2: 4px;
}

[data-theme="dark"] {
  --paper: #14130F;
  --paper-2: #1C1B17;
  --paper-3: #2A2824;
  --ink: #EFEBDF;
  --ink-2: #D6D1C2;
  --ink-3: #9A9488;
  --ink-4: #6A665D;
  --line: #2D2B26;
  --accent: #E38260;
  --accent-dim: #44281E;
  --signal: #7FB89F;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, ul, ol { margin: 0; padding: 0; }

.tw-page {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

.tw-page h1, .tw-page h2, .tw-page h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.08;
  color: var(--ink);
  font-feature-settings: "ss02";
}

.tw-page h1 { font-size: var(--step-5); line-height: 1.02; letter-spacing: -0.025em; }
.tw-page h2 { font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.015em; }
.tw-page h3 { font-size: var(--step-2); line-height: 1.2; }

/* Mono micro */
.mono {
  font-family: var(--mono);
  font-size: 0.78em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Rules */
.rule { height: 1px; background: var(--line); width: 100%; }
.rule-thick { height: 2px; background: var(--ink); width: 100%; }

/* Link */
.tw-link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 100%;
  padding-bottom: 1px;
  transition: background-size .2s ease;
}
.tw-link:hover { background-size: 100% 2px; }

/* Prose */
.prose p { font-family: var(--serif); font-size: 1.18rem; line-height: 1.65; color: var(--ink-2); margin-bottom: 1.25em; max-width: var(--measure); }
.prose p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 4.2em;
  float: left;
  line-height: 0.85;
  padding: 0.08em 0.08em 0 0;
  font-weight: 500;
  color: var(--ink);
}
.prose h2 { font-size: var(--step-2); margin: 2em 0 0.6em; max-width: var(--measure); }
.prose h3 { font-size: var(--step-1); font-family: var(--serif); margin: 1.6em 0 0.4em; max-width: var(--measure); }
.prose blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.35;
  padding: 0.4em 0 0.4em 1.2em;
  border-left: 2px solid var(--accent);
  margin: 1.6em 0;
  max-width: var(--measure);
  color: var(--ink);
}
.prose ul, .prose ol { max-width: var(--measure); margin: 1em 0; padding-left: 1.4em; }
.prose li { font-family: var(--serif); font-size: 1.15rem; line-height: 1.6; margin-bottom: 0.5em; color: var(--ink-2); }
.prose figure { margin: 2em 0; max-width: var(--measure-wide); }
.prose figcaption { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-top: 0.6em; }

/* Callout */
.callout {
  background: var(--paper-2);
  border-left: 2px solid var(--ink);
  padding: 1.2em 1.4em;
  margin: 1.6em 0;
  max-width: var(--measure);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.55;
}
.callout-label { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 0.4em; display: block; }

/* Tag pill */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 3px 8px 3px 0;
  text-decoration: none;
}
.tag::before { content: '#'; color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  border-radius: var(--r-1);
  transition: all .15s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
}

/* Image placeholder (striped) */
.ph {
  background: repeating-linear-gradient(
    135deg,
    var(--paper-2) 0 10px,
    var(--paper-3) 10px 11px
  );
  position: relative;
  color: var(--ink-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  background: var(--paper);
  padding: 4px 10px;
  border: 1px solid var(--line);
  color: var(--ink-3);
}

/* Browser chrome for mock */
.chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.chrome-dots { display: flex; gap: 6px; }
.chrome-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--paper-3); }
.chrome-url {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  border-radius: 2px;
}

/* Scrollbars inside artboards */
.scroll-box { overflow-y: auto; overflow-x: hidden; }
.scroll-box::-webkit-scrollbar { width: 8px; }
.scroll-box::-webkit-scrollbar-thumb { background: var(--paper-3); border-radius: 4px; }



/* Site-specific additions */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper); padding: 10px 14px;
  font-family: var(--mono); font-size: 12px; z-index: 100;
}
.skip-link:focus { left: 10px; top: 10px; }

html, body { height: auto; overflow: auto; margin: 0; background: var(--paper); }
body { font-family: var(--sans); color: var(--ink); }
[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
a { color: inherit; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* Monospace meta should keep digits aligned */
.mono, time { font-variant-numeric: tabular-nums; }

/* Branded selection color */
::selection { background: var(--accent-dim); color: var(--ink); }
::-moz-selection { background: var(--accent-dim); color: var(--ink); }

/* Sticky header shouldn't obscure anchor targets */
:target, .prose h2[id], .prose h3[id], .prose h4[id] {
  scroll-margin-top: 96px;
}

/* Search modal */
dialog.search-modal {
  padding: 0; border: 1px solid var(--line); border-radius: 4px;
  max-width: 720px; width: 92vw; max-height: 80vh;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 40px 80px rgba(0,0,0,0.25);
}
dialog.search-modal::backdrop { background: rgba(18,18,16,0.6); backdrop-filter: blur(3px); }
.search-modal-inner { display: flex; flex-direction: column; max-height: 80vh; }
.search-modal-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  color: var(--ink-3);
}
.search-modal-bar input {
  flex: 1; border: none; background: transparent;
  font-family: var(--serif); font-size: 22px; color: var(--ink);
  outline: none;
}
.search-modal-bar kbd {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  padding: 2px 6px; border: 1px solid var(--line); border-radius: 2px;
  background: var(--paper-2);
}
.search-close {
  background: transparent; border: 1px solid var(--line);
  width: 30px; height: 30px; border-radius: 2px; cursor: pointer;
  font-size: 18px; color: var(--ink-3); line-height: 1;
}
.search-close:hover { color: var(--ink); border-color: var(--ink-3); }
.search-results { flex: 1; overflow-y: auto; }
.search-hint {
  padding: 24px 20px; color: var(--ink-3); font-family: var(--serif);
  font-size: 15px; line-height: 1.4;
}
.search-result {
  display: block; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  transition: background .12s ease;
}
.search-result:hover, .search-result.is-selected {
  background: var(--accent-dim);
}
.search-result-meta {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}
.search-result-title {
  font-family: var(--serif); font-size: 18px; margin-bottom: 4px;
  line-height: 1.3;
}
.search-result-excerpt {
  font-family: var(--serif); font-size: 14px; color: var(--ink-3);
  line-height: 1.4;
}
.search-result mark {
  background: transparent; color: var(--accent); font-weight: 500;
}
.search-modal-foot {
  padding: 10px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 16px; flex-wrap: wrap;
  background: var(--paper-2);
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.search-modal-foot kbd {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 2px;
  margin-right: 4px;
}
@media (max-width: 640px) {
  dialog.search-modal { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .search-modal-inner { max-height: 100vh; height: 100vh; }
  .search-modal-foot { display: none; }
  .search-modal-bar input { font-size: 18px; }
}

/* Tag cloud — wariacja przez font-weight zamiast ulamkowego font-size */
.tw-tag-cloud-item {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-2); text-decoration: none;
  padding: 4px 10px; border: 1px solid var(--line);
  border-radius: 2px;
  transition: background .12s ease, border-color .12s ease;
}
.tw-tag-cloud-item:hover {
  background: var(--paper-2); border-color: var(--ink-3); color: var(--ink);
}

/* Editorial paragraph rhythm — pierwszy akapit flush, kolejne z wcięciem */
.prose p + p {
  text-indent: 1.3em;
  margin-top: -0.3em;  /* zmniejsz odstęp bo wcięcie daje separację wizualną */
}
/* Ale akapit po blokach strukturalnych zawsze flush */
.prose h2 + p, .prose h3 + p, .prose h4 + p,
.prose blockquote + p, .prose ul + p, .prose ol + p,
.prose hr + p, .prose pre + p, .prose figure + p,
.prose .callout + p, .prose table + p {
  text-indent: 0;
  margin-top: 0;
}
/* Mobile: wcięcie mniej dominujące */
@media (max-width: 720px) {
  .prose p + p { text-indent: 1em; margin-top: -0.2em; }
}

/* Pull-quote wariant — dla magazynowych cytatow wyrzuconych poza kolumne */
.prose blockquote.pull {
  font-size: 2.2rem; line-height: 1.2;
  font-style: italic; font-weight: 500;
  padding: 0; margin: 1.8em 0 1.8em -2em;
  max-width: calc(var(--measure) + 4em);
  border: none;
  color: var(--ink);
  text-align: left;
}
.prose blockquote.pull::before {
  content: "„"; font-family: var(--serif); color: var(--accent);
  font-size: 1.4em; line-height: 0; vertical-align: -0.15em; margin-right: 0.05em;
}
.prose blockquote.pull::after {
  content: """;font-family: var(--serif); color: var(--accent);
  font-size: 1.4em; line-height: 0; vertical-align: -0.15em;
}
@media (max-width: 720px) {
  .prose blockquote.pull {
    font-size: 1.5rem; margin-left: 0; max-width: 100%;
    padding-left: 1em; border-left: 2px solid var(--accent);
  }
  .prose blockquote.pull::before, .prose blockquote.pull::after { content: none; }
}

/* Article card hover (homepage grid, related, archive preview) */
.tw-card { cursor: pointer; }
.tw-card .tw-card-title a { transition: color .15s ease; }
.tw-card:hover .tw-card-title { color: var(--accent) !important; }
.tw-card:hover .tw-card-title a { color: var(--accent); }

/* Archive row */
.tw-archive-row {
  display: grid; grid-template-columns: 52px 110px 1fr 80px;
  gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.tw-archive-date { font-size: 12px; color: var(--ink-4); }
.tw-archive-cat  { font-size: 10px; color: var(--accent); }
.tw-archive-title {
  font-family: var(--serif); font-size: 20px; color: var(--ink);
  text-decoration: none; line-height: 1.25;
}
.tw-archive-title:hover { color: var(--accent); }
.tw-archive-read { font-size: 10px; color: var(--ink-3); text-align: right; }

@media (max-width: 720px) {
  .tw-archive-row {
    grid-template-columns: 1fr auto; grid-template-areas:
      "meta meta"
      "title read";
    gap: 6px 12px; padding: 14px 0;
  }
  .tw-archive-date { grid-area: meta; display: inline; }
  .tw-archive-cat  { grid-area: meta; display: inline; margin-left: 10px; }
  .tw-archive-title { grid-area: title; font-size: 17px; }
  .tw-archive-read { grid-area: read; align-self: end; }
}

/* Mobile TOC (auto-hidden on desktop — lewy rail przejmuje rolę) */
.tw-toc-mobile { display: none; }
.tw-toc-mobile > summary {
  cursor: pointer;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent);
  padding: 12px 16px;
  border: 1px solid var(--line); background: var(--paper-2);
  list-style: none;
}
.tw-toc-mobile > summary::-webkit-details-marker { display: none; }
.tw-toc-mobile > summary::after {
  content: "+ "; float: right; color: var(--ink-3);
}
.tw-toc-mobile[open] > summary::after { content: "− "; }
.tw-toc-mobile {
  margin-bottom: 32px;
}
@media (max-width: 960px) {
  .tw-toc-mobile { display: block; }
}
@media (max-width: 720px) {
  :target, .prose h2[id], .prose h3[id], .prose h4[id] { scroll-margin-top: 76px; }
}

/* ---------- Header / navigation ---------- */
.tw-header {
  border-bottom: 1px solid var(--line); background: var(--paper);
  padding: 18px 48px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.tw-brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--serif); font-weight: 500; font-size: 18px;
  letter-spacing: -0.02em;
}
.tw-brand-mark {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink);
  font-family: var(--mono); font-weight: 500; font-size: 10px;
  letter-spacing: -0.02em;
}
.tw-brand-tld { color: var(--ink-3); font-style: italic; }

.tw-menu { position: relative; }
.tw-menu > summary { display: none; }
.tw-nav {
  display: flex; gap: 28px; align-items: center;
}
.tw-nav-link {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  color: var(--ink-3); text-decoration: none;
  border-bottom: 1.5px solid transparent;
  padding: 10px 2px; /* 44px+ hit area bez visible shift */
  display: inline-flex; align-items: center;
}
.tw-nav-link.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tw-nav-link:hover { color: var(--ink); }

.tw-icon {
  background: transparent; border: 1px solid var(--line);
  width: 40px; height: 40px; min-width: 40px;
  border-radius: 2px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 14px;
  font-family: var(--sans);
}
.tw-icon:hover { color: var(--ink); border-color: var(--ink-3); }

@media (max-width: 720px) {
  .tw-header { padding: 14px 20px; }
  .tw-menu > summary.tw-hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--line);
    border-radius: 2px; cursor: pointer; color: var(--ink-2);
    list-style: none;
  }
  .tw-menu > summary.tw-hamburger::-webkit-details-marker { display: none; }
  .tw-menu[open] > summary.tw-hamburger { background: var(--paper-2); color: var(--ink); }
  .tw-menu > .tw-nav {
    display: none;
    position: absolute; top: calc(100% + 14px); right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    min-width: 240px;
    background: var(--paper); border: 1px solid var(--line);
    padding: 8px 0;
    box-shadow: 0 8px 24px rgba(18,18,16,0.08);
  }
  .tw-menu[open] > .tw-nav { display: flex; }
  .tw-menu > .tw-nav .tw-nav-link {
    padding: 14px 20px; border-bottom: 1px solid var(--line);
    font-size: 16px; min-height: 44px; display: flex; align-items: center;
  }
  .tw-menu > .tw-nav .tw-nav-link.is-active {
    border-bottom-color: var(--line);
    box-shadow: inset 2px 0 0 var(--accent);
  }
  .tw-menu > .tw-nav .tw-nav-link:last-of-type { border-bottom: none; }
  .tw-menu > .tw-nav > button {
    margin: 10px 20px 4px; align-self: flex-start;
  }
}

/* Prose styles in article body — inherit from .prose but with content-HTML pragmatics */
.prose {
  font-family: var(--serif);
  max-width: 720px;
}
.prose p { font-family: var(--serif); font-size: 1.18rem; line-height: 1.65; color: var(--ink-2); margin-bottom: 1.25em; }
.prose p:first-of-type::first-letter {
  font-family: var(--serif); font-size: 4.2em; float: left;
  line-height: 0.85; padding: 0.08em 0.08em 0 0; font-weight: 500; color: var(--ink);
}
.prose h2 { font-size: var(--step-2); margin: 2em 0 0.6em; font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; }
.prose h3 { font-size: var(--step-1); font-family: var(--serif); margin: 1.6em 0 0.4em; font-weight: 500; }
.prose h4 { font-size: 1.1rem; font-family: var(--serif); margin: 1.4em 0 0.4em; font-weight: 600; }
.prose blockquote {
  font-family: var(--serif); font-style: italic; font-size: 1.5rem; line-height: 1.35;
  padding: 0.4em 0 0.4em 1.2em; border-left: 2px solid var(--accent);
  margin: 1.6em 0; color: var(--ink);
}
.prose ul, .prose ol { margin: 1em 0; padding-left: 1.4em; }
.prose li { font-family: var(--serif); font-size: 1.08rem; line-height: 1.6; margin-bottom: 0.5em; color: var(--ink-2); }
.prose a { color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-size: 100% 1px; background-position: 0 100%;
  padding-bottom: 1px;
}
.prose a:hover { background-size: 100% 2px; }
.prose img, .prose video, .prose iframe { max-width: 100%; height: auto; margin: 1.4em 0; display: block; }
.prose figure { margin: 1.8em 0; }
.prose figcaption {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-3); margin-top: 0.6em; text-align: center;
}
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--paper-2); padding: 1px 6px; border-radius: 2px; }
.prose pre { background: var(--paper-2); padding: 16px; overflow-x: auto; font-family: var(--mono); font-size: 0.85em; margin: 1.4em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.95rem; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }

/* Responsive */
@media (max-width: 960px) {
  .tw-strap, .tw-hero, section, .tw-footer { padding-left: 24px !important; padding-right: 24px !important; }
  .tw-hero-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .tw-hero-grid h1 { font-size: 48px !important; }
  .tw-grid-3 { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .tw-grid-4 { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .tw-two-col, .tw-two-col-tag { grid-template-columns: 1fr !important; gap: 40px !important; }
  .tw-article-body { grid-template-columns: 1fr !important; padding-left: 24px !important; padding-right: 24px !important; }
  .tw-rail-left, .tw-rail-right { position: static !important; }
  .tw-article-header h1 { font-size: 48px !important; max-width: none !important; }
  .tw-about-hero { grid-template-columns: 1fr !important; gap: 32px !important; }
  .tw-about-hero h1 { font-size: 52px !important; }
  .tw-year-rail { position: static !important; }
  footer.tw-footer { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 640px) {
  .tw-grid-3, .tw-grid-4 { grid-template-columns: 1fr !important; }
  .tw-hero-grid h1 { font-size: 36px !important; }
  .tw-article-header h1 { font-size: 36px !important; }
  footer.tw-footer { grid-template-columns: 1fr !important; }
  .prose p:first-of-type::first-letter { font-size: 2.8em; }
  section { padding-top: 32px !important; padding-bottom: 32px !important; }
  /* Masthead strap: srodkowy slogan ukryty na mobile (za ciasno) */
  .tw-strap > span:nth-child(2) { display: none; }
}

/* ---------- Print ---------- */
@media print {
  :root { --paper: #fff; --paper-2: #fff; --paper-3: #eee; --line: #ccc; }
  html, body { background: #fff !important; color: #000 !important; }
  /* Chrome, toolbar, navigation out */
  .tw-header, .tw-footer, .tw-menu, .tw-toc-mobile,
  .tw-rail-left, .tw-rail-right, .tw-prev-next,
  .search-modal, #progress-bar, .tw-card-meta,
  .tw-grid-3, .tw-grid-4 { display: none !important; }
  /* Pełna szerokość treści */
  .tw-article-body { grid-template-columns: 1fr !important; padding: 0 !important; }
  .prose { max-width: 100% !important; }
  .prose p { font-size: 11pt; line-height: 1.5; color: #000; }
  .prose h1, .prose h2, .prose h3 { color: #000; page-break-after: avoid; }
  .prose p, .prose li { orphans: 3; widows: 3; }
  .prose figure, .prose blockquote, .prose pre, .prose table { page-break-inside: avoid; }
  .prose img { max-width: 100% !important; page-break-inside: avoid; }
  /* Pokaż URL linków obok linków */
  .prose a[href]::after {
    content: " [" attr(href) "]";
    font-family: var(--mono); font-size: 9pt; color: #666;
    word-break: break-all;
  }
  .prose a[href^="#"]::after, .prose a[href^="mailto:"]::after { content: ""; }
  /* Progress bar out, drop-cap zostaje ale mniejszy */
  .prose p:first-of-type::first-letter { font-size: 3em; }
  /* Strony o pełnej szerokości */
  article > header { padding: 0 0 24px !important; border-bottom: 2px solid #000 !important; }
  .tw-article-header h1 { font-size: 28pt !important; max-width: 100% !important; color: #000 !important; }
  /* Podstawowe metadane po tytule */
  @page { margin: 2cm; }
}
