/* ==========================================================================
   Muzuri Spaces — site styles
   --------------------------------------------------------------------------
   Colour discipline: terracotta (--terra) is reserved for calls to action —
   the WhatsApp buttons, the form submit and the mobile action bar. Use it
   nowhere else in the UI, or the CTA stops being the loudest thing on the
   page. Terracotta never sits on a forest band (2.2:1 — fails contrast).

   Motion: everything is visible by default. Elements only start hidden when
   <html> carries both .js and .motion-ok (set inline in <head> when the
   visitor has not asked for reduced motion), and site.js removes .motion-ok
   again if the animation scripts fail to arrive.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-roman.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 300 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette */
  --paper: #f3ede2;
  --paper-2: #e9e1d2;
  --cream: #fbf8f2;
  --ink: #1c2620;
  --muted: #5a5f55;
  --forest: #1f3b2d;
  --forest-700: #2e5240;
  --moss: #55653f;
  --sage: #c8cfb2;
  --line: rgb(28 38 32 / 0.14);
  --line-dark: rgb(200 207 178 / 0.22);
  --terra: #b04a26;          /* CTA only */
  --terra-hover: #953c1d;

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --step--1: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.8vw, 1.95rem);
  --step-3: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem);
  --step-4: clamp(2.2rem, 1.6rem + 2.6vw, 3.75rem);
  --step-5: clamp(2.75rem, 1.6rem + 5vw, 6rem);

  /* Space */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-6: 1.5rem;
  --s-8: 2rem; --s-12: 3rem; --s-16: 4rem; --s-24: 6rem;
  --section-y: clamp(5rem, 10vw, 9rem);
  --wrap: 1320px;
  --pad-x: clamp(1.25rem, 4vw, 3rem);
  --gutter: clamp(1rem, 2.5vw, 2rem);
  --header-h: 68px;

  /* Shape */
  --r: 3px;
  --arch: 999px 999px 0 0;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
html:not(.lenis) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 380;
  font-optical-sizing: auto;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--forest);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 em, h2 em, h3 em, blockquote em { font-style: italic; font-weight: 340; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--sage); color: var(--forest); }

:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; border-radius: 2px; }
.on-dark :focus-visible { outline-color: var(--cream); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--forest); color: var(--cream); padding: var(--s-3) var(--s-4);
  border-radius: var(--r); text-decoration: none;
}
.skip-link:focus { top: var(--s-4); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: var(--section-y); }
.section--tint { background: var(--paper-2); }
.section--dark { background: var(--forest); color: var(--sage); }
.section--dark h2, .section--dark h3 { color: var(--cream); }

.eyebrow {
  display: inline-flex; gap: 0.6em; align-items: baseline;
  font-family: var(--sans); font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--moss);
  margin: 0 0 var(--s-6);
}
.eyebrow__num { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.section--dark .eyebrow { color: var(--sage); }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink); max-width: 38ch; }
.muted { color: var(--muted); }
.measure { max-width: 66ch; }

.section-head {
  display: grid; gap: var(--s-6) var(--gutter);
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.section-head h2 { font-size: var(--step-4); margin: 0; max-width: 18ch; }
.section-head p { margin: 0; color: var(--muted); max-width: 46ch; }
@media (min-width: 900px) {
  .section-head { grid-template-columns: 7fr 5fr; align-items: end; }
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 48px; padding: 0.8em 1.4em;
  border: 1px solid transparent; border-radius: var(--r);
  font-family: var(--sans); font-weight: 600; font-size: var(--step-0); line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn--cta { background: var(--terra); color: var(--cream); }
.btn--cta:hover { background: var(--terra-hover); }
.btn--cta:active { transform: translateY(1px); }
.btn--ghost { border-color: var(--forest); color: var(--forest); background: transparent; }
.btn--ghost:hover { background: var(--forest); color: var(--cream); }
.btn--sm { min-height: 44px; padding: 0.55em 1em; font-size: var(--step--1); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.45em; min-height: 44px;
  font-weight: 600; color: var(--forest); text-decoration: underline;
  text-decoration-color: var(--line); text-underline-offset: 0.35em;
}
.link-arrow::after { content: "→"; transition: transform 0.25s var(--ease); }
.link-arrow:hover { text-decoration-color: currentColor; }
.link-arrow:hover::after { transform: translateX(4px); }
.on-dark .link-arrow, .section--dark .link-arrow { color: var(--cream); text-decoration-color: var(--line-dark); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.site-header.is-scrolled, html:not(.js) .site-header {
  background: rgb(243 237 226 / 0.96);
  border-bottom-color: var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: var(--s-6); }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--forest); margin-right: auto; }
.brand svg { width: 30px; height: 35px; }
.brand__name { font-family: var(--serif); font-size: 1.3rem; font-weight: 420; letter-spacing: -0.015em; line-height: 1; }
.brand__tag { display: block; font-family: var(--sans); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--moss); margin-top: 0.3rem; }

