/* ==========================================================================
   VRG Storeys · single-page brand site
   Tokens follow the VRG Storeys style guide v1.0
   ========================================================================== */

:root {
  /* Colour */
  --brown: #592C0F;
  --brown-deep: #3B1C08;
  --clay: #7A5A47;
  --sand: #E8D9C8;
  --cream: #FEF5EA;
  --cream-deep: #F6EADB;
  --white: #FFFFFF;
  --on-brown: #FEF5EA;
  --on-brown-muted: #D9BFA6;
  --on-brown-line: rgba(254, 245, 234, .2);

  /* Type */
  --head: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --sans: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-display: clamp(3rem, 2.075rem + 3.94vw, 5.625rem);
  --fs-h1: clamp(2.5rem, 1.906rem + 2.535vw, 4.1875rem);
  --fs-h2: clamp(2.0625rem, 1.688rem + 1.596vw, 3.125rem);
  --fs-h3: clamp(1.75rem, 1.53rem + .939vw, 2.375rem);
  --fs-h4: clamp(1.4375rem, 1.328rem + .469vw, 1.75rem);
  --fs-lead: clamp(1.125rem, 1.059rem + .282vw, 1.3125rem);
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-label: .75rem;

  /* Layout */
  --max: 1440px;
  --margin: 40px; /* left/right page padding on desktop and tablet */
  --gutter: 24px;
  --section-y: clamp(96px, 11vw, 160px);
  --head-gap: clamp(32px, 4.5vw, 64px);
  --header-h: 92px;
  --edge: var(--margin);
  --header-h-scrolled: 80px;

  /* Motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

@media (max-width: 1199px) { :root { --gutter: 20px; } }
@media (max-width: 767px)  { :root { --margin: 20px; --gutter: 16px; --header-h: 72px; --header-h-scrolled: 64px; } }

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { font-style: normal; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h-scrolled); overflow-x: clip; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html.is-locked, body.is-locked { overflow: hidden; }
/* Smooth scrolling (Lenis) takes over from CSS smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
address { font-style: normal; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--brown); color: var(--on-brown); padding: 12px 18px; text-decoration: none; font-size: var(--fs-small); font-weight: 600; transition: top .3s; }
.skip-link:focus { top: 16px; }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(var(--margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--margin), env(safe-area-inset-right, 0px));
}
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */
.display, .h1, .h2, .h3, .h4 { font-family: var(--head); font-variant-numeric: lining-nums; text-wrap: balance; }
.display { font-size: var(--fs-display); font-weight: 400; line-height: 1; letter-spacing: -.05em; }
.h1 { font-size: var(--fs-h1); font-weight: 400; line-height: 1.05; letter-spacing: -.04em; }
.h2 { font-size: var(--fs-h2); font-weight: 400; line-height: 1.1; letter-spacing: -.03em; }
.h3 { font-size: var(--fs-h3); font-weight: 500; line-height: 1.15; letter-spacing: -.025em; }
.h4 { font-size: var(--fs-h4); font-weight: 500; line-height: 1.25; letter-spacing: -.02em; }
.lead { font-size: var(--fs-lead); font-weight: 300; line-height: 1.6; }
.label { font-family: var(--head); font-size: 16px; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; }
.muted { color: var(--clay); }
.on-brown-muted { color: var(--on-brown-muted); }
.number { font-family: var(--sans); font-weight: 300; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }

/* Hold the hero until the entrance animation starts (failsafe reveals it after 2.5 s) */
.js:not(.ready) .hero-content,
.js:not(.ready) .site-header .logo,
.js:not(.ready) .site-header .nav { visibility: hidden; }

/* Split-line animation wrappers (built by main.js) */
.line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line-inner { display: block; }

/* --------------------------------------------------------------------------
   Buttons (never underlined)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 52px; padding: 0 28px;
  border: 1px solid currentColor; background: transparent;
  font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .4s var(--ease-out), color .4s var(--ease-out), border-color .4s var(--ease-out);
}
.btn .arrow { transition: transform .5s var(--ease-out); }
.btn:hover .arrow, .btn:focus-visible .arrow { transform: translateX(4px); }
.btn-cream { background: var(--cream); border-color: var(--cream); color: var(--brown); }
.btn-cream:hover { background: var(--white); border-color: var(--white); }

.icon-btn {
  width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--brown); background: transparent; color: var(--brown); cursor: pointer; padding: 0;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out);
}
.icon-btn:hover { background: var(--brown); color: var(--on-brown); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  color: var(--white);
  transition: transform .45s var(--ease-out), background-color .4s var(--ease-out), color .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.header-inner {
  max-width: var(--max); margin-inline: auto;
  height: var(--header-h);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(var(--edge), env(safe-area-inset-left, 0px));
  padding-right: max(var(--edge), env(safe-area-inset-right, 0px));
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 32px;
  transition: height .4s var(--ease-out);
}
.brand { grid-column: 2; }
.nav-left { grid-column: 1; grid-row: 1; }
.nav-right { grid-column: 3; grid-row: 1; }
.nav-right ul { justify-content: flex-end; }
/* Over the hero the nav lines up with the wordmark rather than the full lockup */
@media (min-width: 1024px) { .nav { transition: transform .4s var(--ease-out); } .site-header:not(.is-scrolled) .nav { transform: translateY(-10px); } }
.brand { display: block; line-height: 0; color: inherit; }
.logo { display: block; width: 226px; height: auto; aspect-ratio: 918 / 148; transition: width .4s var(--ease-out); overflow: visible; }
.site-header.is-scrolled { background: var(--white); color: var(--brown); box-shadow: 0 1px 0 var(--sand); }
.site-header.is-scrolled .header-inner { height: var(--header-h-scrolled); }
.site-header.is-scrolled .logo { width: 200px; }
.site-header.is-hidden { transform: translateY(-100%); }

.nav ul { display: flex; gap: clamp(28px, 4.2vw, 60px); }
.nav a {
  position: relative; display: inline-block; padding: 8px 0;
  font-family: var(--head); font-size: 18px; font-weight: 400; letter-spacing: -.01em; text-decoration: none;
}
.nav a { transition: opacity .4s var(--ease-out); }
.nav ul:hover a:not(:hover) { opacity: .6; }

.menu-toggle { display: none; width: 48px; height: 48px; border: 0; background: none; padding: 0; cursor: pointer; align-items: center; justify-content: flex-end; }
.menu-toggle-lines { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.menu-toggle-lines span { display: block; height: 1px; background: currentColor; transition: transform .4s var(--ease-out), width .4s var(--ease-out); }
.menu-toggle-lines span:first-child { width: 28px; }
.menu-toggle-lines span:last-child { width: 18px; }
.menu-open .menu-toggle-lines span:first-child { width: 24px; transform: translateY(4px) rotate(45deg); }
.menu-open .menu-toggle-lines span:last-child { width: 24px; transform: translateY(-4px) rotate(-45deg); }
.site-header.menu-open { color: var(--brown); background: transparent; box-shadow: none; transform: none; }

.mobile-menu {
  position: fixed; inset: 0; z-index: 40; background: var(--cream);
  padding: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 24px) max(var(--margin), env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(var(--margin), env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; justify-content: space-between; overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu ul { display: grid; gap: 4px; }
.mobile-menu nav a { display: block; padding: 10px 0; font-family: var(--head); font-size: 1.75rem; font-weight: 500; line-height: 1.15; letter-spacing: -.03em; text-decoration: none; }
.mobile-menu-foot { display: grid; gap: 4px; font-family: var(--head); font-size: 15px; line-height: 1.5; color: rgba(59, 28, 8, .72); padding-top: 40px; }
.mobile-menu-foot .label { color: #3B1C08; margin-bottom: 2px; }

@media (max-width: 1023px) {
  .nav { display: none; }
  .header-inner { grid-template-columns: auto minmax(0, 1fr); }
  .brand { grid-column: 1; }
  .menu-toggle { display: inline-flex; grid-column: 2; justify-self: end; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .logo { width: 200px; }
  .nav ul { gap: 24px; }
  .nav a { font-size: 16px; }
}
@media (max-width: 767px) {
  .logo { width: 190px; }
  .site-header.is-scrolled .logo { width: 176px; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero-stack { position: relative; }
.hero {
  position: sticky; top: 0; z-index: 0; overflow: hidden;
  min-height: 640px; height: 100vh; height: 100svh; max-height: 1100px;
  display: flex; align-items: flex-end;
  color: var(--on-brown); background: var(--brown-deep);
}
.hero-media { position: absolute; inset: 0; }
.hero-media img, .intro-card-hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 92%; }
.hero-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(36, 16, 4, .42) 0%, rgba(36, 16, 4, 0) 22%),
    linear-gradient(0deg, rgba(36, 16, 4, .55) 0%, rgba(36, 16, 4, .2) 34%, rgba(36, 16, 4, 0) 55%);
}
.hero { color: var(--white); }
/* Darkens as the studio section slides over the hero (driven by main.js) */
.hero-shade { position: absolute; inset: 0; pointer-events: none; background: #1E0D03; opacity: 0; }
.hero-content {
  position: relative;
  padding: 0 max(var(--edge), env(safe-area-inset-right, 0px)) 28px max(calc(var(--edge) - .04em), env(safe-area-inset-left, 0px));
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap;
}
.hero-copy { display: flex; flex-direction: column; }
.hero .display { font-size: clamp(3rem, 1.1rem + 5.6vw, 6.125rem); line-height: 1.04; max-width: 7.2em; }

/* Opening sequence (driven by main.js; hidden without JS, with reduced motion and after a failsafe) */
.intro { display: none; }
.js .intro { display: block; position: fixed; inset: 0; z-index: 95; overflow: hidden; background: var(--cream); color: var(--brown); }
.intro-done .intro { display: none; }
@media (prefers-reduced-motion: reduce) { .js .intro { display: none; } }
.intro-words { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(20px, 3.6vw, 52px); padding: 0 var(--margin); text-align: center; }
.intro-mask { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.intro-line { display: block; transform: translateY(110%); }
.intro-kicker { display: block; }
.intro-kicker .intro-mask { display: inline-block; vertical-align: top; }
.intro-kicker { font-family: var(--head); font-size: clamp(1.3rem, .9rem + 1.35vw, 2.25rem); font-weight: 500; line-height: 1.15; letter-spacing: -.03em; }
.intro-wordmark { width: clamp(280px, 56vw, 806px); max-width: 100%; height: auto; }
.intro-card { position: absolute; left: 50%; top: 50%; width: clamp(240px, 33.34vw, 480px); aspect-ratio: 4 / 3; overflow: hidden; visibility: hidden; transform: translate(-50%, -50%); background: var(--cream-deep); }
.intro-card img { width: 100%; height: 100%; object-fit: cover; }

/* Text link with arrow (no underline) */
.text-link {
  display: inline-flex; align-items: center; gap: 14px; padding: 8px 0;
  font-family: var(--head); font-size: 17px; font-weight: 500; letter-spacing: -.01em; text-decoration: none; white-space: nowrap;
}
.text-link .arrow { transition: transform .5s var(--ease-out); }
.text-link:hover .arrow, .text-link:focus-visible .arrow { transform: translateX(5px); }
.hero-link { color: var(--white); font-size: clamp(17px, 1rem + .3vw, 20px); font-weight: 400; margin-bottom: -.4em; } /* baseline level with the headline */

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding-block: var(--section-y); --section-bg: var(--cream); background: var(--section-bg); }
.section-white { --section-bg: var(--white); }
.section-cream { --section-bg: var(--cream); }
.section-brown { --section-bg: var(--brown); color: var(--on-brown); }
.section-head { display: grid; gap: 16px; max-width: 820px; margin-bottom: var(--head-gap); }
.section-head-split { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.section-head-split > div { display: grid; gap: 16px; }

/* Media */
.media { position: relative; display: block; overflow: hidden; background: var(--cream-deep); }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.ratio-45 { aspect-ratio: 4 / 5; }
.ratio-32 { aspect-ratio: 3 / 2; }
.parallax { position: absolute; inset: -6% 0; display: block; }
.ratio-169 { aspect-ratio: 16 / 9; }
.parallax img { height: 100%; }

/* 2 · Studio: slides up over the pinned hero */
.studio { position: relative; z-index: 1; background: var(--cream); color: var(--brown); padding-block: clamp(72px, 7vw, 104px) clamp(72px, 6vw, 88px); }
.studio-intro { display: grid; gap: clamp(24px, 2.2vw, 32px); max-width: 700px; }
.studio-label { font-family: var(--head); font-size: clamp(16px, .9rem + .2vw, 18px); font-weight: 500; line-height: 1.3; letter-spacing: -.01em; }
.studio-statement { font-family: var(--head); font-size: clamp(1.75rem, 1rem + 2.4vw, 3rem); font-weight: 500; line-height: 1.3; letter-spacing: -.03em; color: #3E1F0B; text-align: justify; hyphens: none; text-box: trim-both cap alphabetic; }
/* While split into lines, keep every line but the last justified */
.studio-statement .line:not(:last-child) { text-align-last: justify; }
.studio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: clamp(72px, 9vw, 130px); }
/* Cards flip 180° in 3D on hover or focus: photo on the front, brown description on the back */
.studio-card { position: relative; aspect-ratio: 427 / 485; perspective: 1600px; transform-style: preserve-3d; outline: none; cursor: default; }
.studio-card-inner { position: absolute; inset: 0; transform-style: preserve-3d; }
/* Hover shows the brown description, only once the cards have landed (main.js adds is-ready) */
.studio-cards.is-ready .studio-card:hover .studio-card-inner, .studio-cards.is-ready .studio-card:focus .studio-card-inner { transform: rotateY(180deg); }
.studio-card-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; color: var(--white); }
.studio-card-front { background: var(--cream-deep); }
.studio-card-front img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio-card-front::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(0deg, rgba(36, 16, 4, .45), rgba(36, 16, 4, 0)); pointer-events: none; }
.studio-card-back { background: var(--brown); transform: rotateY(180deg); }
.studio-card-title { position: absolute; left: 28px; right: 28px; bottom: 24px; z-index: 1; font-family: var(--head); font-size: clamp(1.25rem, .9rem + .7vw, 1.625rem); font-weight: 500; line-height: 1.2; letter-spacing: -.025em; }
.studio-card-desc { position: absolute; left: 28px; right: 28px; top: 28px; font-size: clamp(15px, .85rem + .25vw, 18px); line-height: 1.55; text-align: justify; hyphens: auto; }
.studio-card:focus-visible { box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px var(--brown); }

/* 3 · Services: photo on the left, brown panel on the right. With motion the section
   pins and steps through the six services; without it they read as a list. */
.services { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; background: #7A563F; color: var(--white); }
.services-media { position: relative; overflow: hidden; min-height: 100%; background: var(--brown-deep); }
.service-img { position: absolute; inset: 0; margin: 0; }
.service-img img { width: 100%; height: 100%; object-fit: cover; }
.service-img + .service-img { display: none; }
.services-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 40px; min-height: 100vh; min-height: 100svh; }
.services-top { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; font-family: var(--head); font-size: 22px; font-weight: 400; line-height: 1.2; letter-spacing: -.01em; }
.services-count { display: none; }
.services-title { font: inherit; font-weight: 500; letter-spacing: inherit; }
.services-count { margin-left: auto; }
.services-copy { display: grid; gap: 56px; }
.service-name { font-family: var(--head); font-size: clamp(1.625rem, 1.15rem + .8vw, 2rem); font-weight: 500; line-height: 1.15; letter-spacing: -.03em; margin-bottom: 16px; }
.service-text { max-width: 34em; font-family: var(--head); font-size: clamp(16px, .9rem + .2vw, 18px); line-height: 1.7; letter-spacing: -.005em; text-align: justify; hyphens: none; opacity: .9; }
.service-text .line:not(:last-child) .line-inner { text-align: justify; text-align-last: justify; }
/* Motion version (class added by main.js) */
.services.is-stepped .service-img + .service-img { display: block; clip-path: inset(100% 0 0 0); }
.services.is-stepped .services-panel { height: 100vh; height: 100svh; }
.services.is-stepped .services-count { display: block; }
.services.is-stepped .services-count-track { display: grid; }
.services.is-stepped .services-count-track > span { grid-area: 1 / 1; }
.services.is-stepped .services-count-track > span + span { visibility: hidden; }
.services.is-stepped .services-copy { display: grid; }
.services.is-stepped .service { grid-area: 1 / 1; align-self: end; }
.services.is-stepped .service + .service { visibility: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.tags li { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--clay); border: 1px solid var(--sand); padding: 3px 10px; }

/* 4 · Projects. Without motion: the photo fills the section and the cards sit in a grid.
   With motion (is-staged, added by main.js) the section pins: two lines slide across, the
   small photo grows to full screen, then the project cards travel up the right-hand side. */
.projects { position: relative; z-index: 1; background: var(--pj-bg, #6A4128); color: var(--white); }
.projects-stage { position: relative; overflow: hidden; display: grid; gap: 40px; padding: 40px var(--margin) 64px; }
.projects-photo { position: absolute; inset: 0; overflow: hidden; }
.projects-photo img { width: 100%; height: 100%; object-fit: cover; }
.projects-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(30, 14, 4, .45) 0%, rgba(30, 14, 4, 0) 40%); pointer-events: none; }
.projects-line { display: none; }
.projects-title-mask { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.projects-title-line { display: block; }
.projects-title { position: relative; font-family: var(--head); font-size: clamp(2.5rem, 1.5rem + 2.8vw, 4.25rem); font-weight: 400; line-height: 1.12; letter-spacing: -.04em; }
.projects-list { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.project-card { background: var(--white); padding: 20px; }
.project-open { display: flex; flex-direction: column; gap: 26px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: var(--brown); }
.project-card-img { display: block; aspect-ratio: 480 / 383; overflow: hidden; background: var(--cream-deep); }
.project-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.project-open:hover .project-card-img img, .project-open:focus-visible .project-card-img img { transform: scale(1.04); }
.project-card-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; color: #592C0F; }
.project-card-no { font-family: var(--head); font-size: 18px; line-height: 1; letter-spacing: 0; text-box: trim-both cap alphabetic; }
.project-card-name { font-family: var(--head); font-size: 22px; line-height: 1.1; letter-spacing: -.01em; text-align: right; text-box: trim-both cap alphabetic; }

.projects.is-staged .projects-stage { display: block; height: 100vh; height: 100svh; padding: 0; }
.projects.is-staged .projects-photo { inset: auto; left: 50%; top: 50%; width: var(--pw); height: var(--ph); transform: translate(-50%, -50%); }
.projects.is-staged { --pw: clamp(240px, 33.34vw, 480px); --ph: calc(var(--pw) * 383 / 480); --lh: clamp(2.25rem, 1.4rem + 2.6vw, 4rem); --gap: calc((100svh - var(--ph) - 1.4 * var(--lh)) / 4); }
.projects.is-staged .projects-line {
  display: block; position: absolute; left: 0; white-space: nowrap; will-change: transform;
  font-family: var(--head); font-size: var(--lh); font-weight: 400; line-height: 1; letter-spacing: -.04em; text-box: trim-both cap alphabetic;
}
.projects.is-staged .projects-line-1 { top: var(--gap); transform: translateX(-100%); }
.projects.is-staged .projects-line-2 { bottom: var(--gap); transform: translateX(100vw); }
.projects.is-staged .projects-title { position: absolute; left: var(--margin); top: 40px; z-index: 1; }
.projects.is-staged .projects-list { position: absolute; right: var(--margin); top: 0; z-index: 2; width: min(520px, 36vw); display: flex; flex-direction: column; gap: 40px; padding-bottom: 40px; will-change: transform; }

/* 4 · Legacy timeline. Ivory, with the display and description rising through masks.
   With motion (is-staged, added by main.js) the section pins on desktop: the years arrive
   one by one along the rail, the rail drifts left, and the ivory turns to the Projects brown
   with the text turning light alongside it. */
.timeline-sec {
  --tl-bg: #FEF5EA; --tl-ink: #3B1C08; --tl-muted: rgba(59, 28, 8, .62); --tl-line: rgba(59, 28, 8, .26);
  position: relative; z-index: 1; overflow: clip; background: var(--tl-bg); color: var(--tl-ink);
}
.tls-inner { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(72px, 9vw, 128px); padding: clamp(80px, 7vw, 104px) var(--margin) clamp(80px, 7.5vw, 112px); }
.tls-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 48px; }
.tls-intro { width: fit-content; max-width: 100%; display: grid; gap: clamp(16px, 1.4vw, 22px); }
.tls-title, .tls-stat-num, .tls-year { font-family: var(--head); font-weight: 400; line-height: 1.08; letter-spacing: -.05em; font-variant-numeric: lining-nums; }
.tls-title { font-size: clamp(2.5rem, 1.4rem + 2.4vw, 3.75rem); font-weight: 500; }
@media (min-width: 1024px) { .tls-title { white-space: nowrap; } }
.tls-text { contain: inline-size; font-family: var(--head); font-size: clamp(17px, .9rem + .55vw, 22px); line-height: 1.8; letter-spacing: -.01em; text-align: justify; hyphens: none; }
.tls-text .line:not(:last-child) .line-inner { text-align: justify; text-align-last: justify; }
.tls-stats { display: flex; gap: clamp(56px, 8.5vw, 128px); flex: none; }
.tls-stat { display: flex; flex-direction: column-reverse; gap: 14px; }
.tls-stat-num { font-size: clamp(2.5rem, 1.4rem + 2.4vw, 3.75rem); line-height: 1; }
.tls-stat-label { font-family: var(--head); font-size: 18px; line-height: 1.2; letter-spacing: -.01em; color: var(--tl-muted); }
.tls-mask { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.tls-rise { display: block; }
.tls-item .tls-rise { width: fit-content; }
.tls-rail { }
.tls-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.tls-item { display: flex; flex-direction: column; min-width: 0; }
.tls-mark { display: flex; align-items: center; gap: 8px; margin-bottom: clamp(32px, 3vw, 44px); }
.tls-dot { flex: none; width: 12px; height: 12px; background: var(--tl-ink); }
.tls-rule { flex: 1; height: 1px; margin-right: 8px; background: var(--tl-line); }
.tls-item:last-child .tls-rule { margin-right: 0; }
.tls-year { font-size: clamp(2.5rem, 1.4rem + 2.4vw, 3.75rem); line-height: 1; }
.tls-name { margin-top: 18px; font-family: var(--head); font-size: 18px; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; }
.tls-note { margin-top: 10px; max-width: 30ch; font-family: var(--head); font-size: 15px; line-height: 1.6; color: var(--tl-muted); }


/* 6 · Approach. Continues the Projects brown with light text, in the same language as the
   Legacy timeline: display and description rising through masks, a figure on the right, and a
   rail of squares joined by a rule that draws as you scroll, each stage rising as it is reached. */
.approach {
  --ap-bg: #6A4128; --ap-ink: #FEF5EA; --ap-muted: rgba(254, 245, 234, .72); --ap-line: rgba(254, 245, 234, .32);
  position: relative; z-index: 1; background: var(--ap-bg); color: var(--ap-ink);
}
.apr-inner { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(72px, 9vw, 128px); padding: clamp(80px, 7vw, 104px) var(--margin) clamp(80px, 7.5vw, 112px); }
.apr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 48px; }
.apr-intro { width: fit-content; max-width: 100%; display: grid; gap: clamp(16px, 1.4vw, 22px); }
.apr-title, .fdr-text { font-family: var(--head); font-size: clamp(2.5rem, 1.4rem + 2.4vw, 3.75rem); font-weight: 500; line-height: 1.08; letter-spacing: -.05em; }
@media (min-width: 1024px) { .apr-title { white-space: nowrap; } }
.apr-text { contain: inline-size; font-family: var(--head); font-size: clamp(17px, .9rem + .55vw, 22px); line-height: 1.8; letter-spacing: -.01em; text-align: justify; hyphens: none; }
.apr-text .line:not(:last-child) .line-inner { text-align: justify; text-align-last: justify; }
.apr-count { flex: none; display: flex; flex-direction: column; gap: 14px; }
.apr-count-num { font-family: var(--head); font-size: clamp(2.5rem, 1.4rem + 2.4vw, 3.75rem); font-weight: 400; line-height: 1; letter-spacing: -.05em; font-variant-numeric: lining-nums; }
.apr-count-label { font-family: var(--head); font-size: 18px; line-height: 1.2; letter-spacing: -.01em; color: var(--ap-muted); }
.apr-rise, .fdr-rise { display: block; }
.apr-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.apr-step { display: flex; flex-direction: column; min-width: 0; }
.apr-step > .tls-mask { margin: 0; }
.apr-mark { display: flex; align-items: center; gap: 8px; margin-bottom: clamp(28px, 2.6vw, 40px); }
.apr-dot { flex: none; width: 12px; height: 12px; background: var(--ap-ink); }
.apr-rule { flex: 1; height: 1px; margin-right: 8px; background: var(--ap-line); }
.apr-step:last-child .apr-rule { margin-right: 0; }
.apr-no { font-family: var(--head); font-size: 18px; font-weight: 500; line-height: 1.2; color: var(--ap-muted); font-variant-numeric: lining-nums tabular-nums; }
.apr-name { padding-right: 24px; font-family: var(--head); font-size: clamp(1.375rem, 1rem + .7vw, 1.75rem); font-weight: 500; line-height: 1.15; letter-spacing: -.03em; }
.apr-step > .tls-mask:has(.apr-name) { margin-top: 18px; }
.apr-desc { max-width: 26ch; padding-right: 24px; font-family: var(--head); font-size: 16px; line-height: 1.65; color: var(--ap-muted); }
.apr-step > .tls-mask:has(.apr-desc) { margin-top: 14px; }

/* 7 · Founder. Ivory, the brand symbol assembling on the left and the quote rising line by line. */
.founder { position: relative; z-index: 1; background: var(--cream); color: #3B1C08; }
.fdr-inner { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; padding: clamp(96px, 10vw, 160px) var(--margin); }
.founder-mark { grid-column: 1 / span 4; color: var(--sand); }
.founder-mark svg { width: 100%; height: auto; fill: currentColor; display: block; overflow: visible; }
.fdr-quote { grid-column: 6 / -1; margin: 0; display: flex; flex-direction: column; }
.fdr-label { font-family: var(--head); font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; color: rgba(59, 28, 8, .62); margin-bottom: clamp(24px, 2.6vw, 40px); }
.fdr-text { margin: 0; line-height: 1.12; }
.fdr-cap { margin-top: clamp(32px, 3.4vw, 48px); display: flex; flex-direction: column; gap: 8px; }
.fdr-name { font-family: var(--head); font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -.01em; }
.fdr-role { font-family: var(--head); font-size: 16px; line-height: 1.4; color: rgba(59, 28, 8, .62); }

/* 8 · Contact: details on the left, consultation form on the right */
.contact { background: var(--cream); color: var(--brown-deep); padding-block: clamp(64px, 6.4vw, 92px) clamp(64px, 5vw, 72px); }
.contact-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 56px; align-items: start; }
.contact-side { grid-column: 1 / span 5; display: grid; gap: clamp(40px, 3.8vw, 56px); }
.contact-title { font-family: var(--head); font-size: clamp(2.5rem, 1.4rem + 2.9vw, 4rem); font-weight: 500; line-height: 1.1; letter-spacing: -.04em; max-width: 7.5em; }
.contact-info { display: grid; gap: clamp(28px, 2.6vw, 38px); }
.contact-info dt { font-family: var(--head); font-size: 16px; color: var(--clay); margin-bottom: 8px; }
.contact-info dd { font-family: var(--head); font-size: 18px; line-height: 1.6; letter-spacing: -.01em; }
.contact-info address { font-style: normal; }
.contact-info a { text-decoration: none; transition: color .3s; }
.contact-info a:hover { color: var(--clay); }
.contact-form { grid-column: 7 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 2.6vw, 40px) 28px; }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea {
  display: block; width: 100%; padding: 4px 0 22px; border: 0; border-bottom: 1px solid var(--clay); border-radius: 0; background: transparent;
  font-family: var(--head); font-size: 18px; line-height: 1.4; color: var(--brown-deep); letter-spacing: -.01em; transition: border-color .3s;
}
.field textarea { height: 190px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--clay); opacity: 1; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--brown); }
.field input:focus-visible, .field textarea:focus-visible { box-shadow: 0 1px 0 var(--brown); }
.field [aria-invalid="true"] { border-bottom-color: #A3341C; }
.contact-submit {
  height: 62px; margin-top: 8px; border: 1px solid var(--brown); background: transparent; color: var(--brown-deep); cursor: pointer;
  font-family: var(--head); font-size: 18px; letter-spacing: -.01em; transition: background-color .35s var(--ease-out), color .35s var(--ease-out);
}
.contact-submit:hover, .contact-submit:focus-visible { background: var(--brown); color: var(--cream); }
.form-status { min-height: 1.4em; margin-top: -12px; font-size: 15px; color: var(--clay); }

/* 9 · Footer */
.site-footer { background: #694127; color: var(--white); padding: clamp(40px, 3.6vw, 52px) var(--margin) clamp(36px, 3.4vw, 48px); }
.site-footer > * { max-width: calc(var(--max) - 2 * var(--margin)); margin-inline: auto; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 48px; }
.footer-about { max-width: 512px; font-family: var(--head); font-size: clamp(15px, .85rem + .2vw, 17px); line-height: 1.8; text-align: justify; letter-spacing: -.005em; }
.footer-links { display: grid; grid-template-columns: auto auto auto; column-gap: clamp(48px, 5.8vw, 82px); }
.footer-links ul { display: grid; gap: 14px; align-content: start; }
.footer-links ul:last-child { justify-items: end; }
.footer-links a, .footer-bar a { font-family: var(--head); font-size: clamp(15px, .85rem + .2vw, 17px); text-decoration: none; letter-spacing: -.005em; transition: opacity .3s; }
.footer-links a:hover, .footer-bar a:hover { opacity: .7; }
.footer-wordmark { display: block; width: 100%; height: auto; margin-top: clamp(80px, 10vw, 150px); opacity: .8; }
.footer-bar { margin-top: clamp(48px, 5.6vw, 80px); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--head); font-size: clamp(15px, .85rem + .2vw, 17px); letter-spacing: -.005em; }

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */
.gallery {
  position: fixed; inset: 0; z-index: 80; background: var(--cream-deep); color: var(--brown);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.gallery[hidden] { display: none; }
.gallery-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px var(--margin); }
.gallery-title { font-family: var(--head); font-size: var(--fs-h4); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
.gallery-sub { font-size: var(--fs-small); color: var(--clay); }
.gallery-actions { display: flex; align-items: center; gap: 20px; }
.gallery-count { font-size: 13px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.gallery-stage { display: flex; align-items: center; gap: 20px; padding: 0 var(--margin); min-height: 0; touch-action: pan-y; }
.gallery-figure { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.gallery-figure img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.gallery-thumbs { display: flex; gap: 8px; justify-content: center; padding: 20px var(--margin); overflow-x: auto; }
.gallery-thumbs button { width: 72px; height: 50px; padding: 0; border: 1px solid var(--sand); background: none; cursor: pointer; flex: none; opacity: .65; transition: opacity .3s; }
.gallery-thumbs button:hover { opacity: 1; }
.gallery-thumbs button[aria-current="true"] { opacity: 1; outline: 2px solid var(--brown); outline-offset: -2px; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .studio-cards { gap: 20px; }
  .studio-card-title { left: 20px; right: 20px; bottom: 18px; }
  .studio-card-desc { left: 20px; right: 20px; top: 20px; }
  .tls-head { flex-direction: column; gap: 56px; }
  .tls-track { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 56px; }
  .apr-head { flex-direction: column; gap: 56px; }
  .apr-intro, .tls-intro { width: auto; }
  .apr-text, .tls-text { contain: none; }
  .apr-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 56px; }
  .founder-mark { grid-column: 1 / span 4; }
  .fdr-quote { grid-column: 6 / -1; }
  .contact-side, .contact-form { grid-column: 1 / -1; }
  .footer-top { flex-direction: column; }
}

@media (max-width: 767px) {
  .studio-cards { grid-template-columns: 1fr; }
  .studio-statement { font-size: 1.5rem; }
  .studio-card { aspect-ratio: 4 / 4.4; }
  .services { grid-template-columns: minmax(0, 1fr); }
  .services-media { min-height: 0; aspect-ratio: 4 / 3; }
  .services-panel { min-height: 0; }
  .services.is-stepped .services-media { aspect-ratio: auto; height: 44svh; }
  .services.is-stepped .services-panel { height: 56svh; min-height: 0; padding: 24px var(--margin) 28px; gap: 20px; }
  .services.is-stepped .service-text { font-size: 15.5px; line-height: 1.6; }
  .services.is-stepped .service-name { font-size: 1.5rem; margin-bottom: 10px; }
  .ratio-m-43 { aspect-ratio: 4 / 3; }
  .projects.is-staged .projects-list { left: var(--margin); right: var(--margin); width: auto; gap: 24px; }
  .projects.is-staged .projects-title { top: calc(var(--header-h) + 8px); }
  .project-card { padding: 14px; }
  .apr-inner { min-height: 0; gap: 64px; }
  .apr-steps { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .apr-mark { margin-bottom: 24px; }
  .apr-desc { max-width: 40ch; }
  .tls-inner { min-height: 0; gap: 64px; }
  .tls-stats { gap: 56px; }
  .tls-track { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .tls-mark { margin-bottom: 24px; }
  .tls-note { max-width: 40ch; }
  .founder-mark { grid-column: 1 / span 5; margin-bottom: 48px; }
  .fdr-quote { grid-column: 1 / -1; }
  .contact-form { grid-template-columns: minmax(0, 1fr); }
  .contact-info address br { display: none; }
  .footer-about { text-align: left; }
  .footer-links { width: 100%; grid-template-columns: repeat(3, auto); justify-content: space-between; column-gap: 16px; }
  .hero-link { margin-bottom: 0; }
  .gallery-top { padding-block: 12px; }
  .gallery-stage { padding: 0 12px; gap: 8px; }
  .gallery-prev, .gallery-next { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
