/* ==========================================================================
   Ulmo Design — tokens
   ========================================================================== */
:root {
  color-scheme: light;
  --paper: #f1f1ec;
  --paper-2: #e6e6df;
  --ink: #141414;
  --ink-2: #4d4d48;
  --rule: #8a8a84;
  --gutter: clamp(16px, 2.3vw, 40px);
  --gap: 0px;            /* mosaic seam */
  --cell: 64px;          /* set by mosaic.js */
  --zoom: 1.22;          /* resting crop factor of a tile */
  --display: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --text: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .5rem .75rem; text-decoration: none;
}
.skip:focus { top: 8px; }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ==========================================================================
   Index — masthead (follows Mockup.jpg)
   ========================================================================== */
.masthead { padding: clamp(22px, 3.4vw, 40px) var(--gutter) 0; }

.wordmark {
  margin: 0;
  display: flex; flex-direction: column; align-items: center;
  font-weight: 400;
  line-height: 1;
  user-select: none;
}
.wordmark__ulmo {
  font-family: var(--display);
  font-size: min(24.6vw, 26rem);
  letter-spacing: -0.058em;
  line-height: .74;
  margin-top: .26em;
  /* optical centring: the negative tracking leaves space after the O */
  margin-right: -0.058em;
}
.wordmark__design {
  font-family: var(--display);
  font-size: min(4.25vw, 4.6rem);
  letter-spacing: .72em;
  margin-right: -.72em;
  margin-top: .66em;
}

.strapline {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin-top: clamp(18px, 3.4vw, 46px);
  font-size: clamp(9px, 1.05vw, 12.5px);
  text-transform: uppercase;
  letter-spacing: .02em;
  font-variation-settings: 'wdth' 92;
}
.strapline p { margin: 0; }

/* ==========================================================================
   Mosaic
   ========================================================================== */
.mosaic {
  --cols: 20;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-auto-rows: var(--cell);
  gap: var(--gap);
  justify-content: center;
  margin: clamp(12px, 2vw, 28px) var(--gutter) 0;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}
.cell { position: relative; contain: layout style; }

.tile {
  position: absolute; left: 50%; top: 50%;
  width: var(--cell); height: var(--cell);
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: var(--paper-2);
  display: block;
  cursor: pointer;
  outline-offset: 0;
}
.tile img {
  position: absolute; left: 50%; top: 50%;
  max-width: none;
  width: calc(var(--cell) * var(--zoom) * var(--aw, 1));
  height: calc(var(--cell) * var(--zoom) * var(--ah, 1));
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease;
}
.tile img.is-loaded { opacity: 1; }
.tile:focus-visible { outline: 2px solid var(--ink); }

/* one orchestrated moment: the mosaic arrives as a wave from the wordmark */
.mosaic.is-arriving .tile {
  animation: tile-in .9s var(--ease-out) both;
  animation-delay: calc(var(--d, 0) * 1ms);
}
@keyframes tile-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.55); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* the floating project label that follows the pointer */
.caption {
  position: fixed; left: 0; top: 0; z-index: 50;
  pointer-events: none;
  background: var(--ink); color: var(--paper);
  padding: 5px 8px 6px;
  font-size: 12.5px; line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .18s ease;
}
.caption.is-on { opacity: 1; }
.caption small { display: block; font-size: 10.5px; opacity: .7; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem;
  margin: clamp(32px, 6vw, 80px) var(--gutter) 0;
  padding: 14px 0 28px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
}
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.foot a { text-decoration: none; border-bottom: 1px solid transparent; }
.foot a:hover { border-color: currentColor; }

/* ==========================================================================
   Project page
   ========================================================================== */
.view--project { padding: 0 var(--gutter) 40px; }
.view--project.is-entering > :not(.p-hero) { animation: fade-in .7s .25s var(--ease-out) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.p-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}
.p-bar__mark { font-family: var(--display); font-size: 22px; letter-spacing: -0.03em; text-decoration: none; line-height: 1; }
.p-bar__mark span { font-size: 9px; letter-spacing: .5em; margin-left: .6em; vertical-align: middle; }
.p-bar nav { display: flex; gap: 1.25rem; }
.p-bar nav a { text-decoration: none; }
.p-bar nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