.nav { display: none; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.2rem;
  text-decoration: none; font-weight: 500; color: var(--ink);
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 10px) / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { background-size: 100% 1px; }
.header-cta { display: none; }
.menu-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.25rem;
  background: none; border: 0; cursor: pointer; font-weight: 600; color: var(--forest);
}
.menu-toggle__bars { width: 22px; height: 10px; position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.menu-toggle__bars::before { top: 0; }
.menu-toggle__bars::after { top: 8.5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { top: 4.25px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { top: 4.25px; transform: rotate(-45deg); }
html:not(.js) .menu-toggle { display: none; }
html:not(.js) .nav { display: flex; gap: 0 var(--s-4); flex-wrap: wrap; }
html:not(.js) .site-header { position: static; height: auto; }
html:not(.js) .site-header .wrap { flex-wrap: wrap; padding-block: var(--s-3); gap: var(--s-2) var(--s-6); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0; z-index: 49;
  background: var(--paper);
  padding: var(--s-8) var(--pad-x) var(--s-12);
  display: flex; flex-direction: column; justify-content: space-between;
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu ul { display: grid; gap: var(--s-2); }
.mobile-menu li a {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--serif); font-size: clamp(2rem, 9vw, 2.75rem); color: var(--forest);
  text-decoration: none; padding-block: var(--s-2); border-bottom: 1px solid var(--line);
}
.mobile-menu li a span { font-family: var(--sans); font-size: var(--step--1); color: var(--moss); }
.mobile-menu__foot { display: grid; gap: var(--s-4); margin-top: var(--s-8); }
.mobile-menu__foot .btn { width: 100%; }
.mobile-menu__foot p { margin: 0; color: var(--muted); }

@media (min-width: 960px) {
  .nav { display: flex; gap: clamp(1rem, 2.4vw, 2.25rem); }
  .header-cta { display: inline-flex; }
  .menu-toggle, .mobile-menu { display: none !important; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 7vw, 6rem); position: relative; }
.hero__grid { display: grid; gap: var(--s-12) var(--gutter); align-items: center; }
.hero__copy { position: relative; z-index: 1; }
.hero h1 { font-size: var(--step-5); line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 0.35em; max-width: 11ch; }
.hero__sub { font-size: var(--step-1); line-height: 1.5; max-width: 34ch; margin-bottom: var(--s-8); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); align-items: center; }
.hero__proof {
  display: grid; gap: var(--s-2); margin-top: var(--s-8); padding-top: var(--s-6);
  border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--muted);
}
.hero__proof li { display: flex; gap: 0.6em; align-items: baseline; }
.hero__proof li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--moss); transform: translateY(-2px); }
.hero__proof strong { color: var(--forest); font-weight: 600; }

.hero__media { position: relative; }
.arch {
  position: relative; overflow: hidden; border-radius: var(--arch);
  background: var(--paper-2); aspect-ratio: 4 / 5;
}
.arch img { width: 100%; height: 100%; object-fit: cover; }
.hero__media .arch { max-width: 520px; margin-inline: auto; }
.hero__caption {
  margin-top: var(--s-3); font-size: var(--step--1); color: var(--muted);
  display: flex; justify-content: space-between; gap: var(--s-4);
  max-width: 520px; margin-inline: auto;
}
.hero__frond {
  position: absolute; width: clamp(90px, 13vw, 170px); left: -4%; top: -3%;
  color: var(--moss); pointer-events: none; transform: rotate(-18deg); transform-origin: 50% 100%;
}
.hero__frond path { fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 899px) { .hero__frond { left: 2%; width: 96px; } }

@media (min-width: 900px) {
  .hero { padding-top: clamp(2rem, 4vw, 3.5rem); }
  .hero__grid { grid-template-columns: repeat(12, 1fr); }
  .hero__copy { grid-column: 1 / span 6; }
  .hero__media { grid-column: 7 / span 6; }
  .hero__media .arch { max-width: none; height: min(78vh, 720px); aspect-ratio: auto; margin-right: calc(-1 * var(--pad-x)); }
  .hero__caption { max-width: none; }
}

