/* Scorun — strona www i app.scorun.com.
   Paleta 1:1 z packages/ui_kit/lib/src/colors.dart (Navy & Gold).
   Czcionki własne z /assets/fonts (CSP: tylko 'self'). */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ui_kit: ScorunColors */
  --bg: #070b14;
  --bg-2: #0c1220;
  --surface: #101726;
  --border: #1e283d;
  --muted: #2c3954;
  --text: #ffffff;
  --text-secondary: #a0aab5;
  --accent: #eca016;
  --accent-on: #000000;
  --blue: #4a90e2;
  --teal: #3dcfcf;
  --danger: #ff3b30;
  --piro: #ff5252;
  --ok: #7ed321;

  /* Maile (supabase/templates): granat #070b14, złoto #eca016, tło #eef1f5 — pilnuje check_www */
  --mail-bg: #eef1f5;

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --header-h: 72px;
}

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

html {
  color-scheme: dark;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: #ffbe45; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap { width: min(1200px, 90%); margin: 0 auto; }
.wrap-narrow { width: min(760px, 90%); margin: 0 auto; }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-on);
  padding: 8px 14px;
  border-radius: 999px;
}
.skip:focus { left: 16px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}

.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 1rem;
  margin: 0;
}
.logo:hover { color: var(--text); }
.icon-mark { width: 28px; height: 28px; border-radius: 7px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(16, 23, 38, 0.5);
}

.main-nav a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  padding: 7px 14px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.header-cta { display: flex; align-items: center; gap: 12px; }

/* ---------- Buttons ---------- */

.button {
  --mx: 0px;
  --my: 0px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-on);
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  transform: translate(var(--mx), var(--my));
  transition: transform 0.25s var(--ease), box-shadow 0.3s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  color: var(--accent-on);
  box-shadow: 0 0 0 6px rgba(236, 160, 22, 0.12), 0 10px 40px -10px rgba(236, 160, 22, 0.6);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

.button-secondary:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 6px rgba(74, 144, 226, 0.1);
}

.button-small { min-height: 40px; padding: 8px 18px; font-size: 0.92rem; }

/* ---------- Typography ---------- */

h1, h2, h3, h4 { margin: 0; font-weight: 450; letter-spacing: -0.02em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(236, 160, 22, 0.32);
  background: rgba(236, 160, 22, 0.06);
  color: #f5c66b;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.accent { color: var(--accent); }

.section { position: relative; padding: clamp(96px, 14vw, 168px) 0; }

.section-intro { text-align: center; max-width: 820px; margin: 0 auto 64px; }
.section-intro h1,
.section-intro h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin: 20px 0 18px; }
.section-intro p { color: var(--text-secondary); font-size: 1.15rem; margin: 0; }

/* ---------- Ambient light ---------- */

.glow {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  z-index: 0;
}

.glow-blue { background: radial-gradient(circle, rgba(74, 144, 226, 0.55), transparent 65%); }
.glow-teal { background: radial-gradient(circle, rgba(61, 207, 207, 0.4), transparent 65%); }
.glow-gold { background: radial-gradient(circle, rgba(236, 160, 22, 0.35), transparent 65%); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 112px) 0 0;
  text-align: center;
  isolation: isolate;
}

.hero .glow-blue { width: 760px; height: 760px; left: -260px; top: -240px; animation: drift 18s ease-in-out infinite alternate; }
.hero .glow-teal { width: 620px; height: 620px; right: -220px; top: 40px; animation: drift 22s ease-in-out infinite alternate-reverse; }
.hero .glow-gold { width: 420px; height: 420px; left: 50%; top: 360px; margin-left: -210px; opacity: 0.35; }

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 65%);
  mask-image: radial-gradient(ellipse at 50% 20%, #000 0%, transparent 65%);
}

.hero-content { position: relative; z-index: 2; max-width: 920px; margin: 0 auto; }

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 26px 0 24px;
}

.hero .lead {
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 680px;
  margin: 0 auto 36px;
}

.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(236, 160, 22, 0.7);
  animation: pulse 2s infinite;
}

