/* ==========================================================================
   Emanuel Pilz – Foto & Video
   Colours match emanuelpilz5.myportfolio.com (white, #282828 charcoal, greys).
   Fonts are local only: Archivo is served from assets/fonts (no Google or
   Adobe font servers), with system fonts as fallback. It stands in for the
   portfolio's Acumin Pro, which Adobe's licence doesn't allow to self-host.
   ========================================================================== */

/* Archivo (variable, weights 100–900), split into the same subsets Google
   Fonts uses; the browser only downloads a file when a page needs its characters. */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --white: #fff;
  --ink: #282828;        /* portfolio: logo, headings, active nav */
  --grey: #999;          /* portfolio: nav links, masthead text */
  --grey-light: #ccc;    /* portfolio: secondary logo */
  --panel: #f2f2f2;      /* portfolio: project details */
  --muted: #737373;      /* #999 darkened just enough for readable small text */
  --night: #0e0d0d;      /* last frame of the intro video */

  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 96px);
  --header-h: 64px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  color-scheme: light;
}

@media (min-width: 900px) {
  :root { --header-h: 80px; }
}

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

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, p, figure { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--white); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

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

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

.eyebrow {
  margin-bottom: 20px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.title {
  font-size: clamp(2.25rem, 4.6vw, 4.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.lead {
  max-width: 40ch;
  margin-top: clamp(20px, 2.4vw, 32px);
  font-size: clamp(1.125rem, 1.55vw, 1.4375rem);
  line-height: 1.55;
  hyphens: auto;
  hyphenate-limit-chars: 10 4 4;
  text-wrap: pretty;
}

/* Header (mirrors the portfolio header) ---------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding: 0 var(--gutter);
  color: var(--ink);
  transition: background-color .4s ease, box-shadow .4s ease;
}

.site-header__logo {
  font-size: clamp(1.125rem, 1.6vw, 1.4375rem);
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: clamp(18px, 2.4vw, 36px);
}

.site-nav__link {
  font-size: clamp(.9375rem, 1.2vw, 1.0625rem);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .3s ease;
}
.site-nav__link:hover,
.site-nav__link.is-active { color: var(--ink); }
.site-nav__link.is-active { font-weight: 600; }

/* Over the photo (main.js toggles these per element) */
.site-header__logo,
.site-nav { transition: color .3s ease, opacity .25s ease; }
.site-header__logo.is-hidden,
.site-nav.is-hidden { opacity: 0; }
.site-header__logo.is-light { color: var(--white); }
.site-nav.is-light .site-nav__link { color: rgba(255, 255, 255, .78); }
.site-nav.is-light .site-nav__link:hover { color: var(--white); }

.site-header.is-solid,
html:not(.motion) .site-header {
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

@media (max-width: 479px) {
  .site-nav__link--about { display: none; }
}

/* 1 · Hero --------------------------------------------------------------- */
/* Static by default (no JS / reduced motion); .motion turns it into the
   pinned scroll sequence. */

.hero {
  --out: 0;
  --t: 0;
  position: relative;
  background: var(--white);
}

.hero__stage { position: relative; }
.hero__canvas { display: none; }

.hero__layout {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 24px;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  padding: calc(var(--header-h) + 12px) var(--gutter) 28px;
}

.hero__copy {
  align-self: start;
  container-type: inline-size;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(14px, 2.4vh, 28px);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.hero__title {
  font-size: clamp(2rem, 9.5vw, 4rem);
  font-size: clamp(2rem, 10.5cqi, 4.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.035em;
}

.hero__line { display: block; }
.hero__line--2 { padding-left: 1em; }
.hero__line--3 { padding-left: 2em; }

.hero__cue { display: none; }

.hero__frame {
  --ax: .5;   /* where the portrait sits inside its box (0 = left/top, 1 = right/bottom) */
  --ay: 0;
  position: relative;
  min-height: 0;
}
.hero__frame picture,
.hero__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__poster {
  object-fit: contain;
  object-position: calc(var(--ax) * 100%) calc(var(--ay) * 100%);
}

.hero__shade { display: none; }

.hero__statement {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(20px, 3.4vh, 40px);
  padding: clamp(96px, 18vh, 200px) var(--gutter);
  background: var(--night);
  color: var(--white);
  text-align: center;
}

.hero__statement-title {
  font-size: clamp(3rem, 12.5vw, 11.5rem);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.045em;
}

.hero__statement-text {
  --w: 0;
  max-width: 30ch;
  font-size: clamp(1.125rem, 2.1vw, 1.75rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, .92);
  text-wrap: balance;
}

/* Side-by-side layout: desktop and landscape phones */
@media (min-width: 900px), (orientation: landscape) and (min-width: 560px) {
  .hero__layout {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
    grid-template-rows: minmax(0, 1fr);
    column-gap: clamp(24px, 4vw, 72px);
    padding-bottom: clamp(24px, 5vh, 56px);
  }
  .hero__copy { align-self: center; }
  .hero__title {
    font-size: clamp(2rem, 4.6vw, 6.5rem);
    font-size: clamp(2rem, 7.9cqi, 7rem);
  }
  .hero__frame { --ay: .5; }
}

/* Pinned scroll sequence */
.motion .hero { height: 400vh; }
@media (max-width: 899px) {
  .motion .hero { height: 360vh; }
}

.motion .hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.motion .hero__canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.motion .hero__layout {
  position: absolute;
  inset: 0 0 auto;
  min-height: 0;
}

.motion .hero__copy {
  opacity: calc(1 - var(--out));
  transform: translate3d(0, calc(var(--out) * -8vh), 0);
  filter: blur(calc(var(--out) * 10px));
}

.motion .hero.is-ready .hero__poster { opacity: 0; }   /* stays in the a11y tree */
.motion .hero__poster,
.motion .hero__canvas { animation: fade 1.4s .1s ease both; }

/* Intro: lines rise out of a mask */
.motion .hero__line {
  overflow: hidden;
  padding-bottom: .08em;
  margin-bottom: -.08em;
}
.motion .hero__line > span {
  display: inline-block;
  animation: rise 1.2s var(--ease-out) both;
}
.motion .hero__line--2 > span { animation-delay: .12s; }
.motion .hero__line--3 > span { animation-delay: .24s; }
.motion .hero__eyebrow { animation: fade 1s .45s ease both; }

.motion .hero__cue {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(22px, 5vh, 56px);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fade 1s .7s ease both;
}
.hero__cue-line {
  position: relative;
  width: 44px;
  height: 1px;
  overflow: hidden;
  background: var(--grey-light);
}
.hero__cue-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  animation: cue 2.4s var(--ease-in-out) infinite;
}

.motion .hero__shade {
  display: block;
  position: absolute;
  inset: 0;
  opacity: var(--t);
  background: radial-gradient(60% 50% at 50% 50%, rgba(0, 0, 0, .55), rgba(0, 0, 0, .18) 70%, rgba(0, 0, 0, 0));
  pointer-events: none;
}

.motion .hero__statement {
  position: absolute;
  inset: 0 0 auto;
  height: 100vh;
  height: 100svh;
  padding-block: 0;
  background: none;
  pointer-events: none;
}

/* "Ausdrucksstark" comes into focus like a lens */
.motion .hero__statement-title {
  opacity: var(--t);
  filter: blur(calc((1 - var(--t)) * 20px));
  transform: scale(calc(1.15 - var(--t) * .15));
}
.motion .hero__statement-text { opacity: var(--t); }

/* Word-by-word highlight (words are wrapped in .w by main.js) */
.motion [data-split] .w {
  opacity: clamp(.2, calc(var(--w, 0) * (var(--n) + 2) - var(--i)), 1);
}

@keyframes rise { from { transform: translateY(110%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes cue {
  0%   { transform: translateX(-100%); }
  55%  { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* 2 · Disciplines band --------------------------------------------------- */

.band {
  overflow: hidden;
  padding-block: clamp(72px, 11vw, 168px);
}

.band__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding-inline: var(--gutter);
  font-size: clamp(2.25rem, 5.6vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.045em;
}

/* Each word carries its own dot, so a wrapped line never starts with one */
.band__line > span {
  display: inline-flex;
  align-items: center;
}

.band__sep {
  flex: none;
  width: .15em;
  height: .15em;
  margin: 0 .38em;
  border-radius: 50%;
  background: var(--grey-light);
  transform: translateY(.05em);
}

.motion .band__line {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  white-space: nowrap;
  font-size: clamp(4rem, 13vw, 14rem);
  will-change: transform;
}

/* 3–5 · Text + photo sections ------------------------------------------- */

.section {
  max-width: 1680px;
  margin-inline: auto;
  padding: clamp(72px, 9vw, 152px) var(--gutter);
}

.split {
  display: grid;
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(48px, 7vw, 128px);
  }
  .split--flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .split--flip .shot { order: 2; }
  .split--wide.split--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.shot__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ar, .75);
  background: var(--panel);
}

/* 10 % taller than the frame so the photo can drift (parallax) without
   cropping its sides; --ar is the photo's ratio × 1.1 */
.shot__inner {
  position: absolute;
  inset: -5% 0;
}
.shot__inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot__caption {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 16px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
}
.shot__caption span {
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}

/* Reveal on enter */
.motion [data-reveal="text"] {
  opacity: 0;
  transform: translate3d(0, 40px, 0);
  transition: opacity 1.1s var(--ease-out), transform 1.3s var(--ease-out);
}
.motion [data-reveal="text"].is-in {
  opacity: 1;
  transform: none;
}

.motion [data-reveal="shot"] .shot__frame {
  clip-path: inset(9%);
  transition: clip-path 1.5s var(--ease-out);
}
.motion [data-reveal="shot"] .shot__inner img {
  transform: scale(1.2);
  transition: transform 1.9s var(--ease-out);
}
.motion [data-reveal="shot"] .shot__caption {
  opacity: 0;
  transition: opacity 1s .5s ease;
}
.motion [data-reveal="shot"].is-in .shot__frame { clip-path: inset(0); }
.motion [data-reveal="shot"].is-in .shot__inner img { transform: none; }
.motion [data-reveal="shot"].is-in .shot__caption { opacity: 1; }

/* 6 · Closing ------------------------------------------------------------ */

.closing {
  display: grid;
  justify-items: center;
  gap: clamp(56px, 9vw, 128px);
  text-align: center;
}

.closing__quote {
  max-width: 21ch;
  font-size: clamp(1.875rem, 4.4vw, 4.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.motion .closing__quote .w { transition: opacity .25s linear; }

.closing__shot { width: min(100%, 600px, 80vh * .734); }
.closing__shot .shot__caption { justify-content: center; }

/* 7 · Portfolio ---------------------------------------------------------- */

.portfolio {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 560px;
  margin-top: clamp(24px, 4vw, 64px);
  scroll-margin-top: var(--header-h);
}

.portfolio__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 0 var(--gutter) clamp(20px, 2.6vw, 36px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: .35em;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s ease;
}
.text-link:hover { color: var(--ink); }
.text-link svg { width: 12px; height: 12px; }

.portfolio__frame {
  position: relative;
  border-top: 1px solid var(--panel);
}
.portfolio__frame iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.portfolio__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .9375rem;
  color: var(--grey);
}

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

.site-footer {
  padding: clamp(88px, 12vw, 176px) var(--gutter) 28px;
  background: var(--ink);
  color: var(--white);
}
.site-footer .eyebrow { color: var(--grey); }

.site-footer__cta {
  display: inline-block;
  font-size: clamp(2.5rem, 8vw, 8.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.045em;
  text-decoration: none;
}
/* Inline so the arrow wraps along with the last word on small screens */
.site-footer__cta svg {
  display: inline-block;
  width: .6em;
  height: .6em;
  margin-left: .2em;
  vertical-align: -.02em;
  transition: transform .5s var(--ease-out);
}
.site-footer__cta:hover svg { transform: translate(.1em, -.1em); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: clamp(72px, 10vw, 144px);
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: .875rem;
  color: var(--grey);
}
.site-footer__bottom a {
  text-decoration: none;
  transition: color .2s ease;
}
.site-footer__bottom a:hover,
.site-footer__bottom a[aria-current="page"] { color: var(--white); }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

/* Legal pages: only the bottom row */
.site-footer--compact { padding-top: 28px; }
.site-footer--compact .site-footer__bottom {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Legal pages (Impressum, Datenschutz) ------------------------------------ */

.legal {
  max-width: 760px;
  margin-inline: auto;
  padding: calc(var(--header-h) + clamp(48px, 8vw, 104px)) var(--gutter) clamp(80px, 10vw, 140px);
}

.legal__back {
  display: inline-block;
  margin-bottom: clamp(24px, 3vw, 40px);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s ease;
}
.legal__back:hover { color: var(--ink); }

.legal__lead {
  margin-top: 16px;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  color: var(--muted);
}

.legal h2 {
  margin: clamp(40px, 5vw, 56px) 0 12px;
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.015em;
}

.legal p {
  font-size: 1.0625rem;
  line-height: 1.7;
  hyphens: auto;
  text-wrap: pretty;
}
.legal p + p { margin-top: 14px; }

.legal p a {
  text-decoration: underline;
  text-decoration-color: var(--grey-light);
  text-underline-offset: .2em;
  transition: text-decoration-color .2s ease;
}
.legal p a:hover { text-decoration-color: currentColor; }

.legal__date {
  margin-top: clamp(40px, 5vw, 56px);
  color: var(--muted);
}

/* Template markers: everything in a dashed frame must be filled in or deleted */
.ph {
  padding: 0 .3em;
  border: 1px dashed var(--grey);
  border-radius: 3px;
  background: var(--panel);
  font-weight: 500;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.legal .ph-note {
  margin-block: 16px;
  padding: 14px 18px;
  border: 1px dashed var(--grey);
  border-radius: 4px;
  background: var(--panel);
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--muted);
}