/* ---------- Client strip ---------- */
.clients { border-block: 1px solid var(--line); padding-block: var(--s-6); overflow: hidden; }
.clients .wrap { display: grid; gap: var(--s-4); align-items: center; }
.clients__label { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--moss); margin: 0; white-space: nowrap; }
.clients__viewport { overflow: hidden; position: relative; }
.clients__track { display: flex; width: max-content; }
.clients__list { display: flex; flex-wrap: wrap; gap: var(--s-2) 0; }
.clients__list li {
  display: inline-flex; align-items: center; gap: 1.1rem; padding-right: 1.1rem;
  font-family: var(--serif); font-style: italic; font-size: var(--step-1); color: var(--forest); white-space: nowrap;
}
.clients__list li::after { content: ""; width: 7px; height: 11px; background: var(--moss); border-radius: 0 100% 0 100%; transform: rotate(20deg); opacity: 0.7; }
.clients__list li:last-child::after { display: none; }
.clients__pause {
  display: none; justify-self: start; min-height: 44px; padding: 0 0.25rem;
  background: none; border: 0; font-size: var(--step--1); font-weight: 600; color: var(--moss);
  text-decoration: underline; text-underline-offset: 0.3em; cursor: pointer;
}
/* Marquee only when the list overflows (set by site.js) and motion is allowed */
.motion-ok .clients.is-marquee .clients__list { flex-wrap: nowrap; }
.motion-ok .clients.is-marquee .clients__list li:last-child::after { display: inline-block; }
.motion-ok .clients.is-marquee .clients__track { animation: marquee 42s linear infinite; }
.motion-ok .clients.is-marquee .clients__pause { display: inline-flex; align-items: center; }
.motion-ok .clients.is-marquee:hover .clients__track,
.motion-ok .clients.is-marquee:focus-within .clients__track,
.clients.is-paused .clients__track { animation-play-state: paused !important; }
.clients__list[aria-hidden="true"] { display: none; }
.motion-ok .clients.is-marquee .clients__list[aria-hidden="true"] { display: flex; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (min-width: 1100px) {
  .clients .wrap { grid-template-columns: auto 1fr; gap: var(--s-12); }
}

/* ---------- Approach ---------- */
.approach__grid { display: grid; gap: var(--s-12) var(--gutter); }
.statement { font-family: var(--serif); font-size: var(--step-4); line-height: 1.15; letter-spacing: -0.02em; color: var(--forest); font-weight: 340; margin: 0 0 var(--s-12); max-width: 22ch; }
.statement em { color: var(--moss); }
.principles { counter-reset: p; border-top: 1px solid var(--line); }
.principles li { display: grid; grid-template-columns: 3rem 1fr; gap: var(--s-4); padding-block: var(--s-6); border-bottom: 1px solid var(--line); }
.principles__num { font-size: var(--step--1); font-weight: 600; color: var(--moss); padding-top: 0.45em; font-variant-numeric: tabular-nums; }
.principles h3 { font-size: var(--step-2); margin-bottom: 0.25em; }
.principles p { margin: 0; color: var(--muted); max-width: 48ch; }
.approach__images { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); align-items: start; }
.approach__images figure { margin: 0; }
.approach__images figure:nth-child(2) { margin-top: 22%; }
.approach__images .arch { aspect-ratio: 3 / 4; }
.approach__images figcaption { font-size: var(--step--1); color: var(--muted); margin-top: var(--s-2); }
@media (min-width: 900px) {
  .approach__grid { grid-template-columns: repeat(12, 1fr); }
  .approach__copy { grid-column: 1 / span 7; }
  .approach__images { grid-column: 9 / span 4; grid-template-columns: 1fr; gap: var(--s-8); }
  .approach__images figure:nth-child(2) { margin-top: 0; margin-left: -45%; width: 85%; }
  .statement { margin-bottom: var(--s-16); }
}

