/* ==========================================================================
   Piotr Macholak — portfolio
   Mobile-first. Breakpointy: 640 / 960 / 1200 px.
   ========================================================================== */

:root {
  --navy: #0B1F4D;
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-400: #60A5FA;
  --blue-300: #93C5FD;
  --blue-100: #DBEAFE;
  --blue-50: #EFF6FF;

  --bg: #FFFFFF;
  --bg-alt: #F7FAFF;
  --surface: #FFFFFF;
  --text: #0F172A;
  --text-muted: #475569;
  --border: #E2E8F0;
  --accent: var(--blue-700);
  --accent-soft: var(--blue-50);
  --accent-text: var(--blue-700);
  --line: var(--blue-300);
  --chip-bg: #F1F5FF;
  --chip-text: #1E3A8A;
  --header-bg: rgba(255, 255, 255, .82);

  /* Gradient główny — prawa krawędź przyciemniona względem #60A5FA, żeby biały tekst miał kontrast AA */
  --grad-main: linear-gradient(135deg, #0B1F4D 0%, #1D4ED8 58%, #2563EB 100%); /* koniec #2563EB: biały tekst ≥ 4,5:1 w całym hero */
  --grad-light: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 100%);
  --grad-avatar: linear-gradient(135deg, #1D4ED8 0%, #60A5FA 100%);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .06), 0 16px 32px rgba(29, 78, 216, .08);
  --shadow-lg: 0 8px 20px rgba(15, 23, 42, .08), 0 24px 48px rgba(29, 78, 216, .14);

  /* Na gradiencie (hero, kontakt, 404) i na akcencie */
  --on-accent: #FFFFFF;
  --on-grad-muted: #E6EFFF;
  --on-grad-fill: rgba(255, 255, 255, .08);
  --on-grad-fill-strong: rgba(255, 255, 255, .14);
  --on-grad-line: rgba(255, 255, 255, .22);
  --on-grad-line-strong: rgba(255, 255, 255, .7);
  --primary-hover: #1E40AF;
  --ink: #0F172A;
  --ink-2: #334155;
  --overlay: rgba(5, 10, 25, .92);
  --footer-bg: var(--navy);
  --footer-text: #C7D5EE;
  /* Statusy aplikacji */
  --status-ok: #15803D;
  --status-dev: linear-gradient(135deg, #FACC15 0%, #F97316 100%);
  --status-planned: #94A3B8;
  --status-planned-on-grad: #A5B4FC;
  /* Kropki okna przeglądarki w galerii */
  --frame-dot-1: #F87171;
  --frame-dot-2: #FBBF24;
  --frame-dot-3: #34D399;
  --shadow-accent: 0 6px 14px rgba(29, 78, 216, .25);
  --shadow-accent-lg: 0 10px 22px rgba(29, 78, 216, .32);
  --shadow-photo: 0 20px 50px rgba(5, 15, 45, .45);
  --shadow-header: 0 1px 0 var(--border), 0 6px 20px rgba(15, 23, 42, .06);
  /* Poświaty w tle gradientu (radial-gradient, bez filter: blur) */
  --glow-1: rgba(147, 197, 253, .38);
  --glow-2: rgba(59, 130, 246, .42);
  --glow-3: rgba(96, 165, 250, .16);
  --glow-contact: rgba(147, 197, 253, .26);

  /* Typografia */
  --fs-h1: clamp(2.4rem, 1.6rem + 4vw, 4.2rem);
  --fs-h2: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem);
  --fs-h3: clamp(1.25rem, 1.1rem + .6vw, 1.45rem);
  --fs-h4: 1.125rem;
  --fs-lead: 1.0625rem;
  --fs-body: 1rem;
  --fs-body-sm: .9375rem;
  --fs-small: .875rem;
  --fs-xs: .8125rem;
  --fs-2xs: .75rem;
  --lh-body: 1.6;
  --lh-heading: 1.15;
  --measure: 68ch;

  /* Odstępy: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 96 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --section-pad: var(--space-8);
  --grid-gap: var(--space-4);
  --card-pad: 20px;

  /* Ruch */
  --dur: 300ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --radius: 18px;
  --radius-sm: 12px;
  --container: 1272px; /* + 2 × gutter ≈ 1320 px */
  --gutter: 16px;
  --header-h: 64px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light;
}

/* Ciemny: wg systemu (bez JS) albo wybrany przełącznikiem */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220;
    --bg-alt: #0E1628;
    --surface: #111A2E;
    --text: #E2E8F0;
    --text-muted: #A3B1C6;
    --border: #1F2B45;
    --accent: #60A5FA;
    --accent-soft: rgba(96, 165, 250, .12);
    --accent-text: #93C5FD;
    --line: #2C4C86;
    --chip-bg: rgba(96, 165, 250, .1);
    --chip-text: #BFDBFE;
    --header-bg: rgba(11, 18, 32, .82);
    --grad-light: linear-gradient(180deg, #0E1628 0%, #0B1220 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
    color-scheme: dark;
    --status-ok: #4ADE80;
    --footer-bg: #070D19;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1220;
  --bg-alt: #0E1628;
  --surface: #111A2E;
  --text: #E2E8F0;
  --text-muted: #A3B1C6;
  --border: #1F2B45;
  --accent: #60A5FA;
  --accent-soft: rgba(96, 165, 250, .12);
  --accent-text: #93C5FD;
  --line: #2C4C86;
  --chip-bg: rgba(96, 165, 250, .1);
  --chip-text: #BFDBFE;
  --header-bg: rgba(11, 18, 32, .82);
  --grad-light: linear-gradient(180deg, #0E1628 0%, #0B1220 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
  color-scheme: dark;
  --status-ok: #4ADE80;
  --footer-bg: #070D19;
}

/* ---------- Reset / baza ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
/* Siatka bezpieczeństwa: clip nie tworzy kontenera przewijania (sticky działa), a iOS Safari respektuje go na <html> */
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
/* Język EN wybrany wcześniej: chwilowo ukryj treść, aż JS podmieni teksty (bez „mignięcia” PL) */
.i18n-pending body { opacity: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0; line-height: var(--lh-heading); font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
/* Adresy e-mail i URL nie mają miejsc łamania — bez tego rozpychają karty na wąskim ekranie */
a[href^="mailto:"], a[href^="http"] { overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--blue-400);
  outline-offset: 3px;
  border-radius: 6px;
}
.on-gradient :focus-visible { outline-color: var(--on-accent); }

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--on-accent);
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon { width: 24px; height: 24px; flex: none; }
.icon--inline { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.15em; }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: var(--fs-body-sm);
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  max-width: 100%;
  cursor: pointer;
  transition: box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* Ikony w przyciskach: 18 px (logo sklepów 20 px) */
.btn > svg, .btn .icon { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--blue-700); color: var(--on-accent); box-shadow: var(--shadow-accent); }
.btn--primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-accent-lg); }
:root[data-theme="dark"] .btn--primary { background: var(--blue-500); color: var(--bg); }
:root[data-theme="dark"] .btn--primary:hover { background: var(--blue-400); }
.btn--white { background: var(--on-accent); color: var(--navy); box-shadow: var(--shadow-accent); }
.btn--white:hover { background: var(--blue-50); }
.btn--outline-light { border-color: var(--on-grad-line-strong); color: var(--on-accent); background: var(--on-grad-fill); }
.btn--outline-light:hover { background: var(--on-grad-fill-strong); border-color: var(--on-accent); }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-text); }
.btn--sm { padding: 8px 16px; font-size: var(--fs-small); } /* ta sama wysokość, mniejszy padding */
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .7;
  transform: none;
  box-shadow: none;
}

