/* Dariusz Masłyk — portfolio. Zielony grafit z pastelową szałwią: system, który łączy biznes z technologią.
   Zasady (Taste Skill): dwa kroje, sześć rozmiarów, płaskie powierzchnie odróżnione tonem, bez etykiet nad nagłówkami,
   bez numeracji, bez cieni i obrysów. Wyjątki ustalone z właścicielem są oznaczone komentarzem taste-skill-ignore. */

:root {
  /* Kolory wzięte ze zdjęcia: tło studyjne, granat koszuli, przypalony pomarańcz kraty. */
  --bg: #eceff2;
  --surface: #ffffff;
  --surface-2: #dfe4ea;
  --text: #18222e;
  --muted: #4d5a68;
  --accent: #b14f1f;
  --navy: #2f4a6b;
  --steel: #6b8199;
  --warm: #d08b3e;
  --ink: #ffffff;
  --accent-rgb: 177, 79, 31;
  --navy-rgb: 47, 74, 107;
  --steel-rgb: 107, 129, 153;
  --warm-rgb: 208, 139, 62;
  --paper: #ffffff;
  --paper-2: #eef1f4;
  --paper-ink: #18222e;
  --paper-muted: #4d5a68;
  --paper-accent: #a2491c;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  /* Skala: sześć rozmiarów na całą stronę. */
  --fs-display: clamp(2.5rem, 4.8vw, 3.9rem);
  --fs-h2: clamp(2rem, 3.2vw, 2.75rem);
  --fs-h3: clamp(1.45rem, 2vw, 1.75rem);
  --fs-h4: 1.25rem;
  --fs-body: 1.0625rem;
  --fs-small: .875rem;
  --radius: 14px;
  --pad: clamp(16px, 4vw, 48px);
  --maxw: 1240px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font: 400 var(--fs-body)/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--display); line-height: 1.1; letter-spacing: -0.015em; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--ink); padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* Powierzchnia: jeden krok tonu od tła, bez obrysu, cienia i rozmycia. */
.glass { background: var(--surface); border-radius: var(--radius); }
.news { background: var(--paper); }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 0;
  font: 600 var(--fs-small)/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .2s, background-color .2s, color .2s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: #9a431a; }
.btn-glass { background: var(--surface); color: var(--text); }
.btn-glass:hover { background: var(--surface-2); }
.btn-small { min-height: 34px; padding: 0 16px; }
.btn-large { min-height: 56px; padding: 0 30px; font-size: var(--fs-body); }

/* ---------- Pasek górny ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 56px; padding: 0 var(--pad);
  transition: background-color .3s;
}
.topbar.is-scrolled, .topbar.nav-open { background: rgba(236, 239, 242, .9); backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 var(--fs-small) var(--font); }
.brand-mark { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a:not(.btn) { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: var(--fs-small); transition: color .2s, background-color .2s; }
.nav a:not(.btn):hover, .nav a[aria-current] { color: var(--text); background: var(--surface); }
.nav .btn { margin-left: 10px; }

/* „Pobierz CV”: subtelnie pulsująca ramka i błysk w rogu — świadoma decyzja właściciela. */
.btn-cv {
  position: relative; color: var(--text); background: var(--surface); overflow: hidden;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .35); /* taste-skill-ignore */
  animation: cvGlow 4s ease-in-out infinite;
}
.btn-cv:hover { background: var(--surface-2); }
.btn-cv::after {
  content: ""; position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .9) 0%, rgba(var(--accent-rgb), .5) 30%, transparent 70%); /* taste-skill-ignore */
  opacity: 0; animation: cvGlint 6s ease-in-out infinite 1.5s;
}
@keyframes cvGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .3); } /* taste-skill-ignore */
  50% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .55), 0 0 12px -2px rgba(var(--accent-rgb), .35); } /* taste-skill-ignore */
}
@keyframes cvGlint { 0%, 86%, 100% { opacity: 0; transform: scale(.6); } 91% { opacity: 1; transform: scale(1); } }
.nav-toggle { display: none; min-height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--surface); color: var(--text); font: 600 var(--fs-small) var(--font); cursor: pointer; }

