/*
 * base.css — tokeny, reset, typografia, nawigacja, stopka, przyciski,
 * preloader (migawka listkowa), animacje reveal.
 * Paleta: ciemny grafit #22242B + pomarancz Sony Alpha #E94F09 (tylko akcenty).
 */

:root {
  --bg:       #22242B;
  --bg-deep:  #1B1D22;
  --bg-card:  #282B33;
  --ink:      #F2EFEA;
  --ink-dim:  #A6A8B0;
  --accent:   #E94F09;
  --accent-soft: #F06A2C;
  --line:     rgba(242, 239, 234, 0.1);
  --serif:    'DM Serif Display', Georgia, serif;
  --sans:     'Manrope', -apple-system, 'Segoe UI', sans-serif;
  --container: 1200px;
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html.is-loading { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }
picture { display: contents; }
a { color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Typografia ---------- */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.1;
  letter-spacing: 0;
  margin: 0 0 24px;
}
.display-sm {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.14;
  margin: 0 0 18px;
}
.accent-italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-soft);
}
/* Typewriter akcentow w naglowkach: wpisywanie po wejsciu w kadr (js/main.js).
   display/min-width ustawia JS inline (rezerwuje szerokosc, brak reflow). */
.accent-italic.tw { white-space: nowrap; }
.accent-italic.tw::after {
  content: '';
  display: inline-block;
  width: 0.06em;
  min-width: 1px;
  height: 0.92em;
  margin-left: 0.05em;
  background: currentColor;
  vertical-align: -0.09em;
  animation: tw-caret 0.85s steps(1) infinite;
}
.accent-italic.tw.tw-done::after {
  animation: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
@keyframes tw-caret { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .accent-italic.tw::after { display: none; }
}
.lead {
  font-size: 18px;
  color: var(--ink-dim);
  max-width: 640px;
  margin: 0 0 8px;
}

.section { padding: clamp(90px, 12vw, 150px) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 70px); }

/* ---------- Przyciski ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 34px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-soft); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(242, 239, 234, 0.35);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-soft); }
.btn-sm { padding: 11px 22px; font-size: 12px; }
.btn-wide { width: 100%; text-align: center; }

/* ---------- Logo: gruby grotesk (bez tla) z pomaranczowa kropka ---------- */
.brand-badge {
  display: inline-flex;
  align-items: baseline;
  color: #fff;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 23px;
  line-height: 1;
  letter-spacing: -0.035em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-badge i {
  display: inline-block;
  width: 0.2em;
  height: 0.2em;
  margin-left: 0.16em;
  background: var(--accent);
  border-radius: 1px;
}

/* ---------- Preloader: migawka (cieciwy irysu) -> logo -> lot do rogu ----------
   Sekwencja sterowana klasami z main.js:
   start -> .phase-click (wyzwolenie + flash) -> .show-brand (logo na srodku)
   -> .is-flying (FLIP do pozycji w nav) -> usuniecie. Gra przy KAZDYM wejsciu. */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
/* Koniec animacji: cale przejscie gasnie, logo JUZ stoi w rogu nava (bez lotu) */
.preloader.is-done { opacity: 0; }
/* Intro juz bylo w tej sesji: nie pokazujemy preloadera wcale (bez mignięcia). */
.intro-seen .preloader { display: none !important; }
.preloader-bg {
  position: absolute;
  inset: 0;
  background: var(--bg-deep);
}
.preloader-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
}
.preloader.phase-click .preloader-flash { animation: flashBlink 0.38s ease-out both; }
@keyframes flashBlink {
  0%   { opacity: 0; }
  14%  { opacity: 0.5; }
  60%  { opacity: 0.12; }
  100% { opacity: 0; }
}
.preloader-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Aparat: kreski rysuja sie po kolei (pathlength=1 -> wspolna dasharray) */
.pre-camera {
  width: 150px;
  height: auto;
  color: var(--ink);
  overflow: visible;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.pc-stroke {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: pcDraw 0.55s var(--ease) forwards;
}
.pc-body { animation-duration: 0.7s; }
.pc-stroke:nth-of-type(1) { animation-delay: 0s; }
.pre-camera .pc-btn .pc-stroke { animation-delay: 0.34s; }
.pre-camera > g > .pc-stroke:nth-of-type(2) { animation-delay: 0.05s; }  /* body */
.pre-camera > g > .pc-stroke:nth-of-type(3) { animation-delay: 0.26s; }  /* prism */
.pre-camera > g > .pc-stroke:nth-of-type(4) { animation-delay: 0.4s; }   /* flash cell */
.pre-camera > g > .pc-stroke:nth-of-type(5) { animation-delay: 0.2s; }   /* lens */
.pc-iris .pc-stroke:nth-child(1) { animation-delay: 0.42s; }
.pc-iris .pc-stroke:nth-child(2) { animation-delay: 0.48s; }
.pc-iris .pc-stroke:nth-child(3) { animation-delay: 0.54s; }
.pc-iris .pc-stroke:nth-child(4) { animation-delay: 0.6s; }
.pc-iris .pc-stroke:nth-child(5) { animation-delay: 0.66s; }
.pc-iris .pc-stroke:nth-child(6) { animation-delay: 0.72s; }
@keyframes pcDraw { to { stroke-dashoffset: 0; } }

/* Wyzwolenie: przycisk wciska sie, dioda mruga, irys robi szybki obrot */
.pc-btn { transform-origin: 126px 24px; }
.preloader.phase-click .pc-btn { animation: pcPress 0.32s var(--ease) both; }
@keyframes pcPress {
  0%   { transform: translateY(0); }
  38%  { transform: translateY(5px); }
  100% { transform: translateY(0); }
}
.pc-dot { fill: var(--accent); opacity: 0; }
.preloader.phase-click .pc-dot { animation: pcDot 0.45s ease-out both; }
@keyframes pcDot {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0.5; }
}
/* Po flashu aparat gasnie, wordmark zostaje i leci do rogu */
.preloader.show-brand .pre-camera { opacity: 0; transform: scale(1.12); }