.p-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.6rem, 9.2vw, 9.5rem);
  line-height: .86; letter-spacing: -0.035em;
  text-transform: uppercase;
  margin: clamp(28px, 5vw, 72px) 0 0;
  max-width: 14ch;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.p-meta {
  display: flex; justify-content: space-between; gap: 1rem;
  margin: clamp(16px, 2vw, 26px) 0 clamp(14px, 1.6vw, 20px);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .02em;
  font-variation-settings: 'wdth' 92;
}
.p-meta p { margin: 0; }

.p-hero { margin: 0; position: relative; background: var(--paper-2); }
.p-hero img { width: 100%; height: min(78vh, 62vw); object-fit: cover; }

.p-text {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem clamp(24px, 5vw, 96px);
  padding: clamp(36px, 6vw, 96px) 0;
}
.p-lede {
  margin: 0; font-size: clamp(1.25rem, 2.1vw, 1.9rem); line-height: 1.22;
  letter-spacing: -0.01em; font-weight: 500; max-width: 22ch;
  font-variation-settings: 'wdth' 96;
}
.p-body { max-width: var(--measure); }
.p-body p { margin: 0 0 1em; color: var(--ink-2); }
.p-link {
  display: inline-flex; align-items: center; gap: .5em;
  margin-top: .5rem; padding: .7rem 1rem;
  background: var(--ink); color: var(--paper); text-decoration: none; font-size: 14px;
}
.p-link:hover { background: #000; }
.p-link svg { width: 12px; height: 12px; }

.p-flow { display: grid; gap: var(--gutter); }
.p-flow figure { margin: 0; background: var(--paper-2); cursor: zoom-in; }
.p-flow img { width: 100%; height: auto; }
.p-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); align-items: start; }
.p-embed { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
.p-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.p-next {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem 2rem;
  margin-top: clamp(48px, 8vw, 120px);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.p-next__label { font-size: 13px; grid-column: 1 / -1; }
.p-next__title {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 5.5rem); line-height: .9; letter-spacing: -0.03em;
  transition: letter-spacing .5s var(--ease-out);
}
.p-next img { width: clamp(120px, 22vw, 320px); aspect-ratio: 4 / 3; object-fit: cover; }
.p-next:hover .p-next__title { letter-spacing: -0.01em; }

/* travelling image used for the tile → hero transition */
.fly {
  position: fixed; z-index: 60; overflow: hidden; pointer-events: none;
  background: var(--paper-2);
}
.fly img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: none; }

/* ==========================================================================
   Flagship — City Apartments
   ========================================================================== */
.fx-title {
  position: relative;
  margin: clamp(20px, 4vw, 56px) 0 0;
  aspect-ratio: 1000 / 244;
  overflow: hidden;
}
.fx-title video { position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); object-fit: cover; }
.fx-title__knock { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-title__knock text { font-family: var(--display); letter-spacing: -4px; }

.fx-stage { position: relative; background: var(--ink); color: var(--paper); }
.fx-stage__video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.fx-stage__video video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .9s ease;
}
.fx-stage__video video.is-on { opacity: 1; }
.fx-stage__ui {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 12px clamp(12px, 1.6vw, 20px);
  font-size: 13px;
}
.fx-stage__ui p { margin: 0; }
.fx-rotate { display: flex; gap: 6px; }
.fx-rotate button {
  width: 44px; height: 44px; border: 1px solid rgba(241, 241, 236, .45); background: transparent;
  cursor: pointer; display: grid; place-items: center;
}
.fx-rotate button:hover { background: var(--paper); color: var(--ink); }
.fx-rotate svg { width: 16px; height: 16px; }
.fx-dots { display: flex; gap: 6px; }
.fx-dots i { width: 22px; height: 2px; background: rgba(241, 241, 236, .3); }
.fx-dots i.is-on { background: var(--paper); }

.fx-h {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.8rem, 4.6vw, 4.2rem); line-height: .9; letter-spacing: -0.03em;
  margin: 0 0 clamp(18px, 2.4vw, 32px);
  max-width: 16ch;
}

/* build-out: scroll scrubs through the construction frames */
.fx-build { position: relative; height: 320vh; margin-top: clamp(48px, 8vw, 120px); }
.fx-build__sticky {
  position: sticky; top: 52px; height: calc(100vh - 52px);
  display: grid; grid-template-rows: auto 1fr auto; gap: 14px; padding: 18px 0 20px;
}
.fx-build__frames { position: relative; overflow: hidden; background: var(--paper-2); }
.fx-build__frames img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; will-change: opacity; }
.fx-build__frames img:first-child { opacity: 1; }
.fx-build__bar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.fx-build__bar i { height: 3px; background: var(--paper-2); position: relative; overflow: hidden; }
.fx-build__bar i b { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); }
.fx-build__cap { display: flex; justify-content: space-between; font-size: 13px; }
.fx-build__cap strong { font-weight: 600; }

