/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #fbf7f5;
  --fg: #15130f;
  --fg-soft: #3f3a34;
  --muted: #8f867a;
  --line: #e6ddd2;
  --overlay: rgba(251, 247, 245, 0.88);
  --grey-tile: #d6d1c9;

  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;

  --ease-out: cubic-bezier(0.16, 0.84, 0.44, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;

  --header-pad-x: clamp(20px, 4vw, 48px);

  /* Grainy texture used behind media for the diagonal drop shadows. */
  --shadow-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; border: none; background: none; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 12px 20px;
  z-index: 1000;
}
.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

/* Respect reduced motion globally at the CSS level too */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--header-pad-x);
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
  mix-blend-mode: normal;
}
.site-header.is-visible {
  pointer-events: auto;
}
html:not(.js) .site-header {
  opacity: 1;
  transform: none;
  position: static;
}

/* Short gradient scrim behind the header so it stays legible over media   */
/* scrolling underneath it — sits above the page, below the header's text. */
/* Solid zone matches the header's own box (equal space above/below the    */
/* text); only a short band below that fades out to reveal scrolling media.*/
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 104px;
  background: linear-gradient(to bottom, var(--bg) 0px, var(--bg) 72px, rgba(251, 247, 245, 0) 104px);
  z-index: -1;
  pointer-events: none;
}

.header-name,
.header-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: clamp(0.7rem, 1vw, 0.85rem);
  text-transform: uppercase;
}
.header-title { color: var(--muted); }

@media (max-width: 640px) {
  .header-title { display: none; }
}

.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 24px;
  cursor: pointer;
}
.menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--fg);
  transition: transform 0.3s var(--ease-in-out), opacity 0.3s var(--ease-in-out);
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-panel {
  position: fixed;
  top: 0; right: var(--header-pad-x);
  z-index: 99;
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: none;
  padding: 96px var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0.25s;
}
.nav-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}
.nav-panel a {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.1rem;
  text-decoration: none;
}
.nav-panel a:hover { color: var(--muted); }

/* ==========================================================================
   Hero / Intro
   ========================================================================== */

/* A normal section — no pinning/scroll-jacking. It scrolls away like any
   other section once the user keeps scrolling, and a small persistent gap
   (this section's own bottom margin + .about-section's top padding) always
   separates it from the portrait below. */
.hero-section {
  position: relative;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: var(--space-3);
  /* Reserves clearance so the fixed header (which can stay visible even
     when scrolled back to the very top) never overlaps the video. */
  padding-top: 120px;
}

@media (max-width: 640px) {
  /* The video is width-driven (no max-height clamp) at this size, so it
     renders much shorter — centering it in a full 100svh section leaves a
     large empty band above and below it. Shrink the section so the video
     sits higher, closer to the header, with a tighter (but still visible)
     gap before the resting logo. */
  .hero-section {
    height: 46svh;
    min-height: 320px;
  }
  .hero-logo-rest {
    padding: var(--space-2) 0;
  }
}

.intro-name {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Same word-spacing the plain name-only layout used — the logo replaces
     "ORMANN"'s leading N rather than sitting in extra space, so it never
     needs (or should have) a wider gap than a normal word gap. Scales
     together with the text via fitIntroName() at every viewport width. */
  --intro-name-gap: clamp(10px, 3vw, 28px);
  gap: var(--intro-name-gap);
  width: 100%;
  padding: 0 var(--space-2);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 11vw, 9.5rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
  will-change: transform, opacity;
}

/* Logo mark: stands in for the leading "N" of "ORMANN". Deliberately sized
   bigger than the text's own cap-height (not matched to it) — a different
   typeface reading the same size as the letters just looks like it's trying
   (and failing) to blend in; oversized, it reads clearly as a mark instead.
   Fades out with the rest of the name on split — never moves or leaves
   .intro-name, so it can't shift the row's layout. */
.hero-logo {
  height: clamp(2.4rem, 12vw, 10.5rem);
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* Pulls flush against the logo (cancelling the row's normal word-gap on
   this one side) so "[logo]ORMANN" reads as a single fused word. */
.name-right {
  margin-left: calc(-1 * var(--intro-name-gap));
}

/* Independent resting mark between the hero video and the self-portrait —
   a separate image from the one in the name, not driven by the intro
   timeline at all. It just uses the site's standard reveal-up treatment. */
.hero-logo-rest {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) 0;
}
.hero-logo-rest-img {
  /* Fixed on purpose — this mark should read at the same size regardless of
     window width, not scale down as the browser narrows. */
  height: 90px;
  width: auto;
  display: block;
}

.intro-video-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, 88vw);
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  box-shadow: 0 30px 80px -30px rgba(21, 19, 15, 0.25);
  will-change: transform, opacity;
}
@media (min-width: 900px) {
  .intro-video-wrap {
    width: min(1500px, 92vw);
    max-height: 76vh;
  }
}
html.js .intro-video-wrap {
  opacity: 0;
}
/* Grainy diagonal shadow. A plain child of .intro-video-wrap, so it fades in
   together with it automatically (same animated opacity) instead of showing
   up early, before the video itself is visible. */