/* ---------- Scena w tle ---------- */
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; transition: visibility 0s linear .2s; }
.stage.is-off { visibility: hidden; }
.stage-host { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.stage-host canvas { display: block; width: 100%; height: 100%; }
.stage.scene-ready .stage-host { opacity: 1; }
/* Neutralna kurtyna pod tekstem na tle obrazu sceny — dozwolony wyjątek. */
.stage-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(236, 239, 242, .9) 0%, rgba(236, 239, 242, .5) 34%, rgba(236, 239, 242, 0) 60%), /* taste-skill-ignore */
    linear-gradient(0deg, rgba(236, 239, 242, .85) 0%, rgba(236, 239, 242, 0) 26%); /* taste-skill-ignore */
}
.stage-fallback { position: absolute; right: 3%; top: 50%; width: min(52vw, 680px); transform: translateY(-50%); transition: opacity .8s; }
.stage.scene-ready .stage-fallback { opacity: 0; }
.f-wires path { fill: none; stroke: rgba(var(--navy-rgb), .55); stroke-width: 1.6; }
.f-phone rect:first-child { fill: var(--surface); stroke: #1f2d3d; stroke-width: 1.6; }
.f-phone .scr { fill: var(--surface-2); stroke: rgba(var(--accent-rgb), .5); }
.f-phone .ui { stroke: rgba(24, 34, 46, .6); stroke-width: 4; stroke-linecap: round; }
.f-phone .btn { fill: var(--accent); }
.f-nodes > * { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.f-nodes > :nth-child(3) { stroke: var(--warm); }
.f-nodes > :nth-child(4) { stroke: var(--steel); }
.f-labels text { fill: var(--muted); font: 500 14px var(--font); }

.scene-labels { position: absolute; inset: 0; overflow: hidden; }
.scene-label {
  position: absolute; left: 0; top: 0;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(236, 239, 242, .86);
  font: 600 13px/1.3 var(--font); color: var(--text); white-space: nowrap;
  transition: background-color .3s, color .3s; will-change: transform, opacity;
}
.scene-label b { display: block; font-weight: 600; }
.scene-label span { display: none; margin-top: 1px; color: var(--muted); font-weight: 400; }
.scene-label.is-lit { background: var(--accent); color: var(--ink); }
.scene-label.is-lit span { color: var(--ink); }
.scene-label.is-lit span, .scene-label.is-main span { display: block; }
.scene-label.ok { background: var(--accent); color: var(--ink); }

/* ---------- Otwarcie ---------- */
main { position: relative; z-index: 1; }
.intro {
  position: relative; min-height: 92svh;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(36px, 6vh, 64px);
  max-width: var(--maxw); margin: 0 auto; padding: 120px var(--pad) 56px;
}
.intro-copy { max-width: 600px; }
.intro h1 { display: grid; gap: 12px; }
.intro-name { font-size: var(--fs-h4); font-family: var(--font); font-weight: 600; letter-spacing: 0; color: var(--accent); }
.intro-statement { max-width: 9.5em; font-size: min(var(--fs-display), 3.5rem); line-height: 1.02; letter-spacing: -0.025em; color: var(--text); }
.intro-lead { margin-top: 28px; max-width: 34em; color: var(--text); font-size: var(--fs-body); }
.intro-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); max-width: 920px; }
.fact { padding: 0; background: none; }
.fact-big { font: 600 var(--fs-h2)/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fact-big i { font-style: normal; margin: 0 .25em; color: var(--muted); }
.fact-big .to { color: var(--accent); }
.fact-text { margin-top: 10px; color: var(--text); font-size: var(--fs-small); line-height: 1.5; max-width: 22em; }

/* ---------- Historia ---------- */
.story { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 6vh var(--pad) 0; }
.story-head h2, .section-head h2 { font-size: var(--fs-h2); max-width: 24ch; }
.chapter { min-height: 82svh; display: flex; align-items: center; }
/* Karta wyśrodkowana w lewej kolumnie (scena 3D zajmuje prawą część ekranu). */
@media (min-width: 901px) { .chapter-card { margin-left: max(0px, calc(21vw - 260px - var(--pad))); } }
.chapter-card { width: 100%; max-width: 520px; transition: opacity .5s, transform .5s; }
.js .chapter:not(.is-active) .chapter-card { opacity: .4; transform: scale(.98); }

/* Artykuł w stylu portalu informacyjnego: zdjęcie z boku, tekst obok. Jasny „papier” — decyzja właściciela. */
.news {
  display: grid; grid-template-columns: 36% 1fr;
  overflow: hidden; border-radius: var(--radius); background: var(--paper); color: var(--paper-ink);
  outline: 2px solid transparent; outline-offset: 0; transition: outline-color .4s;
}
.news.media-right { grid-template-columns: 1fr 36%; }
.news.media-right .news-media { order: 2; }
.chapter.is-active .news { outline-color: var(--accent); }
.news-media { position: relative; margin: 0; overflow: hidden; background: var(--surface); }
.news-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.72) contrast(1.04) brightness(.96); transition: transform 1.2s ease; }
.news-media::after { /* wspólny ton zdjęć: neutralna szałwiowa warstwa */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: rgba(47, 74, 107, .12); mix-blend-mode: multiply;
}
.chapter.is-active .news-media img { transform: scale(1.05); }
.news-tag {
  position: absolute; z-index: 2; left: 10px; top: 10px; max-width: calc(100% - 20px); padding: 4px 10px; border-radius: 999px;
  background: var(--paper); color: var(--paper-accent); font-size: var(--fs-small); font-weight: 600; line-height: 1.3;
}
.news-body { padding: 20px 22px; display: flex; flex-direction: column; }
.news-title { font-family: var(--display); font-weight: 600; line-height: 1.12; color: var(--paper-ink); font-size: var(--fs-h4); }
.news-lead {
  margin-top: 8px; font-size: var(--fs-small); line-height: 1.5; color: var(--paper-ink);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.news-quote { margin: 14px 0 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--paper-accent); }