/* Linie nagłówka odsłaniane maską */
.line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.line > span { display: inline-block; transition: transform 0.9s var(--ease); }
.js .line > span { transform: translateY(105%); }
.js.is-ready .line > span { transform: none; }
.js.is-ready .line:nth-child(2) > span { transition-delay: 0.08s; }
.js.is-ready .line:nth-child(3) > span { transition-delay: 0.16s; }

/* ---------- Stage z urządzeniami ---------- */

.stage {
  position: relative;
  z-index: 1;
  margin: clamp(56px, 8vw, 88px) auto 0;
  max-width: 1080px;
  height: clamp(380px, 52vw, 600px);
  perspective: 1600px;
}

.stage-inner {
  position: absolute;
  inset: 0;
  transform: rotateX(calc(14deg - var(--p, 0) * 14deg)) translateY(calc(40px - var(--p, 0) * 40px));
  transform-origin: 50% 100%;
  transition: transform 0.1s linear;
}

.device {
  position: absolute;
  background: linear-gradient(180deg, #131b2d, #0b111e);
  border: 1px solid #26314a;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}

.device-tablet {
  left: 50%;
  bottom: 0;
  width: min(820px, 88%);
  height: 92%;
  transform: translateX(-56%);
  border-radius: 26px;
  padding: 14px;
}

.device-phone {
  right: 4%;
  bottom: -6%;
  width: clamp(190px, 25%, 270px);
  height: 96%;
  border-radius: 36px;
  padding: 12px;
  border-width: 2px;
  animation: float 7s ease-in-out infinite;
}

.screen {
  height: 100%;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.device-phone .screen { border-radius: 26px; }

.ui-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.ui-bar small { color: var(--text-secondary); font-weight: 400; }

.ui-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ui-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ui-chip.ok { color: var(--ok); border-color: rgba(126, 211, 33, 0.35); }
.ui-chip.wait { color: var(--accent); border-color: rgba(236, 160, 22, 0.35); }
.ui-chip.bad { color: var(--danger); border-color: rgba(255, 59, 48, 0.35); }
.ui-chip.plain::before { display: none; }

.ui-body { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }

/* Desk: macierz składy × tory */
.matrix { display: grid; grid-template-columns: 74px repeat(6, 1fr); gap: 6px; font-family: var(--font-mono); font-size: 11px; }
.matrix span { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 7px; background: var(--surface); color: var(--text-secondary); }
.matrix .h { background: transparent; }
.matrix .rowh { justify-content: flex-start; padding-left: 8px; background: transparent; color: var(--text); }
.matrix .done { background: rgba(126, 211, 33, 0.14); color: var(--ok); }
.matrix .run { background: rgba(236, 160, 22, 0.16); color: var(--accent); box-shadow: 0 0 0 1px rgba(236, 160, 22, 0.45) inset; }
.matrix .conf { background: rgba(255, 59, 48, 0.14); color: var(--danger); }

.ui-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; flex: 1; min-height: 0; }
.ui-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-height: 0; overflow: hidden; }
.ui-card h4 { font-size: 12px; font-weight: 600; margin-bottom: 8px; letter-spacing: 0; }
.ui-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: var(--text-secondary); }
.ui-row b { color: var(--text); font-weight: 500; }
.ui-row:last-child { border-bottom: 0; }
.ui-progress { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; margin-top: 6px; }
.ui-progress i { display: block; height: 100%; width: 68%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #ffd27a); }

/* Range: metryczka */
.timer { font-family: var(--font-mono); font-size: 34px; letter-spacing: -0.02em; text-align: center; padding: 8px 0 2px; }
.timer small { display: block; font-size: 10px; color: var(--text-secondary); letter-spacing: 0.1em; }
.hits { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.hit { border-radius: 12px; background: var(--surface); border: 1px solid var(--border); padding: 9px 10px; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.hit b { font-size: 18px; color: var(--text); font-weight: 500; }
.hit.miss b { color: var(--danger); }
.ui-cta { margin-top: auto; border-radius: 12px; background: var(--accent); color: var(--accent-on); text-align: center; font-weight: 700; padding: 11px; font-size: 12px; }

/* Shooter: wyniki */
.res { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; }
.res .pos { font-family: var(--font-mono); color: var(--text-secondary); }
.res .pct { font-family: var(--font-mono); color: var(--accent); }
.res.me { border-color: rgba(236, 160, 22, 0.5); }
.tag { font-family: var(--font-mono); font-size: 9.5px; padding: 1px 6px; border-radius: 5px; margin-left: 6px; border: 1px solid var(--border); color: var(--text-secondary); }
.tag.dq { color: var(--danger); border-color: rgba(255, 59, 48, 0.4); }
.licence { border-radius: 14px; padding: 12px; background: linear-gradient(135deg, #2a1515, #101726 55%, #070b14); border: 1px solid var(--border); }
.licence small { display: block; color: var(--text-secondary); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; }
.licence b { display: block; margin-top: 4px; font-weight: 600; }

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 22px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee ul { display: flex; gap: 56px; padding: 0 28px; margin: 0; list-style: none; }
.marquee li { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.14em; color: var(--text-secondary); white-space: nowrap; }
.marquee li::before { content: "◆"; color: var(--accent); margin-right: 56px; font-size: 0.6rem; vertical-align: 2px; }

/* ---------- Why: przypięty nagłówek, karty nad nim ---------- */

.why { position: relative; }
.why-pin { position: relative; height: 260vh; }
.why-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.why-sticky .section-intro { position: relative; z-index: 1; margin: 0 auto; opacity: calc(1 - var(--p, 0) * 0.55); }

.why-cards { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

.why-card {
  position: absolute;
  width: min(330px, 78vw);
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(16, 23, 38, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
  pointer-events: auto;
  transform: translateY(calc((1 - var(--p, 0)) * var(--from, 110vh) - var(--p, 0) * var(--to, 60vh)));
  will-change: transform;
}

.why-card:nth-child(1) { left: 6%; top: 14%; --from: 70vh; --to: 70vh; }
.why-card:nth-child(2) { right: 7%; top: 8%; --from: 120vh; --to: 50vh; }
.why-card:nth-child(3) { left: 16%; top: 54%; --from: 150vh; --to: 80vh; }
.why-card:nth-child(4) { right: 14%; top: 58%; --from: 190vh; --to: 65vh; }

.why-card .num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); letter-spacing: 0.1em; }
.why-card h3 { font-size: 1.2rem; margin: 10px 0 8px; font-weight: 550; letter-spacing: -0.01em; }
.why-card p { margin: 0; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.55; }
.why-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(236, 160, 22, 0.35), rgba(16, 23, 38, 0.9));
  border: 1px solid rgba(236, 160, 22, 0.35);
  color: var(--accent);
  margin-bottom: 16px;
}
.why-icon svg { width: 20px; height: 20px; }

/* ---------- Statement odsłaniany słowo po słowie ---------- */

.statement { padding: clamp(80px, 12vw, 150px) 0; }
.statement p {
  font-size: clamp(1.8rem, 4.2vw, 3.25rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}
.statement .w { transition: color 0.35s ease; }
.js .statement .w { color: var(--muted); }
.statement .w.on { color: var(--text); }
.statement .w.hl.on { color: var(--accent); }

/* ---------- Rozdziały produktów ---------- */

.chapter { position: relative; padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--border); }
.chapter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.chapter:nth-of-type(even) .chapter-copy { order: 2; }
.chapter h2 { font-size: clamp(2.4rem, 5.4vw, 4rem); line-height: 1; margin: 18px 0 16px; }
.chapter .promise { font-size: 1.2rem; color: var(--text-secondary); margin: 0 0 28px; max-width: 520px; }
.chapter ul { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 12px; }
.chapter li { position: relative; padding-left: 28px; color: var(--text); }
.chapter li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 12px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(236, 160, 22, 0.8);
}
.chapter-links { display: flex; flex-wrap: wrap; gap: 12px; }

.chapter-visual {
  position: relative;
  height: clamp(420px, 44vw, 560px);
  border-radius: 28px;
  border: 1px solid var(--border);
  background: radial-gradient(120% 90% at 30% 10%, rgba(74, 144, 226, 0.16), transparent 55%), var(--bg-2);
  overflow: hidden;
}
.chapter-visual .device { position: absolute; }
.chapter-visual .device-phone { left: 50%; right: auto; bottom: -40px; transform: translateX(-50%); width: min(280px, 64%); height: 100%; animation: none; }
.chapter-visual .device-tablet { left: 6%; bottom: -30px; width: 120%; height: 92%; transform: none; }
.chapter-visual .glow-gold { width: 320px; height: 320px; right: -60px; top: -60px; }
.chapter .ref { margin-top: 20px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); letter-spacing: 0.06em; }

/* Nagranie z symulatora w ramce telefonu */
.chapter-video {
  position: absolute;
  left: 50%;
  top: 6%;
  height: 112%;
  width: auto;
  aspect-ratio: 720 / 1566;
  transform: translateX(-50%);
  border-radius: 40px;
  border: 8px solid #131b2d;
  outline: 1px solid #26314a;
  background: var(--bg);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 80px -30px rgba(236, 160, 22, 0.35);
  object-fit: cover;
}

/* ---------- Kula ---------- */

.orb-wrap { position: relative; height: clamp(320px, 46vw, 560px); display: grid; place-items: center; overflow: hidden; }
.orb {
  width: clamp(240px, 32vw, 420px);
  aspect-ratio: 1;
  border-radius: 46% 54% 52% 48% / 50% 44% 56% 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), transparent 34%),
    radial-gradient(circle at 70% 65%, rgba(236, 160, 22, 0.75), transparent 48%),
    radial-gradient(circle at 25% 75%, rgba(61, 207, 207, 0.85), transparent 50%),
    radial-gradient(circle at 60% 30%, rgba(74, 144, 226, 0.95), transparent 60%);
  filter: blur(26px) saturate(120%);
  animation: morph 14s ease-in-out infinite, spin 40s linear infinite;
  transform: scale(calc(0.8 + var(--p, 0) * 0.35));
}