.intro-video-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 3px;
  transform: translate(18px, 22px);
  background-image:
    linear-gradient(135deg, rgba(20, 17, 14, 0.5), rgba(20, 17, 14, 0.28)),
    var(--shadow-noise);
  background-blend-mode: multiply;
  background-size: cover, 180px 180px;
  filter: blur(14px);
  opacity: 0.7;
}
.intro-video {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  background: #0d0d0d;
}

/* ==========================================================================
   Reveal-up utility (all elements entering from the bottom)
   ========================================================================== */
.reveal-up {
  opacity: 1; /* visible by default: only hidden once JS confirms it will animate it in */
  transform: none;
}
html.js .reveal-up {
  opacity: 0;
  transform: translateY(60px);
}

/* ==========================================================================
   About section
   ========================================================================== */
.about-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-5) var(--header-pad-x) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.about-image {
  position: relative;
  width: min(680px, 90vw);
}
/* Shadow is a plain child, so it fades in together with the image's own
   reveal-up opacity animation automatically. */
.about-image::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 3px;
  transform: translate(14px, 18px);
  background-image:
    linear-gradient(135deg, rgba(20, 17, 14, 0.5), rgba(20, 17, 14, 0.28)),
    var(--shadow-noise);
  background-blend-mode: multiply;
  background-size: cover, 160px 160px;
  filter: blur(12px);
  opacity: 0.65;
}
.about-image img {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
}
.about-text {
  max-width: 620px;
  text-align: center;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--fg-soft);
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--space-5) var(--header-pad-x) var(--space-6);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin: 0 0 var(--space-4);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3) var(--space-3);
}
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .projects-grid { grid-template-columns: 1fr; }
}

.project-tile { position: relative; display: flex; flex-direction: column; gap: var(--space-2); }

/* Small, short grainy shadow behind each tile's video frame — sits on the
   tile (which doesn't clip) so it isn't cut off by .project-frame's own
   overflow:hidden. Matches the frame's box via the same aspect-ratio. */
.project-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  aspect-ratio: 4 / 3;
  z-index: -1;
  border-radius: 2px;
  transform: translate(7px, 9px);
  background-image:
    linear-gradient(135deg, rgba(20, 17, 14, 0.45), rgba(20, 17, 14, 0.22)),
    var(--shadow-noise);
  background-blend-mode: multiply;
  background-size: cover, 140px 140px;
  filter: blur(7px);
  opacity: 0.55;
}

.project-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 2px;
  background: #0c0c0c;
  cursor: pointer;
}
.project-frame:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}
.project-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2);
  background: var(--overlay);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.project-frame:hover .project-overlay,
.project-frame:focus-visible .project-overlay {
  opacity: 1;
}
.project-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: clamp(0.85rem, 1.3vw, 1.1rem);
}

.project-desc {
  font-size: 0.9rem;
  line-height: 1.55;
}
.project-desc a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Project lightbox: enlarged video (70-90% of viewport) with the
   description revealed underneath — only while a project is expanded. */
.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--header-pad-x);
  background: rgba(12, 10, 8, 0.94);
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  transition: opacity 0.35s var(--ease-out);
}
.project-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.project-lightbox-media {
  width: min(82vw, 1360px);
  max-height: 60vh;
  aspect-ratio: 16 / 9;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.project-lightbox-media .project-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Stacked title -> description -> credits, centered as a single reading
   column under the video (credits last and small, per the site's format). */
.project-lightbox-info {
  width: min(720px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Title + credits + description are hidden in the grid — they only appear
   once a project is expanded into the lightbox. */
.project-tile .project-lightbox-title,
.project-tile .project-credits,
.project-tile .project-desc {
  display: none;
}

.project-lightbox-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
}
.project-lightbox .project-lightbox-title {
  display: block;
  color: #fff;
}

.project-lightbox .project-desc {
  display: block;
  text-align: left;
  color: #ece7e1;
  font-size: 0.95rem;
  line-height: 1.65;
}
.project-lightbox .project-desc a { color: #fff; }
.project-lightbox .project-desc a:hover { color: var(--grey-tile); }

.project-lightbox .project-credits {
  display: block;
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  line-height: 1.6;
  color: #8a847c;
}

body.video-expanded { overflow: hidden; }

.video-expand-close {
  position: fixed;
  top: var(--space-3);
  right: var(--header-pad-x);
  z-index: 210;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
}
.video-expand-close.is-visible { display: flex; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer-section {
  min-height: 60svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--header-pad-x);
  text-align: center;
}
.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.footer-lead {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: normal;
  font-size: clamp(1.3rem, 4.4vw, 2.85rem);
  text-transform: lowercase;
  color: var(--fg-soft);
}
.footer-email {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(1.5rem, 5vw, 3.25rem);
  text-transform: lowercase;
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), color 0.3s var(--ease-out);
}
.footer-email:hover,
.footer-email:focus-visible {
  color: var(--muted);
  transform: translateY(-4px);
}
.footer-meta {
  font-size: 0.8rem;
  color: var(--muted);
}