/* Przycisk trzeciego rzędu: link ze strzałką */
.link-arrow, .apps-all, .article-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  font-weight: 700;
  text-decoration: none;
}
.link-arrow svg, .apps-all svg, .article-link svg { width: 16px; height: 16px; flex: none; }
.link-arrow:hover, .apps-all:hover, .article-link:hover { text-decoration: underline; }

/* ---------- Nagłówek / nawigacja ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  color: var(--on-accent);
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.site-header.is-scrolled,
.site-header--solid {
  background: var(--header-bg);
  color: var(--text);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  box-shadow: var(--shadow-header);
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}
.brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-links {
  list-style: none;
  display: none;
}
.nav-links a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  min-width: 0;
}
.nav-back span { overflow: hidden; text-overflow: ellipsis; }
.nav-tools { display: flex; align-items: center; gap: 6px; flex: none; }
@media (max-width: 359.98px) {
  .nav { gap: 4px; }
  .nav-tools { gap: 2px; }
  .lang-switch button { min-width: 30px; padding-inline: 7px; }
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 35%, transparent);
}
.lang-switch button {
  border: 0;
  background: none;
  padding: 4px 9px;
  min-width: 34px;
  min-height: 30px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  opacity: .8;
}
.lang-switch button[aria-pressed="true"] { background: var(--on-accent); color: var(--navy); opacity: 1; }
.site-header.is-scrolled .lang-switch button[aria-pressed="true"],
.site-header--solid .lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
}
.icon-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }

/* Menu mobilne — pełnoekranowe (6 linków mieści się w pasku dopiero od 1200 px) */
@media (max-width: 1199.98px) {
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-content: safe center; /* niski ekran (telefon poziomo): pierwsze linki nie uciekają nad krawędź */
    gap: 8px;
    position: fixed;
    inset: 0;
    z-index: -1;
    padding: calc(var(--header-h) + 24px) 24px 48px;
    background: var(--bg);
    color: var(--text);
    overflow-y: auto;
  }
  .nav-links.is-open a {
    display: block;
    padding: 12px 8px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
  }
  .nav-links.is-open a.is-active { color: var(--accent-text); }
  .menu-open .site-header { color: var(--text); background: var(--bg); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .menu-open .site-header .lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
  .menu-open { overflow: hidden; }
}
@media (min-width: 1200px) {
  .menu-toggle { display: none; }
  .nav { gap: 12px; }
  .nav-links { display: flex; gap: 4px; margin-right: 8px; }
  .nav-links a {
    position: relative;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    opacity: .85;
  }
  .nav-links a:hover { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
  .nav-links a.is-active { opacity: 1; }
  .nav-links a.is-active::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }
  .site-header.is-scrolled .nav-links a.is-active { color: var(--accent-text); }
}

