/* ==========================================================================
   Nico Polzin – Portfolio
   Hand-written replacement for the former Webflow stylesheet.
   ========================================================================== */

@font-face {
  font-family: "Inknut Antiqua";
  src: url("/fonts/inknut-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #0f0f0f;
  --white: #fff;
  --grey: #2f2f2f;
  --muted: #b5b5b5;
  --accent: #f7c578;
  --scopes-blue: #1907ff;
  --serif: "Inknut Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 10vw;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  padding: 0 var(--gutter);
  min-height: 100vh;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }

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

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--white);
  color: var(--black);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform .2s;
}
.skip-link:focus { transform: none; }

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

/* ---------- Typography ---------- */
.heading {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--white);
  font-size: 64px;
  line-height: 1;
}
.heading--stage { line-height: 1.4; }
.heading--l { font-size: 48px; line-height: 1.4; }
.heading--m { font-size: 32px; line-height: 1.4; }
.heading--s { font-size: 26px; line-height: 1.4; }

.paragraph {
  font-weight: 300;
  font-size: 24px;
  line-height: 1.62;
}
.paragraph a { text-underline-offset: 3px; }
.paragraph + .paragraph { margin-top: 1em; }

.label {
  font-weight: 300;
  font-size: 24px;
  line-height: 1.62;
  color: var(--white);
  margin-bottom: 12px;
}

.mini-copy {
  margin-top: 8px;
  font-weight: 300;
  font-size: 16px;
  color: var(--white);
}

/* ---------- Header / navigation ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 8vw 0;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  height: 72px;
  text-decoration: none;
  position: relative;
  z-index: 2;
}
.brand img { width: 72px; height: 72px; }
.brand__dark { position: absolute; top: 0; left: 0; opacity: 0; transition: opacity .3s; }
.brand__claim {
  margin-left: 32px;
  font-size: 16px;
  letter-spacing: .5px;
  color: var(--white);
  transition: opacity .3s;
}

.menu-toggle {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--white);
}
.menu-toggle__bar {
  position: absolute;
  right: 0;
  width: 32px;
  height: 2px;
  background: currentColor;
  transition: transform .4s ease, top .4s ease, background-color .3s;
}
.menu-toggle__bar:nth-child(1) { top: 30px; }
.menu-toggle__bar:nth-child(2) { top: 40px; }

.menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--white);
  color: var(--black);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
.menu__primary { list-style: none; margin: 0; padding: 0; text-align: center; }
.menu__primary li + li { margin-top: 48px; }
.menu__primary a {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 1;
  text-decoration: none;
  color: var(--black);
}
.menu__primary a:hover,
.menu__primary a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 10px; }

.menu__meta {
  position: absolute;
  bottom: 80px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  list-style: none;
  margin: 0;
  padding: 0 24px;
}
.menu__meta a {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--black);
  text-decoration: none;
}
.menu__meta a:hover, .menu__meta a:focus-visible { text-decoration: underline; }

.menu-open { overflow: hidden; }
.menu-open .menu { opacity: 1; visibility: visible; transition: opacity .4s ease; }
.menu-open .menu-toggle { color: var(--black); }
.menu-open .menu-toggle__bar:nth-child(1) { top: 35px; transform: rotate(45deg); }
.menu-open .menu-toggle__bar:nth-child(2) { top: 35px; transform: rotate(-45deg); }
.menu-open .brand__dark { opacity: 1; }
.menu-open .brand__claim { opacity: 0; }

/* ---------- Home: horizontal case gallery ---------- */
.gallery { position: relative; }
.gallery__track {
  list-style: none;
  margin: 0;
  padding: 0;
}

.caseblock {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: var(--white);
}
.case-typo { position: relative; z-index: 1; display: flex; align-items: center; }
.case-typo__counter {
  position: relative;
  top: -34px;
  margin-right: 16px;
  font-size: 14px;
  line-height: 1;
}
.case-typo__line {
  width: 2px;
  height: 83px;
  margin: 4px 16px 0 0;
  background: var(--accent);
}
.case-typo__text { display: flex; flex-direction: column; align-items: flex-start; }
.case-typo__title {
  margin-bottom: 12px;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}
.case-typo__type { margin-left: 2px; font-size: 14px; line-height: 1; }

.case-image { width: 281px; height: 502px; object-fit: cover; }

