:root {
  --night: #100c26;
  --dusk: #1a1440;
  --rim: #2c2560;
  --moon: #eeeafe;
  --haze: #a79fd0;
  --lavender: #b9a8ff;
  --violet: #7b61ff;
  --violet-hover: #6a4ff5;

  --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  --step-3: clamp(2.4rem, 1.6rem + 3.4vw, 4.25rem);

  --gutter: clamp(16px, 4vw, 48px);
  --measure: 62ch;
  --radius: 12px;
}

@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.25s; }
::view-transition-group(tab-line) { animation-duration: 0.35s; animation-timing-function: cubic-bezier(0.3, 0.7, 0.2, 1); }
.top { view-transition-name: top; }

/* Ruch: jedno spokojne tempo dla całej strony */
:root { --ease: cubic-bezier(0.2, 0.7, 0.2, 1); }

@keyframes rise { from { opacity: 0; transform: translateY(32px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes appear { from { opacity: 0; transform: scale(0.6) rotate(-28deg); } to { opacity: 1; transform: none; } }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-14px); } }
@keyframes word-up { from { transform: translateY(110%); } to { transform: none; } }
@keyframes shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes breathe { from { opacity: 0.75; } to { opacity: 1; } }
@keyframes twinkle { from { opacity: 0.15; } to { opacity: 0.7; } }

/* Druga warstwa gwiazd, które powoli migoczą */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background: url("/img/gwiazdy.svg") 300px 180px / 900px auto repeat;
  animation: twinkle 4.5s ease-in-out infinite alternate;
}

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

body {
  margin: 0;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 620px at 85% -12%, #2a2063 0%, transparent 62%),
    url("/img/gwiazdy.svg") top center / 1200px auto repeat,
    var(--night);
  color: var(--moon);
  font: 400 var(--step-0)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--lavender); text-underline-offset: 3px; }
a:hover { color: var(--moon); }

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

h1, h2, h3 { margin: 0; line-height: 1.12; }
p { margin: 0; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  padding: 10px 14px; border-radius: 8px;
  background: var(--moon); color: var(--night);
}
.skip:focus { top: 12px; }

/* --- Nagłówek z zakładkami ------------------------------------------------ */

.top {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.brand {
  display: flex; align-items: center; gap: 12px;
  margin-right: auto;
  color: var(--moon); text-decoration: none;
  font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em;
}
.brand img { width: 38px; height: 38px; border-radius: 10px; }

.tabs { display: flex; gap: 4px; }
.tabs a {
  position: relative;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--haze);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.tabs a:hover { color: var(--moon); background: rgb(255 255 255 / 0.04); }
.tabs a[aria-current="page"] { color: var(--moon); }
.tab-line {
  position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px;
  background: var(--lavender);
  view-transition-name: tab-line;
}

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px;
  border-radius: 10px;
  background: var(--violet); color: #fff;
  font-weight: 600; text-decoration: none;
  position: relative; overflow: hidden; isolation: isolate;
  transition: background-color 0.15s, transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.button::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 0; width: 40%; z-index: -1;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.28), transparent);
  transform: translateX(-120%) skewX(-20deg);
}
.button:hover::after { animation: shine 0.7s var(--ease); }
.button:hover {
  background: var(--violet-hover); color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -12px rgb(123 97 255 / 0.9);
}
.button:active { transform: translateY(0) scale(0.98); }
.button svg { width: 20px; height: 20px; flex: none; }
.button-quiet { background: transparent; color: var(--moon); box-shadow: inset 0 0 0 1px var(--rim); }
.button-quiet:hover { background: var(--dusk); color: var(--moon); box-shadow: inset 0 0 0 1px var(--lavender); }
.top .button { min-height: 40px; padding: 0 16px; }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

.page-head { padding: clamp(32px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); }
.page-head h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.025em; }
.page-head p { margin-top: 16px; max-width: 56ch; color: var(--haze); font-size: var(--step-1); line-height: 1.5; }