/* ---------- Sekcje ---------- */
.section { padding-block: var(--section-pad); background: var(--bg); }
.section--alt { background: var(--grad-light); }
.section-head { max-width: 720px; margin-bottom: var(--space-6); }
.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.section-title {
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section-lead { max-width: var(--measure); margin-top: var(--space-4); color: var(--text-muted); font-size: var(--fs-lead); }

@media (min-width: 640px) {
  :root { --gutter: 24px; --card-pad: 24px; }
}
@media (min-width: 960px) {
  :root { --section-pad: var(--space-9); --grid-gap: var(--space-5); --card-pad: 28px; }
}
@media (min-width: 960px) {
  .section-head { margin-bottom: var(--space-7); }
}

/* ---------- Karty ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* Jeden stan hover dla wszystkich kart: mocniejszy cień, bez przesuwania */
.card:hover { box-shadow: var(--shadow-md); }

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.3;
}
.chips--sm .chip { min-height: 26px; padding: 2px 10px; font-size: var(--fs-xs); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge--current { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Hero ---------- */
/* Poświaty jako gradienty radialne w tle — bez filter: blur() i osobnych warstw.
   (Rozmyte elementy WebKit/Safari renderuje jako prostokątne warstwy GPU: widoczne krawędzie, czasem czarne pole.) */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(520px circle at calc(100% - 60px) 40px, var(--glow-1), transparent 70%),
    radial-gradient(460px circle at 40px calc(100% - 20px), var(--glow-2), transparent 70%),
    radial-gradient(380px circle at 52% 45%, var(--glow-3), transparent 70%),
    var(--grad-main);
  color: var(--on-accent);
  padding: calc(var(--header-h) + 40px) 0 88px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  justify-items: center;
  text-align: center;
}
.hero-text { width: 100%; min-width: 0; }
.hero-photo {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 5px solid var(--on-accent);
  object-fit: cover;
  box-shadow: var(--shadow-photo), 0 0 0 10px var(--on-grad-fill);
}
.hero-title {
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.hero-subtitle {
  margin-top: 14px;
  font-size: clamp(1.05rem, .95rem + .6vw, 1.3rem);
  font-weight: 600;
  color: var(--on-grad-muted);
}
.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: var(--fs-body-sm);
  color: var(--on-grad-muted);
}
.hero-lead {
  max-width: var(--measure);
  margin-inline: auto;
  margin-top: var(--space-5);
  font-size: var(--fs-lead);
  color: var(--on-accent);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
/* Telefon: przyciski jeden pod drugim, na pełną szerokość */
@media (max-width: 639.98px) {
  .hero-actions { flex-direction: column; align-items: stretch; max-width: 420px; margin-inline: auto; }
  .hero-actions > .btn, .hero-actions > .tooltip-wrap, .hero-actions > .tooltip-wrap > .btn { width: 100%; }
}
.hero-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.hero-chips li {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid var(--on-grad-line);
  background: var(--on-grad-fill);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.35;
}
.scroll-down {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--on-accent);
  border: 1px solid var(--on-grad-line-strong);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

@media (min-width: 900px) {
  .hero { padding: calc(var(--header-h) + 72px) 0 128px; min-height: min(100vh, 860px); display: flex; align-items: center; }
  .hero > .container { width: 100%; }
  .hero-inner {
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    justify-items: start;
    text-align: left;
    gap: 56px;
  }
  .hero-lead { margin-inline: 0; }
  .hero-photo-wrap { order: 2; justify-self: center; }
  .hero-photo { width: 300px; height: 300px; border-width: 6px; }
  .hero-actions, .hero-chips { justify-content: flex-start; }
}

/* Strona główna: 900–1099 px tekst + zdjęcie, panel aplikacji pod spodem;
   od 1100 px trzy kolumny: tekst · zdjęcie · panel */
@media (min-width: 900px) {
  .hero--home { padding-bottom: 104px; }
  .hero--home .hero-inner {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    grid-template-areas: "text photo" "panel panel";
    gap: 40px 48px;
  }
  .hero--home .hero-text { grid-area: text; }
  .hero--home .hero-photo-wrap { grid-area: photo; order: 0; }
  .hero--home .apps-panel { grid-area: panel; }
}
@media (min-width: 1100px) {
  .hero--home .hero-inner {
    grid-template-columns: minmax(0, 45fr) minmax(0, 25fr) minmax(0, 30fr);
    grid-template-areas: "text photo panel";
    gap: 40px;
  }
  .hero--home .hero-title { font-size: clamp(2.8rem, 1rem + 3.2vw, 4rem); }
  .hero--home .hero-photo { width: clamp(220px, 19vw, 290px); height: auto; aspect-ratio: 1; }
}

/* ---------- Panel „Moje aplikacje” (hero, od 900 px) ---------- */
.apps-panel { display: none; }
@media (min-width: 900px) {
  .apps-panel {
    display: block;
    width: 100%;
    padding: var(--card-pad);
    border-radius: 20px;
    background: var(--on-grad-fill);
    border: 1px solid var(--on-grad-line);
    text-align: left;
  }
}
.apps-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.apps-title { font-size: var(--fs-h4); font-weight: 800; letter-spacing: -0.01em; }
.apps-all { color: var(--on-accent); }
.apps-group + .apps-group { margin-top: 18px; }
.apps-group-title { margin-bottom: var(--space-2); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--on-grad-muted); }
.apps-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.app-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--on-grad-line);
  background: var(--on-grad-fill);
  color: var(--on-accent);
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.app-tile:hover { background: var(--on-grad-fill-strong); border-color: var(--on-grad-line-strong); }
.app-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; }
.app-mono {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--grad-avatar);
  box-shadow: inset 0 0 0 1px var(--on-grad-line);
  color: var(--on-accent);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
}
.app-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.app-name { font-weight: 700; font-size: var(--fs-body-sm); }
.app-short { font-size: var(--fs-xs); color: var(--on-grad-muted); }
.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.app-badge--ok { background: var(--on-accent); color: var(--navy); }
.app-badge--dev { background: var(--on-grad-fill-strong); color: var(--on-accent); }
.app-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--status-dev); }
.app-dot--planned { background: var(--status-planned); }
.hero .app-dot--planned { background: var(--status-planned-on-grad); }
@media (min-width: 900px) and (max-width: 1099.98px) {
  .apps-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
  .apps-group + .apps-group { margin-top: 0; }
  .apps-group--planned .apps-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apps-panel .app-tile { flex-direction: column; align-items: flex-start; gap: 8px; }
  .apps-panel .app-text { flex: none; }
}