/* Desktop + JS: pinned, horizontally scrolling track (as on the original site) */
@media (min-width: 992px) {
  .js .gallery { height: 400vh; }
  .js .gallery__sticky {
    position: sticky;
    top: 0;
    height: 95vh;
    overflow: clip;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter);
  }
  .js .gallery__track {
    display: flex;
    align-items: center;
    height: 100%;
    width: max-content;
    will-change: transform;
  }
  .js .gallery__item { margin-right: 120px; }
  .js .gallery__item:first-child { margin-left: calc(40vw - 153px); }
  .js .gallery__item:last-child { margin-right: 40vw; }
  .js .caseblock { height: 580px; }
  .js .case-typo { margin-right: 50px; }
  .js .case-image {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    clip-path: inset(50% 0 50% 0);
    transition: opacity .5s ease, clip-path .5s ease;
  }
  .js .caseblock:hover .case-image,
  .js .caseblock:focus-visible .case-image { opacity: 1; clip-path: inset(0 0 0 0); }

  .scroll-hint {
    position: fixed;
    left: 50%;
    top: 88vh;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity .3s;
  }
  .scroll-hint__mouse {
    width: 22px;
    height: 32px;
    border: 2px solid var(--white);
    border-radius: 11px;
    position: relative;
    margin-bottom: 8px;
  }
  .scroll-hint__mouse::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 6px;
    width: 3px;
    height: 3px;
    margin-left: -1.5px;
    border-radius: 50%;
    background: var(--white);
    animation: scroll-dot 2s ease-in-out infinite;
  }
  .scroll-hint__label { font-size: 12px; letter-spacing: 1px; line-height: 1.4; }
  .scroll-hint.is-hidden { opacity: 0; }
}

@keyframes scroll-dot {
  0%, 20% { transform: translateY(0); opacity: 1; }
  80%, 100% { transform: translateY(14px); opacity: 0; }
}

/* Stacked list (mobile, tablet, or no JS) */
@media (max-width: 991px) {
  .gallery { padding-top: 160px; }
  .gallery__item { width: 320px; max-width: 100%; margin: 0 auto 64px; }
  .caseblock { flex-direction: column; align-items: flex-start; }
  .case-typo { align-items: flex-start; margin-bottom: 4vw; }
  .case-typo__counter { display: none; }
  .case-typo__line { height: auto; align-self: stretch; margin-top: 0; }
  .case-typo__title { font-size: 40px; }
  .case-image { width: 100%; height: auto; aspect-ratio: 281 / 502; }
  .scroll-hint { display: none; }
}
@media (min-width: 992px) {
  html:not(.js) .gallery { padding-top: 200px; }
  html:not(.js) .gallery__item { width: 320px; margin: 0 auto 96px; }
  html:not(.js) .caseblock { flex-direction: column; align-items: flex-start; }
  html:not(.js) .case-typo { margin-bottom: 32px; }
  html:not(.js) .case-image { width: 100%; height: auto; }
  html:not(.js) .scroll-hint { display: none; }
}
@media (max-width: 767px) {
  .case-typo__line { margin-right: 8px; }
  .case-image { margin-bottom: 32px; }
  .gallery__item { width: 283px; margin-bottom: 32px; }
}

/* ---------- Case pages ---------- */
.case-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 64px;
  align-items: center;
  height: 70vh;
  margin: 140px auto 120px;
}
.case-stage .heading { overflow-wrap: anywhere; }
.case-stage__media { height: 100%; max-height: 720px; width: 100%; }
.case-stage__media img { width: 100%; height: 100%; object-fit: cover; }
.case-stage__media--top img { object-position: 50% 0; }

.case-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 64px;
  row-gap: 16px;
  margin-bottom: 120px;
}
.case-text__meta { grid-column: 1 / -1; margin-bottom: 16px; }
.case-text__meta dl { margin: 0; }
.case-text__meta div { display: flex; flex-wrap: wrap; gap: 0 .35em; }
.case-text__meta dt, .case-text__meta dd { margin: 0; font-weight: 300; font-size: 24px; line-height: 1.62; }
.case-text__meta dt::after { content: " –"; }
.case-text__body { grid-column: 1 / -1; columns: 2; column-gap: 64px; }
.case-text__body .paragraph { break-inside: avoid-column; }

.case-detail { margin: 0 0 120px; }
.case-detail__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b0b0b;
  overflow: hidden;
}
.case-detail__media img,
.case-detail__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.case-detail__media--contain img { object-fit: contain; }
.case-detail__media--blue { background: var(--scopes-blue); }
.case-detail__media--black { background: #020202; }

.video-toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 999px;
  background: rgba(15,15,15,.75);
  color: var(--white);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
}
.video-toggle:hover { background: var(--black); }

