/* ============================================================
   Wiosenna Energia — landing page
   Foundation: tokens, reset, fonts, base layout
   ============================================================ */

:root {
  /* Color */
  --color-bg: #ffffff;
  --color-ink: #000000;
  --color-surface: #ffffff;
  --color-overlay: rgba(255, 255, 255, 0.85);

  /* Typography */
  --font-sans:      "AdihausDIN", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-condensed: "AdihausDIN Cond", var(--font-sans);

  /* Type sizes at 1366 viewport (PSD canvas reference) */
  --fs-brand:   144px;
  --fs-nav:     56px;
  --fs-h2:      102px;
  --fs-step:    66px;
  --fs-prize:   57px;
  --fs-legal:   46px;
  --fs-email:   72px;

  /* Line heights */
  --lh-tight:  1.05;
  --lh-normal: 1.25;
  --lh-loose:  1.5;

  /* Space (4px grid) */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 16px;  --space-5: 24px;  --space-6: 32px;
  --space-7: 48px;  --space-8: 64px;  --space-9: 96px;
  --space-10: 128px;

  /* Layout */
  --container-max:  93vw;
  --container-wide: 1200px;

  /* Misc */
  --radius-sm: 4px;  --radius-md: 8px;  --radius-lg: 16px;
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-sticky-nav: 100;
  --z-drawer:     200;
  --z-skip-link:  300;
}

/* Fonts ------------------------------------------------------- */
@font-face {
  font-family: "AdihausDIN";
  src: url("fonts/AdihausDIN-Regular.woff2") format("woff2"),
       url("fonts/AdihausDIN-Regular.woff")  format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "AdihausDIN";
  src: url("fonts/AdihausDIN-Bold.woff2") format("woff2"),
       url("fonts/AdihausDIN-Bold.woff")  format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "AdihausDIN Cond";
  src: url("fonts/AdihausDIN-CondBold.woff2") format("woff2"),
       url("fonts/AdihausDIN-CondBold.woff")  format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Reset ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-ink);
  background-color: var(--color-bg);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
}
img, picture, svg { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; padding: 0; margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: var(--lh-tight); }

/* Skip link --------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: var(--z-skip-link);
  padding: var(--space-2) var(--space-4);
  background: var(--color-ink);
  color: var(--color-bg);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: top var(--duration-fast) var(--ease);
}
.skip-link:focus { top: var(--space-2); outline: 3px solid var(--color-ink); outline-offset: 2px; }

/* Background texture ----------------------------------------- */
body {
  background-image: url("images/background-mobile.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
@media (min-width: 768px) {
  body { background-image: url("images/background.jpg"); }
}
@media (min-width: 768px) and (min-resolution: 2dppx) {
  body { background-image: url("images/background@2x.jpg"); }
}
@media (max-width: 767.98px) and (min-resolution: 2dppx) {
  body { background-image: url("images/background-mobile@2x.jpg"); }
}

/* Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Scroll-reveal animations -------------------------------------
   Elements marked with [data-animate] start hidden + offset; when they
   enter the viewport JS adds .is-visible. Optional --stagger inline
   style provides per-item delay for grouped reveals (e.g. step list). */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms var(--ease),
              transform 600ms var(--ease);
  transition-delay: calc(var(--stagger, 0) * 120ms);
  will-change: opacity, transform;
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  [data-animate] { opacity: 1; transform: none; transition: none; }
}

/* Container helper ------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

/* ============================================================
   Header + Nav
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background var(--duration-base) var(--ease),
              backdrop-filter var(--duration-base) var(--ease);
}
.site-header.is-scrolled {
  /* opaque enough background instead of backdrop-filter (which would create a
     containing block for the fixed drawer descendant — clipping it to header
     height when scrolled). */
  background: rgba(255, 255, 255, 0.95);
}