/* ---------- Pasek aplikacji (hero, telefon < 900 px) ---------- */
.apps-strip { display: none; }
@media (max-width: 899.98px) {
  .apps-strip {
    display: block;
    margin: -12px calc(-1 * var(--gutter)) 28px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  }
  .apps-strip::-webkit-scrollbar { display: none; }
  .apps-strip.is-auto { scroll-snap-type: none; }
}
.strip-track { list-style: none; display: flex; gap: 10px; width: max-content; padding: 4px var(--gutter); }
.strip-item { flex: none; scroll-snap-align: start; }
.apps-strip .app-tile { gap: 10px; padding: 7px 12px 7px 7px; background: var(--on-grad-fill); border-color: var(--on-grad-line); text-align: left; }
.apps-strip .app-icon, .apps-strip .app-mono { width: 36px; height: 36px; border-radius: 10px; font-size: 1rem; }
.apps-strip .app-short { display: none; }
.apps-strip .app-name { font-size: var(--fs-small); white-space: nowrap; }
/* Kopia listy potrzebna tylko do pętli z JS */
html:not(.js) .strip-dup,
.apps-strip.no-loop .strip-dup { display: none; }
@media (prefers-reduced-motion: reduce) { .strip-dup { display: none; } }

/* ---------- O mnie ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
.prose p + p { margin-top: 1.1em; }
.prose { font-size: var(--fs-lead); color: var(--text); max-width: var(--measure); }
.facts-card { padding: var(--card-pad); align-self: start; }
.facts-card .icon-tile { margin-bottom: 14px; }
.facts-card h3 { font-size: var(--fs-h4); margin-bottom: var(--space-4); }
.facts { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.facts div { padding-left: 14px; border-left: 3px solid var(--line); }
.facts dt { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
@media (min-width: 960px) {
  .about-grid { grid-template-columns: 1.6fr 1fr; gap: var(--space-8); }
  .facts-card { position: sticky; top: calc(var(--header-h) + var(--space-5)); }
}

/* ---------- Oś czasu ---------- */
.timeline { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gap); }
.tl-group { padding: var(--card-pad) var(--card-pad) var(--space-2); }
.tl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.tl-head > div { min-width: 0; }
.tl-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--grad-avatar);
  color: var(--on-accent);
  font-weight: 800;
  font-size: var(--fs-2xs);
  letter-spacing: .02em;
  box-shadow: var(--shadow-accent);
}
.tl-org { font-size: var(--fs-h4); font-weight: 800; letter-spacing: -0.01em; }
.tl-meta { color: var(--text-muted); font-size: var(--fs-small); }
.tl-about { margin: calc(-1 * var(--space-1)) 0 var(--space-3); max-width: var(--measure); color: var(--text-muted); font-size: var(--fs-body-sm); }
.tl-systems { margin-bottom: 20px; }
.tl-roles { list-style: none; }
/* Telefon: daty grupy w jednej linii, lokalizacja pod nimi */
@media (max-width: 639.98px) {
  .tl-head .tl-meta > .sep { display: none; }
  .tl-head .tl-meta > span:last-child:not(.tl-period):not(.tl-duration) { display: block; }
}
.tl-role {
  position: relative;
  padding: 0 0 22px 34px;
}
/* kreska łącząca kropki */
.tl-role::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 22px;
  bottom: 2px;
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}
.tl-role:last-child::after { display: none; }
.tl-dot {
  position: absolute;
  left: 8px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--blue-500);
  background: var(--surface);
}
.tl-role.is-current .tl-dot { background: var(--accent); border-color: var(--accent); }
.tl-role.is-current .tl-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: .55; }
  100% { transform: scale(2.8); opacity: 0; }
}
.tl-role-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.tl-title { font-size: var(--fs-body); font-weight: 700; min-width: 0; }
.tl-role .tl-meta { margin-top: 2px; }
.tl-text { margin-top: var(--space-3); max-width: var(--measure); color: var(--text-muted); font-size: var(--fs-body-sm); }
.tl-note { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); font-style: italic; }
.tl-points { max-width: var(--measure); margin-top: var(--space-3); padding-left: 1.1em; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: var(--fs-body-sm); }
.tl-points li::marker { color: var(--blue-500); }
.js .tl-points:not(.is-open) .tl-extra { display: none; }
.tl-more {
  margin-top: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-weight: 700;
  font-size: var(--fs-small);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
}
.tl-more:hover { text-decoration-color: currentColor; }
html:not(.js) .tl-more { display: none; }