.more {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 80px;
}
.more .heading { margin-bottom: 40px; }
.more__list {
  display: grid;
  grid-template-columns: repeat(4, min-content);
  gap: 32px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.more__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  text-decoration: none;
  color: var(--white);
}
.more__circle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 92px;
  height: 92px;
  border: 2px solid var(--grey);
  border-radius: 50%;
  transition: border-color .3s;
}
.more__circle img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.more__link:hover .more__circle,
.more__link:focus-visible .more__circle { border-color: var(--accent); }
.more__link .mini-copy { margin-top: 16px; text-align: center; }

/* ---------- About ---------- */
.about {
  max-width: 1280px;
  margin: 240px auto 120px;
  padding: 0 80px;
  display: grid;
  gap: 120px;
}
.about__intro { display: grid; gap: 64px; }
.about__text { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; }
.about__text > div { grid-column: 2; }
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 64px;
}
.split .heading { margin-bottom: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { font-weight: 300; font-size: 24px; line-height: 1.62; }
.timeline li + li { margin-top: 1.62em; }
.timeline time, .timeline .timeline__date { display: block; }

/* ---------- Legal pages ---------- */
.legal {
  max-width: 1280px;
  margin: 240px auto 120px;
  padding: 0 80px;
}
.legal > h1 { margin-bottom: 120px; }
.legal section { margin-bottom: 120px; }
.legal .heading { margin-bottom: 24px; }
.legal .paragraph a { overflow-wrap: anywhere; }
.legal ul { margin: 0 0 1em; padding-left: 1.2em; font-weight: 300; font-size: 24px; line-height: 1.62; }
.notice {
  margin-bottom: 80px;
  padding: 24px 32px;
  border: 2px solid var(--accent);
  font-size: 18px;
  line-height: 1.6;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 48px 0;
  border-top: 1px solid var(--grey);
  font-size: 14px;
  color: var(--muted);
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--white); text-decoration: underline; }

/* ---------- 404 ---------- */
.not-found { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.not-found .paragraph { margin: 24px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .heading { font-size: 40px; }
  .heading--l { font-size: 40px; line-height: 1.6; }
  .menu__primary a { font-size: 48px; }
  .case-stage { grid-template-columns: 1fr; height: auto; row-gap: 32px; margin: 160px auto 6vw; }
  .case-stage__media { height: 90vw; max-height: none; }
  .case-text { grid-template-columns: 1fr; margin-bottom: 6vw; }
  .case-text__body { columns: 1; }
  .about, .legal { margin-top: 160px; padding: 0; gap: 80px; }
  .about__text { grid-template-columns: 1fr; }
  .about__text > div { grid-column: 1; }
}

@media (max-width: 767px) {
  .site-header { padding: 24px 7vw 0; }
  .heading--stage { font-size: 32px; }
  .heading--l { font-size: 28px; }
  .split { grid-template-columns: 1fr; }
  .split .heading { font-size: 32px; margin-bottom: 24px; }
  .case-detail { margin-bottom: 40px; }
  .case-detail__media { aspect-ratio: auto; }
  .case-detail__media img { height: auto; object-fit: contain; }
  .case-detail__media video { height: auto; aspect-ratio: 16 / 9; }
  .menu__primary li + li { margin-top: 24px; }
  .menu__meta { bottom: 6vh; }
  .more { margin-top: 80px; }
}

@media (max-width: 479px) {
  :root { --gutter: 7vw; }
  .site-header { padding-top: 16px; }
  .brand, .brand img { height: 64px; }
  .brand img { width: 64px; }
  .brand__claim { margin-left: 16px; font-size: 15px; }
  .heading--m { font-size: 26px; }
  .paragraph, .label, .timeline li, .legal ul,
  .case-text__meta dt, .case-text__meta dd { font-size: 20px; }
  .menu__meta { display: grid; grid-template-columns: repeat(3, auto); text-align: center; }
  .more__list { grid-template-columns: repeat(2, min-content); gap: 24px 40px; }
}

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

@media print {
  .site-header, .scroll-hint, .video-toggle { display: none; }
  body { background: #fff; color: #000; padding: 0; }
  .heading, .paragraph, .mini-copy { color: #000; }
}