/* Wordmark pojawia sie W MIEJSCU aparatu (absolutnie w centrum) */
.preloader-brand {
  position: absolute;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.5s var(--ease), transform 0.55s var(--ease);
  will-change: transform;
}
.preloader-brand .brand-badge { font-size: clamp(28px, 4.6vw, 42px); }
.preloader.word-in .preloader-brand { opacity: 1; transform: scale(1); }

/* Logo w nav pojawia sie dopiero po zakonczeniu animacji wejsciowej */
html.is-loading .site-nav .nav-brand { opacity: 0; }
.site-nav .nav-brand { transition: opacity 0.3s var(--ease); }

/* ---------- Nawigacja segmentowa: czarny (logo) | bialy | pomarancz (Menu +) ----------
   Segmenty z lekka przezroczystoscia + blur, zeby pasek nie byl "cegla" nad wideo. */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  height: 48px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-seg {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.seg-logo { background: rgba(27, 29, 34, 0.8); padding: 0 46px; }
.nav-brand { text-decoration: none; }
/* Srodkowy segment = klisza: perforacja gora/dol + pionowe przegrody klatek.
   Wzor zyje w ::before (JS steruje --film-x przy scrollu); maska wygasza go
   stopniowo w strefie 30 px przy kaflach logo i Menu — zero twardego odciecia. */
.seg-mid {
  flex: 1;
  background-color: rgba(242, 239, 234, 0.8);
  position: relative;
  overflow: hidden;
  --film-x: 0px;
}
.seg-mid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(11, 12, 15, 0.85) 0 5px, transparent 5px 12px),
    linear-gradient(90deg, rgba(11, 12, 15, 0.85) 0 5px, transparent 5px 12px),
    linear-gradient(90deg, rgba(11, 12, 15, 0.85) 0 5px, transparent 5px 108px);
  background-size: 12px 4px, 12px 4px, 108px calc(100% - 10px);
  background-position: var(--film-x) 1px, var(--film-x) calc(100% - 1px), var(--film-x) center;
  background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%);
}
/* Po otwarciu menu: pomaranczowy prostokat wjezdza od prawej i zalewa klisze */
.seg-mid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.55s var(--ease);
}
body.menu-open .seg-mid::after { transform: scaleX(1); }