/* ---------- Selected work rail ---------- */
.work { overflow: hidden; }
.work__viewport {
  --edge: max(var(--pad-x), calc((100vw - var(--wrap)) / 2 + var(--pad-x)));
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scroll-padding-inline: var(--edge); scrollbar-width: none; padding-bottom: var(--s-4);
}
.work__viewport::-webkit-scrollbar { display: none; }
.work__track { display: flex; gap: var(--gutter); padding-inline: var(--edge); width: max-content; }
.work-card { width: min(78vw, 360px); scroll-snap-align: start; flex: none; display: flex; flex-direction: column; }
.work-card__media { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: var(--r); background: var(--paper-2); }
.work-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.work-card a:hover .work-card__media img { transform: scale(1.04); }
.work-card a { text-decoration: none; color: inherit; display: block; }
.work-card__meta { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-4); font-size: var(--step--1); color: var(--muted); }
.work-card h3 { font-size: var(--step-2); margin: var(--s-2) 0 var(--s-1); }
.work-card p { margin: 0; font-size: var(--step--1); color: var(--muted); max-width: 36ch; }
.work-card--end { justify-content: center; }
.work-card--end a {
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s-4);
  aspect-ratio: 4 / 5; padding: var(--s-8); border-radius: var(--arch);
  background: var(--forest); color: var(--cream);
}
.work-card--end span { font-family: var(--serif); font-size: var(--step-3); line-height: 1.1; }
.work-card--end small { color: var(--sage); font-size: var(--step--1); }
.work__progress { height: 1px; background: var(--line); margin: var(--s-8) auto 0; width: calc(min(100vw, var(--wrap)) - 2 * var(--pad-x)); position: relative; display: none; }
.work__progress span { position: absolute; inset: 0; background: var(--forest); transform-origin: 0 50%; transform: scaleX(0); }
@media (min-width: 1024px) {
  .work-card { width: clamp(340px, 30vw, 440px); }
  .work-card:nth-child(even) { margin-top: var(--s-16); }
}
/* Pinned rail (motion.js, desktop): shorter cards so the whole section fits the viewport */
.work.is-pinned { padding-block: clamp(3rem, 6vh, 5rem); }
.work.is-pinned .section-head { margin-bottom: clamp(1.5rem, 4vh, 3rem); }
.work.is-pinned .work__viewport { overflow: visible; scroll-snap-type: none; padding-bottom: 0; }
.work.is-pinned .work__track { align-items: flex-start; }
.work.is-pinned .work-card { width: clamp(380px, 34vw, 500px); }
.work.is-pinned .work-card__media { aspect-ratio: 4 / 3; }
.work.is-pinned .work-card:nth-child(even) { margin-top: 0; width: clamp(280px, 24vw, 360px); }
.work.is-pinned .work-card:nth-child(even) .work-card__media { aspect-ratio: 1; }
.work.is-pinned .work-card--end a { aspect-ratio: 1; }
.work.is-pinned .work__progress { display: block; }

/* ---------- Before / after slider ---------- */
.ba { margin: 0; }
.ba__stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.ba__stage picture, .ba__stage img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r); }
.ba__tag {
  position: absolute; top: var(--s-3); z-index: 2;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.35em 0.7em; border-radius: 2px; background: rgb(251 248 242 / 0.92); color: var(--forest);
  pointer-events: none;
}
.ba__tag--before { left: var(--s-3); }
.ba__tag--after { left: calc(50% + var(--s-3)); }
.ba__range, .ba__handle { display: none; }
.ba figcaption, .ba__caption { margin-top: var(--s-3); font-size: var(--step--1); color: var(--muted); }
@media (max-width: 599px) {
  html:not(.js) .ba__stage { grid-template-columns: 1fr; }
  html:not(.js) .ba__tag--after { left: var(--s-3); top: calc(50% + var(--s-3)); }
}

/* Enhanced: stacked images, after clipped from the left at --pos */
.js .ba__stage {
  display: block; overflow: hidden; border-radius: var(--r);
  aspect-ratio: var(--ar, 4 / 3); background: var(--paper-2);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.js .ba__stage img { position: absolute; inset: 0; border-radius: 0; }
.js .ba__after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.js .ba__tag--after { left: auto; right: var(--s-3); }
.js .ba__range {
  display: block; position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; -webkit-appearance: none; appearance: none;
}
.js .ba__handle {
  display: block; position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); z-index: 2;
  width: 2px; margin-left: -1px; background: var(--cream); pointer-events: none;
  box-shadow: 0 0 0 1px rgb(28 38 32 / 0.08);
}
.ba__grip {
  position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border-radius: 50%; background: var(--forest); color: var(--cream);
  display: grid; place-items: center; border: 2px solid var(--cream);
  transition: transform 0.25s var(--ease);
}
.ba__grip svg { width: 22px; height: 22px; }
.ba__range:focus-visible ~ .ba__handle .ba__grip { outline: 3px solid var(--moss); outline-offset: 3px; }
.ba__stage:hover .ba__grip { transform: scale(1.06); }