.site-header__brand {
  font-family: var(--font-condensed);
  /* fluid scale; bigger than before, still fits with nav on right */
  font-size: clamp(36px, 6.5vw, 144px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}
.site-header__brand a:hover,
.site-header__brand a:focus-visible { outline: none; }

/* Hamburger button — mobile only */
.site-header__toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}
.site-header__toggle-bar {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-ink);
  transition: transform var(--duration-fast) var(--ease),
              opacity var(--duration-fast) var(--ease);
}

/* Nav list */
.site-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  font-family: var(--font-condensed);
  text-transform: uppercase;
  /* steeper ramp: 1440 ~32, 1920 ~48, hits 56 cap at ~2240 */
  font-size: clamp(16px, 2.5vw, 56px);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.site-nav__list a {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  position: relative;
  color: var(--color-bg);
  background: var(--color-ink);
  transition: transform var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
  will-change: transform;
}
.site-nav__list a:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}
.site-nav__list a.is-active {
  /* active state: invert (black text on white) so it reads as "you are here" */
  color: var(--color-ink);
  background: var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-ink) inset;
}
.site-nav__list a:focus-visible {
  outline: 3px solid var(--color-ink);
  outline-offset: 4px;
}

/* Mobile drawer ------------------------------------------- */
.site-nav__close { display: none; }

@media (max-width: 767.98px) {
  .site-nav {
    position: fixed;
    inset: 0 0 0 30%;
    background: var(--color-bg);
    z-index: var(--z-drawer);
    transform: translateX(100%);
    transition: transform var(--duration-base) var(--ease);
    padding: var(--space-9) var(--space-6);
    overflow-y: auto;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
  }
  .site-nav.is-open { transform: translateX(0); }
  .site-nav__list { gap: var(--space-6); font-size: 28px; }

  .site-nav__close {
    display: inline-flex;
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    font-family: var(--font-condensed);
    font-size: 36px;
    line-height: 1;
    color: var(--color-ink);
  }
  .site-nav__close:focus-visible {
    outline: 3px solid var(--color-ink);
    outline-offset: 2px;
  }
}

@media (min-width: 768px) {
  .site-header__toggle { display: none; }
  .site-nav__list      { flex-direction: row; gap: var(--space-3); flex-wrap: nowrap; }
  .site-nav__list a    { white-space: nowrap; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-7) var(--space-4) var(--space-3);
  max-width: var(--container-wide);
  margin: 0 auto;
}

.hero__products {
  width: 100%;
  max-width: 780px;
}
.hero__products img { width: 100%; height: auto; }

.hero__logo {
  width: clamp(240px, 40vw, 440px);
  height: auto;
  color: var(--color-ink);
}

@media (min-width: 768px) {
  .hero { padding: var(--space-8) var(--space-6) var(--space-4); }
}

/* ============================================================
   Steps ("Weź udział w konkursie")
   ============================================================ */

.steps {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-7) var(--space-4);
  text-align: center;
}

.steps__title {
  font-family: var(--font-condensed);
  font-size: clamp(28px, 7.47vw, 102px);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-7);
}

.steps__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  text-align: left;
}

.steps__item {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-family: var(--font-condensed);
  font-size: clamp(15px, 4.83vw, 66px);
  line-height: var(--lh-normal);
  font-weight: 700;
  text-transform: uppercase;
}

.steps__num {
  flex: 0 0 auto;
  align-self: center;
  /* fixed circular size; design canvas value is 148px at 1366 viewport
     (148/1366 = 10.83vw). Equal width + height keeps the shape circular
     across all viewports — never an oval, never mismatched between rows. */
  width:  clamp(64px, 10.83vw, 148px);
  height: clamp(64px, 10.83vw, 148px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 10px solid var(--color-ink);
  border-radius: 50%;
  font-weight: 700;
  font-family: var(--font-condensed);
}

.steps__text { flex: 1 1 auto; }
.steps__url  { /* inherits condensed bold uppercase from item */ }

/* ============================================================
   Prizes ("I graj o nagrody")
   ============================================================ */

.prizes {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-7) var(--space-4);
  text-align: center;
}

