/* ---------------------------------------------------------------
   Aurora Visions — scroll-held hero
   --------------------------------------------------------------- */

:root {
  --paper:   #ffffff;
  --shade:   #140e0c;          /* warm near-black, pulled from the clouds */
  --rose:    #e9c6b8;          /* icon tint, sampled from the cloud highlights */

  --line:    rgba(255, 255, 255, .16);
  --dim:     rgba(255, 255, 255, .72);

  --gutter:  clamp(20px, 4vw, 56px);
  --ease:    cubic-bezier(.22, 1, .36, 1);

  --serif:   "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:    "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* white type on moving footage: a soft dark halo keeps it readable
     wherever the clouds run bright */
  --halo:    0 1px 2px rgba(20, 14, 12, .34),
             0 2px 22px rgba(20, 14, 12, .30);
}

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

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

body {
  margin: 0;
  background: var(--shade);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

/* beats the display rules on .hero / .footer, for scrub.js's ?only= probe */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

   The section is tall purely to buy scroll distance; the stage inside
   sticks to the viewport and the clip advances across that travel.
   --------------------------------------------------------------- */

.hero {
  position: relative;
  height: 340vh;
  background: var(--shade);
}

.hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter) clamp(20px, 2.8vh, 30px);
  background: var(--shade);
}

/* ---------------------------------------------------------------
   Footage layers
   --------------------------------------------------------------- */

.backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.scrub__canvas,
.scrub__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  z-index: 0;
}

.outro__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
}

/* the <video> only drives the picture until the frame cache is built */
.scrub__video  { opacity: 0; transition: opacity .4s ease; }
.scrub__canvas { opacity: 0; transition: opacity .4s ease; }

.hero__stage.has-frame:not(.is-ready) .scrub__video { opacity: 1; }
.hero__stage.is-ready .scrub__canvas { opacity: 1; }

.backdrop__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  display: block;
  transform: scale(1.14) translateY(2.5%);
  opacity: 0;
  animation: settle 1.9s var(--ease) .1s forwards;
}

@keyframes settle {
  to { transform: scale(1.08) translateY(2.5%); opacity: 1; }
}

/*
  Weighted to the edges, clear through the middle: white type needs a
  floor at top and bottom, but the glider sits centre-frame and should
  keep every bit of contrast the footage has.
*/
.veil {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(20, 14, 12, .52) 0%,
      rgba(20, 14, 12, .20) 13%,
      rgba(20, 14, 12, 0)   30%),
    linear-gradient(to top,
      rgba(20, 14, 12, .82) 0%,
      rgba(20, 14, 12, .64) 14%,
      rgba(20, 14, 12, .42) 26%,
      rgba(20, 14, 12, .16) 38%,
      rgba(20, 14, 12, 0)   52%);
}

/* ---------------------------------------------------------------
   Top bar
   --------------------------------------------------------------- */

/*
  Fixed rather than parked in the hero: it has sections to navigate to now,
  so it has to survive past the footage. Over the clip it rides on its text
  shadow alone; past the hero it takes a backdrop so it stays legible.
*/
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 3vh, 34px) var(--gutter);
  text-shadow: var(--halo);
  transition: background-color .45s var(--ease),
              padding .45s var(--ease),
              border-color .45s var(--ease);
  border-bottom: 1px solid transparent;
}

.topbar.is-stuck {
  padding-block: clamp(14px, 1.8vh, 20px);
  background: rgba(20, 14, 12, .72);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-bottom-color: rgba(255, 255, 255, .1);
  text-shadow: none;
}

.wordmark {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.wordmark__name {
  font-family: var(--serif);
  font-size: clamp(19px, 1.5vw, 25px);
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  /* the tracking adds a trailing gap; pull it back so the mark reads centred */
  margin-right: -.2em;
  line-height: 1;
}

.wordmark__sub {
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: .46em;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: -.46em;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3.4vw, 52px);
}