/* ---------- Transformations ---------- */
.transform__grid { display: grid; gap: var(--s-12) var(--gutter); }
.transform__feature .ba__stage { --ar: 4 / 3; }
.transform__side { display: grid; gap: var(--s-8); align-content: start; }
.transform__side h3 { font-size: var(--step-2); margin-bottom: var(--s-2); }
.transform__note { border-top: 1px solid var(--line); padding-top: var(--s-6); }
.transform__note dl { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-6); margin: 0 0 var(--s-4); font-size: var(--step--1); }
.transform__note dt { color: var(--moss); font-weight: 600; }
.transform__note dd { margin: 0; }
@media (min-width: 900px) {
  .transform__grid { grid-template-columns: repeat(12, 1fr); align-items: start; }
  .transform__feature { grid-column: 1 / span 8; }
  .transform__side { grid-column: 9 / span 4; }
  .transform__half { grid-column: span 6; }
}

/* ---------- Services ---------- */
.services__grid { display: grid; gap: var(--s-12) var(--gutter); }
.service-list { border-top: 1px solid var(--line); counter-reset: svc; }
.service-list li { border-bottom: 1px solid var(--line); }
.service-row {
  display: grid; grid-template-columns: 2.5rem 1fr; gap: 0 var(--s-4); padding-block: var(--s-6);
  color: inherit; text-decoration: none; position: relative;
}
.service-row__num { font-size: var(--step--1); font-weight: 600; color: var(--moss); padding-top: 0.55em; font-variant-numeric: tabular-nums; }
.service-row h3 { font-size: var(--step-2); margin: 0 0 0.2em; transition: transform 0.35s var(--ease), color 0.2s; }
.service-row p { grid-column: 2; margin: 0; color: var(--muted); max-width: 52ch; font-size: var(--step-0); }
.service-row.is-active h3, .service-row:hover h3 { transform: translateX(6px); }
.service-row.is-active .service-row__num { color: var(--forest); }
.services__panel { display: none; }
@media (min-width: 960px) {
  .services__grid { grid-template-columns: repeat(12, 1fr); }
  .service-list { grid-column: 1 / span 7; }
  .services__panel { display: block; grid-column: 9 / span 4; position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
  .services__frame { position: relative; aspect-ratio: 4 / 5; }
  .services__frame img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity 0.45s var(--ease);
  }
  .services__frame img.is-active { opacity: 1; }
  .services__panel figcaption { margin-top: var(--s-3); font-size: var(--step--1); color: var(--muted); min-height: 3em; }
}

/* ---------- Spotlight band ---------- */
.spotlight { position: relative; overflow: hidden; min-height: clamp(420px, 70vh, 720px); display: grid; align-items: end; }
.spotlight__media { position: absolute; inset: -12% 0; }
.spotlight__media img { width: 100%; height: 100%; object-fit: cover; }
.spotlight__card {
  position: relative; z-index: 1; background: var(--paper); padding: clamp(1.5rem, 3vw, 2.5rem);
  margin: 0 var(--pad-x) var(--pad-x); max-width: 520px; border-radius: var(--r);
}
.spotlight__card h2 { font-size: var(--step-3); }
.spotlight__card p { color: var(--muted); }
@media (min-width: 900px) { .spotlight__card { margin-left: calc((100vw - min(100vw, var(--wrap))) / 2 + var(--pad-x)); } }

/* ---------- Numbers ---------- */
.numbers__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-12) var(--gutter); }
.stat { border-top: 1px solid var(--line-dark); padding-top: var(--s-6); }
.stat__value { font-family: var(--serif); font-size: var(--step-5); line-height: 1; color: var(--cream); font-weight: 320; letter-spacing: -0.03em; display: block; font-variant-numeric: lining-nums tabular-nums; }
.stat__value small { font-size: 0.5em; margin-left: 0.08em; }
.stat p { margin: var(--s-3) 0 0; max-width: 24ch; color: var(--sage); font-size: var(--step--1); }
@media (min-width: 900px) { .numbers__grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Process ---------- */
.process__wrap { position: relative; }
.process__steps { display: grid; gap: var(--s-8); position: relative; }
.process__step { position: relative; padding-left: 3.5rem; }
.process__dot {
  position: absolute; left: 0; top: 0; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  border: 1px solid var(--forest); display: grid; place-items: center;
  font-size: var(--step--1); font-weight: 600; color: var(--forest); background: var(--paper);
}
.process__step h3 { font-size: var(--step-2); margin-bottom: var(--s-2); }
.process__step p { color: var(--muted); margin: 0; max-width: 32ch; }
.process__line { display: none; }
.process__steps::before { content: ""; position: absolute; left: 1.25rem; top: 2.5rem; bottom: 2rem; width: 1px; background: var(--line); }
@media (min-width: 900px) {
  .process__steps { grid-template-columns: repeat(4, 1fr); gap: var(--gutter); padding-top: 4.5rem; }
  .process__steps::before { display: none; }
  .process__step { padding-left: 0; }
  .process__dot { position: relative; margin-bottom: var(--s-6); }
  .process__line { display: block; position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 6rem; color: var(--moss); }
  .process__line path { fill: none; stroke: currentColor; stroke-width: 1.2; }
}

/* ---------- Studio ---------- */
.team { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-12) var(--gutter); }
.person { display: grid; gap: var(--s-4); align-content: start; }
.person__portrait {
  aspect-ratio: 4 / 5; border-radius: var(--arch); background: var(--paper);
  position: relative; overflow: hidden; display: grid; place-items: center;
}
.person__portrait svg.person__leaf { position: absolute; inset: auto -10% -6% auto; width: 75%; color: var(--sage); }
.person__portrait svg.person__leaf path { fill: none; stroke: currentColor; stroke-width: 1.4; }
.person__mono { font-family: var(--serif); font-size: clamp(3rem, 8vw, 5rem); color: var(--forest); font-weight: 300; letter-spacing: -0.04em; position: relative; }
.person h3 { font-size: var(--step-2); margin: 0; }
.person__role { font-size: var(--step--1); font-weight: 600; color: var(--moss); letter-spacing: 0.06em; text-transform: uppercase; margin: 0; }
.person p { margin: 0; color: var(--muted); }