@media (min-width: 640px) {
  .tl-group { padding-bottom: var(--space-3); }
  .tl-head { gap: 14px; }
  .tl-avatar { width: 48px; height: 48px; font-size: var(--fs-small); }
  .tl-roles { margin-left: 4px; }
  .tl-role { padding-left: 48px; }
  .tl-role::after { left: 18px; }
  .tl-dot { left: 13px; }
}

/* ---------- Jak pracuję ---------- */
.subsection-title { margin: 0 0 var(--space-5); font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.02em; }
.process + .subsection-title { margin-top: var(--space-7); }
.process { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); }
/* Telefon/tablet: pionowo, numerowane kółka połączone linią (jak oś czasu) */
.process-step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding-bottom: 26px; }
.process-step::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 48px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: var(--line);
}
.process-step:last-child { padding-bottom: 0; }
.process-step:last-child::before { display: none; }
.process-num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-avatar);
  color: var(--on-accent);
  font-weight: 800;
  box-shadow: var(--shadow-accent);
}
.process-title { margin-top: 10px; font-size: var(--fs-h4); font-weight: 700; }
.process-text { margin-top: 6px; color: var(--text-muted); font-size: var(--fs-body-sm); }
@media (min-width: 960px) {
  .process { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
  .process-step { display: block; padding-bottom: 0; }
  .process-step::before { left: 56px; right: -20px; top: 21px; bottom: auto; width: auto; height: 2px; }
  .process-title { margin-top: 16px; }
  .process-title { font-size: var(--fs-body); }
  .process-text { font-size: var(--fs-small); }
}
.tools-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gap); }
.tool-card { padding: var(--card-pad); }
.tool-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); }
.tool-name { font-size: var(--fs-h4); font-weight: 800; }
.tools-note { margin-top: var(--space-5); color: var(--text-muted); font-weight: 600; }
@media (min-width: 768px) { .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Kluczowe projekty ---------- */
.kp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gap); }
.kp-card { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--card-pad); }
.kp-card > div { min-width: 0; }
.kp-title { font-size: var(--fs-h4); font-weight: 700; }
.kp-org { margin-top: var(--space-1); font-size: var(--fs-small); font-weight: 600; color: var(--accent-text); }
.kp-text { margin-top: var(--space-3); color: var(--text-muted); font-size: var(--fs-body-sm); }
@media (min-width: 640px) {
  .kp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kp-card { flex-direction: row; }
  /* nieparzysta liczba kart: ostatnia na całą szerokość */
  .kp-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Desktop: 3 kolumny (siatka 6 ścieżek, karta = 2); niepełny ostatni rząd wyśrodkowany */
@media (min-width: 1100px) {
  .kp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kp-card, .kp-card:last-child:nth-child(odd) { grid-column: span 2; }
  .kp-card:last-child:nth-child(3n+1) { grid-column: 3 / span 2; }
  .kp-card:nth-last-child(2):nth-child(3n+1) { grid-column: 2 / span 2; }
}

/* ---------- Certyfikaty ---------- */
/* 5 odznak: 1 kolumna (< 340 px) → 2 (telefon, ostatnia wyśrodkowana) → 3 + 2 wyśrodkowane (tablet)
   → 5 w rzędzie (od 1100 px). Flex z wyśrodkowaniem, żeby niepełny rząd był pośrodku. */
.cert-grid {
  --cols: 1;
  --gap: var(--grid-gap);
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
}
@media (min-width: 340px) { .cert-grid { --cols: 2; } }
@media (min-width: 640px) { .cert-grid { --cols: 3; } }
@media (min-width: 1100px) { .cert-grid { --cols: 5; } }
.cert {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--card-pad);
}
.cert-icon {
  width: 40px; height: 40px;
  padding: 10px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--grad-avatar);
  color: var(--on-accent);
}
.cert-name { font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.cert-issuer { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- Szkolenia (lżejsza lista zamiast odznak) ---------- */
.section--training { padding-top: 0; }
.training-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.training {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.training-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.training-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.training-name { font-weight: 700; }
.training-icon svg { width: 20px; height: 20px; }
.training-topic { font-size: var(--fs-small); color: var(--text-muted); }
.training-note { margin-top: var(--space-4); font-size: var(--fs-small); color: var(--text-muted); }
@media (min-width: 640px) { .training-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .training-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); } }

/* ---------- Umiejętności ---------- */
.skills-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gap); align-items: start; }
.skill-group { padding: var(--card-pad); }
.skill-title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-h4); font-weight: 700; margin-bottom: var(--space-4); }
.skill-group--lang { background: var(--accent-soft); border-color: transparent; }
.lang-list { margin: 0; display: grid; gap: 10px; }
.lang-list div { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.lang-list dt { font-weight: 700; }
.lang-list dt::after { content: ":"; }
.lang-list dd { margin: 0; color: var(--text-muted); }
@media (min-width: 640px) { .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .skills-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Moje projekty ---------- */
.projects-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gap); }
.project-card { overflow: hidden; display: flex; flex-direction: column; }
.project-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--grad-main);
  padding: 18px 18px 0;
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  border-radius: 10px 10px 0 0;
  box-shadow: var(--shadow-md);
}
.project-body { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--card-pad); flex: 1; }
.project-title-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.project-icon { flex: none; }
.project-icon { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--shadow-sm); }
.project-title { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.02em; }
.project-desc { color: var(--text-muted); font-size: var(--fs-body-sm); }
.status-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-small); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status--ok { color: var(--status-ok); }
.status--soon { color: var(--text-muted); }
.project-body .btn { align-self: flex-start; margin-top: auto; }
.status--dev { color: var(--text-muted); font-size: var(--fs-small); font-weight: 600; margin-top: auto; }
.projects-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 var(--space-4);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.projects-group-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.projects-grid + .projects-group-title { margin-top: var(--space-7); }
.project-card--dev { gap: var(--space-3); padding: var(--card-pad); }
.project-card--dev .project-title { font-size: var(--fs-h4); }
.project-card--dev .app-mono { width: 48px; height: 48px; border-radius: var(--radius-sm); font-size: 1.25rem; }
.project-card { scroll-margin-top: calc(var(--header-h) + 16px); }
@media (min-width: 640px) { .projects-grid--dev { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .projects-grid--dev { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-card--featured { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .project-card--featured .project-thumb { aspect-ratio: auto; min-height: 100%; padding: 28px 0 0 28px; }
  .project-card--featured .project-thumb img { border-radius: 10px 0 0 0; }
  .project-card--featured .project-body { padding: var(--space-6); }
}

/* ---------- Artykuły ---------- */
.articles-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gap); }
.article-card { display: flex; flex-direction: column; overflow: hidden; }
.article-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-body { display: flex; flex-direction: column; gap: var(--space-3); flex: 1; padding: var(--card-pad); }
.article-meta { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); }
.lang-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .06em; }
.article-title { font-size: var(--fs-h4); font-weight: 800; letter-spacing: -0.01em; }
.article-excerpt { color: var(--text-muted); font-size: var(--fs-body-sm); }
.article-link { margin-top: auto; }
.js .articles:not(.is-expanded) .article--extra { display: none; }
html:not(.js) .articles-more { display: none; }
.articles-more { margin-top: var(--space-5); }
.articles-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); padding: var(--space-6); max-width: 640px; border-style: dashed; border-width: 2px; border-color: var(--line); box-shadow: none; }
.articles-empty-title { font-size: var(--fs-h4); font-weight: 800; }
@media (min-width: 640px) { .articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .articles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Kontakt ---------- */
.contact {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(560px circle at calc(100% - 40px) calc(100% + 40px), var(--glow-contact), transparent 70%),
    var(--grad-main);
  color: var(--on-accent);
}
.contact .eyebrow, .contact .section-lead { color: var(--on-grad-muted); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gap); }
.contact-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--card-pad);
  border-radius: var(--radius);
  border: 1px solid var(--on-grad-line);
  background: var(--on-grad-fill);
  transition: background-color var(--dur) var(--ease);
}
.contact-card:hover { background: var(--on-grad-fill-strong); }
.contact-card .icon-tile { background: var(--on-grad-fill-strong); color: var(--on-accent); margin-bottom: var(--space-2); }
.contact-card h3 { font-size: var(--fs-h4); }
.contact-card p { color: var(--on-grad-muted); font-size: var(--fs-body-sm); }
.contact-card a:not(.btn) { color: var(--on-accent); font-weight: 700; font-size: var(--fs-body-sm); overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; }
.copy-status { font-size: var(--fs-small); font-weight: 600; color: var(--on-accent); min-height: 1.3em; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Stopka ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: var(--space-6) 0;
  font-size: var(--fs-small);
}
.footer-inner { display: flex; flex-direction: column; gap: 16px; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--on-accent); text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
@media (min-width: 640px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------- Animacje wejścia ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .tl-role.is-current .tl-dot::after { display: none; }
  .scroll-down { animation: none; }
}