.prizes__title {
  font-family: var(--font-condensed);
  font-size: clamp(28px, 7.47vw, 102px);
  text-transform: uppercase;
  margin-bottom: var(--space-7);
}

.prizes__grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  width: 100%;
}

.prize {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  flex: 1 1 0;
  text-align: left;
  min-width: 0;
}
.prize__qty {
  font-family: var(--font-condensed);
  font-size: clamp(28px, 7.47vw, 102px);
  font-weight: 700;
  line-height: 1;
}
.prize picture {
  align-self: center;
  width: 100%;
  /* same fixed visual height for both prize images, regardless of source aspect */
  height: clamp(140px, 22vw, 320px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.prize picture img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Source prize2.png has visible whitespace around the yoga mat composition,
   so it visually reads ~30% smaller than prize1 in the same container.
   Compensate by scaling the rendered img up; transform doesn't change layout
   so siblings (qty, desc) stay aligned.
   Only on desktop — on mobile the picture container is wide enough that
   the source image at 1× already fills the visual area. */
@media (min-width: 768px) {
  .prize:nth-child(2) picture img {
    transform: scale(1.35);
    transform-origin: center;
  }
}
.prize__desc {
  font-family: var(--font-sans);
  font-size: clamp(13px, 4.17vw, 57px);
  line-height: var(--lh-normal);
  text-transform: uppercase;
  font-weight: 700;
  margin: 0;
}

@media (max-width: 767.98px) {
  .prizes__grid { flex-direction: column; align-items: stretch; gap: var(--space-7); }
}

/* ============================================================
   Form ("Formularz zgłoszeniowy")
   ============================================================ */

.form {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-7) var(--space-4);
}
.form__title {
  font-family: var(--font-condensed);
  font-size: clamp(28px, 7.47vw, 102px);
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}
#promoos-form-root {
  min-height: 480px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.form__legal {
  font-family: var(--font-sans);
  font-size: clamp(11px, 3.37vw, 46px);
  line-height: var(--lh-normal);
  margin-top: var(--space-6);
  color: var(--color-ink);
}

/* ============================================================
   Regulamin
   ============================================================ */

.regulations {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-7) var(--space-4);
}
.regulations__title {
  font-family: var(--font-condensed);
  font-size: clamp(28px, 7.47vw, 102px);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.regulations__link {
  font-family: var(--font-sans);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.regulations__link:focus-visible {
  outline: 3px solid var(--color-ink);
  outline-offset: 2px;
}

/* ============================================================
   Kontakt
   ============================================================ */

.contact {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-7) var(--space-4) var(--space-9);
  /* left-aligned, matches Regulamin layout */
}
.contact__title {
  font-family: var(--font-condensed);
  font-size: clamp(28px, 7.47vw, 102px);
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}
.contact__email {
  display: block;
  margin-top: var(--space-4);
  font-family: var(--font-condensed);
  font-size: clamp(18px, 5.27vw, 72px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  word-break: break-all;
  text-decoration: underline;
  text-underline-offset: 6px;
}
.contact__email:focus-visible {
  outline: 3px solid var(--color-ink);
  outline-offset: 4px;
}

/* ============================================================
   Section headings — white text in black rectangle
   Applied uniformly to all section <h2> titles.
   display: inline-block so the box wraps tightly around the text.
   ============================================================ */

.steps__title,
.prizes__title,
.form__title,
.regulations__title,
.contact__title {
  display: inline-block;
  color: var(--color-bg);
  background: var(--color-ink);
  padding: var(--space-3) var(--space-5);
}

/* ============================================================
   Footer — policy links
   ============================================================ */

.site-footer {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-7);
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: clamp(13px, 1.2vw, 16px);
}
.site-footer__links a {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}
.site-footer__links a:focus-visible {
  outline: 3px solid var(--color-ink);
  outline-offset: 2px;
}