.studio__note { margin-top: var(--s-12); border-top: 1px solid var(--line); padding-top: var(--s-6); color: var(--muted); max-width: 60ch; }
@media (max-width: 599px) { .person h3 { font-size: var(--step-1); } .person p:not(.person__role) { font-size: var(--step--1); } .person__role { font-size: 0.68rem; } }
@media (min-width: 1024px) {
  .team { grid-template-columns: repeat(4, 1fr); align-items: start; }
  .person:nth-child(2) { margin-top: var(--s-16); }
  .person:nth-child(3) { margin-top: var(--s-6); }
  .person:nth-child(4) { margin-top: var(--s-24); }
}

/* ---------- Testimonials ---------- */
.quotes { display: grid; gap: var(--s-8) var(--gutter); }
.quote { margin: 0; border-top: 1px solid var(--line); padding-top: var(--s-6); }
.quote blockquote { margin: 0 0 var(--s-4); font-family: var(--serif); font-size: var(--step-2); line-height: 1.3; color: var(--forest); font-style: italic; font-weight: 320; }
.quote figcaption { font-size: var(--step--1); color: var(--muted); }
.quote--pending blockquote { color: var(--muted); }
.pending-tag {
  display: inline-block; font-family: var(--sans); font-style: normal; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--moss);
  border: 1px dashed var(--moss); padding: 0.2em 0.6em; border-radius: 2px; margin-bottom: var(--s-3);
}
@media (min-width: 900px) { .quotes { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Contact ---------- */
.contact__grid { display: grid; gap: var(--s-12) var(--gutter); }
.contact h2 { font-size: var(--step-4); max-width: 14ch; }
.contact__lines { display: grid; gap: var(--s-4); margin: var(--s-8) 0; }
.contact__lines dt { font-size: var(--step--1); font-weight: 600; color: var(--moss); letter-spacing: 0.1em; text-transform: uppercase; }
.contact__lines dd { margin: 0; }
.contact__lines a { display: inline-flex; min-height: 44px; align-items: center; color: var(--forest); font-size: var(--step-1); font-family: var(--serif); text-decoration-color: var(--line); }
.contact__lines dd a + a { margin-left: var(--s-4); }
.contact__proof { margin: var(--s-8) 0 0; padding: var(--s-6); background: var(--paper-2); border-radius: var(--r); border-left: 3px solid var(--moss); }
.contact__proof p { font-family: var(--serif); font-size: var(--step-1); color: var(--forest); line-height: 1.4; margin-bottom: var(--s-2); }
.contact__proof small { color: var(--muted); }

.form { display: grid; gap: var(--s-6); background: var(--cream); padding: clamp(1.25rem, 3vw, 2.5rem); border-radius: var(--r); border: 1px solid var(--line); }
.form__row { display: grid; gap: var(--s-6); }
@media (min-width: 600px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: var(--s-2); }
.field label { font-size: var(--step--1); font-weight: 600; color: var(--forest); }
.field label span { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0.7em 0.85em;
  background: var(--paper); border: 1px solid rgb(28 38 32 / 0.28); border-radius: var(--r);
  font-size: 1rem; /* 16px stops iOS zooming on focus */
  transition: border-color 0.2s, background-color 0.2s;
}
.field textarea { min-height: 128px; resize: vertical; }
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 2.5em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231F3B2D' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9em center; background-size: 12px 8px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--forest); background-color: var(--cream); outline: none; box-shadow: 0 0 0 3px rgb(85 101 63 / 0.25); }
.field [aria-invalid="true"] { border-color: var(--terra); }
.field__error { font-size: var(--step--1); color: var(--terra-hover); min-height: 0; margin: 0; }
.field__error:empty { display: none; }
.form__actions { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); align-items: center; }
.form__alt { background: none; border: 0; padding: 0; cursor: pointer; }
.form__status { margin: 0; font-size: var(--step--1); color: var(--forest); }
.form__status:empty { display: none; }
@media (min-width: 900px) {
  .contact__grid { grid-template-columns: repeat(12, 1fr); }
  .contact__info { grid-column: 1 / span 5; }
  .contact__form { grid-column: 7 / span 6; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--forest); color: var(--sage); padding: var(--s-16) 0 var(--s-8); position: relative; overflow: hidden; }
.site-footer a { color: var(--cream); text-decoration-color: var(--line-dark); }
.footer__grid { display: grid; gap: var(--s-12) var(--gutter); position: relative; z-index: 1; }
.footer__brand { color: var(--cream); }
.footer__brand .brand { color: var(--cream); }
.footer__brand .brand__tag { color: var(--sage); }
.footer__brand p { margin-top: var(--s-6); max-width: 34ch; }
.site-footer h2 { font-family: var(--sans); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage); margin-bottom: var(--s-4); }
.site-footer ul { display: grid; gap: var(--s-1); }
.site-footer li a { display: inline-flex; min-height: 40px; align-items: center; }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-16); padding-top: var(--s-6); border-top: 1px solid var(--line-dark); font-size: var(--step--1); position: relative; z-index: 1; }
.footer__art { position: absolute; right: -4%; bottom: -10%; width: min(46vw, 520px); color: var(--forest-700); pointer-events: none; }
.footer__art path { fill: none; stroke: currentColor; stroke-width: 1.2; }
@media (min-width: 900px) {
  .footer__grid { grid-template-columns: 5fr 2fr 3fr 2fr; }
}