.nav__link {
  position: relative;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .88);
  padding-bottom: 10px;
  transition: color .35s var(--ease);
}
.nav__link:hover { color: #fff; }

.nav__link.is-active { color: #fff; }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: background-color .4s var(--ease),
              border-color .4s var(--ease),
              color .4s var(--ease);
}
.pill:hover {
  background: #fff;
  border-color: #fff;
  color: var(--shade);
  text-shadow: none;
}

.pill--lg { padding: 16px 36px; font-size: 12px; }

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

.hero__top {
  position: relative;
  z-index: 4;
  text-align: center;
  margin-bottom: clamp(14px, 1.8vh, 22px);
  text-shadow: var(--halo);
  /* `both`, so nothing flashes before the delay. scrub.js drops the
     animation on animationend — a filled animation would otherwise
     outrank the inline opacity the scroll writes. */
  animation: rise 1.15s var(--ease) .45s both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* the glider is bright behind this line — it needs more than the halo */
.hero__top .eyebrow { color: rgba(255, 255, 255, .92); }

.eyebrow {
  margin: 0 0 clamp(14px, 2.2vh, 24px);
  font-size: clamp(10.5px, .85vw, 12.5px);
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  margin-right: -.3em;   /* balance the trailing tracking */
}

.headline {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 3.9rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -.005em;
  text-wrap: balance;
}

.lede {
  margin: clamp(16px, 2.4vh, 26px) auto 0;
  max-width: 46ch;
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 300;
  line-height: 1.65;
  color: rgba(255, 255, 255, .85);
}

/* ---------------------------------------------------------------
   Credential bar
   --------------------------------------------------------------- */

.hero__bottom {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: center;
  animation: rise 1.15s var(--ease) .72s both;
}

.marks {
  width: 100%;
  max-width: 940px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: clamp(18px, 2.6vh, 28px) clamp(8px, 1.5vw, 20px);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 3px;
  background: rgba(255, 255, 255, .07);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.mark {
  position: relative;
  text-align: center;
  padding: 0 clamp(6px, 1.2vw, 18px);
  text-shadow: var(--halo);
}

/* divider, broken where the + sits */
.mark + .mark::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4%;
  bottom: 4%;
  width: 1px;
  background: linear-gradient(to bottom,
    var(--line) 0%,  var(--line) 20%,
    transparent 20%, transparent 44%,
    var(--line) 44%, var(--line) 100%);
}

.mark + .mark::after {
  content: "+";
  position: absolute;
  left: 0;
  top: 32%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, .55);
}

.mark__icon {
  width: clamp(22px, 1.9vw, 27px);
  height: clamp(22px, 1.9vw, 27px);
  color: var(--rose);
  margin-bottom: clamp(10px, 1.6vh, 16px);
}

.mark__title {
  margin: 0 0 6px;
  font-size: clamp(10.5px, .88vw, 13px);
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #fff;
}

.mark__note {
  margin: 0;
  font-size: clamp(10.5px, .88vw, 13px);
  font-weight: 300;
  color: rgba(255, 255, 255, .68);
}

/* ---------------------------------------------------------------
   Second beat, revealed into the climb
   --------------------------------------------------------------- */

.ascent__copy {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: clamp(56px, 10vh, 120px);
  padding-inline: var(--gutter);
  text-align: center;
  opacity: 0;
  text-shadow: var(--halo);
  will-change: opacity, transform;
}

.ascent__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.6vw, 4.1rem);
  font-weight: 400;
  line-height: 1.08;
  text-wrap: balance;
}

.ascent__copy .lede { margin-top: clamp(14px, 2.2vh, 24px); }
.ascent__copy .pill { margin-top: clamp(22px, 3.4vh, 36px); }

/* ---------------------------------------------------------------
   Sections below the hero
   --------------------------------------------------------------- */

.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(84px, 12vh, 150px) var(--gutter);
  /* the top bar is fixed, so an anchor landing at scroll-top lands under it */
  scroll-margin-top: clamp(64px, 8vh, 92px);
}

.section--rule { border-top: 1px solid rgba(255, 255, 255, .09); }

.section__head { max-width: 720px; }

.section__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.6vw, 3.3rem);
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}

.section__intro {
  margin: clamp(16px, 2.2vh, 24px) 0 0;
  max-width: 56ch;
  font-size: clamp(14px, 1.1vw, 16.5px);
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, .7);
}

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

.projects {
  margin-top: clamp(44px, 6vh, 76px);
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.project { border-bottom: 1px solid rgba(255, 255, 255, .12); }

.project__link {
  display: grid;
  grid-template-columns: auto 1.1fr 1.3fr auto auto;
  align-items: center;
  gap: clamp(14px, 2.4vw, 40px);
  padding: clamp(20px, 3vh, 32px) clamp(4px, 1vw, 16px);
  transition: background-color .4s var(--ease), padding-inline .4s var(--ease);
}

.project__link:hover {
  background: rgba(255, 255, 255, .05);
  padding-inline: clamp(10px, 1.8vw, 28px);
}

.project__index {
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--rose);
}

.project__name {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.85rem);
  font-weight: 400;
  line-height: 1.15;
}

.project__craft {
  font-size: clamp(12px, .95vw, 14px);
  font-weight: 300;
  color: rgba(255, 255, 255, .62);
}

.project__year {
  font-size: 12.5px;
  font-weight: 300;
  color: rgba(255, 255, 255, .5);
}

