/* libLuna-style site — tokeny wprost z crates/libluna-core/src/style.rs */

:root {
  color-scheme: light;
  --window-bg: #fafafa;
  --view-bg: #ffffff;
  --card-bg: #ffffff;
  --headerbar-bg: #f2f2f2;
  --sidebar-bg: #ebebeb;
  --text: #2e2e2e;
  --dim: rgba(0, 0, 0, 0.55);
  --border: rgba(0, 0, 0, 0.10);
  --shade: rgba(0, 0, 0, 0.06);
  --accent: #3584e4;
  --accent-fg: #ffffff;
  --accent-soft: rgba(53, 132, 228, 0.13);
  --accent-line: rgba(53, 132, 228, 0.45);
  --good: #2ec27e;
  --warn: #c8871a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.16), 0 4px 14px rgba(0, 0, 0, 0.06);
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --bar-h: 48px;
  --font: "Inter", "Cantarell", "Adwaita Sans", "Noto Sans", system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "SFMono-Regular", ui-monospace,
    "DejaVu Sans Mono", monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --window-bg: #242424;
  --view-bg: #1e1e1e;
  --card-bg: #303030;
  --headerbar-bg: #303030;
  --sidebar-bg: #2b2b2b;
  --text: #ffffff;
  --dim: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.12);
  --shade: rgba(255, 255, 255, 0.08);
  --good: #8ff0a4;
  --warn: #f8e45c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--window-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--accent-fg);
}

figure {
  margin: 0;
}

img {
  max-width: 100%;
}

.run-notes code,
.stack-note code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--shade);
  font-family: var(--mono);
  font-size: 0.9em;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  background: var(--window-bg);
}

/* ── Pasek tytułu ─────────────────────────────────────────────── */

.titlebar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--bar-h);
  padding: 0 10px;
  background: var(--headerbar-bg);
  border-bottom: 1px solid var(--border);
}

.titlebar-left,
.titlebar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.titlebar-left {
  flex: 1 1 auto;
}

.titlebar-right {
  flex: 0 0 auto;
}

.titlebar-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--dim);
  white-space: nowrap;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
  background: var(--shade);
}

.brand img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.crumb {
  color: var(--dim);
  font-size: 12.5px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--shade);
}

.icon-btn:active {
  background: var(--border);
}

.icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.menu-btn {
  display: none;
}

.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--shade);
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.seg-btn .icon {
  width: 14px;
  height: 14px;
}

.seg-btn:hover {
  color: var(--text);
  text-decoration: none;
}

.seg-btn.is-active {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: var(--shadow-sm);
}

.lang-seg .seg-btn {
  min-width: 34px;
}

.accent-btn {
  border-color: transparent;
}

.accent-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 0 1px var(--border);
  background: var(--accent);
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.win-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--dim);
}

.win-dot .icon {
  width: 13px;
  height: 13px;
}

.win-close {
  background: transparent;
  border: 0;
  cursor: pointer;
}

.win-close:hover {
  background: rgba(230, 45, 66, 0.14);
  color: #e62d42;
}

/* Popover akcentów */

.popover {
  position: fixed;
  inset: 54px 16px auto auto;
  width: min(316px, calc(100vw - 24px));
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.popover::backdrop {
  background: transparent;
}

.popover-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.popover-head strong {
  font-size: 14px;
}

.popover-head span {
  color: var(--dim);
  font-size: 11.5px;
}

.accent-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accent-dot {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: var(--dot);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.accent-dot:hover {
  transform: scale(1.12);
}

.accent-dot[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--dot);
}

.popover-note {
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.45;
}

/* ── Układ: sidebar + treść ───────────────────────────────────── */

.app-body {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: var(--bar-h);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - var(--bar-h));
  padding: 16px 10px 16px;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}

.nav-label {
  margin: 8px 10px 4px;
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
}

.nav-item + .nav-item {
  margin-top: 1px;
}

.nav-item .icon {
  width: 16px;
  height: 16px;
  color: var(--dim);
}

.nav-item:hover {
  background: var(--shade);
  text-decoration: none;
}

.nav-item.is-active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.nav-item.is-active .icon {
  color: var(--accent);
}

.nav-sub {
  min-height: 28px;
  margin-left: 20px;
  padding: 3px 10px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
}

