/* Luca Jahn portfolio
   Palette from the brief: Black Emerald, Scrub, August Moon, US Field Drab, Renwick Olive, Argos */
:root {
  --emerald: #151F19;
  --scrub: #3D3C2E;
  --moon: #E7E1D6;
  --drab: #726040;
  --olive: #98886C;
  --argos: #BCBEB6;
  --paper: #EFEDE2; /* logo colour */

  --bg: var(--moon);
  --fg: var(--emerald);
  --muted: var(--drab);
  --line: rgba(21, 31, 25, .18);

  --m: clamp(16px, 4vw, 56px);      /* page margin */
  --g: clamp(12px, 1.6vw, 24px);    /* gutter */
  --font: "General Sans", "Helvetica Neue", Arial, sans-serif;

  /* type scale */
  --t-small: .8125rem;
  --t-body: 1.0625rem;
  --t-lead: clamp(1.25rem, 1.6vw, 1.5rem);
  --t-statement: clamp(1.75rem, 3.5vw, 3.25rem);
  --t-chapter: clamp(3.25rem, 10vw, 10rem);
  --t-hero: clamp(4rem, 11.5vw, 17rem);
}

body[data-theme="moon"]    { --bg: var(--moon);    --fg: var(--emerald); --muted: var(--drab);  --line: rgba(21,31,25,.18); }
body[data-theme="argos"]   { --bg: var(--argos);   --fg: var(--emerald); --muted: var(--scrub); --line: rgba(21,31,25,.2); }
body[data-theme="emerald"] { --bg: var(--emerald); --fg: var(--paper);   --muted: var(--olive); --line: rgba(239,237,226,.16); }
body[data-theme="scrub"]   { --bg: var(--scrub);   --fg: var(--paper);   --muted: var(--argos); --line: rgba(239,237,226,.18); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background-color .9s cubic-bezier(.4,0,.2,1), color .9s cubic-bezier(.4,0,.2,1);
  overflow-x: clip;
}

img, video { display: block; width: 100%; height: 100%; object-fit: cover; }
figure { margin: 0; position: relative; overflow: hidden; background: rgba(61,60,46,.25); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px;
}

.skip {
  position: fixed; left: var(--m); top: 12px; z-index: 100;
  background: var(--emerald); color: var(--paper); padding: 8px 14px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- preloader ---------- */
.loader { display: none; }
/* the scrollbar stays in place (so the layout never jumps), just tinted to melt into the emerald */
html.is-loading:not(.loader-open) { scrollbar-color: var(--emerald) var(--emerald); }
html.is-loading .loader {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--emerald);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.2s cubic-bezier(.3, .2, .05, 1); /* curve measured from the reference video */
}
.loader-logo { height: 14vh; height: 14svh; aspect-ratio: 1080 / 1502; }
.loader-logo svg { display: block; }
/* the page colour rises from the bottom and covers the logo */
html.loader-open .loader { clip-path: inset(0 0 100% 0); pointer-events: none; }
/* then the page comes in: header, capsule and name, small text */
@keyframes page-in { from { opacity: 0; } }
html.loader-open .bar { animation: page-in .5s ease .75s backwards; }
html.loader-open .hero-media,
html.loader-open .hero-name { animation: page-in .7s ease .9s backwards; }
html.loader-open .hero-copy,
html.loader-open .hero-hint { animation: page-in .5s ease 1.15s backwards; }

