/* ============================================================
   elcodo — pro pass
   Loaded LAST. Editorial structure over uniform glass:
   · glass becomes a deliberate accent (console + CTA only)
   · content blocks become paper with hairlines
   · full-bleed section rules + margin index counters
   · tighter type, one shared easing, calmer ambience
   ============================================================ */

body { --ease-ui: cubic-bezier(0.32, 0.72, 0, 1); }

/* deeper ink — more contrast, less washed-out pastel ------------- */
body {
  --ink: oklch(0.21 0.032 272);
  --ink-dim: oklch(0.40 0.024 272);
  --ink-faint: oklch(0.545 0.018 272);
  --hairline: oklch(0.21 0.032 272 / 0.13);
}

/* ambience dialled back: it should sit under the type, not compete */
body::before { opacity: 0.62; }
.blob { opacity: 0.26; filter: blur(72px) saturate(0.95); }

/* ============================================================
   1. type — tighter, more deliberate
   ============================================================ */
h2 {
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero-txt-h1, .cad-svg { letter-spacing: -0.04em; }
p { text-wrap: pretty; }
.kicker { font-size: 11px; letter-spacing: 0.2em; }
.num, .lbl, .clients-kicker, .foot-legal, .eyebrow { font-variant-ligatures: none; }
.stat .big, .foot-legal { font-variant-numeric: tabular-nums; }

/* links: real designed underline, not browser default ------------ */
a { color: var(--ink); }
main a:not(.btn):not(.brand):not(.logo-item),
.foot-legal a, .cta-card .contact a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
  transition: text-decoration-color 0.18s var(--ease-ui), color 0.18s var(--ease-ui);
}
main a:not(.btn):hover, .foot-legal a:hover { text-decoration-color: currentColor; }

/* ============================================================
   2. structure — full-bleed rules + margin index counters
   ============================================================ */
.manifest, .scope, .scale { position: relative; }
.manifest::before, .scope::before, .scale::before, .cta::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--hairline);
}
section[data-idx] > .wrap { position: relative; }
section[data-idx] > .wrap::before {
  content: attr(data-idx);
  position: absolute; top: -30px; right: 32px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em;
  color: var(--ink-faint); opacity: 0.75;
}
@media (max-width: 720px) { section[data-idx] > .wrap::before { display: none; } }

/* the kicker anchors to the rule above it */
.kicker { margin-top: 4px; }

/* ============================================================
   3. cards — paper, not another pane of glass
   ============================================================ */
.cards .card.glass {
  background: oklch(1 0 0 / 0.5);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  box-shadow: none;
  backdrop-filter: blur(6px);
  transition: transform 0.3s var(--ease-ui), border-color 0.3s var(--ease-ui),
              box-shadow 0.3s var(--ease-ui), background 0.3s var(--ease-ui);
}
.cards .card.glass::before, .cards .card.glass::after { display: none; }
/* colour lives in a top rule that grows on hover */
.cards .card::after {
  content: ""; display: block;
  position: absolute; top: 0; left: 0; height: 2px; width: 0;
  background: var(--g);
  transition: width 0.45s var(--ease-ui);
  z-index: 3;
}
.cards .card:hover::after { width: 100%; }
.cards .card:hover {
  transform: translateY(-3px);
  background: oklch(1 0 0 / 0.78);
  border-color: color-mix(in oklab, var(--g) 26%, var(--hairline));
  box-shadow: 0 18px 44px -26px color-mix(in oklab, var(--g) 50%, transparent);
}
.card .num {
  font-size: 10.5px; letter-spacing: 0.18em;
  color: var(--ink-faint);
}
.card .num::first-line { color: inherit; }
.card:hover .num { color: var(--g); }
.card .glyph { width: 30px; height: 30px; opacity: 0.85; }

/* ============================================================
   4. stats — editorial figures on hairlines, no boxes
   ============================================================ */
.stats .stat.glass {
  background: none; border: none; box-shadow: none;
  backdrop-filter: none; border-radius: 0;
  padding: 0;
}
.stats .stat.glass::before, .stats .stat.glass::after { display: none; }
.stats { gap: 44px 44px; }
.stat .big { letter-spacing: -0.05em; line-height: 0.92; }
.stat .lbl {
  font-size: 11px; letter-spacing: 0.18em;
  color: var(--ink-dim); margin-top: 14px;
}
.stat .lbl::before {
  content: ""; display: inline-block;
  width: 7px; height: 7px; margin-right: 9px;
  background: var(--g); vertical-align: 0.02em;
}
.stat p { color: var(--ink-faint); max-width: 34ch; }
@media (max-width: 940px) { .stats { gap: 44px 0; } }

