/* ==========================================================
   Portfolio — Phillip Mrozik
   Koncepcja: płótno automatyzacji (jak edytor workflow).
   Jasne tło, siatka kropek, projekty jako "węzły" z portami.
   Jeden mocny moment: workflow w hero. Reszta jest cicha.
   ========================================================== */

:root {
  --canvas: #eef1f6;
  --paper: #ffffff;
  --ink: #0f1433;
  --ink-2: #454c6b;
  --ink-3: #646b87;
  --line: #d8ddea;
  --line-2: #c3cadb;
  --dot: #c9d0e0;
  --blue: #3a34f2;
  --blue-d: #2a24d6;
  --blue-soft: #e3e2fd;
  --green: #0fa57a;
  --green-soft: #d6f3e8;
  --red: #c8283f;
  --red-soft: #fbe3e7;

  --f-display: "Schibsted Grotesk", "Instrument Sans", system-ui, sans-serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1160px;
  --gut: clamp(18px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.no-scroll, body.menu-open { overflow: hidden; }
img, video, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.ico { flex: none; }
.container { width: min(var(--maxw), 100% - var(--gut) * 2); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { top: 12px; }
.muted { color: var(--ink-3); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); flex: none; }
.dot.busy { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- Typografia ---------- */
.display, .h1, .h2, .h3, h3 { font-family: var(--f-display); letter-spacing: -0.02em; color: var(--ink); }
.display { font-weight: 800; font-size: clamp(2.4rem, 5.6vw, 4.6rem); line-height: 1.04; letter-spacing: -0.032em; text-wrap: balance; }
.h1 { font-weight: 800; font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.08; letter-spacing: -0.028em; text-wrap: balance; }
.h2 { font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; text-wrap: balance; }
.h3, h3 { font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-2); max-width: 34em; line-height: 1.55; }
.sub { font-size: 1.15rem; color: var(--ink-2); max-width: 38em; margin-top: 14px; }
.prose p { max-width: 62ch; color: var(--ink-2); }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 0.9em; }
.prose ul { list-style: disc; padding-left: 1.2em; max-width: 62ch; color: var(--ink-2); }
.prose li + li { margin-top: 0.3em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 0.92em; }
.prose.big p { font-size: 1.2rem; line-height: 1.65; color: var(--ink); }
.prose.big p + p { margin-top: 1.1em; }

/* ---------- Przyciski i linki ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px; border-radius: 10px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 0.97rem; text-decoration: none; white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-lg { height: 54px; padding: 0 28px; font-size: 1.02rem; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 0.9rem; border-radius: 9px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--paper); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a81d33; }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: transparent; }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.text-link { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; text-decoration: none; color: var(--blue); border-bottom: 1.5px solid transparent; padding-bottom: 1px; transition: border-color 0.2s, gap 0.25s var(--ease); }
.text-link:hover { border-color: currentColor; gap: 11px; }
.link-btn { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 4px 2px; font-weight: 600; font-size: 0.92rem; color: var(--blue); }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); transition: background 0.2s, color 0.2s; }
.icon-btn:hover { background: var(--line); color: var(--ink); }
.icon-btn:disabled { opacity: 0.3; pointer-events: none; }
.icon-btn.solid { background: var(--paper); border: 1px solid var(--line-2); }
.icon-btn.solid:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ---------- Górny pasek ---------- */
.topbar { position: sticky; top: 0; z-index: 60; background: rgba(238, 241, 246, 0.86); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.25s; }
.topbar.scrolled { border-color: var(--line); }
.topbar-in { display: flex; align-items: center; gap: 20px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--ink); color: #fff; font: 800 0.95rem var(--f-display); letter-spacing: 0; }
.brand-name { font: 700 1.08rem var(--f-display); letter-spacing: -0.01em; }
.menu { display: flex; gap: 4px; margin-left: auto; }
.menu a { white-space: nowrap; position: relative; padding: 9px 14px; border-radius: 9px; text-decoration: none; font-weight: 500; color: var(--ink-2); transition: color 0.2s, background 0.2s; }
.menu a:hover { color: var(--ink); background: rgba(15, 20, 51, 0.05); }
.menu a.active { color: var(--ink); font-weight: 600; }
.menu a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--blue); }
.status { display: inline-flex; align-items: center; gap: 9px; font-size: 0.88rem; font-weight: 500; color: var(--ink-2); padding: 7px 13px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); }
.lang { position: relative; display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); flex: none; }
.lang::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--ink); transition: transform 0.3s var(--ease); }
.lang[data-active="en"]::before { transform: translateX(100%); }
.lang button { position: relative; z-index: 1; min-width: 44px; padding: 7px 10px; border: 0; background: none; border-radius: 999px; font: 700 0.8rem var(--f-body); letter-spacing: 0.06em; color: var(--ink-2); cursor: pointer; transition: color 0.25s; }
.lang button[aria-pressed="true"] { color: #fff; }
.lang button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); position: relative; margin-left: auto; }
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.3s var(--ease), top 0.3s var(--ease); }
.burger span:nth-child(1) { top: 16px; } .burger span:nth-child(2) { top: 25px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { top: 20px; transform: rotate(-45deg); }

/* ---------- Przejście stron (reakcja na nawigację użytkownika) ---------- */
#app { outline: none; min-height: 60vh; opacity: 0; transform: translateY(8px); }
#app.in { opacity: 1; transform: none; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding-block: clamp(36px, 7vw, 88px) clamp(40px, 6vw, 80px); }
.hero-id { margin-top: 34px; font-size: 0.95rem; color: var(--ink-3); }
.hero-id strong { color: var(--ink); font-weight: 600; }
.display + .lead { margin-top: 26px; }
.display .w { display: inline-block; opacity: 0; transform: translateY(0.45em); animation: rise 0.8s var(--ease) forwards; animation-delay: calc(var(--i) * 60ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Workflow w hero */
.flow { min-width: 0; }
.canvas {
  position: relative; container-type: inline-size; aspect-ratio: 100 / 86; border-radius: 18px;
  border: 1px solid var(--line-2); background-color: #f6f8fb;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.4px); background-size: 22px 22px;
  overflow: hidden;
}
.stage { position: absolute; inset: 7% 5.5%; }
.stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lk { fill: none; stroke: var(--line-2); stroke-width: 0.45; }
.lk.on { stroke: var(--green); stroke-width: 0.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.canvas.run .lk.on { animation: draw 0.4s ease-out var(--d) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.node {
  position: absolute; width: 46%; height: 16.28%; display: flex; align-items: center; gap: 2.2cqw; padding: 0 2.2cqw;
  background: var(--paper); border: 1.5px solid var(--line-2); border-radius: 12px;
}
.n1 { left: 0; top: 0; } .n2 { left: 54%; top: 27.9%; } .n3 { left: 0; top: 55.8%; } .n4 { left: 54%; top: 83.7%; }
.canvas.run .node { animation: node-run 0.9s ease var(--d) both; }
@keyframes node-run {
  0% { border-color: var(--line-2); box-shadow: 0 0 0 0 transparent; }
  14%, 72% { border-color: var(--blue); box-shadow: 0 0 0 5px var(--blue-soft); }
  100% { border-color: var(--green); box-shadow: 0 0 0 0 transparent; }
}
.n-ic { display: grid; place-items: center; flex: none; width: 7.4cqw; height: 7.4cqw; max-width: 40px; max-height: 40px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); }
.n-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.n-tx b { font: 700 clamp(11.5px, 2.8cqw, 15px) var(--f-body); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-tx small { font-size: clamp(10px, 2.2cqw, 12.5px); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.n-st { position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; }
.n-st i { position: absolute; inset: 0; border-radius: 50%; opacity: 0; display: grid; place-items: center; }
.spin { border: 3px solid var(--blue-soft); border-top-color: var(--blue); background: var(--paper); }
.tick { background: var(--green); color: #fff; }
.canvas.run .spin { animation: spin-vis 0.9s linear var(--d) both; }
.canvas.run .spin::after { content: ""; }
@keyframes spin-vis { 0%, 12% { opacity: 0; transform: rotate(0); } 14% { opacity: 1; } 70% { opacity: 1; transform: rotate(560deg); } 72%, 100% { opacity: 0; transform: rotate(600deg); } }
.canvas.run .tick { animation: tick-in 0.9s var(--ease) var(--d) both; }
@keyframes tick-in { 0%, 70% { opacity: 0; transform: scale(0.4); } 100% { opacity: 1; transform: scale(1); } }
.port { position: absolute; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-2); }
.port.top { top: -5.5px; } .port.bot { bottom: -5.5px; }
.canvas-cap { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 0.92rem; color: var(--ink-2); }
.cap-state { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; }

/* Bez animacji: pokaż stan końcowy */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .display .w { opacity: 1; transform: none; }
  #app { opacity: 1; transform: none; }
  .canvas .node { border-color: var(--green); }
  .canvas .tick { opacity: 1; }
  .canvas .lk.on { stroke-dashoffset: 0; }
}

/* ---------- Sekcje ---------- */
.section { padding-block: clamp(44px, 7vw, 88px); }
.section.tight { padding-top: 24px; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head { padding-block: clamp(36px, 6vw, 72px) 20px; }
.page-head.notfound { min-height: 46vh; }

/* Usługi: wiersze, nie karty */
.svc-list { margin-top: 26px; border-top: 1.5px solid var(--ink); }
.svc { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr) minmax(0, 0.9fr); gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.svc p { color: var(--ink-2); max-width: 46ch; }
.svc .tags { justify-content: flex-end; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags li { font-size: 0.82rem; font-weight: 500; padding: 4px 10px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }

/* Siatka projektów: karty jak węzły */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 34px 30px; }
.pcard { position: relative; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; transition: transform 0.35s var(--ease), border-color 0.25s; }
.pcard:hover { transform: translateY(-5px); border-color: var(--ink); }
.pcard-link { position: absolute; inset: 0; z-index: 2; border-radius: 14px; }
.pcard-thumb { position: relative; aspect-ratio: 16 / 10; background: #f1f3f8; overflow: hidden; border-radius: 12px 12px 0 0; border-bottom: 1px solid var(--line); }
.pcard-thumb img, .pcard-thumb video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.pcard:hover .pcard-thumb img, .pcard:hover .pcard-thumb video { transform: scale(1.04); }
.ph { width: 100%; height: 100%; display: grid; place-items: center; background-color: #f1f3f8; background-image: radial-gradient(var(--dot) 1.2px, transparent 1.4px); background-size: 18px 18px; color: var(--blue); }
.ph span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--paper); border: 1.5px solid var(--line-2); }
.pcard-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard-body h3 { font-size: 1.3rem; }
.pcard-body p { color: var(--ink-2); font-size: 0.98rem; line-height: 1.5; }
.pcard-body .tags { margin-top: auto; padding-top: 8px; }
.port.l, .port.r { top: 50%; left: auto; margin: -4.5px 0 0; z-index: 3; background: var(--paper); transition: background 0.2s, border-color 0.2s; }
.port.l { left: -5.5px; } .port.r { right: -5.5px; }
.pcard:hover .port { background: var(--blue); border-color: var(--blue); }
.pcard-admin { position: absolute; top: 12px; right: 12px; z-index: 4; }
.chip { display: inline-block; align-self: flex-start; font-size: 0.82rem; font-weight: 600; color: var(--blue); background: var(--blue-soft); padding: 3px 10px; border-radius: 6px; }
.badge { position: absolute; top: 12px; left: 12px; font-size: 0.78rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--ink); color: #fff; }
.badge.inline { position: static; margin-left: 8px; }
.empty { display: grid; justify-items: start; gap: 12px; padding: clamp(28px, 5vw, 48px); border: 1.5px dashed var(--line-2); border-radius: 16px; background: rgba(255, 255, 255, 0.55); }
.empty h3 { max-width: 24em; }
.empty p { color: var(--ink-2); max-width: 40em; margin-bottom: 8px; }
.empty-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 13px; background: var(--paper); border: 1.5px solid var(--line-2); color: var(--blue); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 34px; }
.fchip { height: 38px; padding: 0 16px; border-radius: 9px; border: 1.5px solid var(--line-2); background: transparent; font-weight: 500; font-size: 0.93rem; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.fchip:hover { border-color: var(--ink); }
.fchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.fcount { margin-left: auto; font-size: 0.9rem; color: var(--ink-3); }

/* Wypowiedź + CTA */
.statement-sec { display: grid; gap: 24px; justify-items: start; }
.statement { font: 600 clamp(1.45rem, 3vw, 2.35rem)/1.28 var(--f-display); letter-spacing: -0.02em; max-width: 27em; text-wrap: pretty; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: clamp(28px, 5vw, 52px); background: var(--ink); color: #fff; border-radius: 20px; flex-wrap: wrap; }
.cta-band .h2, .cta-band .h3 { color: #fff; max-width: 21em; }
.cta-band p { color: #b9bfd8; margin-top: 10px; max-width: 40em; }
.cta-band .btn-primary { background: #fff; color: var(--ink); }
.cta-band .btn-primary:hover { background: var(--blue-soft); }
.cta-band.slim { margin-top: 64px; padding: 28px 32px; }

/* ---------- Szczegóły projektu ---------- */
.pdetail { padding-block: clamp(20px, 4vw, 44px) 40px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink-2); text-decoration: none; margin-bottom: 26px; }
.back:hover { color: var(--blue); }
.pd-meta { display: flex; align-items: center; margin-bottom: 16px; }
.pd-admin { margin-top: 20px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 38px 0 12px; }
.gtile { position: relative; padding: 0; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: #f1f3f8; aspect-ratio: 4 / 3; transition: border-color 0.2s; }
.gallery-wrap { margin: 38px 0 12px; display: grid; gap: 44px; }
.gallery.plain { margin: 0; }
.gtile:hover { border-color: var(--ink); }
.gtile.big { grid-column: 1 / -1; aspect-ratio: 16 / 8.5; }
.gtile img, .gtile video, .gtile .ph { width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: rgba(15, 20, 51, 0.82); color: #fff; padding-left: 3px; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 5vw, 72px); margin-top: 44px; align-items: start; }

/* Problem → Rozwiązanie → Efekty: prawdziwa sekwencja */
.chain { position: relative; display: grid; gap: 34px; }
.chain::before { content: ""; position: absolute; left: 17px; top: 20px; bottom: 20px; width: 2px; background: var(--line-2); }
.step { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 22px; }
.step-n { position: relative; z-index: 1; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); font: 700 0.95rem var(--f-display); }
.step-body h2 { font: 700 1.5rem var(--f-display); letter-spacing: -0.02em; margin: 2px 0 10px; }
.pd-desc { margin-top: 56px; padding-top: 34px; border-top: 1.5px solid var(--ink); }
.pd-desc h2 { font: 700 1.5rem var(--f-display); letter-spacing: -0.02em; margin-bottom: 14px; }
.pd-side { position: sticky; top: 92px; display: grid; gap: 16px; }
.panel { background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.panel h2 { font: 700 1rem var(--f-display); margin-bottom: 14px; }
.panel dl { display: grid; gap: 12px; }
.panel dl div { display: grid; gap: 1px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel dl div:last-child { border: 0; padding: 0; }
.panel dt { font-size: 0.84rem; color: var(--ink-3); }
.panel dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.plinks { display: grid; gap: 4px; }
.plinks a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; text-decoration: none; font-weight: 600; color: var(--blue); border-bottom: 1px solid var(--line); }
.plinks li:last-child a { border: 0; }
.plinks a:hover { color: var(--blue-d); }
.pnav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 72px; }
.pn { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border: 1.5px solid var(--line-2); border-radius: 14px; text-decoration: none; font: 700 1.1rem var(--f-display); letter-spacing: -0.01em; transition: border-color 0.2s, background 0.2s; }
.pn:hover { border-color: var(--ink); background: var(--paper); }
.pn small { display: block; font: 500 0.82rem var(--f-body); color: var(--ink-3); letter-spacing: 0; margin-bottom: 2px; }
.pn.next { justify-content: flex-end; text-align: right; }

/* ---------- MrozikDigital ---------- */
.bd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 5vw, 72px); align-items: start; padding-block: 28px 70px; }
.bd-grid .chain { margin-top: 26px; }
.bd-side { position: sticky; top: 92px; display: grid; gap: 16px; }
.bd-side ul.checks { display: grid; gap: 10px; }
.bd-side ul.checks li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 0.97rem; }
.bd-side ul.checks .ico { color: var(--green); margin-top: 3px; }
.stack-note { margin-top: 16px; color: var(--ink-2); max-width: 56ch; }
.bd-note { margin-top: 44px; padding: 18px 22px; border-left: 3px solid var(--blue); background: rgba(255, 255, 255, 0.6); border-radius: 0 12px 12px 0; color: var(--ink-2); max-width: 62ch; }

/* ---------- O mnie ---------- */
.about-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); padding-bottom: 60px; align-items: start; }
.idcard { position: sticky; top: 96px; display: grid; gap: 8px; }
.avatar { width: 112px; height: 112px; display: grid; place-items: center; border-radius: 26px; background: var(--ink); color: #fff; font: 800 2.4rem var(--f-display); margin-bottom: 14px; position: relative; }
.avatar::after { content: ""; position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); border: 4px solid var(--canvas); }
.idcard h2 { font: 800 1.6rem var(--f-display); letter-spacing: -0.02em; }
.idrole { font-weight: 600; color: var(--blue); }
.idloc, .idstatus { display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: 0.97rem; }
.idstatus { margin-top: 2px; }
.id-links { display: grid; gap: 8px; margin-top: 16px; justify-items: start; }
.social { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; color: var(--ink-2); transition: color 0.2s; }
.social:hover { color: var(--blue); }
.social.block { padding: 10px 16px; border: 1.5px solid var(--line-2); border-radius: 10px; background: transparent; width: 100%; overflow-wrap: anywhere; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.social.block:hover { border-color: var(--ink); background: var(--paper); color: var(--ink); }
.about-main > .h2 { margin: 64px 0 22px; }
.principles { display: grid; gap: 0; border-top: 1.5px solid var(--ink); }
.principles li { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line-2); }
.principles p { color: var(--ink-2); }

/* ---------- Edukacja: oś czasu ---------- */
.edu-sec + .edu-sec { margin-top: 64px; }
.timeline { position: relative; display: grid; gap: 0; margin-left: 8px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 14px; bottom: 14px; width: 2px; background: var(--line-2); }
.tl-item { position: relative; padding: 0 0 34px 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 3px solid var(--blue); }
.tl-body { position: relative; max-width: 720px; }
.tl-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.tl-period { font-size: 0.92rem; color: var(--ink-3); }
.tl-inst { font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.tl-desc { color: var(--ink-2); margin-top: 8px; max-width: 60ch; }
.tl-body .text-link { margin-top: 10px; }
.tl-edit { position: absolute; top: -4px; right: -4px; }

/* ---------- Kontakt ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); padding-block: 28px 70px; align-items: start; }
.mailbox { padding: clamp(26px, 4vw, 44px); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 18px; }
.bigmail { display: block; font: 800 clamp(1.4rem, 3.4vw, 2.5rem)/1.15 var(--f-display); letter-spacing: -0.03em; text-decoration: none; margin-top: 6px; overflow-wrap: anywhere; border-bottom: 3px solid var(--blue-soft); width: fit-content; max-width: 100%; transition: border-color 0.2s, color 0.2s; }
.bigmail:hover { color: var(--blue); border-color: var(--blue); }
.contact-side { display: grid; gap: 10px; }
.contact-side .id-links { margin-top: 6px; margin-bottom: 8px; }

/* ---------- Logowanie ---------- */
.login-wrap { display: grid; place-items: center; padding-block: clamp(40px, 8vw, 96px); }
.login { width: min(420px, 100%); display: grid; gap: 16px; padding: 34px; background: var(--paper); border: 1.5px solid var(--line-2); border-radius: 18px; }
.login-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }
.form-err { min-height: 1.4em; color: var(--red); font-weight: 500; font-size: 0.95rem; }

/* ---------- Formularze (panel admina) ---------- */
.field { display: grid; gap: 7px; }
.field label { font-weight: 600; font-size: 0.93rem; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line-2); border-radius: 10px; padding: 11px 14px; transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
input.invalid { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
::placeholder { color: #8a90a8; }

/* ---------- Szuflada / modal ---------- */
.drawer-wrap, .modal-wrap { position: fixed; inset: 0; z-index: 120; display: flex; }
.scrim { position: absolute; inset: 0; background: rgba(15, 20, 51, 0); transition: background 0.3s; }
.open > .scrim { background: rgba(15, 20, 51, 0.5); }
.drawer { position: relative; margin-left: auto; width: min(660px, 100%); height: 100%; background: var(--canvas); display: flex; flex-direction: column; transform: translateX(40px); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.25s; box-shadow: -1px 0 0 var(--line-2); }
.open > .drawer { transform: none; opacity: 1; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 26px; border-bottom: 1px solid var(--line-2); background: var(--paper); }
.drawer-head h2 { font: 800 1.35rem var(--f-display); letter-spacing: -0.02em; }
.drawer-body { flex: 1; overflow-y: auto; padding: 26px; display: grid; gap: 22px; align-content: start; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 26px; border-top: 1px solid var(--line-2); background: var(--paper); }
.foot-r { display: flex; gap: 10px; margin-left: auto; }
.modal-wrap { align-items: center; justify-content: center; padding: 20px; z-index: 140; }
.modal { position: relative; width: min(460px, 100%); max-height: 92vh; overflow-y: auto; background: var(--paper); border-radius: 16px; padding: 26px; display: grid; gap: 14px; transform: translateY(14px) scale(0.98); opacity: 0; transition: transform 0.3s var(--ease), opacity 0.25s; }
.modal-form { width: min(560px, 100%); }
.open > .modal { transform: none; opacity: 1; }
.modal h3 { font-size: 1.35rem; }
.modal p { color: var(--ink-2); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 6px; }
.modal-actions .grow { flex: 1; }

.dropzone { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 26px 18px; border: 2px dashed var(--line-2); border-radius: 14px; background: var(--paper); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.dropzone:hover, .dropzone.over { border-color: var(--blue); background: var(--blue-soft); }
.dropzone span { color: var(--ink-2); font-size: 0.95rem; }
.dropzone small { color: var(--ink-3); margin-top: 4px; }
.dz-ic { display: grid !important; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--blue-soft); color: var(--blue) !important; margin-bottom: 6px; }
.embed-row { display: flex; gap: 8px; margin-top: 4px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 4px; }
.media-grid:empty { display: none; }
.mt { background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.mt-img { position: relative; aspect-ratio: 4 / 3; background: #f1f3f8; display: grid; place-items: center; }
.mt-img img, .mt-img video { width: 100%; height: 100%; object-fit: cover; }
.mt-cover { position: absolute; left: 6px; top: 6px; font-size: 0.72rem; font-weight: 600; background: var(--ink); color: #fff; padding: 2px 7px; border-radius: 5px; }
.mt-badge { position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; display: grid; place-items: center; background: rgba(15, 20, 51, 0.85); color: #fff; border-radius: 50%; padding-left: 1px; }
.mt-embed { color: var(--blue); }
.mt-ctl { display: flex; justify-content: space-between; padding: 3px; }
.mt-ctl .icon-btn { width: 30px; height: 30px; }
.mt.pending .mt-img { gap: 8px; align-content: center; padding: 8px; text-align: center; }
.mt.pending small { font-size: 0.75rem; color: var(--ink-3); overflow-wrap: anywhere; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--blue-soft); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; background: var(--paper); border: 1.5px solid var(--line-2); border-radius: 10px; cursor: text; }
.tag-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.tag-input input { flex: 1; min-width: 150px; border: 0 !important; padding: 5px 4px !important; box-shadow: none !important; background: transparent; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; background: var(--blue-soft); color: var(--blue); border-radius: 6px; font-size: 0.9rem; font-weight: 500; }
.tag-chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; background: transparent; border-radius: 4px; color: inherit; }
.tag-chip button:hover { background: rgba(58, 52, 242, 0.15); }
.rows { display: grid; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
.rows > .btn { justify-self: start; }

/* ---------- Pasek admina, toast, demo ---------- */
.adminbar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: 0 12px 30px -8px rgba(15, 20, 51, 0.5); max-width: calc(100% - 24px); }
.ab-state { display: inline-flex; align-items: center; gap: 9px; font-size: 0.9rem; font-weight: 500; margin-right: 6px; white-space: nowrap; }
.adminbar .btn-primary { background: #fff; color: var(--ink); }
.adminbar .btn-primary:hover { background: var(--blue-soft); }
.adminbar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.adminbar .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }
.demo-note { position: fixed; left: 16px; bottom: 16px; z-index: 80; max-width: 330px; font-size: 0.82rem; line-height: 1.45; padding: 10px 14px; background: var(--paper); border: 1.5px solid var(--line-2); border-radius: 10px; color: var(--ink-2); }
body:has(.adminbar) .demo-note { bottom: 84px; }
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 36px)); padding: 12px 16px; background: var(--ink); color: #fff; border-radius: 12px; font-size: 0.95rem; opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.35s var(--ease); pointer-events: auto; }
.toast.in { opacity: 1; transform: none; }
.toast-ic { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--green); }
.toast.error { background: var(--red); }
.toast.error .toast-ic { background: rgba(255, 255, 255, 0.25); }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 250; background: rgba(8, 10, 26, 0.94); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; opacity: 0; transition: opacity 0.2s; }
.lb.open { opacity: 1; }
.lb-stage { grid-column: 2; display: grid; place-items: center; height: 100vh; padding: 56px 0; min-width: 0; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; border-radius: 10px; }
.lb-stage iframe { width: min(100%, 1100px); aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; }
.lb-x, .lb-nav { position: absolute; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; transition: background 0.2s; }
.lb-x:hover, .lb-nav:hover { background: rgba(255, 255, 255, 0.24); }
.lb-x { top: 14px; right: 14px; z-index: 2; }
.lb-nav.prev { left: 8px; } .lb-nav.next { right: 8px; }
.lb-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #b9bfd8; font-size: 0.9rem; }

/* ---------- Stopka ---------- */
.footer { border-top: 1px solid var(--line-2); margin-top: 40px; padding-block: 40px 100px; }
.foot-in { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 24px 40px; align-items: start; }
.foot-brand { display: grid; gap: 2px; }
.foot-brand strong { font: 700 1.1rem var(--f-display); }
.foot-brand span { color: var(--ink-3); font-size: 0.93rem; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; }
.foot-nav a:hover { color: var(--blue); }
.foot-soc { display: flex; gap: 10px; }
.social.icon-only { width: 40px; height: 40px; justify-content: center; border: 1.5px solid var(--line-2); border-radius: 10px; }
.social.icon-only span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.foot-copy { grid-column: 1 / -1; font-size: 0.88rem; color: var(--ink-3); padding-top: 22px; border-top: 1px solid var(--line); }
.foot-copy a { color: var(--ink-3); }
.foot-copy a:hover { color: var(--blue); }

/* ---------- Responsywność ---------- */
@media (max-width: 1120px) { .status { display: none; } }
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .flow { max-width: 560px; }
  .svc { grid-template-columns: 1fr; gap: 10px; }
  .svc .tags { justify-content: flex-start; margin-top: 4px; }
  .pd-grid { grid-template-columns: 1fr; }
  .pd-side { position: static; }
  .about-grid, .contact, .bd-grid { grid-template-columns: 1fr; }
  .bd-side { position: static; }
  .idcard { position: static; }
  .principles li { grid-template-columns: 1fr; gap: 6px; }
  .foot-in { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gtile.big { aspect-ratio: 4 / 3; }
  .pnav { grid-template-columns: 1fr; }
  .field-2 { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr auto; }
  .row2 input:nth-child(2) { grid-column: 1; }
  .drawer-head, .drawer-foot { padding-inline: 16px; }
  .drawer-body { padding: 18px 16px; }
  .adminbar { padding-left: 12px; gap: 6px; }
  .ab-state { font-size: 0.8rem; margin-right: 0; }
  .lb { grid-template-columns: 1fr; }
  .lb-stage { grid-column: 1; padding: 64px 12px; }
  .lb-nav { top: auto; bottom: 14px; }
  .lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
  .demo-note { display: none; }
  .btn-lg { width: 100%; }
  .cta-row .btn { flex: 1 1 auto; }
}

@media (max-width: 1060px) {
  /* backdrop-filter robi z paska "rodzica" dla position:fixed i kasuje tło menu, więc na telefonie go nie używamy */
  .topbar { background: var(--canvas); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .status { display: none; }
  .lang { margin-left: auto; }
  .burger { display: block; margin-left: 0; }
  .menu {
    position: fixed; inset: 72px 0 0 0; z-index: 70; background: var(--canvas); flex-direction: column; gap: 0; margin: 0; padding: 18px var(--gut) 40px; overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0.3s;
  }
  .menu.open { opacity: 1; transform: none; visibility: visible; }
  .menu a { font: 700 1.7rem var(--f-display); padding: 16px 4px; border-bottom: 1px solid var(--line); border-radius: 0; letter-spacing: -0.02em; }
  .menu a.active::after { display: none; }
  .menu a.active { color: var(--blue); }
}
@media (max-width: 1240px) and (min-width: 1061px) { .menu a { padding: 9px 10px; } }

/* ---- Galeria projektu: ramki jak okna aplikacji ---- */
.gal-title { font: 700 1.3rem var(--f-display); letter-spacing: -0.02em; margin: 0 0 16px; }
.gal-row { display: flex; gap: 16px; align-items: flex-start; }
.gal-row .shot { flex: var(--ar) 1 0; min-width: 0; }
.gal-row.solo .shot { max-width: min(1100px, calc(var(--ar) * 620px + 4px)); }
.gal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gal-grid > :last-child:nth-child(odd):not(:first-child) { grid-column: 1 / -1; }
.gal-own { margin-top: 16px; }
.gal-own .shot { max-width: 440px; }
.shot { margin: 0; background: var(--paper); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 0 rgba(15,20,51,.03), 0 14px 34px -22px rgba(15,20,51,.35); transition: transform .3s var(--ease), box-shadow .3s, border-color .2s; }
.shot:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 22px 44px -24px rgba(15,20,51,.45); }
.shot-bar { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #f6f7fb; }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.shot-bar i:nth-child(1) { background: #ff6b5f; } .shot-bar i:nth-child(2) { background: #ffc02e; } .shot-bar i:nth-child(3) { background: #2fcf63; }
.shot-bar span { margin-left: 8px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot .gtile { display: block; width: 100%; border: 0; border-radius: 0; aspect-ratio: var(--ar); background: #0f1224; cursor: zoom-in; }
.shot .gtile:hover { border: 0; }
.shot .gtile img { object-fit: contain; display: block; }
.shot .zoom { position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: rgba(15,20,51,.78); color: #fff; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.shot:hover .zoom, .shot .gtile:focus-visible .zoom { opacity: 1; transform: none; }
.lb-count { padding: 0 24px; }
@media (max-width: 820px) {
  .gal-row { flex-direction: column; align-items: stretch; }
  .gal-row .shot { flex: none; }
  .gal-row .shot:not(:only-child) .gtile { max-height: none; }
  .gal-grid { grid-template-columns: minmax(0, 1fr); }
  .shot .zoom { opacity: 1; transform: none; }
}

.hero-shot { margin: 34px 0 6px; }
.hero-shot .shot { max-width: min(1100px, calc(var(--ar) * 620px + 4px)); }
.gallery-wrap.after { margin-top: 64px; }
.gal-group + .gal-group { }

.gal-stack { display: grid; gap: 16px; max-width: 1000px; }
.shot .gtile video { width: 100%; height: 100%; object-fit: contain; }
.shot .play { width: 54px; height: 54px; }
@media (max-width: 820px) { .gal-row.solo .shot { max-width: none; } .gal-row.solo.tall .shot { max-width: 420px; } }

.gal-group, .gal-grid, .gal-stack, .gal-row, .shot { min-width: 0; max-width: 100%; }
.gal-stack { grid-template-columns: minmax(0, 1fr); }
.shot .gtile img { width: 100%; height: 100%; }

.cat-empty { grid-column: 1 / -1; padding: 28px 0; }
