/* Erebus Control
   Układ: ciemne pasy (nagłówek, galeria, dokumentacja, kontakt) na przemian z jasnymi sekcjami treści,
   jak w broszurze firmy. Jeden wyrazisty motyw: ścieżka etapów projektu narysowana jak przewód z zaciskami. */
:root {
  color-scheme: light;
  --ink: #1b2024;        /* najgłębsza ciemna, stopka broszury */
  --slate: #333a42;      /* nagłówek broszury */
  --slate-2: #414852;    /* pas pod schematami */
  --paper: #f3f5f7;      /* chłodne jasne tło */
  --white: #ffffff;
  --blue: #4084be;       /* niebieski z logo */
  --blue-deep: #2a659f;  /* linki i przyciski na jasnym tle */
  --blue-pale: #9cc6ea;  /* akcenty na ciemnym tle */
  --line: #d6dbe1;
  --line-dark: #4c545e;
  --text: #20262c;
  --muted: #56616c;
  --on-dark: #eef1f4;
  --on-dark-muted: #b3bcc6;
  --wire-l: #c8473f;     /* fazy na schemacie */
  --wire-n: #3f6fc4;     /* przewód neutralny */
  --wire-pe: #3f9a5a;    /* przewód ochronny */

  --font-display: "Inter Display", "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "DejaVu Sans Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --gutter: clamp(16px, 4vw, 40px);
  --wrap: 1180px;
  --section: clamp(3.5rem, 8vw, 6.5rem);
}

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter Display"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-display-600.woff") format("woff"); }
@font-face { font-family: "Inter Display"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/inter-display-700.woff") format("woff"); }
@font-face { font-family: "DejaVu Sans Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/dejavu-mono-400.woff") format("woff"); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-deep); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -0.012em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
[id] { scroll-margin-top: 5.5rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 50;
  background: var(--white); color: var(--ink); padding: 0.6rem 1rem;
}
.skip:focus { top: 0.5rem; }

/* ---------- nagłówek ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--slate); color: var(--on-dark);
  border-bottom: 1px solid var(--line-dark);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1rem 1.75rem; flex-wrap: wrap;
  padding-block: 0.7rem;
}
.brand { display: block; flex: none; margin-right: auto; }
.brand img { height: 42px; width: auto; }
.nav { display: flex; gap: 0.25rem 1.5rem; flex-wrap: wrap; list-style: none; }
.nav a {
  color: var(--on-dark); text-decoration: none; font-weight: 500; font-size: 0.97rem;
  padding-block: 0.4rem; border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--blue); color: var(--white); }
.langs { display: flex; list-style: none; border: 1px solid var(--line-dark); border-radius: 3px; flex: none; }
.langs a {
  display: block; padding: 0.3rem 0.62rem; color: var(--on-dark-muted); text-decoration: none;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em;
}
.langs li + li a { border-left: 1px solid var(--line-dark); }
.langs a:hover { color: var(--white); }
.langs a[aria-current="true"] { background: var(--blue); color: var(--white); }
.menu-btn {
  display: none; flex: none; background: none; border: 1px solid var(--line-dark); border-radius: 3px;
  color: var(--on-dark); font: 500 0.92rem var(--font-body); padding: 0.38rem 0.8rem; cursor: pointer;
}
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; gap: 0; order: 5; padding-bottom: 0.4rem; }
  .nav.open { display: flex; }
  .nav a { display: block; padding-block: 0.7rem; border-bottom: 1px solid var(--line-dark); }
  .brand img { height: 36px; }
}

/* ---------- hero ---------- */
.hero { position: relative; background: var(--ink); color: var(--white); isolation: isolate; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(27,32,36,0.94) 0%, rgba(27,32,36,0.82) 42%, rgba(27,32,36,0.32) 100%);
}
.hero .wrap { padding-block: clamp(4rem, 11vw, 8.5rem); }
.hero-text { max-width: 41rem; display: grid; gap: 1.4rem; }
.hero .label { color: var(--blue-pale); }
.hero h1 { font-size: clamp(2.2rem, 5.6vw, 3.9rem); font-weight: 700; letter-spacing: -0.022em; line-height: 1.04; }
.hero-sub { font-size: clamp(1.08rem, 1.7vw, 1.3rem); color: var(--on-dark); max-width: 34rem; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.4rem; }
.btn {
  display: inline-block; padding: 0.82rem 1.4rem; border-radius: 3px; text-decoration: none;
  font-weight: 600; font-size: 1rem; border: 1px solid transparent;
}
.btn-primary { background: var(--blue-deep); color: var(--white); }
.btn-primary:hover { background: var(--blue); color: var(--white); }
.btn-ghost { border-color: rgba(238,241,244,0.55); color: var(--white); }
.btn-ghost:hover { background: rgba(238,241,244,0.12); color: var(--white); }
@media (max-width: 640px) {
  .hero::after { background: linear-gradient(180deg, rgba(27,32,36,0.9) 0%, rgba(27,32,36,0.78) 100%); }
}