/* ==========================================================================
   Podstrona projektu
   ========================================================================== */
.project-hero { padding: calc(var(--header-h) + 48px) 0 72px; }
.project-hero .hero-inner { gap: 20px; }
.project-hero-icon {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  box-shadow: var(--shadow-photo), 0 0 0 1px var(--on-grad-line);
}
.project-hero .hero-title { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); }
.btn.store-btn > svg { width: 20px; height: 20px; }
.store-btn .store-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.store-btn small { font-size: var(--fs-2xs); font-weight: 600; opacity: .8; }
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--on-accent);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
  z-index: 5;
}
.tooltip-wrap:hover .tooltip,
.tooltip-wrap:focus-within .tooltip { opacity: 1; visibility: visible; }
@media (min-width: 900px) {
  .project-hero { min-height: 0; padding: calc(var(--header-h) + 72px) 0 96px; }
  .project-hero .hero-inner { grid-template-columns: auto 1fr; gap: 40px; }
  .project-hero .hero-photo-wrap { order: 0; }
  .project-hero-icon { width: 128px; height: 128px; border-radius: 30px; }
}

/* Galeria */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
}
.tabs [role="tab"] {
  border: 0;
  background: none;
  padding: 8px 18px;
  min-height: 40px;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--fs-small);
  color: var(--text-muted);
  cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-sm); }