/* ---------- Dzień zawodów: zygzak z rysowaną linią ---------- */

.flow-steps { position: relative; max-width: 1000px; margin: 0 auto; }
.flow-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.flow-line path { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.flow-line .base { stroke: var(--border); }
.flow-line .live { stroke: url(#flowGrad); filter: drop-shadow(0 0 6px rgba(236, 160, 22, 0.6)); }
.flow-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(236, 160, 22, 0.18), 0 0 24px 6px rgba(236, 160, 22, 0.65);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.flow-dot.on { opacity: 1; }

.flow-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(40px, 7vw, 88px); position: relative; z-index: 1; }
.flow-item {
  width: min(460px, 100%);
  padding: 26px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(16, 23, 38, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.flow-item:nth-child(even) { justify-self: end; }
.flow-item.lit { border-color: rgba(236, 160, 22, 0.45); box-shadow: 0 0 60px -20px rgba(236, 160, 22, 0.45); }
.flow-item .idx { font-family: var(--font-mono); color: var(--accent); font-size: 0.8rem; letter-spacing: 0.12em; }
.flow-item p { margin: 10px 0 0; font-size: 1.08rem; }

.flow-end {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: clamp(56px, 8vw, 96px);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.4s ease;
}
.flow-end-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid rgba(236, 160, 22, 0.4);
  transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}
.flow-end.lit { color: var(--text); }
.flow-end.lit .flow-end-mark {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: 0 0 0 8px rgba(236, 160, 22, 0.15), 0 0 60px 10px rgba(236, 160, 22, 0.45);
}

/* ---------- Przed / ze Scorun ---------- */

.tabs { display: flex; justify-content: center; gap: 8px; margin: 0 auto 32px; }
.tab {
  font: inherit;
  font-size: 0.92rem;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--text); border-color: rgba(236, 160, 22, 0.55); background: rgba(236, 160, 22, 0.08); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 1000px; margin: 0 auto; }
.compare-box { padding: 32px; border-radius: 24px; border: 1px solid var(--border); background: var(--surface); transition: opacity 0.4s ease, filter 0.4s ease; }
.compare-box h3 { font-size: 1.15rem; font-weight: 550; margin-bottom: 18px; }
.compare-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.compare-box li { padding-left: 26px; position: relative; color: var(--text-secondary); }
.compare-box.legacy li::before { content: "✕"; position: absolute; left: 0; color: var(--muted); }
.compare-box.scorun { border-color: rgba(236, 160, 22, 0.45); box-shadow: 0 0 80px -30px rgba(236, 160, 22, 0.5); }
.compare-box.scorun li { color: var(--text); }
.compare-box.scorun li::before { content: "◆"; position: absolute; left: 0; color: var(--accent); font-size: 0.7rem; top: 0.25em; }
.compare[data-show="legacy"] .scorun,
.compare[data-show="scorun"] .legacy { opacity: 0.32; filter: saturate(0.3); }

/* ---------- Zorza ---------- */

.aurora { position: relative; height: 220px; overflow: hidden; }
.aurora::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue) 20%, #fff 50%, var(--accent) 80%, transparent);
  box-shadow: 0 0 22px 3px rgba(255, 255, 255, 0.5);
}
.aurora::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 120px;
  background: linear-gradient(90deg, rgba(74, 144, 226, 0.55), rgba(61, 207, 207, 0.4) 45%, rgba(236, 160, 22, 0.5));
  filter: blur(40px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
  transform: scaleX(calc(0.4 + var(--p, 0) * 0.6));
  opacity: calc(0.3 + var(--p, 0) * 0.7);
}

