/* ==========================================================================
   Piotr Dytkowski — Kancelaria Prawnicza
   ========================================================================== */

@font-face {
  font-family: "General Sans";
  src: url("../fonts/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #0e1a2b;
  --navy-rgb: 14 26 43;
  --sky: #9fcbe0;
  --bg: #ffffff;
  --surface: #f2f5f7;
  --fg: #11151b;
  --muted: #646b75;
  --line: #e1e6ea;
  --on-navy-muted: rgb(255 255 255 / 0.58);
  --on-navy-line: rgb(255 255 255 / 0.12);

  --font-sans: "General Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(1.5rem, 4vw, 3rem);
  --max: 1400px;
  --header-h: 76px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, p, ul, dl, dd, address { margin: 0; }
ul { padding: 0; list-style: none; }
address { font-style: normal; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible {
  outline: 1px solid var(--sky);
  outline-offset: 4px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--fg);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease-out);
}
.skip-link:focus { transform: none; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--light { color: var(--on-navy-muted); }

.logo { height: 44px; width: auto; }

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

.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding-inline: var(--gutter);
  color: #fff;
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.5s var(--ease-out),
    color 0.5s var(--ease-out),
    border-color 0.5s var(--ease-out),
    transform 0.6s var(--ease-out),
    opacity 0.6s var(--ease-out);
}

.header.is-solid {
  background: rgb(255 255 255 / 0.9);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  color: var(--fg);
  border-color: var(--line);
}

.header__inner {
  max-width: var(--max);
  margin-inline: auto;
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
}

.header__logo { justify-self: start; transition: opacity 0.3s; }
.header__logo:hover { opacity: 0.7; }

.nav { display: none; gap: 2.5rem; }

.nav__link,
.header__cta,
.menu-toggle__label {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.nav__link { opacity: 0.78; transition: opacity 0.3s; }
.nav__link:hover, .nav__link.is-active { opacity: 1; }

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: var(--sky);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }

.header__aside {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header__cta {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  border-color: rgb(255 255 255 / 0.35);
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
.header.is-solid .header__cta { border-color: var(--line); }
.header__cta span { transition: transform 0.4s var(--ease-out); }
.header__cta:hover { background: #fff; color: var(--navy); border-color: #fff; }
.header.is-solid .header__cta:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.header__cta:hover span { transform: translateX(3px); }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}
.menu-toggle__bars { display: grid; gap: 5px; width: 22px; }
.menu-toggle__bars i { display: block; height: 1px; background: currentColor; }
.menu-toggle__bars i:last-child { width: 60%; justify-self: end; }

@media (min-width: 1024px) {
  .header__inner { grid-template-columns: 1fr auto 1fr; }
  .nav { display: flex; }
  .header__cta { display: inline-flex; }
  .menu-toggle { display: none; }
}

/* ---------- Mobile menu ---------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.1rem var(--gutter) 2.5rem;
  background: var(--navy);
  color: #fff;
  overflow-y: auto;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease-in-out);
}
.menu[hidden] { display: none; }
.menu.is-open { clip-path: inset(0 0 0 0); }

.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(var(--header-h) - 1.1rem);
}

.menu__close {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
}

.menu__nav { display: grid; border-top: 1px solid var(--on-navy-line); }
.menu__nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--on-navy-line);
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 350;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.menu__nav a span { font-family: var(--font-mono); font-size: 1rem; color: var(--on-navy-muted); }

.menu__contact { display: grid; gap: 0.4rem; margin-top: auto; color: rgb(255 255 255 / 0.85); }
.menu__contact .eyebrow { margin-bottom: 0.5rem; }

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
}

.hero__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--navy) url("../img/hero-poster.jpg") center / cover no-repeat;
  clip-path: inset(0 round 0);
  will-change: clip-path;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  will-change: transform;
}

.hero__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgb(var(--navy-rgb) / 0.45) 0%,
    rgb(var(--navy-rgb) / 0.12) 38%,
    rgb(var(--navy-rgb) / 0.78) 100%);
}

.hero__dim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--navy);
  opacity: 0;
}

.hero__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
}

.hero__sweep {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  height: 1px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.1);
}
.hero__sweep span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 33%;
  background: linear-gradient(to right, transparent, var(--sky), transparent);
  opacity: 0.7;
  animation: sweep 6s var(--ease-in-out) infinite;
}

@keyframes sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  padding: 7rem var(--gutter) 2rem;
  will-change: transform, opacity;
}

.hero__inner { margin-top: auto; }

.hero__title {
  font-size: clamp(1.75rem, 3.3vw, 3.1rem);
  font-weight: 450;
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 28ch;
}
@media (min-width: 900px) { .hero__title { max-width: none; } }

.hero__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(255 255 255 / 0.16);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.7);
}

.hero__scroll span { display: inline-block; animation: nudge 2.4s var(--ease-in-out) infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* ---------- Line reveal (titles) ---------- */

.line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.line > span { display: block; }

.js .hero__title .line > span,
.js [data-reveal-lines] .line > span {
  transform: translate3d(0, 110%, 0);
  transition: transform 1.2s var(--ease-out);
}
.js [data-reveal-lines] .line:nth-child(2) > span,
.js .hero__title .line:nth-child(2) > span { transition-delay: 0.12s; }

.js.is-loaded .hero__title .line > span,
.js [data-reveal-lines].is-in .line > span { transform: none; }

.js.is-loaded .hero__title .line:nth-child(1) > span { transition-delay: 0.75s; }
.js.is-loaded .hero__title .line:nth-child(2) > span { transition-delay: 0.87s; }

/* Hero intro: framed card opens to full bleed */
.js .hero__frame { clip-path: inset(16svh 18vw 16svh 18vw round 28px); }
.js.is-loaded .hero__frame {
  clip-path: inset(0 0 0 0 round 0);
  transition: clip-path 1.7s var(--ease-in-out) 0.15s;
}
@media (max-width: 700px) {
  .js .hero__frame { clip-path: inset(20svh 1.25rem 26svh 1.25rem round 22px); }
  .js.is-loaded .hero__frame { clip-path: inset(0 0 0 0 round 0); }
}

.js .hero__meta,
.js .header { opacity: 0; }
.js .header { transform: translateY(-12px); }
.js.is-loaded .header { opacity: 1; transform: none; transition-delay: 0.9s; }
.js.is-loaded .hero__meta { opacity: 1; transition: opacity 1s var(--ease-out) 1.3s; }
.js.is-loaded .header.is-ready { transition-delay: 0s; }

/* Generic reveal */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Sections ---------- */

.section {
  padding: clamp(6rem, 11vw, 8rem) var(--gutter);
  border-top: 1px solid var(--line);
}
.section--surface { background: var(--surface); }

.section__head { display: grid; gap: 1.5rem; margin-bottom: clamp(3rem, 6vw, 4.5rem); }

.section__head--split { align-items: end; }
@media (min-width: 1024px) {
  .section__head--split { grid-template-columns: 1.3fr 1fr; gap: 4rem; }
}

.display {
  text-wrap: balance;
  font-size: clamp(2rem, 4.3vw, 3.6rem);
  font-weight: 350;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Practice grid */
.practice {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (min-width: 640px) { .practice { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .practice { grid-template-columns: repeat(3, 1fr); } }

.practice__item { background: var(--bg); }

.practice__link {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 15rem;
  padding: clamp(1.75rem, 2.6vw, 2.25rem);
  transition: background-color 0.4s var(--ease-out);
}
.practice__link:hover { background: var(--surface); }

.practice__num {
  position: absolute;
  top: clamp(1.75rem, 2.6vw, 2.25rem);
  right: clamp(1.75rem, 2.6vw, 2.25rem);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  opacity: 0.7;
}

.practice__title {
  max-width: 21ch;
  padding-right: 2.5rem;
  text-wrap: balance;
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  font-weight: 380;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.practice__text {
  max-width: 40ch;
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted);
}

.practice__arrow {
  display: inline-block;
  margin-top: auto;
  padding-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted);
  transition: transform 0.4s var(--ease-out), color 0.3s;
}
.practice__link:hover .practice__arrow { transform: translateX(8px); color: var(--fg); }

/* Firm points */
.points {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 900px) { .points { grid-template-columns: repeat(2, 1fr); } }

.points__item {
  position: relative;
  padding: 1.5rem 0 2.25rem;
  font-size: clamp(1rem, 1.2vw, 1.0625rem);
  line-height: 1.55;
  color: #2a3038;
}
.points__item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: #cfd6dc;
  transform-origin: left;
}
.js .points__item::before { transform: scaleX(0); transition: transform 1.2s var(--ease-out) var(--d, 0s); }
.js .points__item.is-in::before { transform: scaleX(1); }

/* Facts */
.facts__grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) { .facts__grid { grid-template-columns: repeat(3, 1fr); } }

.facts__item {
  padding: 2rem 0 0.5rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .facts__item { padding: 2.25rem 2.5rem 0.5rem 0; border-bottom: 0; }
  .facts__item + .facts__item { padding-left: 2.5rem; border-left: 1px solid var(--line); }
}

.facts__value {
  font-size: clamp(2.75rem, 5vw, 4.25rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.facts__item dd {
  max-width: 36ch;
  margin-top: 1.25rem;
  padding-bottom: 2rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.footer {
  padding: clamp(5rem, 10vw, 7.5rem) var(--gutter) 2rem;
  background: var(--navy);
  color: #fff;
}

.footer__cta {
  display: grid;
  gap: 2rem;
  padding-bottom: clamp(3.5rem, 7vw, 5rem);
  border-bottom: 1px solid var(--on-navy-line);
}
@media (min-width: 1024px) {
  .footer__cta { grid-template-columns: 1fr auto; align-items: end; }
}

.footer__heading {
  font-size: clamp(2rem, 4.3vw, 3.6rem);
  font-weight: 350;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.footer__mail {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  justify-self: start;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgb(255 255 255 / 0.3);
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  transition: border-color 0.3s;
}
.footer__mail span { font-family: var(--font-mono); font-size: 0.9em; transition: transform 0.4s var(--ease-out); }
.footer__mail:hover { border-color: var(--sky); }
.footer__mail:hover span { transform: translateX(6px); }

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}
@media (min-width: 640px) { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }

.footer__brand { display: grid; gap: 1.5rem; align-content: start; }
.footer__brand .logo { height: 52px; }

.footer__col { display: grid; gap: 1rem; align-content: start; font-size: 0.9375rem; line-height: 1.6; color: rgb(255 255 255 / 0.88); }
.footer__col a { transition: color 0.3s; }
.footer__col a:hover { color: var(--sky); }
.footer__muted { color: var(--on-navy-muted); font-size: 0.8125rem; }

.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8a93a0;
}
.status.is-open .status__dot {
  background: #4ade80;
  box-shadow: 0 0 0 0 rgb(74 222 128 / 0.6);
  animation: pulse 2.4s ease-out infinite;
}
.status__label { color: #fff; }
.status__hours { color: var(--on-navy-muted); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(74 222 128 / 0.55); }
  70%, 100% { box-shadow: 0 0 0 8px rgb(74 222 128 / 0); }
}

.footer__bottom {
  display: grid;
  gap: 0.9rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--on-navy-line);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.6;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-navy-muted);
}
@media (min-width: 1024px) {
  .footer__bottom { grid-template-columns: 1fr auto; }
  .footer__credits { grid-column: 1 / -1; }
}
.footer__links { display: flex; flex-wrap: wrap; gap: 1.75rem; }
.footer__links a { transition: color 0.3s; }
.footer__links a:hover { color: #fff; }
.footer__credits { opacity: 0.7; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js .hero__frame { clip-path: none; }
  .hero__video { transform: none; }
}