.gallery { list-style: none; display: grid; gap: var(--grid-gap); }
.gallery--desktop { grid-template-columns: minmax(0, 1fr); }
.gallery--mobile { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 260px)); justify-content: center; gap: 28px; }
@media (min-width: 640px) { .gallery--desktop { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  text-align: left;
}
.gallery figcaption { margin-top: var(--space-3); font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); text-align: center; }
.gallery figure { margin: 0; }
.frame-browser {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--dur) var(--ease);
}
.frame-browser::before {
  content: "";
  display: block;
  height: 28px;
  background:
    radial-gradient(circle at 16px 14px, var(--frame-dot-1) 4.5px, transparent 5px),
    radial-gradient(circle at 32px 14px, var(--frame-dot-2) 4.5px, transparent 5px),
    radial-gradient(circle at 48px 14px, var(--frame-dot-3) 4.5px, transparent 5px),
    var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.frame-phone {
  display: block;
  padding: 10px;
  border-radius: 38px;
  background: var(--ink);
  box-shadow: var(--shadow-md), inset 0 0 0 2px var(--ink-2);
  transition: box-shadow var(--dur) var(--ease);
}
.frame-phone img { border-radius: 28px; }
.shot:hover .frame-browser,
.shot:hover .frame-phone,
.shot:focus-visible .frame-browser,
.shot:focus-visible .frame-phone { box-shadow: var(--shadow-lg); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--overlay);
  color: var(--on-accent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.lightbox-caption { min-width: 0; font-weight: 600; font-size: .95rem; padding-left: 6px; }
.lightbox-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 12px; touch-action: pan-y; }
.lightbox-stage img { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); width: auto; height: auto; object-fit: contain; border-radius: 10px; }
.lightbox-stage.is-phone img { border-radius: 24px; }
.lightbox-nav { display: flex; justify-content: center; gap: 16px; padding: 12px; }
.lightbox .icon-btn { width: 48px; height: 48px; color: var(--on-accent); background: var(--on-grad-fill-strong); }
.lightbox .icon-btn:hover { background: var(--on-grad-line); }
.lightbox-counter { align-self: center; font-variant-numeric: tabular-nums; font-size: .9rem; opacity: .85; min-width: 4em; text-align: center; }
@media (min-width: 960px) { .lightbox-stage { padding: 0 32px; } }