/* ---------- FAQ ---------- */

.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); font-size: 1.3rem; transition: transform 0.3s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 22px; color: var(--text-secondary); }

/* ---------- Zamknięcie ---------- */

.close {
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: 32px;
  border: 1px solid var(--border);
  padding: clamp(64px, 9vw, 112px) 24px;
  background: var(--bg-2);
  isolation: isolate;
}
.close .glow-blue { width: 600px; height: 600px; left: -160px; bottom: -320px; }
.close .glow-gold { width: 520px; height: 520px; right: -140px; top: -280px; }
.close h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin-bottom: 18px; position: relative; }
.close p { color: var(--text-secondary); margin: 0 auto 32px; max-width: 560px; position: relative; }
.close .hero-actions { position: relative; }

/* ---------- Stopka ---------- */

.site-footer { margin-top: clamp(80px, 10vw, 120px); padding-bottom: 48px; }
.footer-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 40px clamp(24px, 4vw, 48px);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(74, 144, 226, 0.08), transparent 60%),
    var(--bg-2);
}
.footer-card::after {
  content: "SCORUN";
  position: absolute;
  right: -10px;
  bottom: -38px;
  font-size: clamp(5rem, 14vw, 11rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.025);
  pointer-events: none;
}
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 28px; position: relative; z-index: 1; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--text-secondary); font-size: 0.95rem; }
.footer-links a:hover { color: var(--text); }
.site-footer p,
footer p { color: var(--text-secondary); font-size: 0.85rem; margin: 6px 0 0; position: relative; z-index: 1; }