/* "Menu +" — pomaranczowy segment, otwiera pelnoekranowe menu */
.seg-menu.menu-toggle {
  background: rgba(233, 79, 9, 0.8);
  border: 0;
  color: #0B0C0F;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  gap: 12px;
  padding: 0 36px;
  cursor: pointer;
  transition: background 0.25s;
}
.seg-menu.menu-toggle:hover { background: var(--accent-soft); }
.mt-plus {
  position: relative;
  width: 14px;
  height: 14px;
  transition: transform 0.35s var(--ease);
}
.mt-plus::before, .mt-plus::after {
  content: '';
  position: absolute;
  background: #0B0C0F;
}
.mt-plus::before { left: 0; right: 0; top: 6px; height: 2px; }
.mt-plus::after { top: 0; bottom: 0; left: 6px; width: 2px; }
.menu-toggle:hover .mt-plus { transform: rotate(90deg); }
body.menu-open .mt-plus { transform: rotate(45deg); }
body.menu-open .menu-toggle:hover .mt-plus { transform: rotate(135deg); }

/* Pelnoekranowe menu */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background:
    radial-gradient(90% 100% at 85% 10%, rgba(233, 79, 9, 0.1), transparent 55%),
    var(--bg-deep);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 110px 24px 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s;
}
body.menu-open .menu-overlay { opacity: 1; visibility: visible; }
.menu-links {
  display: grid;
  gap: 0;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}
.menu-links a {
  display: flex;
  align-items: baseline;
  gap: 22px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.25;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: clamp(10px, 1.6vw, 18px) 2px;
  opacity: 0;
  transform: translateY(18px);
  transition: color 0.3s, opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
body.menu-open .menu-links a { opacity: 1; transform: none; }
body.menu-open .menu-links a:nth-child(1) { transition-delay: 0.06s; }
body.menu-open .menu-links a:nth-child(2) { transition-delay: 0.12s; }
body.menu-open .menu-links a:nth-child(3) { transition-delay: 0.18s; }
body.menu-open .menu-links a:nth-child(4) { transition-delay: 0.24s; }
body.menu-open .menu-links a:nth-child(5) { transition-delay: 0.3s; }
body.menu-open .menu-links a:nth-child(6) { transition-delay: 0.36s; }
.menu-links a em {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.menu-links a:hover span { font-style: italic; color: var(--accent-soft); }
.menu-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
  max-width: var(--container);
  margin: 40px auto 0;
  width: 100%;
  color: var(--ink-dim);
  font-size: 14px;
}
.menu-foot a { color: var(--ink-dim); text-decoration: none; transition: color 0.25s; }
.menu-foot a:hover { color: var(--ink); }
@media (max-width: 640px) {
  .site-nav { height: 44px; }
  .seg-logo { padding: 0 20px; }
  .seg-menu.menu-toggle { padding: 0 20px; font-size: 13px; }
  .site-nav .brand-badge { font-size: 19px; }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .preloader { display: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Stopka ---------- */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding: 70px 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 50px;
}
.footer-brand .brand-badge { display: inline-block; font-size: 22px; margin-bottom: 22px; }
.footer-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.footer-col a, .footer-area {
  display: block;
  color: var(--ink-dim);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 8px;
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 12.5px;
}
.footer-bottom a { color: var(--ink-dim); }
/* Podpis autora: wysrodkowany, pod dolnym paskiem */
.footer-credit-line { text-align: center; padding-bottom: 24px; font-size: 12.5px; }
.footer-credit { color: var(--ink-dim); text-decoration: none; }
.footer-credit:hover { color: var(--accent-soft); }
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}

/* ---------- Sekcja prawna ---------- */
.legal { padding-top: 170px; }
.legal-inner { max-width: 760px; }
.legal ol { color: var(--ink-dim); padding-left: 20px; display: grid; gap: 14px; margin: 30px 0 40px; }
.legal strong { color: var(--ink); }