/* Funkcje */
.features-intro { max-width: var(--measure); font-size: var(--fs-lead); margin-bottom: var(--space-6); }
.features-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gap); }
.feature { padding: var(--card-pad); }
.feature .icon-tile { margin-bottom: 14px; }
.feature h3 { font-size: var(--fs-h4); margin-bottom: var(--space-2); }
.feature p { color: var(--text-muted); }
.feature-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.feature-list li { display: flex; gap: 10px; color: var(--text-muted); }
.feature-list li > span { min-width: 0; }
.feature-list li svg { color: var(--accent-text); margin-top: .2em; }
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .features-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature--wide { grid-column: span 2; }
  .feature--wide .feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
}

.tech-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.tech-wrap .prose { color: var(--text-muted); }
@media (min-width: 960px) { .tech-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: start; } }

.privacy-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding: var(--card-pad); }
.privacy-card h3 { font-size: var(--fs-h4); }
.privacy-card .section-title { font-size: var(--fs-h3); }
.privacy-links { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 640px) { .privacy-card { grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: var(--space-5); } .privacy-card > :not(.icon-tile) { grid-column: 2; } .privacy-card .icon-tile { grid-row: span 3; } }

/* ==========================================================================
   Polityka prywatności / dokument
   ========================================================================== */
.doc-bar { height: 6px; background: var(--grad-main); margin-top: var(--header-h); }
.doc { padding-block: 40px 80px; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.toc { font-size: .9rem; }
.toc-inner { padding: 20px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-alt); }
.toc h2 { font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.toc ol { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.toc a { display: block; padding: 5px 8px; border-radius: 8px; color: var(--text); text-decoration: none; line-height: 1.35; }
.toc a:hover { background: var(--accent-soft); color: var(--accent-text); }
.toc .toc-sub a { padding-left: 22px; font-size: .85rem; color: var(--text-muted); }

.doc-content { min-width: 0; max-width: var(--measure); }
.doc-content h1 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 20px; }
.doc-content h2 { font-size: var(--fs-h3); font-weight: 800; letter-spacing: -0.02em; margin: 48px 0 14px; padding-top: 4px; }
.doc-content h3 { font-size: var(--fs-h4); margin: 28px 0 10px; }
.doc-content p { margin: 0 0 14px; }
.doc-content ul, .doc-content ol { margin: 0 0 16px; padding-left: 1.3em; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.doc-content li::marker { color: var(--blue-500); }
.doc-content a { overflow-wrap: anywhere; }
.doc-meta {
  display: grid;
  gap: 4px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.doc-meta p { margin: 0; }
.doc-alt { margin-top: 8px; font-weight: 600; }
.table-wrap {
  margin: 0 0 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
.table-wrap:focus-visible { outline-offset: 2px; }
.doc-content table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .92rem; }
.doc-content th, .doc-content td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.doc-content th { background: var(--bg-alt); font-weight: 700; white-space: nowrap; }
.doc-content tr:last-child td { border-bottom: 0; }
.doc-content hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
@media (min-width: 960px) {
  .doc { padding-top: 56px; }
  .doc-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 56px; }
  .toc-inner { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
}

/* 404 */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 96px 0 64px; }
.error-code { font-size: clamp(5rem, 3rem + 10vw, 9rem); font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.error-page > .container { min-width: 0; }
.error-page p { margin: var(--space-4) auto var(--space-6); max-width: 46ch; color: var(--on-grad-muted); }

/* Nawigacja podstron */
.nav--sub .nav-back { margin-right: auto; }
.nav--sub .brand { margin-right: 8px; }
@media (max-width: 639.98px) {
  .nav--sub .brand { display: none; }
}
