/* ==========================================================================
   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);
}

/* ==========================================================================
   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
   ========================================================================== */

/* Tall wrapper that provides scroll distance for the pinned hero sequence:
   short scroll = header + a peek of the portrait; further scroll = the video
   scrolls away and the portrait rises into full view underneath. */
.hero-pin {
  position: relative;
  height: 230vh;
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

.intro-name {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 28px);
  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;
}

/* Scroll-driven wrapper: carries the video up and away once the user scrolls
   past the initial "header + peek" stage. Kept separate from .intro-video-wrap
   so the scroll-driven tween never fights the load-time rise-in tween. */
.hero-scroll-shift {
  position: absolute;
  top: 50%;
  left: 50%;
  will-change: transform;
}

.intro-video-wrap {
  position: relative;
  width: min(760px, 88vw);
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  overflow: hidden;
  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;
  transform: translateY(90px);
}
.intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0d0d0d;
}

/* Portrait: sits below the video, mostly hidden beyond the sticky
   viewport's bottom edge (clipped by .hero-sticky's overflow:hidden), only
   a sliver visible until scroll brings the full portrait into view. This is
   the site's one and only portrait image. */
.hero-image-peek {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: min(750px, 90vw);
  border-radius: 3px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.hero-image-peek img {
  width: 100%;
  height: auto;
  display: block;
}
html:not(.js) .hero-image-peek {
  position: relative;
  left: auto;
  bottom: auto;
  opacity: 1;
  margin: var(--space-4) auto;
}

/* ==========================================================================
   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-6) var(--header-pad-x) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.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 { display: flex; flex-direction: column; gap: var(--space-2); }

.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;
}

.project-lightbox-info {
  width: min(82vw, 1360px);
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  align-items: flex-start;
}

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

.project-lightbox .project-credits {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #b3ada4;
  text-align: left;
}
.project-lightbox .project-desc {
  display: block;
  flex: 1 1 420px;
  max-width: 620px;
  text-align: left;
  color: #ece7e1;
  font-size: 0.9rem;
  line-height: 1.6;
}
.project-lightbox .project-desc a { color: #fff; }
.project-lightbox .project-desc a:hover { color: var(--grey-tile); }

@media (max-width: 760px) {
  .project-lightbox-info { flex-direction: column; }
  .project-lightbox .project-credits { white-space: normal; }
}

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-email {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(1.75rem, 6vw, 4rem);
  text-decoration: none;
  text-transform: lowercase;
}
.footer-email:hover { color: var(--muted); }
.footer-meta {
  font-size: 0.8rem;
  color: var(--muted);
}