.langs { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); }
.langs a { color: var(--text-secondary); padding: 2px 4px; }
.langs a[aria-current="page"] { color: var(--accent); }
.bearstone-note { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--text-secondary); }
.note { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em; }

/* ---------- Strony tekstowe (polityka, regulamin, kontakt) ---------- */

.doc { padding: clamp(48px, 8vw, 96px) 0 0; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; margin: 0 0 16px; }
.doc h2 { font-size: 1.4rem; font-weight: 550; margin: 44px 0 12px; letter-spacing: -0.01em; }
.doc h3 { font-size: 1.1rem; font-weight: 550; margin: 28px 0 8px; }
.doc p,
.doc li { color: #c8d0d9; }
.doc ul,
.doc ol { padding-left: 1.3em; }
.doc li { margin: 6px 0; }
.doc strong { color: var(--text); font-weight: 600; }
.doc table { width: 100%; border-collapse: collapse; margin: 16px 0; display: block; overflow-x: auto; }
.doc th,
.doc td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface); color: var(--text); font-weight: 550; }
.updated { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); letter-spacing: 0.04em; }

.company {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ---------- Pobieranie ---------- */

.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.dl-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.dl-card.ready { border-color: rgba(236, 160, 22, 0.45); box-shadow: 0 0 80px -36px rgba(236, 160, 22, 0.6); }
.dl-card h2 { font-size: 1.6rem; margin: 0; }
.dl-card p { margin: 0; color: var(--text-secondary); }
.dl-card .button { margin-top: auto; }
.dl-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); line-height: 1.7; word-break: break-all; }
.dl-steps { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dl-box { padding: 28px; border-radius: 24px; border: 1px solid var(--border); background: var(--bg-2); }
.dl-box h3 { font-size: 1.15rem; font-weight: 550; margin-bottom: 12px; }
.dl-box ol,
.dl-box ul { margin: 0; padding-left: 1.2em; color: var(--text-secondary); }
.dl-box li { margin: 8px 0; }

/* ---------- app.scorun.com (/m/…) ---------- */

.lang { display: none; }
html[lang="pl"] .lang-pl,
html[lang="en"] .lang-en,
html[lang="es"] .lang-es,
html[lang="fr"] .lang-fr { display: block; }

body > header.wrap { padding: 28px 0; }
body > main.wrap:not(.home) { padding: 24px 0 0; }
body > main.wrap .lang h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; margin-bottom: 16px; }
body > main.wrap .lang p { color: var(--text-secondary); }
body > footer.wrap { padding: 48px 0; border-top: 1px solid var(--border); margin-top: 64px; }