/* ---------- Mobile action bar ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-2);
  padding: var(--s-2) var(--s-3) calc(var(--s-2) + env(safe-area-inset-bottom));
  background: rgb(243 237 226 / 0.97); border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform 0.35s var(--ease);
}
.action-bar.is-visible { transform: none; }
.action-bar .btn { min-height: 48px; }
@media (min-width: 960px) { .action-bar { display: none; } }
html:not(.js) .action-bar { display: none; }

/* ---------- Page intro (inner pages) ---------- */
.page-intro { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); }
.page-intro h1 { font-size: var(--step-5); max-width: 14ch; margin-bottom: var(--s-6); }
.page-intro p { max-width: 52ch; color: var(--muted); font-size: var(--step-1); line-height: 1.5; }

/* ---------- Projects page ---------- */
.filter {
  position: sticky; top: var(--header-h); z-index: 20; background: var(--paper);
  border-block: 1px solid var(--line); padding-block: var(--s-3);
}
.filter .wrap { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: center; justify-content: space-between; }
.filter__buttons { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; }
.filter__buttons button {
  min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; font-weight: 600; font-size: var(--step--1); color: var(--forest); cursor: pointer; white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.filter__buttons button:hover { border-color: var(--forest); }
.filter__buttons button[aria-pressed="true"] { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.filter__count { margin: 0; font-size: var(--step--1); color: var(--muted); }

.projects { display: grid; gap: clamp(3rem, 6vw, 5rem) var(--gutter); padding-block: clamp(2.5rem, 5vw, 4rem) var(--section-y); }
.project[hidden] { display: none; }
.project__media { position: relative; overflow: hidden; border-radius: var(--r); background: var(--paper-2); aspect-ratio: 4 / 3; }
.project__media img { width: 100%; height: 100%; object-fit: cover; }
.project__media--tall { aspect-ratio: 3 / 4; }
.project__media--plan img { object-fit: contain; background: var(--cream); padding: var(--s-4); }
.project__cat { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--moss); margin: var(--s-4) 0 var(--s-2); }
.project h3 { font-size: var(--step-3); margin-bottom: var(--s-3); }
.project--text h3, .project--narrow h3 { font-size: var(--step-2); }
.project__facts { display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-6); margin: 0 0 var(--s-4); font-size: var(--step--1); }
.project__facts dt { color: var(--moss); font-weight: 600; }
.project__facts dd { margin: 0; color: var(--ink); }
.project__open {
  display: inline-flex; align-items: center; gap: 0.45em; min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer; font-weight: 600; color: var(--forest);
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.35em;
}
.project__open:hover { text-decoration-color: currentColor; }
.project--text { border-top: 1px solid var(--line); padding-top: var(--s-6); }
.project__note { font-size: var(--step--1); color: var(--muted); margin: 0 0 var(--s-4); }
@media (min-width: 900px) {
  .projects { grid-template-columns: repeat(12, 1fr); align-items: start; }
  .project { grid-column: span 6; }
  .project--wide { grid-column: span 7; }
  .project--narrow { grid-column: span 5; }
  .project--full { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter); align-items: end; }
  .project--full .project__visual { grid-column: 1 / span 8; }
  .project--full .project__body { grid-column: 9 / span 4; }
  .project--text { grid-column: span 4; }
  .project--offset { margin-top: var(--s-16); }
}
.projects__heading { grid-column: 1 / -1; margin: var(--s-8) 0 0; padding-top: var(--s-8); border-top: 1px solid var(--forest); display: flex; justify-content: space-between; gap: var(--s-4); align-items: baseline; }
.projects__heading h2 { font-size: var(--step-3); margin: 0; }
.projects__heading p { margin: 0; color: var(--muted); font-size: var(--step--1); }
.projects__heading[hidden] { display: none; }