/* ---------- pasek platform ---------- */
.platforms { background: var(--ink); color: var(--on-dark-muted); border-top: 1px solid var(--line-dark); }
.platforms .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.4rem; padding-block: 1.1rem; }
.platforms ul { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; }
.platforms li {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.03em; color: var(--on-dark);
  border: 1px solid var(--line-dark); border-radius: 2px; padding: 0.22rem 0.6rem; background: var(--slate);
}

/* ---------- sekcje ---------- */
.section { padding-block: var(--section); }
.section-white { background: var(--white); }
.section-dark { background: var(--slate); color: var(--on-dark); }
.section-ink { background: var(--ink); color: var(--on-dark); }
.section-head { display: grid; gap: 0.8rem; max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.section-dark .section-head p, .section-ink .section-head p { color: var(--on-dark-muted); }

/* o nas */
.about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about > * { min-width: 0; }
.about-main { display: grid; gap: 1.3rem; }
.about-main p { max-width: 38rem; }
.about-side { display: grid; gap: 2rem; }
.about-side > div { display: grid; gap: 0.7rem; }
.about-side h3 { font-size: 1.12rem; }
.about-side p { color: var(--muted); font-size: 1rem; }
.industries { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.industries li { padding: 0.75rem 0 0.75rem 1.4rem; border-bottom: 1px solid var(--line); position: relative; font-weight: 500; }
.industries li::before { content: ""; position: absolute; left: 0; top: 1.28rem; width: 8px; height: 8px; background: var(--blue); }
.industries small { display: block; font-weight: 400; color: var(--muted); font-size: 0.93rem; }
@media (max-width: 820px) { .about { grid-template-columns: minmax(0, 1fr); } }

/* etapy: przewód z zaciskami */
.steps { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 1.1rem; counter-reset: step; }
.steps li { position: relative; padding-top: 2.6rem; min-width: 0; counter-increment: step; }
.steps li::before {
  content: ""; position: absolute; top: 0.62rem; left: 0; right: -1.1rem; height: 2px; background: var(--blue);
}
.steps li:last-child::before { right: 0; }
.steps li::after {
  content: ""; position: absolute; top: 0; left: 0; width: 1.3rem; height: 1.3rem;
  background: var(--white); border: 2px solid var(--blue); border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--white), inset 0 0 0 9px var(--blue);
}
.step-no { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--blue-deep); display: block; }
.step-no::before { content: "0" counter(step); }
.steps h3 { font-size: 1.06rem; margin: 0.25rem 0 0.4rem; hyphens: auto; overflow-wrap: anywhere; }
.steps p { font-size: 0.93rem; color: var(--muted); line-height: 1.5; }
@media (max-width: 980px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .steps li { padding: 0 0 1.6rem 2.4rem; }
  .steps li::before { top: 0.4rem; bottom: -0.4rem; left: 0.6rem; right: auto; width: 2px; height: auto; }
  .steps li:last-child::before { display: none; }
  .steps li:last-child { padding-bottom: 0; }
  .steps li::after { top: 0.15rem; }
}