[hidden] { display: none !important; }

/* ---------- Odsłanianie przy scrollu ---------- */

.rv { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .rv { opacity: 0; transform: translateY(16px); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- Animacje ---------- */

@keyframes drift { from { translate: 0 0; } to { translate: 60px 40px; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(236, 160, 22, 0.6); } 70% { box-shadow: 0 0 0 10px rgba(236, 160, 22, 0); } 100% { box-shadow: 0 0 0 0 rgba(236, 160, 22, 0); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes morph {
  0%, 100% { border-radius: 46% 54% 52% 48% / 50% 44% 56% 50%; }
  33% { border-radius: 58% 42% 40% 60% / 42% 58% 42% 58%; }
  66% { border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%; }
}
@keyframes spin { to { rotate: 360deg; } }

/* ---------- Responsywność ---------- */

@media (max-width: 1023px) {
  .main-nav { display: none; }
  .why-pin { height: auto; }
  .why-sticky { position: static; height: auto; display: block; padding: 96px 0 0; overflow: visible; }
  .why-sticky .section-intro { opacity: 1; margin-bottom: 40px; }
  .why-cards { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: min(1200px, 90%); margin: 0 auto; }
  .why-card { position: static; width: auto; transform: none; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter:nth-of-type(even) .chapter-copy { order: 0; }
  .dl-grid { grid-template-columns: 1fr; }
  .stage-inner { transform: none; }
}

@media (max-width: 720px) {
  .header-cta .button { display: none; }
  .why-cards { grid-template-columns: 1fr; }
  .stage { height: 440px; }
  .device-tablet { width: 128%; transform: translateX(-62%); height: 80%; }
  .device-phone { right: 2%; width: 200px; height: 92%; }
  .compare { grid-template-columns: 1fr; }
  .flow-item:nth-child(even) { justify-self: stretch; }
  .flow-item { width: 100%; }
  .flow-line,
  .flow-dot { display: none; }
  .dl-steps { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation: none !important; transition: none !important; }
  .why-pin { height: auto; }
  .why-sticky { position: static; height: auto; display: block; padding: 96px 0 0; overflow: visible; }
  .why-sticky .section-intro { opacity: 1; margin-bottom: 40px; }
  .why-cards { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; width: min(1200px, 90%); margin: 0 auto; }
  .why-card { position: static; width: auto; transform: none; }
  .js .rv { opacity: 1; transform: none; }
  .js .line > span { transform: none; }
  .js .statement .w { color: var(--text); }
  .js .statement .w.hl { color: var(--accent); }
  .stage-inner { transform: none; }
  .marquee-track { transform: none; }
  .flow-dot { display: none; }
}