/* ============================================================
   5. clients strip — framed by rules, reads as a credit line
   ============================================================ */
.clients .wrap {
  padding-top: 30px; padding-bottom: 6px;
}
.clients-kicker { letter-spacing: 0.18em; font-size: 10.5px; }

/* ============================================================
   6. buttons + micro-interaction consistency
   ============================================================ */
.btn { border-radius: 4px; transition: all 0.2s var(--ease-ui); }
.btn-primary { border-radius: 4px; }
.btn .arr { transition: transform 0.28s var(--ease-ui); display: inline-block; }
.btn:hover .arr { transform: translateX(4px); }
.btn-contact { border-radius: 3px; }

/* nav: linki chowają się poniżej 940px, ale przycisk Kontakt zostaje */
.nav .wrap { gap: 20px; }
.nav-links { margin-left: auto; }
@media (max-width: 940px) { .btn-contact { display: inline-flex; } }

/* lede jako lejek: trzy zdania, każde krótsze, pierwsze nigdy się nie łamie */
.lede-funnel {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: fit-content; max-width: 100%; margin-inline: auto;
}
.lede-funnel span { display: block; white-space: nowrap; }
.lede-funnel span:nth-child(1) { font-size: 1em; color: var(--ink-dim); }
.lede-funnel span:nth-child(2) { font-size: 0.94em; color: var(--ink-faint); }
.lede-funnel span:nth-child(3) { font-size: 0.94em; color: var(--ink); font-weight: 500; }
@media (max-width: 900px) {
  .lede-funnel { width: auto; }
  .lede-funnel span { white-space: normal; }
}

/* ============================================================
   8. konsola — pasek instrumentu, nie okno macOS
   ============================================================ */
.console-bar { gap: 12px; padding: 14px 18px; }
.console-bar .bar-px { display: flex; gap: 3px; }
.console-bar .bar-px i { width: 7px; height: 7px; display: block; }
.console-bar .bar-px i:nth-child(1) { background: var(--c-navy); }
.console-bar .bar-px i:nth-child(2) { background: var(--c-pink); }
.console-bar .bar-px i:nth-child(3) { background: var(--c-orange); }
.console-bar .bar-px i:nth-child(4) { background: var(--c-green); }
.console-bar .bar-px i:nth-child(5) { background: var(--c-peri); }
.console-bar .label {
  font-size: 11.5px; letter-spacing: 0.1em; color: var(--ink-dim);
}
.console-foot { justify-content: flex-end; }