/* ---------- header ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px var(--m);
  font-size: .9375rem; font-weight: 500;
  color: var(--fg);
  background: var(--bg);
  transition: color .9s, background-color .9s cubic-bezier(.4,0,.2,1);
}
.hero ~ * .bar, body.at-top .bar { background: transparent; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; justify-self: start; }
.brand-mark { width: 15px; height: 22px; }
.bar-chapter { justify-self: center; color: var(--muted); transition: opacity .4s; }
.bar-nav { justify-self: end; display: flex; gap: clamp(14px, 2vw, 28px); }
.bar-nav a, .brand { text-decoration: none; }
.bar-nav a { position: relative; }
.bar-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s;
}
.bar-nav a:hover::after { transform: scaleX(1); }
body.on-media .bar { color: var(--paper); background: transparent; }
body.on-media .bar-chapter { opacity: 0; }

/* ---------- hero ---------- */
.hero { height: 280vh; position: relative; }
.hero-pin {
  position: sticky; top: 0; height: 100vh; height: 100svh; height: 100dvh; overflow: hidden; /* dvh: grows when the phone browser hides its bars */
}
/* name split around the capsule: Luca left, Jahn right */
.hero-name {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--m);
  font-size: var(--t-hero); font-weight: 500; line-height: .8; letter-spacing: -.05em;
  pointer-events: none;
}
.hn { display: block; will-change: transform; }
.hn-first { margin-left: -.04em; }
.hn-last { margin-right: -.02em; }
.hero-copy {
  position: absolute; left: var(--m); bottom: clamp(24px, 5vh, 48px);
}
.hero-lede {
  display: flex; gap: clamp(28px, 4vw, 64px);
  font-size: var(--t-body); line-height: 1.15; font-weight: 500;
}
/* the small capsule frame (shape taken from the logo) */
.hero-anchor {
  position: absolute; inset: 0; margin: auto; height: auto;
  width: clamp(280px, 42vw, 820px); aspect-ratio: 2 / 1;
  pointer-events: none;
}
.hero-media {
  position: absolute; inset: 0; z-index: 1;
  clip-path: inset(38% 26% 38% 26% round 999px);
  will-change: clip-path;
}
.hero-media video { transform-origin: 50% 50%; }
.hero-over {
  position: absolute; z-index: 2; left: var(--m); bottom: clamp(28px, 7vh, 72px);
  color: var(--paper); font-size: var(--t-statement); line-height: 1.08; letter-spacing: -.02em; font-weight: 500;
  opacity: 0; max-width: 15ch; text-wrap: balance;
}
.hero-hint {
  position: absolute; right: var(--m); bottom: clamp(24px, 5vh, 48px); font-size: var(--t-small); color: var(--muted);
}

[data-words] .w { opacity: .16; }
/* ---------- chapters ---------- */
.chapter { padding: clamp(80px, 14vh, 160px) 0 clamp(100px, 16vh, 180px); }
.chapter-head {
  padding: 0 var(--m);
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--g); row-gap: 28px;
  align-items: end; margin-bottom: clamp(48px, 9vh, 110px);
  overflow-x: clip; /* titles slide in from the right edge */
}
.chapter-title {
  grid-column: 1 / -1;
  font-size: var(--t-chapter); font-weight: 500; line-height: .9; letter-spacing: -.045em;
  white-space: nowrap; margin-left: -.05em;
}
.chapter-aside {
  grid-column: 7 / span 5;
  display: grid; grid-template-columns: 1fr 2fr; gap: var(--g);
}
.chapter-meta { color: var(--muted); font-size: .9375rem; font-weight: 500; line-height: 1.4; }
.chapter-text { max-width: 42ch; }

.bleed { height: 100vh; height: 100svh; margin: 0 var(--m); border-radius: 4px; }
.bleed img, .bleed video { transform-origin: 50% 50%; }
.bleed-video .v-tall { display: none; }

/* keith grant mosaic */
.mosaic {
  padding: clamp(80px, 14vh, 160px) var(--m) 0;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--g); row-gap: clamp(40px, 8vh, 100px);
}
.m { border-radius: 4px; }
.m-a { grid-column: 1 / span 5; aspect-ratio: 2 / 3; }
.m-b { grid-column: 7 / span 6; aspect-ratio: 16 / 10; margin-top: 30vh; }
.m-c { grid-column: 2 / span 6; aspect-ratio: 16 / 10; margin-top: 6vh; }
.m-d { grid-column: 9 / span 4; aspect-ratio: 2 / 3; margin-top: 14vh; }
.m-e { grid-column: 3 / span 8; aspect-ratio: 16 / 9; }

/* moto split */
.split {
  padding: 0 var(--m);
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--g);
}
.split-sticky {
  grid-column: 1 / span 6; position: sticky; top: 76px; justify-self: center;
  height: calc(100vh - 100px); max-width: 100%; aspect-ratio: 3 / 4; border-radius: 4px;
}
.split-flow { grid-column: 8 / -1; display: grid; gap: clamp(40px, 10vh, 120px); padding-top: 20vh; }
.split-flow figure { aspect-ratio: 2 / 3; border-radius: 4px; }

/* films horizontal */
.films { padding: 0; }
.films-pin {
  height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center;
  gap: clamp(24px, 4vh, 48px); overflow: hidden;
}
.films-head {
  padding: 0 var(--m); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--g);
}
.films-head .chapter-title { grid-column: auto; }
.films-head .chapter-text { max-width: 36ch; color: var(--muted); }
.films-track {
  display: flex; gap: var(--g); padding: 0 var(--m); width: max-content; will-change: transform;
}
.reel { height: min(58vh, 640px); aspect-ratio: 4 / 5; border-radius: 4px; flex: none; }