.nav-sub:hover {
  color: var(--text);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 4px 4px 0;
}

.status-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent);
}

.status-card p {
  margin: 7px 0 8px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.45;
}

.status-card a {
  font-size: 11.5px;
  font-weight: 600;
}

.repo-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: 11.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.repo-link:hover {
  background: var(--shade);
  color: var(--text);
  text-decoration: none;
}

.repo-link .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.content {
  width: 100%;
  margin: 0;
  padding: 40px clamp(22px, 4.5vw, 88px) 72px;
  overflow: hidden;
}

/* ── Typografia treści ────────────────────────────────────────── */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  min-height: 440px;
  margin-bottom: 78px;
  scroll-margin-top: 68px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 4.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.hero .lead {
  max-width: 62ch;
  margin: 0 0 24px;
  color: var(--dim);
  font-size: clamp(15.5px, 1.25vw, 19px);
  line-height: 1.62;
}

.hero .lead strong {
  color: var(--text);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  background: var(--shade);
  transform: translateY(-1px);
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-fg);
}

.btn-primary:hover {
  background: var(--accent);
  filter: brightness(1.06);
}

.hero-note {
  margin: 0;
  color: var(--dim);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: flex-end;
  justify-self: end;
  width: 100%;
  max-width: clamp(440px, 32vw, 680px);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8% -4% -8% 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--accent-soft), transparent 70%);
  filter: blur(14px);
  z-index: 0;
}

.hero-shot {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
  transform: rotate(-0.6deg);
}

.hero-shot img {
  display: block;
  width: 100%;
  height: clamp(420px, 30vw, 620px);
  object-fit: cover;
  object-position: top center;
}

.hero-badge {
  position: absolute;
  z-index: 2;
  left: -12px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.hero-badge .icon {
  width: 14px;
  height: 14px;
  color: var(--good);
}

.section {
  margin-bottom: 74px;
  scroll-margin-top: 68px;
}

.section-head {
  max-width: 720px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(25px, 2.8vw, 33px);
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.section-head > p:last-child {
  margin: 0;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Karty warstw ─────────────────────────────────────────────── */

.layer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.layer-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  scroll-margin-top: 68px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.layer-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-line);
}

.layer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.layer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
}

.layer-icon .icon {
  width: 21px;
  height: 21px;
}

.tag {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.layer-card h3 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.layer-card > p {
  margin: 0 0 14px;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.58;
}

.analogy {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 11.5px;
}

.analogy strong {
  color: var(--text);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.chip {
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--shade);
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 600;
}

/* ── Dlaczego ─────────────────────────────────────────────────── */

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.why-card {
  padding: 19px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.why-num {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.why-card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.why-card p {
  margin: 0;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.58;
}

.pullquote {
  margin: 22px 0 0;
  padding: 17px 22px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--accent-soft);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

/* ── Stos ─────────────────────────────────────────────────────── */

.stack {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--sidebar-bg);
}

.stack-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.stack-row + .stack-arrow + .stack-row {
  margin-top: 0;
}

.stack-kicker {
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack-row strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.stack-row span:last-child {
  color: var(--dim);
  font-size: 12.5px;
}

.stack-row.is-accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.stack-row.is-accent strong {
  color: var(--accent);
}

.stack-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  color: var(--dim);
  font-size: 13px;
}

.stack-note {
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 12.5px;
}

/* ── Stan projektu ────────────────────────────────────────────── */

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.status-card-big {
  padding: 20px 22px;
}

.status-card-big h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 15px;
}

.status-card-big h3 .icon {
  width: 17px;
  height: 17px;
}

.status-card-big.good h3 {
  color: var(--good);
}

.status-card-big.todo h3 {
  color: var(--warn);
}

.status-card-big ul {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-card-big li {
  position: relative;
  padding-left: 17px;
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.5;
}

.status-card-big li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}

.status-card-big.good li::before {
  background: var(--good);
}

.status-card-big.todo li::before {
  background: var(--warn);
}

.status-note {
  margin: 14px 0 0;
  color: var(--dim);
  font-size: 12.5px;
}

/* ── Galeria ──────────────────────────────────────────────────── */

.gallery {
  columns: 2;
  column-gap: 14px;
}

.shot {
  display: block;
  break-inside: avoid;
  margin: 0 0 14px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.shot:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.shot-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--sidebar-bg);
  cursor: zoom-in;
  line-height: 0;
}

