:root {
  --paper: #ECE7DB;
  --ink: #141310;
  --muted: #6B665A;
  --line: rgba(20, 19, 16, 0.18);
  --accent: #D9371A;
  --gutter: clamp(16px, 2.75vw, 40px);
  --gap: 4px;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--paper); }

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

.top { padding: clamp(10px, 1.6vw, 24px) var(--gutter) 0; }

.wordmark {
  margin: 0;
  overflow: hidden;
  line-height: 0.78;
  font-size: 13.2vw; /* refined by script to fit exactly */
  font-weight: 900;
  font-stretch: 112%;
  letter-spacing: -0.035em;
  white-space: nowrap;
  padding: 0.06em 0 0.05em;
}
.wordmark span { display: inline-block; transform-origin: left bottom; }

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  padding: clamp(18px, 2.6vw, 40px) 0 clamp(20px, 2.8vw, 44px);
}

.status { margin: 0; font-size: 15px; font-weight: 400; min-height: 1.45em; }
.status a { text-decoration: none; }
.status a:hover { color: var(--accent); }
.status .s-site { font-weight: 700; }
.status .s-label { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.filters a { text-decoration: none; }
.filters a, .filters button {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.filters a:hover, .filters button:hover { border-bottom-color: currentColor; }
.filters button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Wall ---------- */

.wall { padding: 0 var(--gutter); }
.cols { display: flex; align-items: flex-start; gap: var(--gap); }
.feature { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.feature .tile { aspect-ratio: 16 / 10; }
.feature video { display: block; width: 100%; height: 100%; object-fit: contain; background: #0b0d10; transition: transform 0.3s ease; }
@media (max-width: 860px) { .feature { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .feature { grid-template-columns: 1fr; } }
@media (hover: hover) { .tile:hover video { transform: none; } }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }

.tile {
  display: block;
  width: 100%;
  overflow: hidden;
  background: rgba(20, 19, 16, 0.08);
  cursor: zoom-in;
}
.tile[hidden] { display: none; }
.tile img { display: block; width: 100%; height: auto; transition: transform 0.3s ease; }
.tile:focus-visible { outline-offset: -2px; }
@media (hover: hover) {
  .tile:hover img { transform: scale(1.04); }
}

/* ---------- Statement ---------- */

.statement { padding: clamp(28px, 3.5vw, 56px) var(--gutter) 0; }
.statement p {
  margin: 0;
  max-width: 22em;
  font-size: clamp(22px, 3.4vw, 54px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* ---------- Project index ---------- */

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.index { padding: 0 var(--gutter); }
.partner-title { margin-top: clamp(40px, 5vw, 72px); }
.projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.projects a {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
  gap: 8px 32px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding 0.25s ease, color 0.2s ease;
}
.projects a:hover { color: var(--accent); padding-left: 12px; }
.p-num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.p-name { font-size: clamp(20px, 2.2vw, 32px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.p-what { color: var(--muted); max-width: 46ch; }
.projects a:hover .p-what { color: var(--ink); }
.p-url { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

@media (max-width: 860px) {
  .projects a { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .p-what, .p-url { grid-column: 2; }
}

/* ---------- Facts ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 40px 32px;
  padding: clamp(24px, 3vw, 48px) var(--gutter) clamp(28px, 3.5vw, 56px);
}
.facts ul { list-style: none; margin: 0; padding: 0; }
.facts li { font-size: 15px; font-weight: 500; padding: 2px 0; }
@media (max-width: 860px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .facts { grid-template-columns: 1fr; } }

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

.contact {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(28px, 3.5vw, 52px) var(--gutter) 20px;
}
.contact .eyebrow { color: rgba(236, 231, 219, 0.6); }
.cta {
  display: inline-block;
  font-size: clamp(30px, 5.6vw, 96px);
  font-weight: 900;
  font-stretch: 112%;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-decoration: none;
  transition: color 0.2s ease;
}
.cta:hover { color: var(--accent); }
.cta span { font-weight: 400; }
.cta-alt {
  display: flex; flex-wrap: wrap; gap: 10px 36px;
  margin: clamp(12px, 1.4vw, 20px) 0 0;
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 600;
}
.cta-alt a { text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; }
.cta-alt a:hover { color: var(--accent); }
.cta-alt .wa-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.5em 1.15em;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cta-alt .wa-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.live {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin: clamp(22px, 2.6vw, 36px) 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(236, 231, 219, 0.6);
}
.live a, .live span { color: var(--paper); text-decoration: none; }
.live a:hover { color: var(--accent); }
.brand {
  display: block;
  width: clamp(150px, 15vw, 230px);
  height: auto;
  margin: clamp(22px, 2.6vw, 36px) 0 0;
}
.live + .brand + .foot { margin-top: 16px; }
.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: clamp(22px, 2.6vw, 36px);
  padding-top: 18px;
  border-top: 1px solid rgba(236, 231, 219, 0.2);
  font-family: var(--mono);
  font-size: 12px;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ---------- Viewer ---------- */

.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(20, 19, 16, 0.96);
  color: var(--paper);
  cursor: zoom-out;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgba(20, 19, 16, 0.6); }
.viewer-bar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 10px 24px;
  padding: 14px var(--gutter);
  font-size: 16px;
}
.viewer-bar p { margin: 0; }
.viewer-title strong { font-weight: 800; margin-right: 12px; }
.viewer-title span { color: rgba(236, 231, 219, 0.6); }
.viewer-actions { display: flex; align-items: center; gap: 22px; margin-left: auto; font-family: var(--mono); font-size: 13px; }
.viewer-actions #v-count { color: rgba(236, 231, 219, 0.6); }
.viewer-actions a { text-decoration: none; cursor: pointer; }
.viewer-actions a:hover { color: var(--accent); }
.v-close {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
}
.v-close:hover { background: var(--accent); color: var(--paper); }
.viewer-stage {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 var(--gutter) 28px;
}
.viewer-stage img {
  justify-self: center;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  cursor: default;
}
.v-nav {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(236, 231, 219, 0.45);
}
.v-nav:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
@media (max-width: 640px) {
  .viewer-stage { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; padding-bottom: 20px; }
  .viewer-stage img { grid-column: 1 / -1; grid-row: 1; }
  #v-prev { grid-row: 2; justify-self: end; }
  #v-next { grid-row: 2; justify-self: start; }
  .viewer-actions { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile img { transition: none; }
  .projects a { transition: none; }
}

/* ==========================================================
   Motion
   .intro  load, hover and viewer motion (all screen sizes)
   .anim   scroll motion (laptop and desktop only, never phones)
   Neither class is set when the visitor prefers reduced motion.
   ========================================================== */

/* ---------- Load: the name rises letter by letter ---------- */

.wordmark .ch { display: inline-block; }
.intro .wordmark .ch {
  transform: translateY(110%);
  animation: rise 0.95s cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
  animation-delay: calc(var(--i) * 55ms + 80ms);
}
.intro .bar { animation: fade-up 0.7s ease 0.75s both; }
@keyframes rise { to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Ticker ---------- */

.ticker { overflow: hidden; border-top: 2px solid var(--ink); padding: clamp(8px, 1vw, 14px) 0; }
.ticker-track {
  display: flex; align-items: center; gap: clamp(20px, 3vw, 48px);
  width: max-content;
  padding-left: clamp(20px, 3vw, 48px);
  font-size: clamp(26px, 4.4vw, 72px);
  font-weight: 900;
  font-stretch: 112%;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.ticker-track i {
  flex: none;
  width: 0.36em; height: 0.36em;
  border-radius: 50%;
  background: var(--accent);
}
.intro .ticker-track { animation: ticker 26s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Hover ---------- */

.cta span { display: inline-block; transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.2, 1); }
.cta:hover span { transform: translate(0.07em, -0.07em); }

/* ---------- Viewer: opens with a short zoom ---------- */

.intro .viewer[open] { animation: v-fade 0.22s ease both; }
.intro .viewer-stage img.swap { animation: v-zoom 0.35s cubic-bezier(0.2, 0.85, 0.2, 1) both; }
@keyframes v-fade { from { opacity: 0; } }
@keyframes v-zoom { from { opacity: 0; transform: scale(0.96); } }

/* ---------- Scroll reveals (laptop and desktop only) ---------- */

.anim .tile, .anim .facts > div, .anim .cta, .anim .cta-alt {
  opacity: 0; transform: translateY(34px);
  transition: opacity 0.6s ease var(--d, 0ms), transform 0.85s cubic-bezier(0.2, 0.85, 0.2, 1) var(--d, 0ms);
}
.anim .tile.is-in, .anim .facts > div.is-in, .anim .cta.is-in, .anim .cta-alt.is-in {
  opacity: 1; transform: none;
}
.anim .cta { transition-property: opacity, transform, color; }

/* The statement lights up word by word as it scrolls past. */
.anim #statement .w { opacity: 0.16; transition: opacity 0.35s ease; }
.anim #statement .w.on { opacity: 1; }

/* ---------- Name: a colour wave keeps passing through the letters ---------- */

.wordmark .ch { transform-origin: bottom; transition: -webkit-text-fill-color 0.2s ease; }
.intro .wordmark .ch {
  animation: rise 0.95s cubic-bezier(0.2, 0.85, 0.2, 1) forwards, wave 5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 55ms + 80ms), calc(var(--i) * 90ms + 1.8s);
}
.wordmark .ch:hover { -webkit-text-fill-color: var(--accent); }
@keyframes wave {
  0%, 18%, 100% { scale: 1 1; color: inherit; }
  8% { scale: 1 0.8; color: var(--accent); }
}

/* ---------- Viewer clip ---------- */

.viewer-stage video { justify-self: center; max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; cursor: default; }
.viewer-stage img[hidden], .viewer-stage video[hidden] { display: none; }
@media (max-width: 640px) { .viewer-stage video { grid-column: 1 / -1; grid-row: 1; } }

/* ---------- Extra motion ---------- */
@keyframes nudge { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(0.08em, -0.08em); } }
@keyframes glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.intro .cta span { animation: nudge 1.8s ease-in-out infinite; }
.intro .status a span { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
.intro .live a, .intro .live span { animation: glow 3.2s ease-in-out infinite; }
@media (hover: hover) {
  .intro .tile { transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.2, 1), box-shadow 0.35s ease; }
  .intro .tile:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.45); }
}

/* ---------- Straight bottom edge ---------- */
.balanced .col .tile { min-height: 0; }
.balanced .col .tile img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- Smaller opening clips ---------- */
@media (min-width: 861px) {
  .feature { grid-template-columns: repeat(4, minmax(0, 18%)); gap: var(--gap); }
}
@media (min-width: 521px) and (max-width: 860px) {
  .feature { grid-template-columns: repeat(2, minmax(0, 38%)); }
}
@media (max-width: 520px) {
  .feature { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* smoother scrolling: skip painting what is far off screen */
.statement, .facts, .ticker { content-visibility: auto; contain-intrinsic-size: auto 400px; }
.tile { will-change: auto; }

/* tighter spacing around the statement and bottom */
.bar { padding-bottom: clamp(12px, 1.6vw, 24px); }
.eyebrow { margin-bottom: 8px; }

/* clip row fills the width: four clips plus two pieces on wide screens */
@media (min-width: 861px) {
  .feature { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.feature .tile.fill img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