/* --- Start ------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(32px, 6vw, 80px) 0 clamp(48px, 8vw, 104px);
}
.hero h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.03em; max-width: 14ch; }
.hero .lead { margin-top: 22px; max-width: 46ch; color: var(--haze); font-size: var(--step-1); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.logo-wrap { transition: transform 0.6s var(--ease); }
.orbit-logo { width: min(100%, 460px); margin-inline: auto; overflow: visible; }
.orbit-line { stroke-dasharray: 1; }
.halo { animation: breathe 3s ease-in-out infinite alternate; }

/* Nagłówki: słowa wjeżdżają od dołu (anim.js dzieli tekst na słowa) */
.js .hero h1:not(.split), .js .page-head h1:not(.split) { visibility: hidden; }
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.word-in { display: inline-block; animation: word-up 0.9s var(--ease) calc(var(--i) * 80ms + 0.05s) both; }

/* Wejście na stronę główną */
.js .hero .lead { animation: rise 0.9s var(--ease) 0.45s both; }
.js .hero .actions { animation: rise 0.9s var(--ease) 0.6s both; }
.js .orbit-logo { animation: appear 1.3s var(--ease) 0.1s both, float 3.5s ease-in-out 1.4s infinite alternate; }
.js .orbit-line { animation: draw 1.6s var(--ease) 0.4s both; }

/* Sekcje przy przewijaniu (klasy dodaje anim.js, grają przy każdym powrocie na ekran) */
.reveal {
  opacity: 0;
  filter: blur(6px);
  transition:
    opacity 0.8s var(--ease) var(--delay, 0ms),
    transform 0.9s var(--ease) var(--delay, 0ms),
    filter 0.8s var(--ease) var(--delay, 0ms);
}
.reveal.from-below { transform: translateY(56px) scale(0.97); }
.reveal.from-left { transform: translateX(-64px); }
.reveal.from-right { transform: translateX(64px) scale(0.97); }
.reveal.is-visible { opacity: 1; filter: none; transform: none; }

.offer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  padding: clamp(32px, 5vw, 56px) 0;
  border-top: 1px solid var(--rim);
}
.offer h2 { font-size: var(--step-1); font-weight: 700; }
.offer p { margin-top: 10px; color: var(--haze); }
.offer .from { margin-top: 14px; color: var(--moon); font-weight: 600; }

.recent { padding: clamp(32px, 5vw, 56px) 0; border-top: 1px solid var(--rim); }
.recent-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.recent-head h2 { font-size: var(--step-2); font-weight: 700; }
.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.recent-grid a { color: var(--moon); text-decoration: none; }
.thumb {
  display: block; overflow: hidden;
  border-radius: var(--radius); background: var(--dusk);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.recent-grid img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.recent-grid a:hover .thumb { transform: translateY(-8px); box-shadow: 0 24px 48px -20px rgb(123 97 255 / 0.75); }
.recent-grid a:hover img { transform: scale(1.08); }
.recent-grid strong { display: block; margin-top: 14px; font-weight: 600; transition: color 0.2s; }
.recent-grid a:hover strong { color: var(--lavender); }
.recent-grid a > span:not(.thumb) { color: var(--haze); font-size: var(--step--1); }

.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin: clamp(16px, 3vw, 32px) 0 clamp(56px, 8vw, 96px);
  padding: clamp(24px, 4vw, 40px);
  border-radius: 18px;
  background: linear-gradient(120deg, #241b57, #1a1440);
}
.cta h2 { font-size: var(--step-2); font-weight: 700; }
.cta p { margin-top: 8px; color: var(--haze); }

/* --- Realizacje ----------------------------------------------------------------- */

.project {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(32px, 5vw, 56px) 0;
  border-top: 1px solid var(--rim);
}
.project h2 { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.01em; }
.project .tech { margin-top: 6px; color: var(--lavender); font-weight: 500; }
.project-text p:not(.tech) { margin-top: 16px; max-width: var(--measure); color: var(--haze); }

.commands { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.commands li {
  padding: 4px 10px; border-radius: 6px;
  background: var(--dusk); color: var(--moon);
  font-size: var(--step--1); font-weight: 500;
}

.project figure { margin: 0; }
.project figure > img,
.mosaic img { width: 100%; border-radius: var(--radius); background: var(--dusk); }
.project figcaption { margin-top: 12px; color: var(--haze); font-size: var(--step--1); }

.mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mosaic img { aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; }

.films { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
.films video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--dusk); }
.films figcaption { margin-top: 10px; }

/* --- Cennik ---------------------------------------------------------------------- */

.prices { display: grid; gap: 36px; padding-bottom: clamp(40px, 6vw, 72px); }
.price-group h2 { font-size: var(--step-1); font-weight: 700; margin-bottom: 6px; }
.price-group dl { margin: 0; }
.price-group dl > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  gap: 16px; align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--rim);
}
.price-group dt { font-weight: 600; }
.price-group dd { margin: 0; }
.price-group .what { color: var(--haze); }
.price-group .price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.note {
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--dusk);
  color: var(--haze);
  max-width: 72ch;
}
.note strong { color: var(--moon); }