.shot-open img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.shot:hover .shot-open img {
  transform: scale(1.012);
}

.shot figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 15px 14px;
  line-height: 1.45;
}

.shot figcaption strong {
  font-size: 13px;
}

.shot figcaption span {
  color: var(--dim);
  font-size: 12px;
}

/* ── Uruchomienie ─────────────────────────────────────────────── */

.run-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.code-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: #1d1d1d;
  color: #ededed;
  box-shadow: var(--shadow-md);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: #262626;
  color: #a9a9a9;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #d7d7d7;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.copy-btn .icon {
  width: 12px;
  height: 12px;
}

.code-card pre {
  margin: 0;
  padding: 15px 17px 17px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  tab-size: 2;
}

.code-card code {
  font-family: inherit;
}

.code-card .c {
  color: #7e9a7e;
}

.code-card .cmd {
  color: #9fc5ff;
}

.run-notes {
  padding: 18px 20px;
}

.run-notes h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.run-notes ul {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.run-notes li {
  position: relative;
  padding-left: 17px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.55;
}

.run-notes li + li {
  margin-top: 5px;
}

.run-notes li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.run-notes p {
  margin: 0;
  color: var(--dim);
  font-size: 12.5px;
}

.code-card + .code-card,
.run-grid + .code-card {
  margin-top: 14px;
}

/* ── Stopka ───────────────────────────────────────────────────── */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 18px clamp(22px, 4vw, 54px);
  border-top: 1px solid var(--border);
  background: var(--sidebar-bg);
  color: var(--dim);
  font-size: 11.5px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.footer-brand img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.footer-brand span {
  color: var(--dim);
  font-weight: 400;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: var(--dim);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-note {
  flex-basis: 100%;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
}

/* ── Toast + lightbox ─────────────────────────────────────────── */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--window-bg);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--sidebar-bg);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.lightbox-caption {
  margin: 9px 4px 2px;
  color: var(--dim);
  font-size: 12px;
}

/* ── Responsywność ────────────────────────────────────────────── */

.scrim {
  display: none;
}

@media (min-width: 1680px) {
  .gallery {
    columns: 3;
  }
}

@media (max-width: 1180px) {
  .titlebar-center {
    display: none;
  }

  .why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    min-height: 0;
  }

  .hero-visual {
    justify-content: flex-start;
    justify-self: start;
    max-width: 560px;
  }

  .hero-shot {
    transform: none;
  }

  .hero-shot img {
    height: clamp(280px, 52vw, 420px);
  }

  .hero-badge {
    left: 12px;
    bottom: 12px;
  }
}

@media (max-width: 980px) {
  .app-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .menu-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    z-index: 80;
    top: var(--bar-h);
    bottom: 0;
    left: 0;
    width: 272px;
    height: auto;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .scrim {
    position: fixed;
    inset: var(--bar-h) 0 0;
    z-index: 70;
    display: block;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .app.sidebar-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .content {
    padding-top: 30px;
  }

  .run-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .why-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .layer-grid {
    grid-template-columns: 1fr;
  }

  .crumb,
  .window-controls,
  .theme-seg .seg-btn span {
    display: none;
  }

  .theme-seg .seg-btn {
    min-width: 30px;
    padding: 4px 6px;
  }

  .titlebar-right {
    gap: 5px;
  }

  .titlebar {
    padding: 0 7px;
  }

  .content {
    padding: 24px 18px 56px;
  }

  .hero {
    margin-bottom: 58px;
  }

  .hero h1 {
    font-size: clamp(34px, 10vw, 46px);
  }

  .gallery {
    columns: 1;
  }

  .stack-row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 12px 14px;
  }

  .stack-row strong {
    font-size: 14px;
  }

  .stack-row span:last-child {
    font-size: 12px;
  }

  .section {
    margin-bottom: 56px;
  }

  .site-footer {
    padding: 16px 18px;
  }

  .footer-note {
    padding-top: 8px;
  }
}

@media (max-width: 460px) {
  .brand span {
    display: none;
  }

  .lang-seg .seg-btn {
    min-width: 30px;
    padding: 4px 6px;
  }

  .hero .actions .btn {
    width: 100%;
  }

  .popover {
    inset: 54px 8px auto auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
