/* =========================================================
   Mirek Wróbel — trener personalny
   Kolory z logo: pomarańcz #E4572E, czerń #111111
   ========================================================= */

:root {
  --bg: #111111;
  --fg: #efe8df;
  --fg-soft: rgba(239, 232, 223, 0.8);
  --muted: rgba(239, 232, 223, 0.55);
  --line: rgba(239, 232, 223, 0.14);
  --accent: #e4572e;
  --accent-ink: #111111;

  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Nic nie może poszerzać strony (iPhone/Safari przewijał ją w bok
   przez warstwę kółka, która wystaje poza napis) */
html,
body {
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

em {
  font-style: normal;
  color: var(--accent);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

/* Ikony liniowe */
.rail svg,
.tile__icon svg,
.footer__cta svg,
.fab svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail svg .fill {
  fill: currentColor;
}

/* =========================================================
   Kursor (tylko urządzenia z myszką)
   ========================================================= */

.cursor {
  display: none;
}

.has-cursor .cursor {
  display: block;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  transition: opacity 0.3s, background-color 0.3s, border-color 0.3s;
}

.has-cursor .cursor.is-visible {
  opacity: 1;
}

.has-cursor .cursor.is-link {
  background: transparent;
  border-color: var(--accent);
}

/* =========================================================
   Górny pasek i elementy przypięte
   ========================================================= */

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: calc(18px + env(safe-area-inset-top)) var(--gutter) 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.topbar__name {
  white-space: nowrap;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.topbar__meta {
  color: var(--muted);
  text-align: right;
}

.topbar__meta-long {
  display: none;
}

@media (min-width: 600px) {
  .topbar__meta-long {
    display: inline;
  }
}

.rail {
  position: fixed;
  left: calc(var(--gutter) - 10px);
  bottom: 28px;
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 16px;
}

.rail__link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.3s, transform 0.45s var(--ease-out);
}

.rail__link:hover,
.rail__link:focus-visible {
  color: var(--fg);
}

.rail__link svg {
  width: 20px;
  height: 20px;
}

.aside-note {
  position: fixed;
  right: var(--gutter);
  bottom: 32px;
  z-index: 30;
  display: none;
  margin: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .rail,
  .aside-note {
    display: flex;
  }
}

/* =========================================================
   HERO: logo + napis z ukrytym tekstem
   ========================================================= */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 6svh, 72px);
  padding: calc(72px + env(safe-area-inset-top)) var(--gutter) 56px;
}

.hero__logo {
  width: min(64vw, 30svh, 320px);
}

.hero__logo svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Logo na ciemnym tle: czarne linie i napis → jasne */
.hero__logo [stroke="#111111"] {
  stroke: var(--fg);
}

.hero__logo [fill="#111111"] {
  fill: var(--fg);
}

.manifest {
  --fs: clamp(2.6rem, min(14vw, 11.5svh), 9.5rem);
  --pad: calc(var(--fs) * 1.9);
  position: relative;
  /* szerokość = szerokość napisu, żeby kółko wędrowało po tekście */
  max-width: 100%;
  font-family: var(--display);
  font-size: var(--fs);
  /* zapas na polskie znaki (Ó, Ś) nad wielkimi literami */
  line-height: 1.12;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.manifest__layer {
  margin: 0;
}

.manifest__layer span {
  display: block;
}

/* Warstwa odsłaniana przez kółko — wycięta okręgiem (clip-path z JS) */
.manifest__reveal {
  position: absolute;
  inset: calc(var(--pad) * -1);
  padding: var(--pad);
  background: var(--accent);
  color: var(--accent-ink);
  clip-path: circle(0 at 50% 50%);
  pointer-events: none;
}

/* =========================================================
   Sekcje
   ========================================================= */

.section {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(72px, 11vw, 160px) var(--gutter);
}

.label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 clamp(28px, 5vw, 56px);
  font: 500 11px/1.4 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Pomarańczowa kropka przed nazwą sekcji */
.label::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.label--center {
  justify-content: center;
}

.label--center::after {
  display: none;
}

/* ---------- Linki (kafelki) ---------- */

.links {
  padding-top: clamp(48px, 8vw, 120px);
}

.links__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.tile {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 3vw, 40px);
  padding: clamp(20px, 3vw, 36px) clamp(4px, 1.2vw, 16px);
  border-top: 1px solid var(--line);
  overflow: hidden;
  transition: color 0.45s var(--ease-out);
}

/* Skośny pas jak w logo — wjeżdża po najechaniu */
.tile__fill {
  position: absolute;
  inset: -2px -14%;
  z-index: -1;
  background: var(--accent);
  transform: translateX(-102%) skewX(-18deg);
  transition: transform 0.6s var(--ease-out);
}

.tile__no {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--accent);
  transition: color 0.45s var(--ease-out);
}