/* konsola żyje: spokojny puls cienia + światło idące za kursorem */
.console {
  --gx: 50%; --gy: 0%; --lume: 0;
  position: relative; overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .console { animation: console-breathe 4.2s ease-in-out infinite; }
  .console:focus-within, .console:hover { animation-play-state: paused; }
}
@keyframes console-breathe {
  0%, 100% { box-shadow: 0 1px 0 0 var(--glass-hi) inset, 0 -1px 0 0 oklch(0.3 0.04 272 / 0.06) inset, 0 22px 60px -30px oklch(0.45 0.10 290 / 0.30); }
  46% { box-shadow: 0 1px 0 0 var(--glass-hi) inset, 0 -1px 0 0 oklch(0.3 0.04 272 / 0.06) inset, 0 30px 78px -28px oklch(0.55 0.16 350 / 0.38); }
}
.console-lume {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  opacity: var(--lume);
  transition: opacity 0.5s var(--ease-ui);
  background:
    radial-gradient(230px 180px at var(--gx) var(--gy),
      color-mix(in oklab, var(--c-pink) 22%, transparent), transparent 68%),
    radial-gradient(320px 240px at calc(100% - var(--gx)) calc(100% - var(--gy)),
      color-mix(in oklab, var(--c-peri) 16%, transparent), transparent 70%);
}
.console-bar, .console-body, .console-foot { position: relative; z-index: 1; }
.console .prompt-input { resize: none; }
@media (min-width: 901px) { .scope-head h2 { white-space: nowrap; } }
/* skip link — dostępny na każdej stronie, nie tylko prawnych */
.skip{position:absolute;left:-9999px;top:0;z-index:300;background:#fff;color:var(--ink);padding:12px 18px;font-family:var(--font-mono);font-size:13px;letter-spacing:0.06em;border:1px solid var(--hairline);text-decoration:none}
.skip:focus{left:20px;top:14px}

/* wdowy i sieroty: równe łamanie w nagłówkach, wiszące spójniki sklejone w treści */
h1, h2, h3, .lede, .cta-card p { text-wrap: balance; }
.manifest p, .card p, .stat p, .doc p, .doc li { text-wrap: pretty; hyphens: none; }
.manifest h2 { text-wrap: balance; }

@media (min-width: 1400px) { .manifest h2 { max-width: none; white-space: nowrap; } }
@media (min-width: 901px) {
  .cta-card h2 { font-size: clamp(28px, 3.35vw, 46px); white-space: nowrap; }
  .cta-card h2 br { display: none; }
  .cta-card h2 em { margin-left: 0.3em; }
}
.console-foot .chip { border-radius: 3px; letter-spacing: 0.1em; text-transform: uppercase; }
.console-foot .chip:hover { color: var(--ink); border-color: oklch(0.3 0.04 272 / 0.28); }

/* ============================================================
   9. hero — pole kreślarskie: siatka + rozsypane piksele
   ============================================================ */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
/* siatka jak na arkuszu technicznym, gaśnie ku brzegom (warstwa cienka) */
.hero::before { display: none; }
.hero-fine {
  position: absolute; inset: -60px; z-index: -2; pointer-events: none;
  will-change: transform;
  background-image:
    linear-gradient(to right, oklch(0.21 0.032 272 / 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(0.21 0.032 272 / 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: center center;
  filter: blur(0.6px);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 46%, #000 20%, transparent 78%);
  mask-image: radial-gradient(80% 70% at 50% 46%, #000 20%, transparent 78%);
}
/* gruba siatka leży WYŻEJ, jest ostra i mocno reaguje na kursor */
.hero-coarse {
  position: absolute; inset: -140px; z-index: -1; pointer-events: none;
  will-change: transform;
  background-image:
    linear-gradient(to right, oklch(0.21 0.032 272 / 0.16) 1.5px, transparent 1.5px),
    linear-gradient(to bottom, oklch(0.21 0.032 272 / 0.16) 1.5px, transparent 1.5px);
  background-size: 132px 132px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(66% 58% at 50% 48%, #000 14%, transparent 74%);
  mask-image: radial-gradient(66% 58% at 50% 48%, #000 14%, transparent 74%);
}
/* rozsypane piksele w kolorach logo, powolne migotanie */
.hero::after {
  background-image:
    linear-gradient(var(--c-pink) 0 0), linear-gradient(var(--c-navy) 0 0),
    linear-gradient(var(--c-orange) 0 0),
    linear-gradient(var(--c-peri) 0 0), linear-gradient(var(--c-pink) 0 0),
    linear-gradient(var(--c-peri) 0 0), linear-gradient(var(--c-orange) 0 0);
  background-repeat: no-repeat;
  background-size: 7px 7px, 7px 7px, 5px 5px, 5px 5px, 5px 5px, 7px 7px, 5px 5px;
  background-position:
    12% 22%, 20% 68%, 31% 14%,
    63% 19%, 76% 72%, 86% 34%, 92% 58%;
  opacity: 0.5;
}
@media (prefers-reduced-motion: no-preference) {
  .hero::after { animation: plot-marks 7s steps(1) infinite; }
}
@keyframes plot-marks {
  0%, 100% { opacity: 0.5; }
  33% { opacity: 0.26; }
  66% { opacity: 0.62; }
}
@media (max-width: 700px) {
  .hero-fine { background-size: 18px 18px; }
  .hero-coarse { background-size: 100px 100px; }
  .hero::after { display: none; }
}

/* ============================================================
   7. CTA + console keep the glass — now it means something
   ============================================================ */
.cta-card.glass { border-radius: 8px; }
.console { border-radius: 8px; }
.foot .wrap:first-child { padding-top: 0; }
.foot { border-top: none; }
.foot-legal { border-top: none; padding-top: 0; margin-top: 22px; }