/* kompetencje */
.comp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4.5rem); }
.comp > section { min-width: 0; display: grid; gap: 1rem; align-content: start; border-top: 3px solid var(--slate); padding-top: 1.4rem; }
.comp-lead { color: var(--muted); }
.comp dl { display: grid; }
.comp dl > div { padding-block: 0.95rem; border-top: 1px solid var(--line); }
.comp dt { font-weight: 600; }
.comp dd { color: var(--muted); font-size: 0.98rem; }
@media (max-width: 820px) { .comp { grid-template-columns: minmax(0, 1fr); } }

/* galeria z tabliczkami */
.gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.9rem; list-style: none; }
.gallery li { min-width: 0; }
.shot { display: block; width: 100%; padding: 0; border: 0; background: var(--ink); cursor: zoom-in; overflow: hidden; }
.shot img { width: 100%; aspect-ratio: 3 / 5; object-fit: cover; transition: transform 0.35s ease; }
.shot:hover img { transform: scale(1.03); }
.plate {
  display: flex; align-items: center; gap: 0.55rem; margin-top: 0.55rem;
  background: var(--ink); color: var(--white); border: 1px solid var(--line-dark);
  padding: 0.5rem 0.65rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.3;
}
.plate::before, .plate::after { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--line-dark); }
.plate span { flex: 1; text-align: center; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .gallery-scroll { overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-snap-type: x proximity; padding-bottom: 0.6rem; }
  .gallery { grid-template-columns: repeat(5, minmax(210px, 1fr)); width: max-content; min-width: 100%; }
  .gallery li { scroll-snap-align: start; width: 210px; }
}

/* biuro */
.office { position: relative; background: var(--ink); color: var(--white); }
.office img { width: 100%; max-height: 520px; object-fit: cover; }
.office-cap { background: var(--ink); }
.office-cap .wrap { display: grid; gap: 0.3rem; padding-block: 1.5rem; }
.office-cap h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
.office-cap p { color: var(--on-dark-muted); }

/* dokumentacja */
.bus { display: grid; gap: 5px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.bus i { display: block; height: 2px; background: var(--wire-l); position: relative; }
.bus i:nth-child(4) { background: var(--wire-n); }
.bus i:nth-child(5) { background: var(--wire-pe); }
.bus-labels { display: flex; gap: 1rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--on-dark-muted); margin-bottom: 0.5rem; }
.sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; list-style: none; }
.sheet { display: block; width: 100%; padding: 0.7rem; border: 0; background: var(--white); cursor: zoom-in; }
.sheet img { width: 100%; }
@media (max-width: 700px) { .sheets { grid-template-columns: minmax(0, 1fr); } }

/* kontakt */
.contact { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact > * { min-width: 0; }
.contact-intro { display: grid; gap: 1rem; }
.contact-intro p { color: var(--on-dark-muted); max-width: 30rem; }
.contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem 2rem; }
.contact-list > div { min-width: 0; display: grid; gap: 0.3rem; align-content: start; border-top: 1px solid var(--line-dark); padding-top: 0.9rem; }
.contact-list dt { color: var(--blue-pale); }
.contact-list dd { font-size: 1.05rem; overflow-wrap: anywhere; }
.contact-list .big { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.1rem, 1.7vw, 1.28rem); line-height: 1.3; }
.contact-list a { color: var(--white); text-decoration-color: var(--blue); }
.contact-list a:hover { color: var(--blue-pale); }
@media (max-width: 820px) { .contact { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .contact-list { grid-template-columns: minmax(0, 1fr); } }

.site-footer { background: var(--ink); color: var(--on-dark-muted); border-top: 1px solid var(--line-dark); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; justify-content: space-between; padding-block: 1.3rem; }

/* powiększenie zdjęcia */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgba(15, 18, 21, 0.9); }
.lightbox img { max-width: min(96vw, 1400px); max-height: 86vh; width: auto; height: auto; background: var(--white); }
.lightbox form { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.lightbox button {
  background: var(--white); color: var(--ink); border: 0; border-radius: 3px; cursor: pointer;
  font: 600 0.95rem var(--font-body); padding: 0.45rem 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shot img { transition: none; }
  .shot:hover img { transform: none; }
}