.cta-band { padding-block: var(--section-y); text-align: left; }
.cta-band .wrap { display: grid; gap: var(--s-8); }
.cta-band h2 { font-size: var(--step-4); max-width: 16ch; margin: 0; }
@media (min-width: 900px) { .cta-band .wrap { grid-template-columns: 1fr auto; align-items: end; } }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0;
  background: rgb(18 28 22 / 0.97); color: var(--cream);
}
.lightbox::backdrop { background: rgb(18 28 22 / 0.6); }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: var(--s-3) var(--pad-x); gap: var(--s-4); }
.lightbox__title { font-family: var(--serif); font-size: var(--step-1); margin: 0; color: var(--cream); }
.lightbox__count { font-size: var(--step--1); color: var(--sage); font-variant-numeric: tabular-nums; }
.lightbox button {
  min-width: 48px; min-height: 48px; border-radius: 50%; border: 1px solid var(--line-dark);
  background: transparent; color: var(--cream); cursor: pointer; display: inline-grid; place-items: center;
}
.lightbox button:hover { background: var(--forest-700); }
.lightbox button svg { width: 20px; height: 20px; }
.lightbox__stage { position: relative; min-height: 0; touch-action: pan-y; }
.lightbox__stage img { position: absolute; inset: 0 var(--pad-x); width: calc(100% - 2 * var(--pad-x)); height: 100%; object-fit: contain; }
.lightbox__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding: var(--s-3) var(--pad-x) calc(var(--s-4) + env(safe-area-inset-bottom)); }
.lightbox__caption { margin: 0; font-size: var(--step--1); color: var(--sage); max-width: 60ch; }
.lightbox__nav { display: flex; gap: var(--s-2); }

/* ---------- Motion initial states (only with JS + motion allowed) ---------- */
.motion-ok [data-reveal] { opacity: 0; transform: translateY(24px); }
.motion-ok [data-split] { visibility: hidden; }

/* Hero entrance is pure CSS so the first screen never waits on the animation scripts */
.motion-ok :is(.hero, .page-intro) [data-reveal],
.motion-ok :is(.hero, .page-intro) h1 { animation: hero-rise 1s var(--ease) both; animation-delay: var(--delay, 0s); }
.motion-ok :is(.hero, .page-intro) h1 { --delay: 0.1s; }
.motion-ok .page-intro p:not(.eyebrow) { --delay: 0.3s; }
.motion-ok .hero .hero__sub { --delay: 0.3s; }
.motion-ok .hero .hero__actions { --delay: 0.42s; }
.motion-ok .hero .hero__proof { --delay: 0.54s; }
.motion-ok [data-hero-image] { animation: arch-rise 1.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.motion-ok [data-hero-image] img { animation: settle 2.2s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes arch-rise { from { clip-path: inset(35% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes settle { from { transform: scale(1.1); } to { transform: none; } }
.motion-ok [data-draw] { opacity: 0; }
.motion-ok .process__line path { stroke-dasharray: 2000; stroke-dashoffset: 2000; }
.split-line { display: block; }

@media print {
  .site-header, .action-bar, .mobile-menu, .clients__pause { display: none !important; }
  .motion-ok [data-reveal], .motion-ok [data-split], .motion-ok [data-draw] { opacity: 1 !important; visibility: visible !important; transform: none !important; clip-path: none !important; }
}
