:root {
  --logo-font-size: 18px;
  --gutter: 40px;
  --edge-margin: 50px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #000;
}

body.hero-consumed #hero {
  height: 0;
  overflow: hidden;
  background: #fff;
}

body.hero-consumed {
  background: #fff;
}

body.subpage-active {
  overflow: hidden;
}

/* ---------- Area 1 — Hero ---------- */

#hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #000;
}

#wordmark {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  color: #fff;
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1;
  will-change: transform;
  transform-origin: top left;
  mix-blend-mode: difference;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}

.wordmark-text {
  display: block;
  will-change: transform;
}

/* ---------- Area 2 — Gallery ---------- */

#gallery {
  position: relative;
  background: #fff;
  color: #000;
}

#site-nav {
  position: fixed;
  top: 24px;
  left: var(--edge-margin);
  width: calc(100vw - (2 * var(--edge-margin)));
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
  mix-blend-mode: difference;
}

#site-nav.is-visible {
  opacity: 1;
  visibility: visible;
}

body.subpage-active #wordmark {
  pointer-events: none;
}

body.subpage-active #site-nav {
  mix-blend-mode: normal;
  background: transparent;
}

body.subpage-active #site-nav a,
body.subpage-active #site-nav .nav-separator {
  color: #000;
}

#site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: baseline;
  width: 100%;
}

#site-nav li {
  display: flex;
  align-items: baseline;
  justify-self: start;
  white-space: nowrap;
  line-height: 1;
}

#site-nav li:nth-child(1) {
  grid-column: 7;
}

#site-nav li:nth-child(2) {
  grid-column: 8;
}

#site-nav li:nth-child(3) {
  grid-column: 9;
}

#site-nav li:nth-child(4) {
  grid-column: 10;
}

#site-nav li:nth-child(5) {
  grid-column: 11;
}

#site-nav li:nth-child(6) {
  grid-column: 12;
}

#site-nav a {
  color: #fff;
  display: inline-block;
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#site-nav a:hover {
  opacity: 0.5;
}

#site-nav .nav-separator {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.15em;
  color: #fff;
}

#gallery-pin {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

#gallery-track {
  display: flex;
  align-items: flex-end;
  gap: var(--gutter);
  padding: 0 var(--edge-margin);
  will-change: transform;
}

.item {
  margin: 0;
  flex: 0 0 auto;
  position: relative;
}

#gallery-track .item[data-subpage] {
  cursor: pointer;
}

#gallery-track .item[data-subpage]:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 8px;
}

.item-visual {
  display: block;
  width: auto;
  background: #ccc;
}

.item[data-ratio="1:1"] .item-visual { aspect-ratio: 1 / 1; }
.item[data-ratio="9:16"] .item-visual { aspect-ratio: 9 / 16; }
.item[data-ratio="16:9"] .item-visual { aspect-ratio: 16 / 9; }
.item[data-ratio="2:3"] .item-visual { aspect-ratio: 2 / 3; }

#gallery-track .item:nth-child(1) .item-visual {
  width: 63vh;
  height: 66.5vh;
  aspect-ratio: auto;
}
#gallery-track .item:nth-child(2) .item-visual { height: 75vh; }
#gallery-track .item:nth-child(3) .item-visual { height: 68vh; }
#gallery-track .item:nth-child(4) .item-visual { height: 75vh; }
#gallery-track .item:nth-child(5) .item-visual { height: 70vh; }

#gallery-track .item:nth-child(2) {
  transform: translateY(5vh);
}

#gallery-track .item:nth-child(3) {
  transform: translateY(3vh);
}

#gallery-track .item:nth-child(4) {
  transform: translateY(6vh);
}

#gallery-track .item:nth-child(5) {
  transform: translateY(3vh);
}

figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 0;
  padding: 0 0 12px 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000;
  z-index: 1;
}

#subpage-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: #fff;
}

#subpage-layer.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#subpage-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