.project__arrow {
  width: 19px;
  height: 19px;
  color: rgba(255, 255, 255, .45);
  transition: transform .45s var(--ease), color .45s var(--ease);
}
.project__link:hover .project__arrow {
  color: #fff;
  transform: translate(3px, -3px);
}

/* ------------------------------------------------------ About */

.about {
  margin-top: clamp(40px, 5.5vh, 68px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 92px);
}

.about__body p {
  margin: 0 0 1.25em;
  max-width: 60ch;
  font-size: clamp(14.5px, 1.15vw, 17px);
  font-weight: 300;
  line-height: 1.78;
  color: rgba(255, 255, 255, .78);
}
.about__body p:last-child { margin-bottom: 0; }

.about__label {
  margin: 0 0 clamp(16px, 2.2vh, 22px);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.skills li {
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 300;
  color: rgba(255, 255, 255, .82);
}
.skills li:first-child { border-top: 1px solid rgba(255, 255, 255, .09); }

.stats {
  margin: clamp(48px, 7vh, 88px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 44px);
  padding-top: clamp(28px, 4vh, 44px);
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.stat__label {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.stat__value {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 400;
  line-height: 1;
  color: var(--rose);
}

/* ---------------------------------------------------- Journal */

.posts {
  margin-top: clamp(44px, 6vh, 76px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2vw, 30px);
}

.post__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(22px, 3vh, 34px);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 3px;
  background: rgba(255, 255, 255, .035);
  transition: background-color .4s var(--ease),
              border-color .4s var(--ease),
              transform .5s var(--ease);
}
.post__link:hover {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .22);
  transform: translateY(-4px);
}

.post__meta {
  margin: 0 0 clamp(18px, 2.6vh, 28px);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.post__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.7vw, 1.5rem);
  font-weight: 400;
  line-height: 1.22;
}

.post__excerpt {
  margin: 12px 0 clamp(20px, 3vh, 30px);
  font-size: clamp(13px, 1vw, 14.5px);
  font-weight: 300;
  line-height: 1.68;
  color: rgba(255, 255, 255, .66);
}

/* pinned to the card floor so the rules line up across uneven titles */
.post__more {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--rose);
}

/* ---------------------------------------------------- Contact */

.section--contact { text-align: center; }

.section--contact .eyebrow { margin-inline: auto; }

.contact__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.6vw, 4.2rem);
  font-weight: 400;
  line-height: 1.1;
}

.contact__intro { margin-inline: auto; }

.contact__mail {
  display: inline-block;
  margin-top: clamp(32px, 4.5vh, 54px);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .3);
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 300;
  transition: border-color .4s var(--ease), color .4s var(--ease);
}
.contact__mail:hover { border-bottom-color: var(--rose); color: var(--rose); }

.contact__actions { margin-top: clamp(28px, 4vh, 44px); }

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

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(30px, 4.5vh, 48px) var(--gutter) clamp(36px, 5vh, 60px);
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.footer .wordmark { justify-items: start; }

.footer__social {
  display: flex;
  gap: clamp(18px, 2.4vw, 34px);
  font-size: 12.5px;
  font-weight: 300;
  color: rgba(255, 255, 255, .72);
}
.footer__social a { transition: color .35s var(--ease); }
.footer__social a:hover { color: #fff; }

.footer__legal {
  margin: 0;
  font-size: 11.5px;
  font-weight: 300;
  color: rgba(255, 255, 255, .42);
}

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

@media (max-width: 980px) {
  .posts { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: clamp(24px, 4vh, 36px); }
  .project__link {
    grid-template-columns: auto 1fr auto;
    row-gap: 8px;
  }
  /* the craft line drops under the name once the row can't hold five columns */
  .project__craft { grid-column: 2 / 4; }
  .project__year  { grid-row: 1; grid-column: 3; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .marks { max-width: 520px; grid-template-columns: repeat(2, 1fr); row-gap: clamp(18px, 3vh, 28px); }
  /* only the second column carries a divider once it wraps to 2-up */
  .mark:nth-child(odd) + .mark::before,
  .mark:nth-child(odd) + .mark::after { display: block; }
  .mark:nth-child(3)::before,
  .mark:nth-child(3)::after { display: none; }
}

@media (max-width: 560px) {
  .pill { padding: 12px 22px; font-size: 10.5px; }
  .marks { grid-template-columns: 1fr; max-width: 320px; row-gap: 22px; }
  .mark + .mark::before,
  .mark + .mark::after { display: none; }
  .hero { height: 300vh; }
}

/* ---------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  .backdrop__video { transform: scale(1.08) translateY(2.5%); opacity: 1; }
  /* no scrub: the hero collapses back to a single looping screen */
  .hero { height: 100svh; }
  .ascent__copy { display: none; }
}