.steps { padding: clamp(32px, 5vw, 56px) 0 clamp(56px, 8vw, 96px); border-top: 1px solid var(--rim); }
.steps > h2 { font-size: var(--step-2); font-weight: 700; }
.steps ol {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin: 28px 0 0; padding: 0; list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 36px; height: 36px; margin-bottom: 14px;
  border-radius: 50%;
  background: var(--dusk);
  color: var(--lavender); font-weight: 700;
}
.steps h3 { font-size: var(--step-1); font-weight: 600; }
.steps li p { margin-top: 8px; color: var(--haze); }
.steps .actions { margin-top: 36px; }

/* --- Regulamin ----------------------------------------------------------------------- */

.doc { max-width: 72ch; padding-bottom: clamp(56px, 8vw, 96px); }
.doc section + section { margin-top: 36px; }
.doc h2 { font-size: var(--step-1); font-weight: 700; }
.doc ol { margin: 12px 0 0; padding-left: 1.4em; color: var(--haze); }
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--lavender); }
.doc .updated { margin-top: 40px; color: var(--haze); font-size: var(--step--1); }

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

.foot {
  display: flex; justify-content: space-between; gap: 24px;
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 28px var(--gutter) 36px;
  background: linear-gradient(var(--rim), var(--rim)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  color: var(--haze); font-size: var(--step--1);
}
.foot nav { display: flex; gap: 22px; }
.foot a { color: var(--haze); text-decoration: none; }
.foot a:hover { color: var(--moon); }

/* --- Mniejsze ekrany ------------------------------------------------------------------- */

@media (max-width: 900px) {
  .top { flex-wrap: wrap; row-gap: 12px; }
  .tabs { order: 3; width: 100%; margin-left: -14px; }
  .hero, .project { grid-template-columns: minmax(0, 1fr); }
  .logo-wrap { grid-row: 1; }
  .orbit-logo { width: min(80%, 360px); }
  .offer, .recent-grid, .steps ol { grid-template-columns: minmax(0, 1fr); }
  .cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .tabs { margin-left: 0; display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 0; }
  .tabs a { padding: 8px 6px; font-size: 0.95rem; }
  .tabs a:first-child { margin-left: -6px; }
  .tab-line { left: 6px; right: 6px; }
  .price-group dl > div { grid-template-columns: minmax(0, 1fr) auto; }
  .price-group .what { grid-column: 1 / -1; grid-row: 2; margin-top: -8px; }
  .films, .mosaic { grid-template-columns: minmax(0, 1fr); }
  .foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  body::before, .halo, .word-in,
  .js .hero .lead, .js .hero .actions,
  .js .orbit-logo, .js .orbit-line, .button:hover::after { animation: none; }
  .recent-grid img, .thumb, .button, .logo-wrap { transition: none; }
  .button:hover, .recent-grid a:hover img, .recent-grid a:hover .thumb { transform: none; }
}