#subpage-view {
  min-height: 100vh;
}

#subpage-shell {
  min-height: calc(100vh + (2 * var(--edge-margin)));
  padding: var(--edge-margin);
}

/* Block in both alignments so `#subpage-main`'s margin-left is always measured
   from the shell's padding edge — a grid column start would double-count it. */
#subpage-shell[data-align="left"],
#subpage-shell[data-align="right"] {
  display: block;
}

#subpage-description {
  display: none;
}

#subpage-shell[data-align="left"] #subpage-description {
  display: block;
}

/* Taken out of flow so it never contributes to `#subpage-main`'s origin.
   The sticky container spanned the full scroll length, so pinning to the
   viewport is equivalent while staying independent of the shell's layout. */
#subpage-description-sticky {
  position: fixed;
  top: 24px;
  left: var(--edge-margin);
  width: var(--subpage-description-width, 240px);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

#subpage-description-sticky p {
  margin: 0;
}

#subpage-main {
  position: relative;
  min-height: calc(100vh + var(--edge-margin));
  /* Lands the anchor tile at the source tile's own viewport Y, so the
     entry/exit tween has zero vertical delta to cover. */
  margin-top: calc(var(--subpage-anchor-top, var(--edge-margin)) - var(--edge-margin));
}

#subpage-main[data-align="left"] {
  width: var(--subpage-anchor-width);
  margin-left: calc(var(--subpage-anchor-left) - var(--edge-margin));
}

#subpage-main[data-align="right"] {
  width: var(--subpage-anchor-width);
  margin-left: calc(var(--subpage-anchor-right) - var(--subpage-anchor-width) - var(--edge-margin));
}

#subpage-anchor {
  margin: 0 0 var(--subpage-stack-gap) 0;
}

#subpage-anchor .item-visual,
#subpage-stack .item-visual {
  width: 100%;
  height: auto;
}

#subpage-stack {
  display: flex;
  flex-direction: column;
  gap: var(--subpage-stack-gap);
  padding-bottom: var(--edge-margin);
}

#subpage-stack .item {
  width: var(--tile-width, 100%);
  align-self: var(--tile-align, flex-start);
}

#subpage-aux-text {
  display: none;
}

#subpage-main[data-align="right"] #subpage-aux-text {
  display: block;
  position: absolute;
  left: 0;
  top: calc(var(--subpage-anchor-height) + var(--subpage-stack-gap));
  width: var(--subpage-aux-width);
  font-size: 13px;
  line-height: 1.45;
}

#subpage-aux-text p {
  margin: 0;
}

.subpage-ghost {
  position: fixed;
  margin: 0;
  z-index: 85;
  pointer-events: none;
  transform-origin: top left;
}

.subpage-ghost .item-visual {
  width: 100%;
  height: 100%;
  background: #ccc;
}

.subpage-ghost figcaption {
  inset: auto auto 0 0;
}

/* ---------- Area 3 — Contact ---------- */

#contact {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #000;
  color: #fff;
  font-weight: 400;
}

#contact-wordmark-band {
  position: absolute;
  left: var(--edge-margin);
  bottom: 5vh;
  width: calc(100vw - (2 * var(--edge-margin)));
  overflow: hidden;
}

#contact-wordmark {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
  color: #fff;
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1;
}

#contact-info {
  position: absolute;
  top: 30vh;
  left: var(--edge-margin);
  width: calc(100vw - (2 * var(--edge-margin)));
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.contact-column {
  font-size: 13px;
  line-height: 1.4;
  justify-self: start;
}

.contact-column p {
  margin: 0;
}

.contact-address {
  grid-column: 1 / span 2;
}

.contact-direct {
  grid-column: 4 / span 2;
}

.contact-links {
  grid-column: 7 / span 2;
}

.contact-social {
  grid-column: 10 / span 2;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-column a {
  color: #fff;
  text-decoration: none;
}

.contact-column a:hover {
  opacity: 0.6;
}