/* wildlife */
.bleed-video { clip-path: inset(0 18% round 4px); }
.field {
  padding: clamp(80px, 14vh, 160px) var(--m) 0;
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--g); row-gap: clamp(32px, 6vh, 80px);
}
.f { border-radius: 4px; }
.f-a { grid-column: 1 / span 4; aspect-ratio: 3 / 4; }
.f-b { grid-column: 6 / span 3; aspect-ratio: 2 / 3; margin-top: 16vh; }
.f-c { grid-column: 10 / span 3; aspect-ratio: 3 / 4; margin-top: 4vh; }
.f-d { grid-column: 2 / span 3; aspect-ratio: 4 / 5; }
.f-e { grid-column: 6 / span 7; aspect-ratio: 3 / 2; margin-top: 8vh; }
.f-f { grid-column: 3 / span 6; aspect-ratio: 3 / 2; }

/* ugc fan */
.fan {
  position: relative; padding: 40px 0; overflow-x: clip;
  display: flex; justify-content: center; align-items: center;
}
.fan-card {
  position: absolute; width: clamp(180px, 22vw, 320px); aspect-ratio: 9 / 16;
  border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(21,31,25,.45);
}
.fan-card:nth-child(1) { transform: translateX(-85%) rotate(-8deg); }
.fan-card:nth-child(2) { position: relative; z-index: 2; }
.fan-card:nth-child(3) { transform: translateX(85%) rotate(8deg); }

/* about */
.about {
  padding: clamp(120px, 20vh, 220px) var(--m);
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--g); row-gap: clamp(48px, 8vh, 96px);
}
.about-title { grid-column: 1 / span 3; font-size: var(--t-lead); font-weight: 500; color: var(--muted); }
.about-body { grid-column: 4 / span 5; grid-row: 1; display: grid; gap: 1.1em; align-content: start; }
.about-portrait {
  grid-column: 10 / -1; grid-row: 1; align-self: start;
  aspect-ratio: 188 / 237; border-radius: 9999px; overflow: hidden; margin: 0;
}
.about-portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  /* zoom in slightly and shift left so the figure sits in the centre of the capsule */
  transform: scale(1.15) translate(-6%, 3%);
}
.about-lede { font-size: var(--t-statement); line-height: 1.1; letter-spacing: -.022em; font-weight: 500; margin-bottom: .3em; }
.skills {
  grid-column: 4 / -1; margin: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); column-gap: var(--g);
  border-top: 1px solid var(--line);
}
.skills div { padding: 22px 0; border-bottom: 1px solid var(--line); padding-right: var(--g); }
.skills dt { font-weight: 500; margin-bottom: 4px; }
.skills dd { margin: 0; color: var(--muted); }

/* contact */
.contact {
  min-height: 100vh; min-height: 100svh; padding: 0 var(--m);
  display: flex; flex-direction: column;
}
.contact-main {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-start;
  padding: clamp(80px, 14vh, 160px) 0 clamp(72px, 12vh, 140px);
}
.contact-mark { width: clamp(44px, 4.4vw, 64px); aspect-ratio: 296 / 432; height: auto; color: var(--olive); margin-bottom: clamp(32px, 6vh, 64px); }
.contact-title {
  font-size: var(--t-statement); line-height: 1.08; letter-spacing: -.022em; font-weight: 500; max-width: 16ch;
  color: var(--muted);
}
.contact-mail {
  margin-top: clamp(20px, 3vh, 36px);
  font-size: clamp(2.25rem, 7.4vw, 8rem); font-weight: 500; letter-spacing: -.04em; line-height: 1;
  text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .5s cubic-bezier(.4,0,.2,1); padding-bottom: .08em; width: fit-content;
}
.contact-mail:hover { background-size: 100% 2px; }
.foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--g);
  border-top: 1px solid var(--line); padding: 24px 0 28px;
  font-size: .9375rem; font-weight: 500;
}
.foot p { margin: 0; }
.foot-name { color: var(--muted); }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; justify-self: center; }
.foot-links a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s; padding-bottom: 2px; }
.foot-links a:hover { background-size: 100% 1px; }
.foot-legal { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; justify-self: end; color: var(--muted); }
.foot-legal a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s, color .35s; padding-bottom: 2px; }
.foot-legal a:hover, .foot-legal a[aria-current] { background-size: 100% 1px; color: var(--fg); }

