/* Palette pulled from the film: dusk sky, spire shadow, sun, dunes. */
:root {
  --dusk: #1f1626;
  --dusk-2: #2c1f33;
  --haze: #b7a6d3;
  --sun: #ffe3a3;
  --dune: #e09a4a;
  --sand: #e9b677;
  --umber: #2b1a14;
  --umber-2: #5a3a2a;
  --plum: #3b2448;
  --text-on-dusk: #f3e6d3;

  --gutter: clamp(16px, 5vw, 72px);
  --measure: 34rem;
  --ease-out: cubic-bezier(.2, .7, .1, 1);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }
html.is-intro { overflow: hidden; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--umber);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--dune);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: .5rem 1rem;
  background: var(--sun);
  color: var(--dusk);
}
.skip-link:focus { top: 12px; }

/* ---------- Masthead ---------- */

.masthead {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 22px var(--gutter);
  color: var(--text-on-dusk);
}
.mark {
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  letter-spacing: -.01em;
  text-decoration: none;
}
.masthead nav { display: flex; gap: clamp(.9rem, 2.4vw, 2rem); }
.masthead nav a {
  font-size: .95rem;
  text-decoration: none;
  color: color-mix(in srgb, var(--text-on-dusk) 78%, transparent);
}
.masthead nav a:hover { color: var(--sun); }
.is-intro .masthead nav { opacity: 0; pointer-events: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: clip;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(44vw, 74svh);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 110px var(--gutter) 72px;
  background: var(--dusk);
  color: var(--text-on-dusk);
}

