:root {
  --linen: #f1ece4;
  --sand: #e4dacb;
  --green: #2f5d4a;
  --bronze: #9a6f45;
  --ink: #23231f;
  --muted: #6e6a62;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --pad: clamp(1.25rem, 5vw, 5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font: 300 1rem/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2 { font-family: var(--serif); font-weight: 300; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(2rem, 4.4vw, 3.6rem); color: var(--green); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 1rem; z-index: 100; background: var(--green); color: #fff; padding: .5rem 1rem; }
.skip:focus { left: 1rem; }

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 1.4rem;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem var(--pad);
  transition: background .5s var(--ease), padding .5s var(--ease), opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.brand img { width: clamp(108px, 11vw, 150px); filter: brightness(0) invert(1); transition: filter .5s var(--ease), width .5s var(--ease); }
.nav ul { display: flex; gap: clamp(1.2rem, 3vw, 2.8rem); list-style: none; margin: 0; padding: 0; }
.nav a {
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .26em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  position: relative;
  padding: .3rem 0;
  transition: color .5s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.nav-toggle { display: none; }

.site-header.is-solid { background: rgba(241, 236, 228, .94); backdrop-filter: blur(10px); padding-top: .9rem; padding-bottom: .9rem; }
.site-header.is-solid .brand img { filter: none; width: clamp(96px, 9vw, 124px); }
.site-header.is-solid .nav a { color: var(--green); }

/* Hero: a tall scroll track with a pinned stage. Scroll progress drives the intro frames. */
.hero { position: relative; height: 420vh; background: #d9d4cc; color: #fff; }
.hero-stage { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; }
.hero-media, .hero-video, .hero-canvas, .hero-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-media { transform: scale(calc(1.06 - var(--p, 0) * .06)); transform-origin: 50% 45%; will-change: transform; }
.hero-video { object-fit: cover; }
.hero-canvas { transition: opacity .9s linear; }
.hero.is-looping .hero-canvas { opacity: 0; }
.hero-shade {
  background:
    linear-gradient(to bottom, rgba(20, 22, 18, .38), rgba(20, 22, 18, 0) 26%),
    linear-gradient(to top, rgba(20, 22, 18, calc(.25 + var(--p, 0) * .3)), rgba(20, 22, 18, 0) 55%);
}

.hero-beat {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: clamp(2.5rem, 9vh, 6rem);
  display: grid;
  justify-items: start;
  opacity: var(--o, 0);
  transform: translateY(calc((1 - var(--o, 0)) * var(--dir, 1) * 36px));
  pointer-events: none;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .2);
}
.hero-beat.is-active { pointer-events: auto; }
.hero-beat--right { justify-items: end; text-align: right; }
.hero-beat .eyebrow { color: rgba(255, 255, 255, .85); }
.beat-title { margin: 0; font-family: var(--serif); font-weight: 300; line-height: 1.05; font-size: clamp(2.4rem, 6.2vw, 5.6rem); }
.beat-title em, .hero h1 em { font-style: italic; }
.beat-sub { margin: 1.2rem 0 0; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(255, 255, 255, .85); max-width: 30ch; }
.hero h1 { font-size: clamp(2.8rem, 7.4vw, 6.6rem); }

.scroll-hint {
  margin-top: 2.6rem;
  display: inline-flex; flex-direction: column; align-items: center; gap: .9rem;
  font-size: .7rem; letter-spacing: .3em; text-transform: uppercase;
}
.scroll-hint::after {
  content: ""; width: 1px; height: 3.2rem; background: currentColor; transform-origin: top;
  animation: drop 2.2s var(--ease) infinite;
}
@keyframes drop { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); transform-origin: top; } 56% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.hero-progress {
  position: absolute; right: clamp(1rem, 2.4vw, 2.2rem); top: 50%; width: 1px; height: 22vh;
  transform: translateY(-50%); background: rgba(255, 255, 255, .25);
}
.hero-progress span { position: absolute; inset: 0; background: #fff; transform-origin: top; transform: scaleY(var(--p, 0)); }

.hero-cue {
  justify-self: start;
  margin-top: 2.4rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-size: .7rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  text-decoration: none;
}
.hero-cue::before { content: ""; width: 3.5rem; height: 1px; background: currentColor; transform-origin: left; animation: cue 2.6s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleX(0); } 50% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }

/* Panels */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--linen); }
.panel { position: relative; display: block; aspect-ratio: 4 / 5; max-height: 92vh; overflow: hidden; text-decoration: none; color: #fff; width: 100%; }
.panel img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease); }
.panel::after { content: ""; position: absolute; inset: 0; background: rgba(20, 22, 18, .18); transition: background .8s var(--ease); }
.panel span {
  position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 3.8rem); font-weight: 300; letter-spacing: .04em;
}
.panel:hover img { transform: scale(1.05); }
.panel:hover::after { background: rgba(20, 22, 18, .3); }

/* Studio */
.studio {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 7vw, 8rem);
  align-items: center;
  padding: clamp(5rem, 12vw, 10rem) var(--pad);
  max-width: 1500px;
  margin: 0 auto;
}
.studio-image img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.studio h2 { margin-bottom: 2.2rem; }
.prose p { margin: 0 0 1.2rem; color: var(--muted); max-width: 38rem; }
.signature { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--green); margin: 2rem 0 0; }

