/* ---------- Fonts (self-hosted, no Google requests) ---------- */
@font-face {
  font-family: "Marcellus";
  src: url("fonts/marcellus-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --cream: #F7F5EE;
  --olive: #61602D;
  --wine: #90414D;
  --rose: #C56A79;
  --blush: #EAB4BB;
  --line: rgba(97, 96, 45, 0.2);
  --line-light: rgba(247, 245, 238, 0.45);

  --serif: "Marcellus", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --header-h: 88px;
  --edge: clamp(16px, 4.2vw, 60px);            /* outer page margin */
  --gutter: clamp(20px, 12.8vw, 184px);        /* text column inset */
  --section-y: clamp(96px, 11vw, 168px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--olive);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--blush); color: var(--olive); }
img { display: block; max-width: 100%; }
figure { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
h2 { font-size: clamp(34px, 3.6vw, 56px); line-height: 1.04; letter-spacing: -0.025em; }
h3 { font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.container { padding-inline: var(--gutter); max-width: 1440px; margin-inline: auto; }
.section { padding-block: var(--section-y); }
.hidden { display: none; }

.label {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .16em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 44px;
}
.label--sm { margin: 10px 0 18px; opacity: .75; }
.link, .footer__links a { transition: opacity .3s ease; }
.link:hover, .footer__links a:hover { opacity: .6; }

/* ---------- Gradient canvas (rendered by gradient.js) ---------- */
canvas.grad { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Fallback when WebGL isn't available */
canvas.grad.grad--fallback, .header, .hero, .finale {
  background-color: var(--rose);
}
canvas.grad.grad--fallback {
  background:
    radial-gradient(60% 80% at 15% 20%, #A0964C 0%, transparent 60%),
    radial-gradient(50% 70% at 85% 30%, #61602D 0%, transparent 60%),
    radial-gradient(60% 70% at 40% 90%, #EAB4BB 0%, transparent 65%),
    radial-gradient(50% 60% at 70% 70%, #90414D 0%, transparent 60%),
    #C56A79;
  background-attachment: fixed;
}

/* ---------- Header: sticky colour bar ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  margin-bottom: calc(-1 * var(--header-h));   /* floats over the hero */
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--edge);
  color: var(--cream);
  border-bottom: 1px solid var(--line-light);
  overflow: hidden;
}
.header > :not(canvas) { position: relative; z-index: 1; }
.header__logo img { width: 58px; height: auto; }
.nav__links { display: flex; gap: 40px; }
.nav__links a {
  position: relative;
  font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: calc(var(--header-h) + 40px) var(--edge) 96px;
  color: var(--cream);
  text-align: center;
  overflow: hidden;
}
.hero > :not(canvas) { position: relative; z-index: 1; }
.hero__title {
  font-size: clamp(26px, 2.55vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.012em;
  text-shadow: 0 1px 40px rgba(70, 30, 36, .18);
}
.hero__title .line { display: block; opacity: 0; transform: translateY(18px); animation: rise 1.6s var(--ease) forwards; }
.hero__title .line:nth-child(2) { animation-delay: .18s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero__foot {
  position: absolute !important; left: var(--edge); right: var(--edge); bottom: 28px;
  display: flex; justify-content: space-between; margin: 0;
  opacity: .85;
}

/* ---------- Statement ---------- */
.statement {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 120px); align-items: end;
  padding: var(--section-y) var(--edge) var(--section-y) var(--gutter);
}
.statement__body { max-width: 520px; }
.statement__lead {
  font-family: var(--serif);
  font-size: clamp(24px, 2.25vw, 34px);
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin-bottom: 40px;
}
.statement__text { max-width: 420px; }
.statement__text p + p { margin-top: 1em; }
.statement__img { aspect-ratio: 770 / 958; }

/* ---------- Image reveal ---------- */
.media { overflow: hidden; background: #ECE7DC; }
.media img {
  width: 100%; height: 100%; object-fit: cover;
  clip-path: inset(14% 0 0 0);
  transform: scale(1.08);
  transition: clip-path 1.5s var(--ease), transform 1.8s var(--ease);
}
.is-visible .media img, .media.is-visible img { clip-path: inset(0); transform: none; }

/* ---------- Cards (services + founders) ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 48px); }
.card__img { aspect-ratio: 520 / 640; margin-bottom: 28px; }
.card h3 { margin-bottom: 12px; }
.card h3 + .label--sm { margin-top: -2px; }
.card p:not(.label) { max-width: 480px; }

#about, #services, .process { border-top: 1px solid var(--line); }
#about h2 { margin-bottom: 32px; }
.lead { max-width: 640px; margin-bottom: 72px; font-size: 16px; }

/* ---------- Method ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 48px); }
.steps li { border-top: 1px solid var(--olive); padding-top: 28px; }
.steps__num { display: block; font-family: var(--serif); font-size: 56px; line-height: 1; letter-spacing: -0.02em; margin-bottom: 36px; }
.steps h3 { margin-bottom: 14px; }
.steps p { max-width: 240px; }

/* ---------- Archive: Our work ---------- */
.archive { border-top: 1px solid var(--line); padding-bottom: 0; }
.archive > .container { padding-inline: var(--edge); }
.archive > .container > .label { padding-left: calc(var(--gutter) - var(--edge)); }
.work {
  display: grid;
  grid-template-columns: 30fr 23fr 30fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}
.work > * { min-width: 0; }
.work__item--1 { margin-top: 0; }
.work__item--2 { margin-top: 170px; }
.work__item--3 { margin-top: 60px; }
.work figcaption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin-bottom: 12px;
}
.work__brand { font-family: var(--serif); font-size: 21px; line-height: 1.1; letter-spacing: -0.015em; }
.work__city { font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; opacity: .6; }
.work .media img { height: auto; }

/* ---------- Archive: client marquee ---------- */
.clients { padding-block: var(--section-y); }
.clients > .label { display: block; margin-bottom: 56px; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track {
  display: flex; align-items: center; width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track li { flex: 0 0 auto; padding-inline: clamp(36px, 5vw, 80px); }
.marquee__track img { height: 72px; width: auto; max-width: 190px; object-fit: contain; opacity: .9; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Finale: contact + footer on one gradient ---------- */
.finale { position: relative; color: var(--cream); overflow: hidden; }
.finale > :not(canvas) { position: relative; z-index: 1; }
.contact { border-top: 0; }
.contact__grid { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; }
.contact__intro h2 { margin-bottom: 28px; }
.contact__intro p { max-width: 340px; margin-bottom: 36px; }
.contact__intro .label { margin: 0; }

.form { display: grid; gap: 34px; }
.field { display: grid; gap: 14px; }
.field span { font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.field input, .field textarea {
  font: inherit; font-size: 16px; color: inherit;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line-light);
  border-radius: 0;
  padding: 0 0 12px;
  outline: none;
  resize: vertical;
  transition: border-color .3s ease;
}
.field input:focus, .field textarea:focus { border-bottom-color: var(--cream); }
.field textarea { min-height: 96px; }

.btn {
  justify-self: start;
  font-family: var(--sans); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  background: var(--cream); color: var(--olive);
  border: 0; border-radius: 0;
  padding: 18px 28px;
  cursor: pointer;
  transition: background .3s ease, color .3s ease;
}
.btn:hover { background: var(--olive); color: var(--cream); }

.footer {
  border-top: 1px solid var(--line-light);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  padding: 32px var(--edge) 36px;
  font-size: 14px;
}
.footer__links { display: flex; gap: 24px; }
.footer__links .label { margin: 0; }

/* ---------- Hover: gentle grow (mouse and trackpad only) ---------- */
@media (hover: hover) {
  .card__img, .work .media { transition: transform .9s var(--ease), box-shadow .9s var(--ease); }
  .statement__img.is-visible, .steps li.is-visible, .statement__lead.is-visible, .lead.is-visible, .contact__intro.is-visible {
    transition: opacity 1.1s ease, transform .9s var(--ease);
  }
  .statement__lead, .lead, .contact__intro, .steps li { transform-origin: left center; }

  /* photos: the frame grows, the picture inside zooms a touch more */
  .card:hover .card__img, .work__item:hover .media { transform: scale(1.03); box-shadow: 0 30px 60px -30px rgba(70, 40, 30, .35); }
  .card.is-visible:hover .media img, .work__item.is-visible:hover .media img { transform: scale(1.04); transition: transform 1.4s var(--ease), clip-path 1.5s var(--ease); }
  .statement__img.is-visible:hover { transform: scale(1.02); }
  .statement__img.is-visible:hover img { transform: scale(1.04); transition: transform 1.4s var(--ease), clip-path 1.5s var(--ease); }

  /* text blocks */
  .steps li.is-visible:hover { transform: scale(1.04); }
  .statement__lead.is-visible:hover, .lead.is-visible:hover, .contact__intro.is-visible:hover { transform: scale(1.02); }
}

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 120px 24px; }
.legal h1 { font-size: clamp(36px, 3.6vw, 52px); margin-bottom: 40px; }
.legal h2 { font-size: 24px; margin: 40px 0 12px; }
.legal p { margin-bottom: 12px; }
.legal a { text-decoration: underline; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s ease, transform 1.3s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.grid-2 .reveal:nth-child(2), .steps .reveal:nth-child(2), .work .reveal:nth-child(2) { transition-delay: .12s; }
.steps .reveal:nth-child(3), .work .reveal:nth-child(3) { transition-delay: .24s; }
.steps .reveal:nth-child(4) { transition-delay: .36s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .media img, .hero__title .line { opacity: 1; transform: none; clip-path: none; transition: none; animation: none; }
  .marquee__track { animation-duration: 120s; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 56px; }
  .contact__grid { grid-template-columns: 1fr; gap: 48px; }
  .work { grid-template-columns: 1fr 1fr; }
  .work__item--3 { margin-top: -60px; }
  .work__item--2 { margin-top: 90px; }
}
@media (max-width: 640px) {
  :root { --header-h: 68px; }
  .header__logo img { width: 42px; }
  .nav__links { gap: 14px; }
  .nav__links li:first-child { display: none; }
  .hero__title .line { display: inline; }
  .statement { grid-template-columns: 1fr; gap: 48px; padding-inline: var(--edge); }
  .grid-2 { grid-template-columns: 1fr; gap: 56px; }
  .steps { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; gap: 40px; }
  .work__item--2, .work__item--3 { margin-top: 0; }
  .work__brand { font-size: 19px; }
  .marquee__track img { height: 52px; max-width: 120px; }
  .footer { flex-direction: column; align-items: flex-start; }
  .footer__links { flex-wrap: wrap; gap: 14px 20px; }
}