.tile__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tile__title {
  font-family: var(--display);
  font-size: clamp(2rem, 6.4vw, 5.25rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.tile__sub {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  overflow-wrap: anywhere;
  transition: color 0.45s var(--ease-out);
}

.tile__icon {
  display: grid;
  place-items: center;
  width: clamp(44px, 5.5vw, 72px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: border-color 0.45s var(--ease-out), transform 0.6s var(--ease-out);
}

.tile__icon svg {
  width: 42%;
  height: 42%;
}

.tile:hover,
.tile:focus-visible,
.tile:active {
  color: var(--accent-ink);
}

.tile:hover .tile__fill,
.tile:focus-visible .tile__fill,
.tile:active .tile__fill {
  transform: translateX(0) skewX(-18deg);
}

.tile:hover .tile__no,
.tile:hover .tile__sub,
.tile:focus-visible .tile__no,
.tile:focus-visible .tile__sub,
.tile:active .tile__no,
.tile:active .tile__sub {
  color: rgba(17, 17, 17, 0.72);
}

.tile:hover .tile__icon,
.tile:focus-visible .tile__icon,
.tile:active .tile__icon {
  border-color: rgba(17, 17, 17, 0.35);
  transform: rotate(45deg);
}

.tile:hover .tile__icon--static,
.tile:focus-visible .tile__icon--static,
.tile:active .tile__icon--static {
  transform: none;
}

.tile:focus-visible {
  outline-offset: -2px;
}

/* ---------- O mnie ---------- */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
}

/* Dwa skośne pasy jak w logo (miejsce na przyszłe zdjęcie) */
.about__figure {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 64svh;
}

.about__stripe {
  position: absolute;
  inset: 6% 0 0;
  background: var(--accent);
  clip-path: polygon(40% 0, 52% 0, 21% 100%, 9% 100%);
  transform-origin: bottom;
}

.about__stripe + .about__stripe {
  inset: 0 0 6%;
  clip-path: polygon(55% 0, 92% 0, 61% 100%, 24% 100%);
  transform-origin: top;
}

.js .about__figure .about__stripe {
  transform: scaleY(0);
  transition: transform 1.2s var(--ease-out);
}

.js .about__figure .about__stripe + .about__stripe {
  transition-delay: 0.15s;
}

.js .about__figure.is-inview .about__stripe {
  transform: scaleY(1);
}

.about__lead {
  margin: 0 0 24px;
  font-family: var(--display);
  font-size: clamp(2.5rem, 5.2vw, 4.75rem);
  line-height: 1.1;
  text-transform: uppercase;
}

.about__text p:not(.about__lead) {
  max-width: 56ch;
  margin: 0 0 1em;
  font-size: clamp(16px, 1.25vw, 19px);
  color: var(--fg-soft);
}

/* Kolejne akapity wjeżdżają jeden po drugim */
.about__text [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
.about__text [data-reveal]:nth-child(3) { transition-delay: 0.2s; }
.about__text [data-reveal]:nth-child(4) { transition-delay: 0.3s; }

/* Wyróżnienie: skośny pomarańczowy pas jak w logo, wjeżdża od lewej */
.about__text mark {
  position: relative;
  z-index: 0;
  background: none;
  color: var(--fg);
  margin: 0 0.1em;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.5s var(--ease-out) 0.7s;
}

.nowrap {
  white-space: nowrap;
}

.about__text mark::before {
  content: "";
  position: absolute;
  inset: 0.08em -0.2em;
  z-index: -1;
  background: var(--accent);
  transform: skewX(-14deg) scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease-out) 0.6s;
}

.about__text .is-inview mark,
.no-js .about__text mark {
  color: var(--accent-ink);
}

.about__text .is-inview mark::before,
.no-js .about__text mark::before {
  transform: skewX(-14deg) scaleX(1);
}

/* Emotki z pomarańczową poświatą */
.emoji {
  display: inline-block;
  font-style: normal;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(228, 87, 46, 0.75)) drop-shadow(0 0 22px rgba(228, 87, 46, 0.35));
}

.about__lead .emoji {
  font-size: 0.8em;
  vertical-align: 0.06em;
}

.is-inview .emoji--wave {
  transform-origin: 70% 80%;
  animation: emoji-wave 1.8s ease-in-out 0.5s 2;
}

.is-inview .emoji--wink {
  animation: emoji-tilt 1.2s ease-in-out 1s 2;
}

.is-inview .emoji--flex {
  animation: emoji-flex 1.1s var(--ease-out) 1.1s 3;
}

.emoji:hover {
  animation-iteration-count: infinite;
}

@keyframes emoji-wave {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(16deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(16deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

@keyframes emoji-tilt {
  0%, 100% { transform: rotate(0) scale(1); }
  40% { transform: rotate(-12deg) scale(1.15); }
}

@keyframes emoji-flex {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px rgba(228, 87, 46, 0.75)) drop-shadow(0 0 22px rgba(228, 87, 46, 0.35));
  }

  40% {
    transform: scale(1.3) rotate(-8deg);
    filter: drop-shadow(0 0 16px rgba(228, 87, 46, 1)) drop-shadow(0 0 34px rgba(228, 87, 46, 0.6));
  }
}

@media (max-width: 767px) {
  .about__grid {
    grid-template-columns: 1fr;
  }

  .about__figure {
    display: none;
  }
}

/* ---------- W liczbach ---------- */

.stats__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: clamp(28px, 4vw, 56px);
}

.stat + .stat {
  padding-left: clamp(16px, 4vw, 56px);
  border-left: 1px solid var(--line);
}

.stat__num {
  display: flex;
  align-items: flex-start;
  gap: 0.08em;
  font-family: var(--display);
  font-size: clamp(5rem, 19vw, 15rem);
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}

/* Mały skośny pasek — nawiązanie do logo */
.stat__bar {
  width: 0.16em;
  height: 0.62em;
  margin-top: 0.06em;
  background: var(--accent);
  transform: skewX(-18deg);
}

.stat__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =========================================================
   Stopka / CTA
   ========================================================= */

.footer {
  padding: clamp(96px, 13vw, 200px) var(--gutter) calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer__title {
  margin: 0 0 clamp(36px, 5vw, 64px);
  font-family: var(--display);
  font-size: clamp(3.2rem, 11vw, 9.5rem);
  /* zapas na kreskę nad Ś */
  line-height: 1.12;
  text-transform: uppercase;
}

.footer__cta {
  display: inline-grid;
  place-items: center;
  width: clamp(156px, 17vw, 210px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  transition: transform 0.5s var(--ease-out);
}

.footer__cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: transform 0.5s var(--ease-out);
}

.footer__cta svg {
  width: 26px;
  height: 26px;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  max-width: 1440px;
  margin: clamp(72px, 10vw, 140px) auto 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer__social {
  display: flex;
  gap: 20px;
}

.footer__social a {
  padding: 12px 0;
  transition: color 0.3s;
}

.footer__social a:hover,
.footer__social a:focus-visible {
  color: var(--fg);
}

@media (max-width: 600px) {
  .footer__bottom {
    flex-direction: column;
    gap: 4px;
  }
}

/* =========================================================
   Komunikat „Skopiowano numer” (komputer)
   ========================================================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 22px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: #1a1a1a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(228, 87, 46, 0.18);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast__title {
  font-size: 15px;
  font-weight: 500;
}

.toast__title strong {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.toast__sub {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* =========================================================
   Pływający przycisk (telefon / tablet)
   ========================================================= */

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, calc(100% + 40px));
  transition: transform 0.5s var(--ease-out);
}

.fab svg {
  width: 18px;
  height: 18px;
}

.fab.is-visible {
  transform: translate(-50%, 0);
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .fab {
    display: none;
  }
}

/* =========================================================
   Animacje wejścia (tylko gdy działa JS)
   ========================================================= */

/* Rysowanie linii: logo + sylwetka */
/* Animacja (a nie transition), żeby zawsze ruszyła — także gdy klasa
   dojdzie w tej samej klatce co pierwsze wyrenderowanie */
.js .draw path.ln {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.js .draw.is-drawn path.ln {
  animation: draw-line 1.8s var(--ease-out) var(--d, 0s) both;
}

/* Zabezpieczenie: po zakończeniu rysowania linie są zawsze pełne */
.js .draw.is-done path.ln {
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  opacity: 1;
  animation: none;
}

@keyframes draw-line {
  0% {
    stroke-dashoffset: 1;
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.js .hero__logo #pas-lewy,
.js .hero__logo #pas-prawy {
  transform-box: fill-box;
  transform: scaleY(0);
  transition: transform 1.1s var(--ease-out);
}

.js .hero__logo #pas-lewy {
  transform-origin: 50% 100%;
}

.js .hero__logo #pas-prawy {
  transform-origin: 50% 0%;
  transition-delay: 0.12s;
}

.js .hero__logo .is-drawn #pas-lewy,
.js .hero__logo .is-drawn #pas-prawy {
  transform: scaleY(1);
}

.js .hero__logo #napis-MIREK-WROBEL,
.js .hero__logo #TRENER-PERSONALNY {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.js .hero__logo .is-drawn #napis-MIREK-WROBEL {
  opacity: 1;
  transform: none;
  transition-delay: 0.9s;
}

.js .hero__logo .is-drawn #TRENER-PERSONALNY {
  opacity: 1;
  transform: none;
  transition-delay: 1.15s;
}

.js .manifest,
.js .topbar {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

.js .is-ready .manifest {
  opacity: 1;
  transform: none;
  transition-delay: 0.5s;
}

.js .is-ready .topbar {
  opacity: 1;
  transform: none;
  transition-delay: 1.2s;
}

/* Pojawianie się przy przewijaniu */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.js [data-reveal].is-inview {
  opacity: 1;
  transform: none;
}

.links__list [data-reveal]:nth-child(2) { transition-delay: 0.08s; }
.links__list [data-reveal]:nth-child(3) { transition-delay: 0.16s; }
.stats__list [data-reveal]:nth-child(2) { transition-delay: 0.1s; }

/* Ograniczenie ruchu w ustawieniach systemu */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
  }
}