/* Services */
.services { background: var(--green); color: var(--linen); padding: clamp(5rem, 11vw, 9rem) var(--pad); }
.services .eyebrow { color: #c9a77f; }
.services h2 { color: var(--linen); max-width: 22ch; }
.services-head { max-width: 1500px; margin: 0 auto clamp(3rem, 6vw, 5rem); }
.services-list {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1500px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(241, 236, 228, .25);
}
.services-list li {
  display: flex; gap: 1.2rem; align-items: baseline;
  padding: 1.8rem 1.5rem 1.8rem 0;
  border-bottom: 1px solid rgba(241, 236, 228, .25);
  font-family: var(--serif); font-size: clamp(1.25rem, 1.9vw, 1.65rem);
}
.services-list span { font-family: var(--sans); font-size: .7rem; letter-spacing: .2em; color: #c9a77f; }

/* Projects */
.projects { padding: clamp(5rem, 11vw, 9rem) var(--pad); max-width: 1640px; margin: 0 auto; }
.projects-head { text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.projects h2 { font-size: clamp(2.6rem, 6vw, 5rem); }
.filters { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem 2.2rem; margin-top: 2rem; }
.filters button {
  background: none; border: 0; padding: .4rem 0; cursor: pointer;
  font: 400 .72rem var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid transparent; transition: color .3s, border-color .3s;
}
.filters button:hover { color: var(--ink); }
.filters button[aria-selected="true"] { color: var(--green); border-color: var(--green); }
.gallery { columns: 3 300px; column-gap: 14px; }
.gallery button {
  display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; background: var(--sand);
  cursor: zoom-in; overflow: hidden; break-inside: avoid;
  opacity: 0; transform: translateY(18px); animation: rise .9s var(--ease) forwards;
}
.gallery img { width: 100%; transition: transform 1.2s var(--ease), opacity .6s; }
.gallery button:hover img { transform: scale(1.035); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Contact */
.contact { text-align: center; padding: clamp(5rem, 12vw, 10rem) var(--pad); background: var(--sand); }
.contact h2 { margin-bottom: 2rem; }
.contact-mail {
  display: inline-block; font-family: var(--serif); font-size: clamp(1.4rem, 3.4vw, 2.6rem); font-style: italic;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--bronze); padding-bottom: .2rem;
  overflow-wrap: anywhere;
}
.contact-mail:hover { color: var(--green); }
.contact-links { list-style: none; padding: 0; margin: 2.6rem 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: .8rem 2.6rem; }
.contact-links a { font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; text-decoration: none; color: var(--green); }
.contact-links a:hover { color: var(--bronze); }

/* Footer */
.site-footer {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: 2.2rem var(--pad); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.site-footer img { width: 104px; }
.site-footer p { margin: 0; }
.site-footer a { justify-self: end; text-decoration: none; }
.site-footer a:hover { color: var(--green); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: rgba(24, 25, 22, .94); padding: 4rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; color: var(--linen); cursor: pointer; font: 300 2.6rem/1 var(--serif); padding: 1rem; opacity: .75; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: .6rem; right: 1rem; }
.lb-prev { left: .6rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .6rem; top: 50%; transform: translateY(-50%); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.services-list li.reveal:nth-child(3n+2) { transition-delay: .1s; }
.services-list li.reveal:nth-child(3n) { transition-delay: .2s; }

/* Legal page */
.legal { max-width: 52rem; margin: 0 auto; padding: 9rem var(--pad) 6rem; }
.legal h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); color: var(--green); margin-bottom: 3rem; }
.legal h2 { font-size: 1.6rem; margin: 2.6rem 0 .8rem; }
.legal p { color: var(--muted); margin: 0 0 1rem; }
.legal-page .site-header { background: rgba(241, 236, 228, .94); }
.legal-page .brand img { filter: none; }
.legal-page .nav a { color: var(--green); }

@media (max-width: 860px) {
  .nav-toggle {
    display: grid; gap: 7px; width: 44px; height: 44px; place-content: center;
    background: none; border: 0; cursor: pointer; position: relative; z-index: 2;
  }
  .nav-toggle span:not(.sr) { width: 26px; height: 1px; background: #fff; transition: transform .4s var(--ease), background .4s; }
  .is-solid .nav-toggle span:not(.sr), .legal-page .nav-toggle span:not(.sr), .nav-open .nav-toggle span:not(.sr) { background: var(--green); }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
  .nav ul {
    position: fixed; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
    background: var(--linen); opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s;
  }
  .nav-open .nav ul { opacity: 1; visibility: visible; }
  .nav ul a { color: var(--green); font-family: var(--serif); font-size: 2rem; letter-spacing: .04em; text-transform: none; }
  .nav-open .brand { position: relative; z-index: 2; }
  .nav-open .brand img { filter: none; }

  .hero { height: 340vh; }
  .hero-beat--right { justify-items: start; text-align: left; }
  .hero-progress { display: none; }
  .panels { grid-template-columns: 1fr; }
  .panel { aspect-ratio: 4 / 3; }
  .studio { grid-template-columns: 1fr; }
  .services-list { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .site-footer a { justify-self: center; }
  .lightbox { padding: 3.5rem .5rem; }
}
@media (min-width: 861px) and (max-width: 1100px) {
  .services-list { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { height: auto; }
  .hero-media { transform: none; }
  .hero-canvas, .hero-beat:not(.hero-beat--final), .hero-progress { display: none; }
  .hero-beat--final { --o: 1; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
