/* ===========================================================
   POLSOC Dania — shared styles
   Inspired by superlocaldesign.com structure, retuned to PL×DK palette
   =========================================================== */

:root {
  --navy: #0B2545;          /* granatowy — hero, ścieżka */
  --navy-deep: #081A33;
  --cream: #F4ECD6;         /* główne tło sekcji jasnych */
  --cream-soft: #FBF5E7;
  --warm-white: #FFF7E3;    /* tekst na ciemnym tle */
  --red: #D62828;           /* polski/duński akcent */
  --red-dim: #B41E1E;
  --ink: #0B2545;           /* tekst na kremie */
  --ink-soft: #4A5874;
  --rule: rgba(11, 37, 69, 0.18);
  --rule-light: rgba(255, 247, 227, 0.22);

  --pad-x: max(clamp(20px, 4vw, 48px), calc((100vw - 1440px) / 2));
  --display-font: "Familjen Grotesk", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--display-font);
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

section[id], div[id] {
  scroll-margin-top: 12vh;
}

body { overflow-x: hidden; }

a { color: inherit; text-decoration: none; }

/* ============== A11Y ============== */
.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--navy);
  color: var(--warm-white);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: transform .2s ease;
}
.skip-link:focus {
  top: 8px;
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}
a:focus-visible, button:focus-visible, summary:focus-visible, details:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

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

/* ============== TYPE SCALE ============== */