.news-quote p { font: italic 500 var(--fs-small)/1.45 var(--display); font-size: .95rem; color: var(--paper-ink); }
.news-quote cite { display: block; margin-top: 4px; font-style: normal; font-size: var(--fs-small); font-weight: 600; color: var(--paper-accent); }
.news-foot { margin-top: 14px; font-size: var(--fs-small); color: #8a3f17; }
.chapter-extra { margin-top: 12px; }
.chapter-extra .label { font-size: var(--fs-small); font-weight: 600; color: var(--paper-accent); margin-bottom: 6px; }
.chapter-extra .chips { gap: 6px; }
.chapter-extra .chips li { font-size: var(--fs-small); padding: 2px 10px; color: var(--paper-ink); background: var(--paper-2); }
.story-progress {
  position: fixed; right: var(--pad); bottom: 26px; z-index: 5;
  display: flex; gap: 10px; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity .4s;
}
.story-progress.show { opacity: 1; }
.story-progress span { display: flex; flex-direction: column; gap: 8px; color: var(--muted); opacity: .5; font-size: 0; transition: opacity .3s, color .3s; }
.story-progress span::before { content: ""; width: 34px; height: 3px; background: currentColor; border-radius: 2px; transition: width .3s; }
.story-progress span.on { color: var(--accent); opacity: 1; font-size: var(--fs-small); font-weight: 600; }
.story-progress span.on::before { width: 64px; }

/* ---------- Sekcje ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(64px, 7vw, 104px) var(--pad) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 3.5vw, 44px); }
.section-sub { margin-top: 20px; color: var(--text); font-size: var(--fs-body); max-width: 40em; }
.section-sub strong { color: var(--warm); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: var(--fs-small); color: var(--text); }

.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; transition-delay: calc(var(--i, 0) * 80ms); }
.js .reveal.in-view { opacity: 1; transform: none; }

/* ---------- Teczki projektów ---------- */
.cases { display: grid; gap: clamp(56px, 7vw, 96px); }
.case { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.case-sticky { position: sticky; top: 96px; }
.case h3 { font-size: var(--fs-h3); }
.case-area { margin-top: 14px; color: var(--text); font-size: var(--fs-body); }
.case .chips { margin-top: 18px; }
.case-cover { margin-top: 24px; padding: 24px; display: grid; place-items: center; }
.case.is-flipped { grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); }
.case.is-flipped .case-side { order: 2; }
.case-deck { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.case.is-flipped .case-deck { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.artefact.is-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 20px; align-items: center; min-height: 0; }
.artefact.is-wide figcaption { align-self: start; padding-right: 0; }
.artefact.is-wide .art-body { grid-column: 2; grid-row: 1 / span 2; }
.artefact { position: relative; margin: 0; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-height: 250px; transition: background-color .3s, transform .3s; }
.artefact:hover { background: var(--surface-2); transform: translateY(-3px); }
.artefact figcaption { display: grid; gap: 4px; padding-right: 84px; }
.art-label { font-size: var(--fs-small); font-weight: 600; color: var(--accent); }
.art-title { font: 600 var(--fs-h4)/1.2 var(--display); }
.art-body { flex: 1; display: grid; align-content: center; }
.art-svg { width: 100%; height: auto; overflow: visible; }
.art-story { margin: 0; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0; font-size: var(--fs-body); color: var(--text); }
.art-caption { margin-top: 10px; font-size: var(--fs-small); color: var(--muted); }
.art-steps { display: grid; gap: 10px; }
.art-steps li { position: relative; display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-small); color: var(--text); }
.tick { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; background: var(--surface-2); position: relative; transition: background-color .3s; }
.tick::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid var(--ink); border-width: 0 2px 2px 0; opacity: 0; transform: rotate(45deg) scale(.6); transition: transform .3s, opacity .3s; }
.is-live .tick, .in-view .tick { animation: tickOn .4s forwards; animation-delay: calc(.5s + var(--d, 0) * .45s); }
@keyframes tickOn { to { background: var(--accent); } }
.in-view .tick::after { opacity: 1; transform: rotate(45deg) scale(1); transition-delay: calc(.6s + var(--d, 0) * .45s); }
.art-pipe { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-small); }
.art-pipe li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 8px; background: var(--paper-2); border-left: 3px solid var(--accent); }
.art-pipe li + li::before { content: ""; position: absolute; left: 22px; top: -7px; width: 1px; height: 8px; background: var(--accent); }
.art-pipe b { font-weight: 600; color: var(--text); }
.art-pipe span { color: var(--muted); text-align: right; }
.art-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.art-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px; border-bottom: 1px solid rgba(var(--accent-rgb), .3); }
.art-table td { padding: 8px 6px; border-bottom: 1px solid rgba(var(--accent-rgb), .14); color: var(--text); }
.art-table td.hit { color: var(--accent); font-weight: 600; }
.art-code { margin: 0; padding: 14px; border-radius: 10px; background: #18222e; font: 500 .8rem/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; color: #e9eef3; overflow-x: auto; white-space: pre; }
.art-code .k { color: #9fb4cc; }
.art-code .s { color: #f0b37a; }

/* SVG artefaktów */
.art-svg text { font-family: var(--font); }
.s-dev { fill: var(--surface-2); stroke: #1f2d3d; stroke-width: 1.4; }
.s-bar { fill: rgba(var(--accent-rgb), .18); }
.s-row rect:first-child { fill: rgba(var(--navy-rgb), .14); }
.s-row path { stroke: rgba(24, 34, 46, .5); stroke-width: 2; stroke-linecap: round; }
.s-thumb { fill: rgba(var(--navy-rgb), .5); }
.s-pack { fill: none; stroke: var(--warm); stroke-width: 1.4; stroke-dasharray: 4 3; }
.s-tag { fill: var(--warm); font-size: 10px; font-weight: 600; }
.s-cta { fill: var(--accent); }
.s-note { fill: var(--muted); font-size: 11px; }
.s-hint rect:first-child { fill: rgba(var(--steel-rgb), .18); stroke: var(--steel); stroke-width: 1.2; }
.s-hint path { stroke: rgba(24, 34, 46, .55); stroke-width: 2; stroke-linecap: round; }
.s-chip { fill: var(--accent); }
.s-chip.ghost { fill: none; stroke: var(--muted); }
.s-ai path { fill: rgba(var(--steel-rgb), .12); stroke: var(--steel); stroke-width: 1.4; }
.s-ai .in { fill: none; }
.a-flow { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 3 8; animation: flow 1.6s linear infinite; animation-play-state: paused; }
.is-live .a-flow, .in-view .a-flow { animation-play-state: running; }
@keyframes flow { to { stroke-dashoffset: -22; } }
.q-h { fill: var(--text); font-size: 11px; font-weight: 600; }
.q-life { stroke: rgba(var(--accent-rgb), .3); stroke-dasharray: 3 4; }
.q-msg path:first-child { stroke: var(--accent); stroke-width: 1.4; }
.q-msg path.back { stroke: var(--steel); stroke-dasharray: 4 3; }
.q-head { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.q-msg text { fill: var(--text); font-size: 10.5px; }
.js .q-msg { opacity: 0; transition: opacity .4s; transition-delay: calc(.3s + var(--d) * .35s); }
.in-view .q-msg { opacity: 1; }
.e-box rect:first-child { fill: rgba(var(--navy-rgb), .1); stroke: rgba(var(--navy-rgb), .6); }
.e-head { fill: rgba(var(--navy-rgb), .35); }
.e-t { fill: var(--text); font-size: 9.5px; font-weight: 600; }
.e-f { fill: var(--muted); font-size: 9.5px; }
.e-rel { stroke: var(--accent); stroke-width: 1.4; }
.e-card { fill: var(--accent); font-size: 9.5px; }
.e-note { fill: var(--muted); font-size: 11px; }
.t-grid { stroke: rgba(var(--accent-rgb), .14); }
.t-area { fill: rgba(var(--accent-rgb), .1); }
.t-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.a-draw { stroke-dasharray: 600; stroke-dashoffset: 600; }
.in-view .a-draw { transition: stroke-dashoffset 1.8s ease .3s; stroke-dashoffset: 0; }
.t-dot { fill: var(--warm); }
.t-note { fill: var(--warm); font-size: 11px; }
.t-axis { fill: var(--muted); font-size: 10px; }
.p-axis, .p-tick { stroke: rgba(var(--accent-rgb), .3); }
.p-m { fill: var(--muted); font-size: 11px; }
.p-bar.a { fill: rgba(var(--navy-rgb), .3); stroke: var(--navy); }
.p-bar.b { fill: rgba(var(--accent-rgb), .25); stroke: var(--accent); }
.p-bar.c { fill: rgba(var(--steel-rgb), .25); stroke: var(--steel); }
.p-t { fill: var(--text); font-size: 11px; }
.p-now { stroke: var(--warm); stroke-dasharray: 3 3; }
.p-nt { fill: var(--warm); font-size: 10px; }
.p-cap { fill: var(--muted); font-size: 11px; }

/* Okładki projektów (visuals.js) */
.viz { width: 100%; max-width: 420px; height: auto; overflow: visible; }
.viz .v-grid path { stroke: rgba(var(--navy-rgb), .1); stroke-width: .6; fill: none; }
.viz .v-line { fill: none; stroke: rgba(var(--accent-rgb), .4); stroke-width: 1.2; }
.viz .v-dash { stroke-dasharray: 2 4; }
.viz .v-flow { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 3 11; animation: vflow 1.8s linear infinite; }
.viz .v-flow-amber { stroke: var(--warm); }
@keyframes vflow { to { stroke-dashoffset: -28; } }
.viz .v-box > *, .viz .v-node > * { fill: rgba(var(--navy-rgb), .1); stroke: rgba(200, 218, 196, .7); stroke-width: 1.3; }
.viz .v-accent > * { stroke: var(--navy); }
.viz .v-amber > * { stroke: var(--warm); fill: rgba(var(--warm-rgb), .1); }
.viz .v-teal > * { stroke: var(--accent); fill: rgba(var(--accent-rgb), .1); }
.viz .v-box > .v-in, .viz .v-node > .v-in { fill: none; stroke: rgba(220, 230, 218, .5); stroke-width: 1.2; }
.viz .v-box > .v-fill { fill: rgba(var(--navy-rgb), .4); stroke: none; }
.viz .v-box > .v-screen { fill: var(--surface); stroke: rgba(var(--accent-rgb), .4); }
.viz .v-box > .v-in-box { fill: var(--accent); stroke: none; }
.viz .v-bar { fill: rgba(var(--warm-rgb), .55); }
.viz .v-t text, .viz .v-t-doc, .viz .v-t-small { fill: var(--muted); font: 600 11px var(--font); }
.viz .v-bracket { fill: none; stroke: var(--warm); stroke-width: 1.3; }
.viz .v-layer path { fill: rgba(var(--accent-rgb), .1); stroke: rgba(var(--accent-rgb), .6); stroke-width: 1; }
.viz .v-layer .v-layer-2 { fill: rgba(var(--steel-rgb), .08); stroke: rgba(var(--steel-rgb), .5); }
.viz .v-wave { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.viz .v-cal rect { fill: none; stroke: var(--steel); stroke-width: 1; }

/* ---------- Mapa powiązań ---------- */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.map { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(48px, 7vw, 110px); }
.map-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.map-wires path { fill: none; }
.map-wires .wire { stroke: rgba(var(--navy-rgb), .3); stroke-width: 1.2; transition: opacity .6s; }
.map.is-focus .map-wires .wire { opacity: .1; }
/* Aktywny przewód rysuje się powoli od strony źródła, a po nim jedzie punkt światła. */
.map.is-focus .map-wires .wire.on {
  opacity: 1; stroke: var(--accent); stroke-width: 2;
  stroke-dasharray: 1 2; stroke-dashoffset: 1; animation: wireDraw var(--t, 2.6s) cubic-bezier(.45, 0, .25, 1) var(--d, 0s) forwards;
}
.map.is-focus .map-wires .wire.on.rev { stroke-dashoffset: -1; animation-name: wireDrawRev; }
.map-wires .spark { stroke: var(--accent); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: .05 2; opacity: 0; filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 1)); } /* taste-skill-ignore — światło na życzenie właściciela */
.map.is-focus .map-wires .spark.on { animation: spark var(--t, 2.6s) cubic-bezier(.45, 0, .25, 1) var(--d, 0s) forwards; }
.map.is-focus .map-wires .spark.on.rev { animation-name: sparkRev; }
@keyframes wireDraw { to { stroke-dashoffset: 0; } }
@keyframes wireDrawRev { to { stroke-dashoffset: 0; } }
@keyframes spark { 0% { opacity: 0; stroke-dashoffset: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; stroke-dashoffset: -.95; } }
@keyframes sparkRev { 0% { opacity: 0; stroke-dashoffset: -.95; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; stroke-dashoffset: 0; } }
.map-col { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }
.map-col h3 { font: 600 var(--fs-small) var(--font); color: var(--muted); margin-bottom: 4px; }
.map-node {
  display: grid; gap: 2px; text-align: left; width: 100%;
  padding: 11px 14px; border-radius: 10px; border: 0; border-left: 4px solid var(--accent);
  background: var(--surface); color: var(--text); cursor: pointer;
  font: 600 var(--fs-small)/1.3 var(--font);
  transition: opacity .25s, background-color .25s, transform .25s;
}
.map-node.exp { border-left-color: var(--warm); }
.map-node.proj { border-left-color: var(--steel); }
.map-node.area { border-left-color: var(--navy); }
.mn-sub { font-weight: 400; color: var(--muted); }
.map.is-focus .map-node:not(.on) { opacity: .3; transition-delay: 0s; }
/* Kafelek zapala się dopiero, gdy dotrze do niego światło. */
.map.is-focus .map-node.on { background: var(--surface-2); animation: nodeOn 1s ease var(--d, 0s) both; }
@keyframes nodeOn { from { opacity: .3; background: var(--surface); } to { opacity: 1; background: var(--surface-2); } }
.map-node.is-source { transform: translateX(4px); background: var(--accent); color: var(--ink); }
.map-node.is-source .mn-sub { color: var(--ink); }
.map-node:hover { background: var(--surface-2); }
.map-panel { position: sticky; top: 96px; padding: 24px; border-radius: var(--radius); background: var(--surface); min-height: 260px; }
.map-panel .label { font-size: var(--fs-small); font-weight: 600; color: var(--accent); margin: 16px 0 6px; }
.map-panel .label:first-child { margin-top: 0; }
.map-panel h3 { font-size: var(--fs-h4); margin-bottom: 8px; }
.map-panel p { color: var(--text); font-size: var(--fs-small); }
.map-panel .hint { margin-top: 14px; }
.legend { display: grid; gap: 6px; font-size: var(--fs-small); }
.legend i, .metro-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.legend .exp { background: var(--warm); }
.legend .skill { background: var(--accent); }
.legend .proj { background: var(--steel); }
.legend .area { background: var(--navy); }
.rel { display: grid; gap: 4px; }
.rel li { font-size: var(--fs-small); color: var(--text); padding-left: 16px; position: relative; }
.rel li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

/* ---------- Linia metra ---------- */
.metro-scroll { overflow-x: auto; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad) 8px; scrollbar-width: thin; }
.metro { min-width: 980px; }
.metro-hint { display: none; margin-bottom: 10px; font-size: var(--fs-small); color: var(--accent); }
.metro-svg { width: 100%; height: auto; overflow: visible; }
.metro-svg text { font-family: var(--font); }
.m-years text { fill: var(--muted); font-size: 13px; }
.m-years path { stroke: rgba(var(--navy-rgb), .08); }
.m-break { fill: var(--muted); font-size: 13px; }
.m-line { fill: none; stroke-width: 7; stroke-linecap: round; }
.m-line.amber { stroke: var(--warm); }
.m-line.violet { stroke: var(--steel); }
.m-line.cyan { stroke: var(--accent); stroke-width: 9; }
.m-line.logic { stroke: rgba(24, 34, 46, .35); stroke-width: 2; stroke-dasharray: 2 8; }
.js .m-line.draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.metro.in-view .m-line.draw { transition: stroke-dashoffset 2.2s cubic-bezier(.6, .1, .2, 1); stroke-dashoffset: 0; }
.metro.in-view .m-line.cyan { transition-delay: 1.2s; }
.m-train { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 18 400; opacity: 0; }
.metro.is-live .m-train { opacity: .9; animation: train 4.5s linear infinite 3s; }
@keyframes train { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -418; } }
.m-span { fill: rgba(24, 34, 46, .06); }
.m-station .m-dot { fill: var(--bg); stroke-width: 4; }
.m-station.amber .m-dot { stroke: var(--warm); }
.m-station.violet .m-dot { stroke: var(--steel); }
.m-station.cyan .m-dot { stroke: var(--accent); fill: var(--surface-2); }
.m-origin .m-dot { fill: var(--bg); stroke: rgba(24, 34, 46, .7); stroke-width: 3; }
.m-label { fill: var(--text); font-size: 15px; font-weight: 600; }
.m-sub { fill: var(--muted); font-size: 13px; }
.m-line-label { font-size: 13px; font-weight: 600; }
.m-line-label.amber { fill: var(--warm); }
.m-line-label.violet { fill: var(--steel); }
.m-line-label.cyan { fill: var(--accent); }
.m-cert rect { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.m-cert path { fill: none; stroke: rgba(var(--accent-rgb), .5); }
.m-cert .m-year { fill: var(--muted); }
.m-cert text { fill: var(--text); font-size: 13px; }
.m-station:focus-visible, .m-cert:focus-visible { outline: none; }
.m-station:focus-visible .m-dot, .m-cert:focus-visible rect { stroke: var(--text); }
/* Legenda zostaje w kadrze ekranu, nawet gdy sama linia przewija się w bok. */
.metro-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-size: var(--fs-small); color: var(--text); position: sticky; left: 0; max-width: calc(100vw - 2 * var(--pad)); }
.metro-legend .amber { background: var(--warm); }
.metro-legend .violet { background: var(--steel); }
.metro-legend .cyan { background: var(--accent); }
.metro-legend .cert { width: 10px; height: 10px; background: var(--accent); transform: rotate(45deg); border-radius: 2px; }
.metro-legend .logic { background: rgba(24, 34, 46, .45); height: 2px; }
.metro-list { display: none; }
.ml-item { position: relative; display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 0 0 22px 22px; }
.ml-item::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: -6px; width: 4px; border-radius: 2px; background: var(--accent); }
.ml-item:last-child::before { bottom: 6px; }
.ml-item::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 3px currentColor; } /* taste-skill-ignore — kropka stacji, nie cień */
.ml-item.amber { color: var(--warm); } .ml-item.amber::before { background: var(--warm); }
.ml-item.violet { color: var(--steel); } .ml-item.violet::before { background: var(--steel); }
.ml-item.logic { color: rgba(24, 34, 46, .6); } .ml-item.logic::before { background: rgba(24, 34, 46, .3); }
.ml-item.cyan, .ml-item.cert { color: var(--accent); }
.ml-item.cert::after { border-radius: 2px; transform: rotate(45deg) scale(.85); }
.ml-item.main::after { width: 16px; height: 16px; left: -2px; background: var(--accent); }
.ml-when { font-size: var(--fs-small); font-weight: 600; font-variant-numeric: tabular-nums; }
.ml-what { color: var(--text); font-size: var(--fs-small); }
.ml-what b { display: block; font-size: var(--fs-body); }
.ml-what span { color: var(--muted); }
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: clamp(36px, 4vw, 56px); }
.skills { gap: clamp(24px, 3vw, 40px); }
.skill-group { padding: 0; }
.skill-group h3 { font: 600 var(--fs-h4) var(--display); color: var(--text); margin-bottom: 14px; }