/* ---------- legal pages (imprint, privacy) ---------- */
.legal {
  padding: clamp(140px, 22vh, 240px) var(--m) clamp(96px, 16vh, 180px);
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--g); row-gap: clamp(48px, 8vh, 96px);
}
.legal-title {
  grid-column: 1 / -1;
  font-size: var(--t-chapter); font-weight: 500; line-height: .9; letter-spacing: -.045em; margin-left: -.04em;
}
.legal-body { grid-column: 4 / span 6; display: grid; gap: clamp(36px, 5vh, 56px); max-width: 68ch; }
.legal-body section { display: grid; gap: .9em; padding-top: 22px; border-top: 1px solid var(--line); }
.legal-body h2 { font-size: var(--t-lead); font-weight: 500; line-height: 1.2; letter-spacing: -.01em; }
.legal-body ul { margin: 0; padding-left: 1.1em; display: grid; gap: .3em; }
.legal-body a { text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal-lede { font-size: var(--t-lead); line-height: 1.35; font-weight: 500; }
.legal-date { color: var(--muted); }
.legal-foot { margin: 0 var(--m); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .bar-chapter { display: none; }
  .bar { grid-template-columns: 1fr auto; font-size: .875rem; padding-top: 14px; padding-bottom: 14px; }
  .bar-nav { gap: 14px; }
  /* The browser bars come and go while scrolling, so the hero must not depend on them.
     The section is always the size of the screen without bars, and everything inside it
     is placed within the part that stays visible when the bars are showing. */
  .hero-pin { --bars: 0px; height: 100vh; height: 100lvh; }
  @supports (height: 100lvh) { .hero-pin { --bars: calc(100lvh - 100svh); } }
  .hero-name { bottom: var(--bars); }
  .hero-anchor { bottom: var(--bars); }
  .hero-copy { bottom: calc(clamp(24px, 5vh, 48px) + var(--bars)); }
  .hero-hint { bottom: calc(clamp(24px, 5vh, 48px) + var(--bars)); }
  .hero-over { bottom: calc(clamp(28px, 7vh, 72px) + var(--bars)); }
  .hero-anchor { width: 72vw; aspect-ratio: 3 / 4; }
  /* Luca sits just above the capsule, Jahn just below it (capsule = 72vw wide, 96vw tall).
     On shorter screens the name shrinks so it never runs into the image or the menu. */
  .hero-name {
    flex-direction: column; align-items: stretch; justify-content: center;
    row-gap: calc(96vw + 20px); padding: 0 var(--m);
    font-size: 28vw;
    font-size: min(28vw, max(52px, calc((50vh - 48vw - 82px) * 1.25)));
    font-size: min(28vw, max(52px, calc((50svh - 48vw - 82px) * 1.25)));
  }
  .hn-last { align-self: flex-end; }
  .hero-media video { object-position: 8% 50%; }
  .hero-lede { flex-direction: column; gap: 8px; }
  .chapter-aside { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 10px; }
  .chapter-title { white-space: normal; }
  .bleed { height: 70svh; }
  .m-a, .m-b, .m-c, .m-d, .m-e { grid-column: 1 / -1; margin-top: 0; }
  .m-b, .m-d { grid-column: 3 / -1; }
  .m-c { grid-column: 1 / span 10; }
  .split-sticky { grid-column: 1 / -1; position: relative; top: 0; height: auto; width: 100%; aspect-ratio: 3 / 4; }
  .split-flow { grid-column: 1 / -1; padding-top: 48px; gap: 48px; }
  .films-head { flex-direction: column; align-items: flex-start; }
  .reel { height: 52svh; }
  .bleed-video { clip-path: none; aspect-ratio: 9 / 12; height: auto; }
  .bleed-video .v-wide { display: none; }
  .keith .bleed video { object-position: 65% 50%; }
  .bleed-video .v-tall { display: block; }
  .f-a, .f-b, .f-c, .f-d, .f-e, .f-f { grid-column: span 6; margin-top: 0; }
  .f-e, .f-f { grid-column: 1 / -1; }
  /* even 48px spacing below the opening media in the project sections */
  .mosaic, .field { padding-top: 48px; row-gap: 48px; }
  .f-a, .f-b, .f-c, .f-d { aspect-ratio: 3 / 4; } /* side-by-side pairs share one height */
  .fan-card { width: 34vw; }
  .fan-card:nth-child(1) { transform: translateX(-75%) rotate(-5deg); }
  .fan-card:nth-child(3) { transform: translateX(75%) rotate(5deg); }
  .about-title, .about-body, .skills { grid-column: 1 / -1; }
  .about-title, .about-body, .about-portrait { grid-row: auto; }
  .about-portrait { grid-column: 1 / -1; width: min(72vw, 360px); justify-self: center; }
  .foot { grid-template-columns: 1fr auto; row-gap: 14px; }
  .foot-links { justify-self: start; grid-column: 1 / -1; grid-row: 1; }
  .foot-legal { gap: 16px; }
  .legal-body { grid-column: 1 / -1; }
  .skills { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero-pin { position: relative; }
  [data-words] .w { opacity: 1; }
  .films-pin { height: auto; padding: 96px 0; }
  .films-track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; }
  .reel { scroll-snap-align: start; }
  .bleed-video { clip-path: none; }
  body, .bar { transition: none; }
}

/* text for search engines and screen readers only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