.eyebrow {
  font-family: var(--display-font);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.body {
  font-size: 16px;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.body-lg {
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.32;
  letter-spacing: -0.015em;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; }

.h-display {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: clamp(56px, 11vw, 172px);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.h-1 {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: clamp(48px, 7.4vw, 124px);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.h-2 {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: clamp(34px, 4.4vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.h-3 {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: clamp(24px, 2.4vw, 40px);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.serif-it {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

/* ============== NAV ============== */

.nav {
  position: fixed;
  top: 20px; left: var(--pad-x); right: var(--pad-x);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  z-index: 100;
  color: var(--cream);
  transition: color .35s ease, transform .35s cubic-bezier(.4, 0, .2, 1), opacity .35s ease;
  pointer-events: none;
  will-change: transform;
}
.nav.is-hidden {
  transform: translateY(calc(-100% - 28px));
  opacity: 0;
  pointer-events: none;
}
.nav-links { display: flex; align-items: center; }
.nav > * { pointer-events: auto; }

.nav.is-on-cream { color: var(--ink); }

.nav-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex: 0 0 auto;
}
.nav-logo span { white-space: nowrap; display: inline-block; }
.nav-links { flex: 0 0 auto; flex-wrap: nowrap; white-space: nowrap; }
.nav-links a { white-space: nowrap; display: inline-block; }

.nav-logo img {
  width: 32px; height: 32px;
  border-radius: 50%;
}

.nav-logo .full { display: inline; }
.nav-logo .short { display: none; }
.nav.is-scrolled .nav-logo .full { display: none; }
.nav.is-scrolled .nav-logo .short { display: inline; }

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.nav-links a { position: relative; padding: 6px 0; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 2px;
  height: 1px;
  background: currentColor;
  transition: right .3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { right: 0; }

/* Burger button — hidden on desktop, shown on mobile */
.nav-burger {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 110;
  flex: 0 0 auto;
}
.nav-burger .bar {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform .25s ease, opacity .15s ease, top .25s ease;
}
.nav-burger .bar:nth-child(1) { top: 15px; }
.nav-burger .bar:nth-child(2) { top: 21px; }
.nav-burger .bar:nth-child(3) { top: 27px; }
.nav-burger[aria-expanded="true"] .bar:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-burger[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] .bar:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* Mobile menu: drawer from the right */
@media (max-width: 900px) {
  .nav-burger { display: block; }

  /* Drop `will-change: transform` on the parent .nav so descendants with
     position:fixed are positioned relative to the viewport, not .nav itself. */
  .nav { will-change: auto; }

  /* Override hide-on-scroll: use top/opacity (NOT transform) so .nav never
     creates a containing block for the fixed-positioned drawer.
     Otherwise the navy drawer leaks 30+px past the right viewport edge. */
  .nav.is-hidden {
    transform: none;
    top: -80px;
    opacity: 0;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 86vw);
    height: 100vh;
    height: 100dvh;
    background: var(--navy);
    color: var(--warm-white);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 96px 28px max(32px, env(safe-area-inset-bottom)) 28px;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.35);
    z-index: 105;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.is-open { transform: translateX(0); }

  .nav-links a {
    display: block;
    font-size: 22px;
    letter-spacing: -0.01em;
    text-transform: none;
    padding: 16px 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 247, 227, 0.14);
    color: var(--warm-white);
  }
  .nav-links a::after { display: none; }
  .nav-links a:hover { color: var(--red); }

  /* Backdrop — z-index MUST be below .nav (100) so the drawer (inside .nav,
     z 105 in nav's stacking context) renders above the backdrop. If backdrop
     z >= 100 it sits visually above the drawer and steals all link clicks. */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 37, 69, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 99;
  }
  .nav-backdrop.is-open { opacity: 1; pointer-events: auto; }

  body.nav-locked { overflow: hidden; }
}

/* ============== UTILS ============== */

section { padding-left: var(--pad-x); padding-right: var(--pad-x); }

.bg-navy { background: var(--navy); color: var(--warm-white); }
.bg-cream { background: var(--cream); color: var(--ink); }

.full-vh { min-height: 100vh; display: flex; flex-direction: column; }

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }
.rule-light { height: 1px; background: var(--rule-light); border: 0; margin: 0; }

/* ============== BUTTONS ============== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 14px 26px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
  white-space: nowrap;
}
.btn:hover { background: currentColor; }
.btn:hover .btn-label,
.btn:hover .btn-arrow {
  color: var(--navy);
  mix-blend-mode: difference;
}
.btn-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 11px;
}

.btn-fill {
  background: var(--red);
  color: var(--warm-white);
  border-color: var(--red);
}
.btn-fill:hover { background: var(--red-dim); border-color: var(--red-dim); }
.btn-fill:hover .btn-label, .btn-fill:hover .btn-arrow { color: var(--warm-white); mix-blend-mode: normal; }

/* ============== FOOTER ============== */

.footer {
  background: var(--navy);
  color: var(--warm-white);
  position: relative;
  overflow: hidden;
  padding: 80px var(--pad-x) 32px;
}
.footer-deco-wrap { overflow: hidden; width: 100%; position: relative; z-index: 1; }

.footer-deco {
  font-family: var(--display-font);
  font-weight: 500;
  font-size: clamp(28px, 6.4vw, 110px);
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  margin: 40px 0 80px;
  color: var(--warm-white);
  position: relative;
  text-align: center;
  width: 100%;
  z-index: 1;
}
.footer-deco .x {
  color: var(--red);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  padding: 0 0.04em;
}

.footer-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.footer-shape {
  position: absolute;
  opacity: 0.85;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 48px;
  position: relative;
  z-index: 2;
  margin-bottom: 60px;
  align-items: start;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }

.pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.footer-grid ul a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.footer-grid ul a:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule-light);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill:hover { background: var(--warm-white); color: var(--navy); border-color: var(--warm-white); }

.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--rule-light);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative; z-index: 2;
  color: rgba(255, 247, 227, 0.6);
}
.footer-bottom .fb-left { justify-self: start; }
.footer-bottom .fb-right { justify-self: end; text-align: right; }
.footer-bottom .fb-credit {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  text-align: center;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 0.18em;
  line-height: 1;
  white-space: nowrap;
}
.footer-bottom a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}
.footer-bottom a:hover { color: var(--warm-white); }

.fb-credit a {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--red);
  font-size: 13px;
  padding-left: 6px;
  transition: opacity .2s ease;
}
.fb-credit a:hover { opacity: 0.75; }

.fb-signature {
  display: inline-block;
  width: 60px;
  height: auto;
  flex: 0 0 auto;
  opacity: 0.76;
  transform: translateY(2px);
}

@media (max-width: 900px) {
  .footer-bottom {
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: center;
  }
  .footer-bottom .fb-left,
  .footer-bottom .fb-right { justify-self: center; text-align: center; }
  .footer-bottom .fb-credit {
    grid-column: 1;
    justify-self: center;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 6px;
    white-space: normal;
  }
  .fb-signature { width: 56px; }
}

/* ============== SCROLL REVEAL ============== */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 80ms; }
.reveal.delay-2 { transition-delay: 160ms; }
.reveal.delay-3 { transition-delay: 240ms; }
.reveal.delay-4 { transition-delay: 320ms; }