/* A tiny canvas mirrors the film; blown up and blurred it becomes the room's light. */
.glow {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  filter: blur(70px) saturate(1.25);
  opacity: .5;
  pointer-events: none;
  /* Fade out before the hero ends so the horizon band picks up clean dusk. */
  -webkit-mask-image: linear-gradient(#000 55%, transparent 88%);
  mask-image: linear-gradient(#000 55%, transparent 88%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 20% 40%, rgba(31, 22, 38, .55), rgba(31, 22, 38, .1) 70%);
  pointer-events: none;
}
.hero > :not(.glow) { position: relative; z-index: 1; }

.headline {
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-size: clamp(2.6rem, 6.2vw, 6.2rem);
  line-height: .94;
  letter-spacing: -.025em;
  color: var(--sun);
  text-wrap: balance;
}
.headline .line { display: block; }

.lede {
  max-width: var(--measure);
  margin-top: clamp(1.4rem, 3vw, 2.2rem);
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  color: var(--text-on-dusk);
}

.film {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
.film video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: var(--dusk-2);
  box-shadow: 0 40px 120px -30px rgba(224, 154, 74, .45);
}
/* Once the intro is over, the film itself is the replay control. */
.is-landed .film video { cursor: pointer; }

.overlay-btn {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: .5rem .9rem;
  border: 1px solid rgba(255, 227, 163, .35);
  border-radius: 999px;
  background: rgba(31, 22, 38, .55);
  backdrop-filter: blur(8px);
  color: var(--text-on-dusk);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.overlay-btn:hover { border-color: var(--sun); color: var(--sun); }

/* A click anywhere skips the intro. */
.is-intro body { cursor: pointer; }

/* Intro: the film fills the screen, everything else waits.
   Only the video goes fixed; the figure keeps its spot in the layout. */
.is-intro .film video {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100vw;
  height: 100svh;
  object-position: 50% 38%;
  border-radius: 0;
  box-shadow: none;
}
/* Tall screens: a full-width square beats cropping away the climber. */
@media (max-aspect-ratio: 1/1) {
  .is-intro .film video {
    height: 100vw;
    margin: auto;
  }
}
/* Mid-flight from full screen to its place beside the headline. */
.film video.is-flying {
  position: fixed;
  inset: auto;
  z-index: 20;
  margin: 0;
}

.js .hero-copy .line,
.js .hero-copy .lede {
  opacity: 0;
  transform: translateY(.6em);
}
.is-landed .hero-copy .line,
.is-landed .hero-copy .lede {
  opacity: 1;
  transform: none;
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 140ms + 200ms);
}
.hero-copy .line:nth-child(2) { --i: 1; }
.hero-copy .line:nth-child(3) { --i: 2; }
.hero-copy .lede { --i: 3.5; }

/* Sky to sand: the page lands where the climber did. */
.horizon {
  height: clamp(120px, 22vh, 240px);
  background: linear-gradient(var(--dusk), #4a2a3a 28%, #a3533a 62%, var(--dune) 84%, var(--sand));
}

/* ---------- Shared section frame ---------- */

.work,
.stack,
.climbing {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(4rem, 9vw, 8rem) var(--gutter);
}

.section-head h2,
.contact h2 {
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  line-height: 1;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.section-head p {
  max-width: 28rem;
  margin-top: 1.1rem;
  color: var(--umber-2);
}
@media (min-width: 900px) {
  .section-head { position: sticky; top: 3rem; align-self: start; }
}

.tools {
  margin-top: .6rem;
  font-variation-settings: "wdth" 72;
  font-weight: 600;
  font-size: 1rem;
  color: var(--umber-2);
}

/* ---------- Work ---------- */

.project-shot {
  display: block;
  margin-bottom: 1.2rem;
}
.project-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 30px 80px -30px rgba(43, 26, 20, .55);
}

.project {
  padding: 1.6rem 0 1.8rem;
  border-top: 1px solid color-mix(in srgb, var(--umber) 22%, transparent);
}
.project:first-child { border-top: 0; padding-top: 0; }
.project h3 {
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -.015em;
}
.project h3 a {
  text-decoration: none;
  background: linear-gradient(var(--plum), var(--plum)) 0 100% / 0 3px no-repeat;
  transition: background-size .35s var(--ease-out);
}
.project h3 a:hover,
.project h3 a:focus-visible { background-size: 100% 3px; }
.outcome { max-width: var(--measure); margin-top: .5rem; }

/* ---------- Stack ---------- */

.stack { border-top: 1px solid color-mix(in srgb, var(--umber) 22%, transparent); }

.kit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 2rem 2.5rem;
}
.kit dt {
  font-weight: 750;
  font-variation-settings: "wdth" 115;
  font-size: 1.2rem;
}
.kit dd { margin-top: .3rem; color: var(--umber-2); }

/* ---------- Climbing ---------- */

.climbing { border-top: 1px solid color-mix(in srgb, var(--umber) 22%, transparent); }

.reel {
  position: relative;
  justify-self: center;
  width: min(100%, calc(82svh * 9 / 16));
  aspect-ratio: 9 / 16;
}
.reel video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: var(--dusk);
  box-shadow: 0 30px 80px -30px rgba(43, 26, 20, .55);
}

/* ---------- Contact: night falls again ---------- */

.contact {
  padding: clamp(6rem, 14vw, 11rem) var(--gutter) 2.5rem;
  background:
    linear-gradient(var(--sand), var(--dune) 6%, #a3533a 16%, #4a2a3a 30%, var(--dusk) 46%);
  color: var(--text-on-dusk);
}
.contact h2 { color: var(--sun); }
/* Photo beside the text, the pair centered on the page. */
.contact-inner {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-top: clamp(4rem, 10vw, 8rem);
}
.headshot {
  display: block;
  width: clamp(9rem, 18vw, 16rem);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}
.contact-inner p {
  max-width: var(--measure);
  margin-top: 1.1rem;
}
@media (max-width: 640px) {
  .contact-inner { grid-template-columns: 1fr; justify-items: start; }
  .headshot { width: 8rem; }
}
.email {
  display: inline-block;
  margin-top: 2.2rem;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-size: clamp(1.4rem, 4.6vw, 3.6rem);
  letter-spacing: -.02em;
  color: var(--sun);
  text-decoration-thickness: 3px;
  text-underline-offset: .18em;
  overflow-wrap: anywhere;
}
.email:hover { color: #fff1cc; }
.resume { margin-top: 1.6rem; }
.resume-btn {
  display: inline-block;
  padding: .75rem 1.3rem;
  border: 1.5px solid color-mix(in srgb, var(--sun) 55%, transparent);
  border-radius: 6px;
  color: var(--sun);
  font-weight: 700;
  font-size: 1rem;
  font-variation-settings: "wdth" 112;
  text-decoration: none;
  transition: border-color .2s, background-color .2s;
}
.resume-btn:hover {
  border-color: var(--sun);
  background: color-mix(in srgb, var(--sun) 10%, transparent);
}
.fine {
  margin-top: clamp(4rem, 10vw, 7rem);
  text-align: center;
  font-size: .9rem;
  color: var(--haze);
}

/* ---------- Small screens ---------- */

@media (max-width: 899px) {
  .hero {
    grid-template-columns: 1fr;
    align-content: start;
    padding-top: 84px;
    gap: 2rem;
  }
  .film { order: -1; }
  .work, .stack, .climbing { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .masthead nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .is-landed .hero-copy .line,
  .is-landed .hero-copy .lede { transition: none; }
}