/* ---------- Kontakt ---------- */
.contact { padding-bottom: clamp(64px, 7vw, 104px); }
.contact-h { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.025em; max-width: 16ch; }
.contact-photo { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.contact-photo img { width: 100%; height: 100%; object-fit: cover; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); margin-top: clamp(40px, 5vw, 64px); align-items: center; }
.contact-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.contact-cta .btn { max-width: 100%; overflow-wrap: anywhere; }
.contact-list { display: grid; gap: 18px; margin: 0; padding: 28px; border-radius: var(--radius); background: var(--surface); }
.contact-list div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
.contact-list dt { font-size: var(--fs-small); color: var(--muted); padding-top: 2px; }
.contact-list dd { margin: 0; font-size: var(--fs-body); }
.contact-list a { text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), .5); text-underline-offset: 4px; }
.contact-list a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; max-width: var(--maxw); margin: 0 auto; padding: 32px var(--pad) 40px; font-size: var(--fs-small); color: var(--muted); }
.footer a { text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), .4); text-underline-offset: 3px; }
.footer a:hover { color: var(--text); }

/* ---------- Responsywność ---------- */
@media (max-width: 1100px) {
  .map-wrap { grid-template-columns: 1fr; }
  .map-panel { position: static; min-height: 0; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-progress { display: none; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav { position: absolute; top: 56px; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px var(--pad) 18px; background: var(--bg); }
  .nav-open .nav { display: flex; }
  .nav a:not(.btn) { padding: 12px; font-size: var(--fs-body); }
  .nav .btn { margin: 8px 0 0; justify-content: center; }

  .stage-vignette { background: linear-gradient(0deg, rgba(236, 239, 242, .95) 0%, rgba(236, 239, 242, .55) 45%, rgba(236, 239, 242, .25) 100%); } /* taste-skill-ignore */
  .stage-fallback { right: 50%; transform: translate(50%, -60%); width: min(92vw, 520px); opacity: .5; }
  .intro { justify-content: flex-end; padding-top: 46vh; }
  .facts { grid-template-columns: 1fr; gap: 20px; }
  .chapter { align-items: flex-end; padding-bottom: 8vh; }
  .chapter-card { max-width: 520px; margin: 0 auto; }
  .news, .news.media-right { grid-template-columns: 1fr; }
  .news.media-right .news-media { order: 0; }
  .news-media { aspect-ratio: 2.6 / 1; }
  .case { grid-template-columns: 1fr; }
  .case-sticky { position: static; }
  .map { grid-template-columns: 1fr; gap: 34px; }
  .map-col { flex-direction: row; flex-wrap: wrap; }
  .map-col h3 { width: 100%; }
  .map-node { width: auto; }
  .map-wires { display: none; }
  .map-panel { z-index: 4; max-height: 40vh; overflow-y: auto; margin-top: 8px; outline: 2px solid transparent; transition: outline-color .3s; }
  .map-panel.is-open { position: sticky; bottom: 12px; outline-color: var(--accent); }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-photo { max-width: 240px; }
  .metro-scroll { overflow: visible; margin: 0; padding: 0; }
  .metro { min-width: 0; }
  .metro-svg { display: none; }
  .metro-list { display: block; margin-top: 8px; }
  .metro-legend { display: none; }
  .case.is-flipped { grid-template-columns: 1fr; }
  .case.is-flipped .case-side { order: 0; }
}
@media (max-width: 600px) {
  .case-deck, .case.is-flipped .case-deck { grid-template-columns: 1fr; }
  .artefact.is-wide { grid-template-columns: 1fr; }
  .artefact.is-wide .art-body { grid-column: 1; grid-row: auto; }
  .skills { grid-template-columns: 1fr; }
  .intro-cta .btn { flex: 1 1 100%; justify-content: center; }
  .contact-cta { align-items: stretch; }
  .contact-cta .btn { justify-content: center; padding: 0 16px; }
  .contact-list div { grid-template-columns: 1fr; gap: 2px; }
  .scene-label { padding: 3px 8px; }
  .scene-label.is-main:not(.is-lit) span { display: none; }
}

/* ---------- Ograniczenie ruchu ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
  .js .reveal, .js .q-msg { opacity: 1; transform: none; }
  .js .m-line.draw { stroke-dashoffset: 0; }
  .a-draw { stroke-dashoffset: 0; }
  .tick { background: var(--accent); }
  .tick::after { opacity: 1; transform: rotate(45deg) scale(1); }
  .map.is-focus .map-wires .wire.on { stroke-dashoffset: 0; }
  .map-wires .spark { display: none; }
}
