/* Site chrome: header, listings, note pages, footer. Tokens and patterns follow lab17.pl/assets/css/site.css. */

/* ── Tokens ── */
:root {
  --bg: #0A0C10;
  --surface: #0E1117;
  --surface-band: #0C0F14;
  --surface-hover: #11151C;
  --selected: #1A1F29;
  --border: #1F2430;
  --border-2: #2A303C;
  --border-hover: #3A4150;
  --text: #E8EAF0;
  --text-2: #C4CAD4;
  --text-3: #AEB5C2;
  --muted: #9AA3B2;
  --garden: #8BE28B;
  --font-sans: 'Schibsted Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 5vw, 64px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text-2);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased;
}
.site-main { flex: 1 0 auto; }
:is(a, button):focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.dot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--area, currentColor)); }
.count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 8px 14px; border-radius: 8px; background: var(--text); color: var(--bg); }
.skip-link:focus { left: 8px; }

.eyebrow {
  margin: 0; display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 400; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--text); }
.eyebrow.is-garden { color: var(--garden); }
.lede { margin: 0; max-width: 62ch; font-size: 18px; line-height: 1.6; color: var(--text-2); }
.cta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--garden); text-decoration: none; }
.cta:hover { text-decoration: underline; text-underline-offset: 4px; }
.empty { margin: 0; padding: 24px; border-radius: 14px; border: 1px dashed var(--border-2); color: var(--text-3); font-size: 15px; line-height: 1.5; }

/* ── Header ── */
.site-header { border-bottom: 1px solid var(--border); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; }
.brand-mark { display: flex; color: var(--garden); }
.brand-name { font-family: var(--font-mono); font-size: 15px; font-weight: 500; letter-spacing: 0.02em; }
.brand-sub { font-size: 14px; color: var(--muted); }
.brand-sub::before { content: '/'; margin-right: 10px; color: var(--border-hover); }
.brand:hover .brand-name { color: var(--garden); }
@media (max-width: 600px) { .brand-sub { display: none; } } /* The Polish label wraps below ~600px. */

.lang { display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface); }
.lang-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 40px; padding: 0 10px; border-radius: 999px;
  color: var(--muted); text-decoration: none;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: 0.08em;
  transition: background-color .2s, color .2s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn[aria-current] { background: var(--text); color: var(--bg); }

/* ── Listings (home, /notes/, tags) ── */
.listing { padding-top: clamp(40px, 6vw, 80px); padding-bottom: 80px; }
.page-head { display: flex; flex-direction: column; gap: 20px; max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.page-head .eyebrow .dot { background: var(--area); }
.page-title { margin: 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.05; font-weight: 600; letter-spacing: -0.025em; color: var(--text); }

.stages { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 14px 28px; }
.stages li { display: flex; align-items: center; gap: 12px; }
.stage-icon {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid currentColor; color: var(--c);
  display: flex; align-items: center; justify-content: center;
}
.stages .text { display: flex; flex-direction: column; gap: 1px; }
.stages .name { font-size: 15px; font-weight: 600; color: var(--c); }
.stages .desc { font-size: 14px; color: var(--muted); }

.chips { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-2); color: var(--text-2); text-decoration: none; font-size: 14px;
  transition: border-color .2s, color .2s;
}
.chip:hover { border-color: var(--area); color: var(--text); }

.listing-body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 48px; }
.garden-notes { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.tabs {
  align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; padding: 4px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--bg);
}
.tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background-color .2s, color .2s;
}
.tab:hover { color: var(--text); }
.tab[aria-current] { background: var(--selected); color: #fff; }
.tab[aria-current] .count { color: var(--text-2); }

.notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.note {
  display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color .2s, background-color .2s;
}
.note:hover { border-color: var(--border-hover); background: var(--surface-hover); }
.note .stage-icon { width: 36px; height: 36px; }
.note-body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.note-stage { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c); }
.note-title { font-size: 18px; line-height: 1.3; font-weight: 600; }
.note-blurb { font-size: 15px; line-height: 1.55; color: var(--text-3); }
.note-tags { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 2px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.note-tags .is-hit { color: var(--area); }
.note-arrow { flex-shrink: 0; color: var(--muted); font-size: 18px; transition: transform .2s, color .2s; }
.note:hover .note-arrow { color: var(--text); transform: translateX(3px); }

.areas { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.areas ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.area-link {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 4px;
  border-bottom: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-size: 15px;
}
.area-link .area-name { flex-grow: 1; }
.area-link:hover { color: var(--area); }
.area-link.is-empty { color: var(--muted); }
.area-link.is-empty .dot { opacity: 0.45; }

.pagination { margin-top: 16px; }
.pagination .nav-links { display: flex; gap: 6px; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; border-radius: 10px; color: var(--muted); text-decoration: none; }
.pagination .page-numbers.current { background: var(--selected); color: var(--text); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Note page ── */
.note-page { max-width: calc(720px + 2 * var(--gutter)); padding-top: clamp(40px, 6vw, 72px); padding-bottom: 80px; }
.note-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 40px; }
.note-badge { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.note-badge strong { color: var(--c); font-weight: 600; }
.note-page-title { margin: 0; font-size: clamp(32px, 4.5vw, 48px); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.note-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.note-meta time { color: var(--text-3); }
.note-meta a { color: var(--garden); text-decoration: none; }
.note-meta a:hover { text-decoration: underline; text-underline-offset: 4px; }

.prose { font-size: 18px; line-height: 1.7; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.25em; }
.prose > :is(h2, h3, h4) + * { margin-top: 0.6em; }
.prose .alignwide { margin-left: min(0px, (100% - 1040px) / 2); margin-right: min(0px, (100% - 1040px) / 2); }
.prose .alignfull { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); max-width: none; }

.note-foot { display: flex; flex-direction: column; gap: 40px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.tags { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-2); color: var(--text-3); text-decoration: none;
  font-family: var(--font-mono); font-size: 12px;
  transition: border-color .2s, color .2s;
}
.tag-pill.is-area { border-color: var(--area); color: var(--area); }
.tag-pill:hover { border-color: var(--area); color: var(--text); }
.backlinks { display: flex; flex-direction: column; gap: 14px; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); }
.site-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 28px; padding-bottom: 28px; font-size: 14px; color: var(--muted); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--garden); }

@media (max-width: 560px) {
  .note { padding: 16px; gap: 12px; }
  .note .stage-icon { width: 32px; height: 32px; }
  .note-arrow { display: none; }
  .tabs { align-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