.fx-steps { list-style: none; margin: clamp(48px, 8vw, 120px) 0 0; padding: 0; display: grid; gap: clamp(36px, 5vw, 72px); }
.fx-step { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 64px); align-items: center; }
.fx-step:nth-child(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.fx-step:nth-child(even) .fx-step__media { order: -1; }
[tabindex="-1"]:focus { outline: none; }
.fx-step__n { font-family: var(--display); font-size: clamp(3rem, 8vw, 7rem); line-height: .8; letter-spacing: -0.04em; }
.fx-step h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); line-height: 1.15; margin: .6em 0 .4em; font-weight: 600; }
.fx-step p { margin: 0; color: var(--ink-2); max-width: 32rem; }
.fx-step__media { background: var(--paper-2); aspect-ratio: 16 / 10; overflow: hidden; }
.fx-step__media img, .fx-step__media video { width: 100%; height: 100%; object-fit: cover; }
.fx-step__media--plan { background: #fff; }
.fx-step__media--plan img { object-fit: contain; padding: 4%; }

.fx-gallery { margin-top: clamp(48px, 8vw, 120px); }
.fx-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gutter); }
.fx-grid figure { margin: 0; background: var(--paper-2); cursor: zoom-in; overflow: hidden; }
.fx-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.fx-grid figure:hover img { transform: scale(1.03); }
.fx-grid .w6 { grid-column: span 6; }
.fx-grid .w4 { grid-column: span 4; }
.fx-grid .w3 { grid-column: span 3; }
.fx-grid .w2 { grid-column: span 2; }

.fx-cta {
  margin-top: clamp(64px, 10vw, 160px);
  background: var(--ink); color: var(--paper);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch;
  text-decoration: none; overflow: hidden;
}
.fx-cta__text { padding: clamp(24px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.fx-cta__text p { margin: 0; max-width: 28rem; color: rgba(241, 241, 236, .75); }
.fx-cta__big {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(2rem, 5.4vw, 5.2rem); line-height: .88; letter-spacing: -0.03em;
}
.fx-cta__url { display: inline-flex; align-items: center; gap: .6em; font-size: clamp(1rem, 1.6vw, 1.3rem); border-bottom: 1px solid currentColor; align-self: flex-start; padding-bottom: 2px; }
.fx-cta__url svg { width: .8em; height: .8em; transition: transform .4s var(--ease-out); }
.fx-cta:hover .fx-cta__url svg { transform: translate(3px, -3px); }
.fx-cta video { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 20, 20, .96); color: var(--paper);
  display: grid; grid-template-rows: auto 1fr;
}
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: 12px var(--gutter); font-size: 13px; }
.lightbox__bar button { background: none; border: 1px solid rgba(241,241,236,.4); color: var(--paper); padding: .45rem .8rem; cursor: pointer; }
.lightbox__stage { position: relative; display: grid; place-items: center; padding: 0 var(--gutter) var(--gutter); min-height: 0; }
.lightbox__stage img { max-width: 100%; max-height: calc(100vh - 80px); object-fit: contain; }
.lightbox__nav { position: absolute; top: 0; bottom: 0; width: 30%; border: 0; background: none; cursor: pointer; }
.lightbox__nav--prev { left: 0; cursor: w-resize; }
.lightbox__nav--next { right: 0; cursor: e-resize; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 760px) {
  .p-text { grid-template-columns: 1fr; }
  .p-pair { grid-template-columns: 1fr; }
  .p-next { grid-template-columns: 1fr; }
  .p-next img { width: 100%; }
  .fx-step, .fx-step:nth-child(even) { grid-template-columns: 1fr; }
  .fx-step:nth-child(even) .fx-step__media { order: 0; }
  .fx-grid .w4, .fx-grid .w3, .fx-grid .w2 { grid-column: span 6; }
  .fx-cta { grid-template-columns: 1fr; }
  .fx-build { height: 260vh; }
  .fx-stage__ui { flex-wrap: wrap; }
  .p-meta { flex-direction: column; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mosaic.is-arriving .tile { animation: none; }
  .view--project.is-entering > * { animation: none; }
  * { scroll-behavior: auto !important; }
}
