/* ==========================================================================
   filipmierzwa.com
   Standalone rebuild of the original Squarespace site.

   Every value here was measured from the live site with a headless browser
   across the full range of viewport widths, so the layout and type scale
   reproduce the original rather than approximating it. Where a number looks
   arbitrary it is because it is: it is what Squarespace computed.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts

   The original serves Proxima Nova and Brandon Grotesque from Adobe Typekit
   through a kit belonging to the Squarespace account, which does not survive
   leaving the platform. These are the closest open-licensed substitutes, self
   hosted so the site makes no third-party requests at all. See README.md for
   how to swap an Adobe Fonts kit back in for an exact type match.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Figtree';
  src: url('../fonts/figtree-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('../fonts/figtree-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('../fonts/figtree-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('../fonts/figtree-latin-700-italic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
/* Brandon Grotesque's bold is a light geometric face, so the wordmark matches
   at Jost 500 rather than at a 700 — a bold substitute renders far too heavy. */
@font-face {
  font-family: 'Jost';
  src: url('../fonts/jost-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #fcfcfc;
  --surface: #fff;
  --ink: #000;
  --ink-muted: #38383b;
  --accent: #b3785b;

  --font-body: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-wordmark: 'Jost', var(--font-body);

  /* The original references aktiv-grotesk for the button but never loads it,
     so on the live site it falls back to the browser's default serif. That
     was reproduced at first; the button now uses the body face instead. */
  --font-button: var(--font-body);

  /* Content gutter and the cap the original's content width hits at 1800px. */
  --gutter: 6vw;
  --content-max: 1800px;

  /* Fluid sizes. Above a 1800px viewport the original stops growing, which is
     what the min() caps reproduce. */
  --fs-title: 2.215rem;
  --fs-sub: 1.135rem;
  --lh-title: 1.2991;
  --lh-sub: 1.389;
  --lh-body: 1.8;

  --header-h: calc(12vw + 37px);
}

@media (min-width: 768px) {
  :root {
    --gutter: 4vw;
    --fs-title: calc(1rem + min(2.156vw, 38.808px));
    --fs-sub: calc(1rem + min(0.24vw, 4.32px));
  }
}

@media (min-width: 800px) {
  :root { --header-h: calc(4.4vw + 2rem); }
}

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

/* Percentages rather than px so the reader's own browser font-size setting is
   respected; 100%/112.5% land on the original's 16px/18px by default. */
html {
  font-size: 100%;
  scroll-behavior: smooth;
}
@media (min-width: 1024px) { html { font-size: 112.5%; } }

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

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

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

a { color: inherit; }

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.wrap {
  max-width: var(--content-max);
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  background: var(--bg);
  padding: 6vw;
  transition: transform 0.3s ease;
}

/* Set by site.js while scrolling down; without JavaScript the header simply
   stays put. */
.header[data-hidden='true'] { transform: translateY(-100%); }

@media (min-width: 800px) {
  .header { padding: 2.2vw 4vw; }
}

.header__inner {
  max-width: var(--content-max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  min-height: 37px;
}

@media (min-width: 800px) {
  .header__inner { min-height: 2rem; }
}

.wordmark {
  font-family: var(--font-wordmark);
  font-size: var(--fs-sub);
  font-weight: 500;
  line-height: 1.4;
  /* Tuned so the wordmark renders at the original's exact width. */
  letter-spacing: 0.1468em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  margin-right: 2.5vw;
  white-space: nowrap;
}

.nav { display: none; }

@media (min-width: 800px) {
  .nav { display: block; }
}

.nav__list {
  display: flex;
  gap: 2.5vw;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  display: inline-block;
  padding: 0.1em 0;
  color: var(--ink-muted);
  text-decoration: none;
  line-height: var(--lh-body);
}

.nav__link:hover,
.nav__link[aria-current='page'] {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* Social icons, in both the header and the footer. */
.social {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social__link {
  display: block;
  color: var(--ink-muted);
}

.header .social > li + li { margin-left: 1.5vw; }
.footer .social > li + li { margin-left: 12px; }
.menu .social > li + li { margin-left: 1.5rem; }

.social__link svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social__link:hover { color: var(--accent); }

/* Below the nav breakpoint the original's header carries only the wordmark
   and the burger; the social links move into the menu overlay. */
.header .social { display: none; }

@media (min-width: 800px) {
  .header .social {
    display: flex;
    margin-left: auto;
  }
}

/* The burger replaces the nav below 800px, matching the original. */
.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 30px;
  height: 37px;
  margin-left: auto;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink-muted);
}

.burger span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

@media (min-width: 800px) {
  .burger { display: none; }
}

.burger[aria-expanded='true'] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded='true'] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Mobile menu overlay — a fade, as the original is configured to use. */
.menu {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: var(--header-h) var(--gutter) var(--gutter);
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu[data-open='true'] {
  opacity: 1;
  visibility: visible;
}

.menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
}

.menu__link {
  display: inline-block;
  padding: 0.4em 0;
  font-size: var(--fs-sub);
  color: var(--ink-muted);
  text-decoration: none;
}



body[data-menu-open='true'] { overflow: hidden; }

@media (min-width: 800px) {
  .menu { display: none; }
}

/* --------------------------------------------------------------------------
   Main section
   -------------------------------------------------------------------------- */
.section {
  /* The header is fixed, so its height is added to the section's own padding,
     exactly as the original does. */
  /* The original's section padding is viewport-max based, so it tracks the
     larger of the two axes rather than width alone. */
  padding: calc(var(--header-h) + 6.6vmax) var(--gutter) 6.6vmax;
}

.section--narrow .wrap { max-width: 1200px; }

/* --------------------------------------------------------------------------
   Collage: image left, text card overlapping to the right.

   Sizes are container-relative (cqw) because every measurement on the
   original resolves against the collage's own width, not the viewport — which
   is what keeps it correct once the 1800px cap engages.
   -------------------------------------------------------------------------- */
.collage {
  container-type: inline-size;
  display: grid;
  grid-template-columns: 1fr;
}

.collage__media {
  grid-area: 1 / 1;
  align-self: start;
  justify-self: start;
  width: 70%;
}

.collage__media img {
  width: 100%;
  height: auto;
}

.collage__card {
  grid-area: 1 / 1;
  align-self: start;
  justify-self: end;
  width: 45%;
  margin-top: 5cqw;
  padding: 5cqw;
  background: var(--surface);
}

/* Below 768px the original adds a fixed 17px of block padding around the
   collage. */
@media (max-width: 767px) {
  .collage { padding-block: 17px; }
}

/* Below 472px the card drops under the image and overlaps it by 20% of the
   collage width — the original's stacked variant. */
@media (max-width: 470px) {
  .collage { grid-template-rows: auto auto; }
  .collage__media { width: 90%; }
  .collage__card {
    grid-area: 2 / 1;
    width: 90%;
    margin-top: -20cqw;
    padding: 9cqw;
  }
}

/* Container query units are well supported, but if they are missing the
   percentages still give a correct, if slightly differently spaced, layout. */
@supports not (width: 1cqw) {
  .collage__card { margin-top: 4.6vw; padding: 4.6vw; }
  @media (max-width: 470px) {
    .collage__card { margin-top: -18.4vw; padding: 8.3vw; }
  }
}

/* --------------------------------------------------------------------------
   Card typography
   -------------------------------------------------------------------------- */
.card__title {
  margin: 0 0 1.04rem;
  font-size: var(--fs-title);
  font-weight: 700;
  line-height: var(--lh-title);
}

.card__body > h2 {
  margin: 2rem 0;
  font-size: var(--fs-sub);
  font-weight: 700;
  line-height: var(--lh-sub);
}

.card__body p {
  margin: 0 0 1rem;
}

.card__body ul {
  margin: 0 0 1rem;
  padding-left: 2.2rem;
}

.card__body li { margin: 0; }

/* The button supplies the gap below the copy, so the last block must not add
   its own trailing margin on top of it. */
.card__body > *:last-child { margin-bottom: 0; }

.card__body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.card__body a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Button
   -------------------------------------------------------------------------- */
.button {
  display: inline-block;
  margin-top: 1.544rem;
  padding: 1.3rem 2.171rem;
  border: 2px solid var(--accent);
  font-family: var(--font-button);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: normal;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.button:hover {
  background: var(--accent);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  min-height: 20vh;
  display: flex;
  align-items: center;
  padding: 2vmax var(--gutter);
}

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

.footer__line { margin: 0; }

.footer__link {
  font-size: 0.9rem;
  color: inherit;
  text-decoration: none;
}

.footer__link:hover { text-decoration: underline; text-underline-offset: 0.25em; }

.footer .social {
  justify-content: flex-end;
  /* Measured on the original, and constant at every width. */
  margin-top: 34px;
}

/* Above 768px the original keeps a block's worth of space below the social
   row, which shifts the vertically centred footer content up by half of it. */
@media (min-width: 768px) {
  .footer .social { margin-bottom: 17px; }
}

/* --------------------------------------------------------------------------
   Prose pages (Impressum)
   -------------------------------------------------------------------------- */
.prose p { margin: 0 0 1rem; }
.prose a { color: inherit; }

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

@media print {
  .header, .menu, .burger, .skip-link { display: none !important; }
  .section { padding-top: 0; }
  .collage { display: block; }
  .collage__media, .collage__card { width: 100%; margin: 0; padding: 0; }
}

/* LinkedIn's mark is a solid letterform rather than an outline. */
.social__link svg.is-filled {
  fill: currentColor;
  stroke: none;
}
