/* ============================================================
   ELENA | Design + Build | Residence 854
   ============================================================ */

:root {
  --ink: #14120f;
  --ink-soft: #1c1915;
  --cream: #f1ebdf;
  --bone: #faf7f1;
  --paper: #ece4d3;
  --brass: #b3925a;
  --brass-bright: #c9a96b;
  --muted: #8b8478;
  --muted-dark: #6f6a60;
  --hair-dark: rgba(20, 18, 15, 0.14);
  --hair-light: rgba(250, 247, 241, 0.18);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --pad-x: clamp(1.25rem, 5vw, 6rem);
  --ease-lux: cubic-bezier(0.65, 0.05, 0, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: auto;
  overflow-x: hidden;
  width: 100%;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--ink);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

::selection { background: var(--brass); color: var(--ink); }

img { display: block; width: 100%; height: 100%; object-fit: cover; }

em { font-style: italic; }

/* ============================================================
   PRELOADER
   ============================================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Returning within the same session (navigating between pages): the inline
   head script adds .no-intro, so the loading screen never paints again. */
html.no-intro .preloader { display: none !important; }
.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}
.preloader-mark { text-align: center; }
.preloader-logo {
  display: block;
  width: clamp(230px, 44vw, 400px);
  height: auto;
}
.preloader-count {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}
.preloader-line {
  position: absolute;
  left: 50%;
  bottom: clamp(3rem, 8vh, 5rem);
  transform: translateX(-50%);
  width: min(46vw, 320px);
  height: 1px;
  background: var(--hair-dark);
  overflow: hidden;
}
.preloader-line span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ============================================================
   CURSOR / GRAIN / PROGRESS
   ============================================================ */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brass-bright);
  z-index: 950;
  pointer-events: none;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor-label {
  position: fixed;
  top: 0; left: 0;
  z-index: 949;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.cursor-label span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(20, 18, 15, 0.82);
  color: var(--cream);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  margin-right: 0;
  text-transform: uppercase;
  transform: scale(0);
}
@media (hover: none) {
  .cursor, .cursor-label { display: none; }
  /* Phones / touch: kill the fixed full-screen animated grain and the
     per-frame blend on the header. Both force the compositor to redraw a
     full-viewport layer on every scroll frame, which is the main cause of
     the stuttering, "jumping" scroll on phones. */
  .grain { display: none; }
  .header-center, .menu-btn { mix-blend-mode: normal; }
  .menu-btn { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55); }
}

.grain {
  position: fixed;
  /* Only -8%: the keyframes translate at most 3%, so this still covers the
     viewport while shrinking the composited layer from ~9x to ~1.2x screen area. */
  inset: -8%;
  z-index: 900;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

.progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  z-index: 940;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.1rem, 3vh, 1.8rem) var(--pad-x);
  /* Blend lives on the text children below (not the whole header) so the colour
     monogram keeps its true gold + red instead of inverting against the page. */
  color: #fff;
}
.header-center,
.menu-btn { mix-blend-mode: difference; }
.header.is-ready { transition: transform 0.6s var(--ease-lux); }
.header.is-hidden { transform: translateY(-110%); }
.header-mark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  text-decoration: none;
}
.header-logo {
  height: clamp(2rem, 4vw, 2.5rem);
  width: auto;
  display: block;
  flex-shrink: 0;
  /* True gold/red (no blend). A tight dark outline defines the thin gold frame
     on white sections; the softer glow keeps depth over dark imagery. */
  filter:
    drop-shadow(0 0 0.6px rgba(35, 25, 15, 0.85))
    drop-shadow(0 0 1.4px rgba(35, 25, 15, 0.6))
    drop-shadow(0 2px 8px rgba(0, 0, 0, 0.42));
}
.header-mark-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: 0.16em;
  /* Brand gold lettering (no blend), with a soft shadow so it stays
     legible over both the dark hero and the lighter sections below. */
  color: var(--brass-bright);
  text-shadow: 0 1px 4px rgba(20, 18, 15, 0.55);
}
.header-mark-sub {
  margin-top: 0.4rem;
  font-family: var(--sans);
  font-size: 0.5rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  opacity: 0.7;
}
.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  text-transform: uppercase;
  opacity: 0.75;
}
.menu-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: none;
  border: 0;
  color: inherit;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.4rem 0;
}
.menu-btn-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 26px;
}
.menu-btn-lines i {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform 0.5s var(--ease-lux), width 0.5s var(--ease-lux);
}
.menu-btn-lines i:nth-child(2) { width: 70%; align-self: flex-end; }
.menu-btn:hover .menu-btn-lines i:nth-child(2) { width: 100%; }

/* ============================================================
   MENU OVERLAY
   ============================================================ */
.menu {
  position: fixed;
  inset: 0;
  z-index: 700;
  visibility: hidden;
  pointer-events: none;
}
.menu.is-open { visibility: visible; pointer-events: auto; }
.menu-bg {
  position: absolute;
  inset: 0;
  background: var(--ink);
}
.menu-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad-x);
}
.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1.6vh, 1.1rem);
}
.menu-link {
  display: inline-flex;
  align-items: baseline;
  gap: 1.4rem;
  text-decoration: none;
  color: var(--cream);
}
.menu-link em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--brass);
}
.menu-link-mask { display: block; overflow: hidden; padding-bottom: 0.16em; margin-bottom: -0.16em; }
.menu-link-text {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 7.5vh, 4.6rem);
  line-height: 1.12;
  transition: color 0.4s ease, letter-spacing 0.6s var(--ease-lux);
}
.menu-link:hover .menu-link-text {
  color: var(--brass-bright);
  letter-spacing: 0.04em;
  font-style: italic;
}
.menu-foot {
  position: absolute;
  bottom: clamp(1.5rem, 5vh, 3rem);
  left: var(--pad-x);
  right: var(--pad-x);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   MEDIA HELPERS
   ============================================================ */
.media {
  position: relative;
  overflow: hidden;
}
/* Promote ONLY the elements that animate transform continuously (the hero and
   the scroll-parallax media). A blanket will-change on every photo spawned 20+
   composited layers and exhausted GPU memory on phones, which made scrolling
   lag and the desktop hero stutter. */
[data-parallax] img {
  will-change: transform;
  backface-visibility: hidden;
}
.media.has-cap::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 36%;
  background: linear-gradient(to top, rgba(20, 18, 15, 0.48), transparent);
  pointer-events: none;
  z-index: 1;
}
.media-cap {
  position: absolute;
  left: 1.2rem;
  bottom: 1rem;
  z-index: 2;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}
.media-cap-light { color: var(--cream); }

/* Masked reveal lines. Bottom padding gives descenders (g, p, y, j) room
   inside the overflow:hidden clip; the matching negative margin keeps the
   original vertical rhythm so nothing shifts. */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.18em;
  margin-bottom: -0.18em;
}
.line-inner { display: block; padding-bottom: 0.02em; }

[data-words] .w { display: inline-block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
}
.hero-img {
  transform-origin: center center;
  /* The hero image scales on intro and parallaxes on scroll, so give it its
     own GPU layer up front — otherwise the browser re-rasterizes a 2400px
     image every frame, which is what made the desktop hero look slow/glitchy. */
  will-change: transform;
  backface-visibility: hidden;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    /* top: keeps the header legible */
    linear-gradient(to bottom, rgba(20, 18, 15, 0.42) 0%, rgba(20, 18, 15, 0) 30%),
    /* left: a soft vignette under the text column, fades out before the sky */
    linear-gradient(to right, rgba(20, 18, 15, 0.5) 0%, rgba(20, 18, 15, 0.14) 30%, rgba(20, 18, 15, 0) 52%),
    /* bottom: eased multi-stop so the lower text lifts without a hard band */
    linear-gradient(to top, rgba(20, 18, 15, 0.84) 0%, rgba(20, 18, 15, 0.62) 14%, rgba(20, 18, 15, 0.34) 32%, rgba(20, 18, 15, 0.12) 50%, rgba(20, 18, 15, 0) 66%);
}
.hero-content {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: clamp(7rem, 16vh, 10rem);
  color: var(--bone);
}
.hero-eyebrow {
  font-size: 0.64rem;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 1.6rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 2px 16px rgba(0, 0, 0, 0.6);
}
.hero-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3rem, 9.5vw, 8.2rem);
  line-height: 1.02;
  letter-spacing: 0.005em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 0 4px 36px rgba(0, 0, 0, 0.45);
}
.hero-title em { color: var(--brass-bright); }
.hero-sub {
  margin-top: 1.8rem;
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  letter-spacing: 0.12em;
  color: rgba(250, 247, 241, 0.82);
  max-width: 34em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 14px rgba(0, 0, 0, 0.55);
}
.hero-foot {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: clamp(1.4rem, 4vh, 2.6rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  color: rgba(250, 247, 241, 0.62);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.hero-scrollline {
  flex: 1;
  height: 1px;
  background: var(--hair-light);
  position: relative;
  overflow: hidden;
}
.hero-scrollline::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 18%;
  background: var(--brass);
  animation: scrollline 2.6s var(--ease-lux) infinite;
}
@keyframes scrollline {
  0% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(680%); }
}

/* ============================================================
   INTRO
   ============================================================ */
.intro {
  background: var(--bone);
  padding: clamp(7rem, 18vh, 13rem) var(--pad-x);
  text-align: center;
}
.intro-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 2.6rem;
}
.intro-text {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.7rem, 3.6vw, 3.3rem);
  line-height: 1.32;
  max-width: 24em;
  margin: 0 auto;
  color: var(--ink);
}
.intro-rule {
  width: 1px;
  height: clamp(4rem, 10vh, 7rem);
  background: var(--hair-dark);
  margin: clamp(3rem, 8vh, 5rem) auto 0;
}

/* ============================================================
   CHAPTERS (shared)
   ============================================================ */
.chapter { padding: clamp(6rem, 14vh, 11rem) var(--pad-x); }
.chapter-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-bottom: clamp(3.5rem, 9vh, 6.5rem);
}
.chapter-no {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(5rem, 13vw, 11rem);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px var(--brass);
  opacity: 0.55;
  flex-shrink: 0;
}
.chapter-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.3rem;
}
.chapter-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 1.04;
}
.chapter-note {
  position: absolute;
  right: 0;
  bottom: 0.4rem;
  max-width: 22em;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  line-height: 1.9;
  color: var(--muted-dark);
  text-align: right;
}
@media (max-width: 900px) {
  /* Stack the number, title and note so none of them squeezes the others */
  .chapter-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .chapter-no {
    order: -1;
    font-size: clamp(3.5rem, 17vw, 6rem);
  }
  .chapter-note {
    position: static;
    text-align: left;
    margin-top: 1.4rem;
    max-width: 36em;
  }
}

[data-words] {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.9vw, 1.55rem);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ============================================================
   CHAPTER 01 : SKETCH
   ============================================================ */
.chapter-sketch {
  background: var(--paper);
  background-image: radial-gradient(ellipse at 20% 0%, rgba(179, 146, 90, 0.10), transparent 55%);
}
.chapter-sketch .media-cap {
  color: var(--ink-soft);
  text-shadow: none;
}
.sketch-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
.sketch-main { aspect-ratio: 16 / 9.4; }
.sketch-main img { object-fit: cover; }
.sketch-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vh, 3.5rem);
  padding-top: clamp(1rem, 6vh, 4rem);
}
.sketch-copy p { max-width: 30em; }
.sketch-side { aspect-ratio: 16 / 9; }
@media (max-width: 900px) {
  .sketch-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MORPH (paper to plot) + DUSKFADE (day to dusk)
   ============================================================ */
.morph, .duskfade {
  position: relative;
  background: var(--ink);
}
.morph-stage, .duskfade-stage {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}
.morph-layer, .duskfade-layer {
  position: absolute;
  inset: 0;
}
.morph-real, .duskfade-dusk { opacity: 0; }
.morph-paper img { object-fit: cover; }
.morph-stage::after, .duskfade-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(to top, rgba(20, 18, 15, 0.6), transparent);
  pointer-events: none;
  z-index: 3;
}

.morph-caption, .duskfade-caption {
  position: absolute;
  left: var(--pad-x);
  bottom: clamp(2rem, 7vh, 4.5rem);
  z-index: 5;
  color: var(--bone);
}
.morph-title, .duskfade-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.05;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32), 0 2px 30px rgba(0, 0, 0, 0.42);
}
.morph-title em, .duskfade-title em { color: var(--brass-bright); }
.morph-tag, .duskfade-time {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.4rem;
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 12px rgba(0, 0, 0, 0.55);
}
.morph-tag-a, .duskfade-time-day { color: var(--bone); }
.morph-tag-b, .duskfade-time-dusk { color: var(--bone); opacity: 0.4; }
.duskfade-time-sep {
  width: clamp(3rem, 8vw, 6rem);
  height: 1px;
  background: var(--hair-light);
}

/* ============================================================
   CHAPTER 02 : BUILD
   ============================================================ */
.chapter-build { background: var(--bone); }
.build-wide {
  aspect-ratio: 16 / 8.2;
  margin-bottom: clamp(2rem, 6vh, 4.5rem);
}
.build-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4.5rem);
  align-items: center;
}
.build-split-img { aspect-ratio: 4 / 3.4; }
.build-split-copy p { max-width: 28em; }
.spec-list {
  list-style: none;
  margin-top: clamp(2rem, 5vh, 3rem);
}
.spec-list li {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--hair-dark);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.spec-list li:last-child { border-bottom: 1px solid var(--hair-dark); }
.spec-list li span:first-child { color: var(--muted-dark); }
.spec-list li span:last-child { color: var(--ink); text-align: right; }
@media (max-width: 900px) {
  .build-split { grid-template-columns: 1fr; }
}

/* ============================================================
   FULL BLEED : GATE
   ============================================================ */
.bleed {
  position: relative;
  background: var(--ink);
}
.bleed-media {
  height: clamp(70vh, 100svh, 100svh);
}
.bleed-media img { height: 100%; }
.bleed-caption {
  position: absolute;
  inset: auto var(--pad-x) clamp(2.5rem, 8vh, 5rem);
  z-index: 3;
  max-width: 46em;
}
.bleed-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 1.2rem;
}
.bleed-line {
  color: var(--bone) !important;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   CHAPTER 03 : LIGHT + HSCROLL
   ============================================================ */
.chapter-light {
  background: var(--bone);
  padding-bottom: clamp(2rem, 5vh, 4rem);
}
.hscroll {
  position: relative;
  background: var(--bone);
  overflow: hidden;
}
.hscroll-track {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  padding: 0 var(--pad-x) clamp(5rem, 12vh, 8rem);
  width: max-content;
}
.hpanel {
  position: relative;
  width: clamp(300px, 44vw, 720px);
  flex-shrink: 0;
}
.hpanel-tall { width: clamp(260px, 34vw, 540px); }
.hpanel-media {
  overflow: hidden;
  aspect-ratio: 3 / 2;
}
.hpanel-tall .hpanel-media { aspect-ratio: 3 / 2.6; }
.hpanel-media img {
  transition: transform 1.2s var(--ease-lux);
}
.hpanel:hover .hpanel-media img { transform: scale(1.045); }
.hpanel figcaption {
  margin-top: 1.1rem;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted-dark);
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
}
.hpanel figcaption em {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--brass);
}

/* ------------------------------------------------------------
   Framed-picture treatment (the Chapter 04 "Details" style),
   applied to every contained content photo across the studio
   site: the home feature rows, the project gallery, and the
   residence chapters. A fine brass keyline is drawn just inside
   each photo (like a matted print); because it lives inside the
   border-box it survives both overflow clipping and the
   clip-path / parallax reveals. Full-bleed backgrounds (hero,
   the gate, aerial, the dusk crossfades) are left unframed.
   ------------------------------------------------------------ */
.hpanel-media,
.cap-media,
.feature-media,
.gallery-grid figure,
.sketch-main,
.sketch-side,
.build-wide,
.build-split-img,
.details-stair,
.dgrid-item { position: relative; }

.hpanel-media::before,
.cap-media::before,
.feature-media::before,
.gallery-grid figure::before,
.sketch-main::before,
.sketch-side::before,
.build-wide::before,
.build-split-img::before,
.details-stair::before,
.dgrid-item::before {
  content: "";
  position: absolute;
  inset: clamp(8px, 1.4vw, 15px);
  border: 1px solid rgba(179, 146, 90, 0.55);
  z-index: 1;
  pointer-events: none;
  transition: inset 0.9s var(--ease-lux), border-color 0.9s var(--ease-lux);
}

/* the gallery scroller panels also lift off the page (not clip-masked) */
.hpanel-media { box-shadow: 0 26px 52px -30px rgba(20, 18, 15, 0.55); }

/* the keyline opens a touch and warms on hover */
.hpanel:hover .hpanel-media::before,
.cap-row:hover .cap-media::before,
.feature-media:hover::before,
.gallery-grid figure:hover::before,
.sketch-main:hover::before,
.sketch-side:hover::before,
.build-wide:hover::before,
.build-split-img:hover::before,
.details-stair:hover::before,
.dgrid-item:hover::before {
  inset: clamp(6px, 1.1vw, 11px);
  border-color: rgba(201, 169, 107, 0.9);
}

/* Mobile fallback: native swipe */
@media (max-width: 768px) {
  /* Hero: darker veil + stronger shadows so the headline reads over the photo */
  .hero-veil {
    background:
      linear-gradient(to bottom, rgba(20, 18, 15, 0.5) 0%, rgba(20, 18, 15, 0) 22%),
      linear-gradient(to top, rgba(20, 18, 15, 0.92) 0%, rgba(20, 18, 15, 0.8) 24%, rgba(20, 18, 15, 0.52) 46%, rgba(20, 18, 15, 0.22) 66%, rgba(20, 18, 15, 0) 82%);
  }
  .hero-content {
    bottom: clamp(2.5rem, 8vh, 5rem);
  }
  .hero-title { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 26px rgba(0, 0, 0, 0.62); }
  .hero-sub { color: rgba(250, 247, 241, 0.95); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 1px 14px rgba(0, 0, 0, 0.6); }

  /* The centred "Design · Build" label crowds the monogram on phones — drop it */
  .header-center { display: none; }

  /* Morph + dusk crossfades: keep the effect, lose the full-screen zoom.
     The stage becomes a properly-sized landscape frame; the two images still
     overlap and crossfade (driven by a non-pinned scrubbed timeline in JS). */
  .morph-stage, .duskfade-stage {
    height: 68vw;
    min-height: 230px;
    max-height: 56svh;
  }
  .morph-caption, .duskfade-caption { bottom: clamp(1.2rem, 4.5vw, 2rem); }
  .morph-title, .duskfade-title { font-size: clamp(1.7rem, 7vw, 2.4rem); }

  /* Scrolling gallery: vertical stack instead of a sideways swipe */
  .hscroll { overflow: visible; }
  .hscroll-track {
    flex-direction: column;
    align-items: stretch;
    width: auto;
    gap: clamp(2.2rem, 7vw, 3.2rem);
    padding: 0 var(--pad-x) clamp(3rem, 9vh, 5rem);
  }
  .hpanel, .hpanel-tall { width: 100%; }
  .hpanel-media, .hpanel-tall .hpanel-media { aspect-ratio: 3 / 2; }
}

/* ============================================================
   CHAPTER 04 : DETAILS
   ============================================================ */
.chapter-details {
  background: var(--cream);
}
.details-split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: center;
  margin-bottom: clamp(3rem, 8vh, 6rem);
}
.details-stair { aspect-ratio: 3 / 3.6; }
.details-copy p { max-width: 28em; }
.facts { margin-top: clamp(2.2rem, 5vh, 3.2rem); }
.facts-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1.4rem;
}
.facts-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--hair-dark);
  border: 1px solid var(--hair-dark);
}
.facts-list li {
  background: var(--cream);
  padding: 1.4rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.facts-list strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  color: var(--ink);
}
.facts-list span {
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 2.5rem);
}
.dgrid-item { aspect-ratio: 3 / 3.4; }
.dgrid-item:nth-child(2) { transform: translateY(clamp(1.5rem, 4vh, 3rem)); }
@media (max-width: 900px) {
  .details-split { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: 1fr; }
  .dgrid-item:nth-child(2) { transform: none; }
}

/* ============================================================
   AERIAL
   ============================================================ */
.aerial {
  position: relative;
  background: var(--ink);
}
.aerial-media { height: 100svh; min-height: 540px; }
.aerial-caption {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--pad-x);
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(20, 18, 15, 0.38), rgba(20, 18, 15, 0.05) 70%);
}
.aerial-line {
  max-width: 22em;
  color: var(--bone) !important;
  font-size: clamp(1.5rem, 3vw, 2.6rem) !important;
  line-height: 1.4 !important;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}

/* ============================================================
   THE ATELIER : ABOUT / LEGACY
   ============================================================ */
.ethos {
  background: var(--bone);
  padding: clamp(7rem, 18vh, 13rem) var(--pad-x);
}
.ethos-inner { max-width: 58rem; margin: 0 auto; }
.ethos-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  text-transform: uppercase;
  color: var(--brass);
  text-align: center;
  margin-bottom: 2.4rem;
}
.ethos-statement {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 6.5vw, 5rem);
  line-height: 1.05;
  text-align: center;
  color: var(--ink);
  margin-bottom: clamp(3rem, 8vh, 5rem);
}
.ethos-statement em { font-style: italic; color: var(--brass); }
.ethos-portrait {
  width: clamp(200px, 24vw, 290px);
  margin: 0 auto clamp(2.6rem, 6vh, 3.8rem);
  text-align: center;
}
.ethos-portrait img {
  width: 100%;
  aspect-ratio: 4 / 4.4;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(150, 120, 70, 0.5), 0 22px 48px -24px rgba(20, 18, 15, 0.55);
}
.ethos-portrait figcaption {
  margin-top: 1.05rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.3;
}
.ethos-portrait figcaption span {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.58rem;
  letter-spacing: 0.34em;
  margin-right: -0.34em;
  text-transform: uppercase;
  color: var(--brass);
  margin-top: 0.5rem;
}
.ethos-body {
  max-width: 40em;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(1.4rem, 3.4vh, 2.1rem);
}
.ethos-coda {
  max-width: 22em;
  margin: clamp(3.5rem, 9vh, 6rem) auto 0;
  text-align: center;
  font-style: italic;
  font-size: clamp(1.5rem, 3.2vw, 2.5rem);
  line-height: 1.4;
  color: var(--ink);
}

/* ============================================================
   THE PRACTICE : SERVICES + LOCATION
   ============================================================ */
.practice {
  background: var(--ink);
  color: var(--cream);
  padding: clamp(6rem, 14vh, 11rem) var(--pad-x);
}
.practice-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
  max-width: 78rem;
  margin: 0 auto;
}
.practice-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 1.4rem;
}
.practice-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  line-height: 1.06;
  color: var(--cream);
  margin-bottom: clamp(1.6rem, 4vh, 2.4rem);
}
.practice-title em { font-style: italic; color: var(--brass-bright); }
.practice-intro {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.7;
  color: var(--muted);
  max-width: 26em;
  margin-bottom: clamp(1.8rem, 4vh, 2.4rem);
}
.practice-loc {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream);
}
.practice-loc span { display: flex; align-items: center; gap: 0.75rem; }
.practice-loc i {
  width: 6px;
  height: 6px;
  border: 1px solid var(--brass);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.service-list { list-style: none; }
.service-list li {
  display: flex;
  align-items: baseline;
  gap: clamp(1rem, 2vw, 1.7rem);
  padding: clamp(0.85rem, 2vh, 1.15rem) 0;
  border-top: 1px solid var(--hair-light);
}
.service-list li:last-child { border-bottom: 1px solid var(--hair-light); }
.service-no {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--brass);
  flex-shrink: 0;
  min-width: 1.8em;
}
.service-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  line-height: 1.2;
  color: var(--cream);
}
@media (max-width: 820px) {
  .practice-grid { grid-template-columns: 1fr; gap: clamp(2.4rem, 6vh, 3.4rem); }
}

/* ============================================================
   OUTRO / FOOTER
   ============================================================ */
.outro {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.outro-media {
  position: absolute;
  inset: 0;
}
.outro-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(20, 18, 15, 0.3), rgba(20, 18, 15, 0.1) 38%),
    /* left vignette under the text column */
    linear-gradient(to right, rgba(20, 18, 15, 0.55) 0%, rgba(20, 18, 15, 0.16) 32%, rgba(20, 18, 15, 0) 55%),
    /* bottom: eased so the sub-text and button lift cleanly */
    linear-gradient(to top, rgba(20, 18, 15, 0.9) 0%, rgba(20, 18, 15, 0.72) 16%, rgba(20, 18, 15, 0.4) 36%, rgba(20, 18, 15, 0.12) 56%, rgba(20, 18, 15, 0) 70%);
}
.outro-content {
  position: relative;
  z-index: 2;
  padding: clamp(10rem, 24vh, 16rem) var(--pad-x) clamp(4rem, 10vh, 7rem);
  color: var(--bone);
}
.outro-eyebrow {
  font-size: 0.64rem;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 1.6rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 2px 16px rgba(0, 0, 0, 0.6);
}
.outro-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 8vw, 7rem);
  line-height: 1.02;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 0 4px 36px rgba(0, 0, 0, 0.45);
}
.outro-title em { color: var(--brass-bright); }
.outro-sub {
  margin-top: 1.6rem;
  max-width: 34em;
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  letter-spacing: 0.1em;
  line-height: 1.9;
  color: rgba(250, 247, 241, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 14px rgba(0, 0, 0, 0.55);
}
.outro-cta {
  display: inline-flex;
  align-items: center;
  gap: 1.3rem;
  margin-top: clamp(2rem, 5vh, 3rem);
  padding: 1.15rem 2.2rem;
  border: 1px solid rgba(201, 169, 107, 0.55);
  color: var(--bone);
  text-decoration: none;
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transition: color 0.5s var(--ease-lux), border-color 0.5s var(--ease-lux);
}
.outro-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brass);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform 0.5s var(--ease-lux);
  z-index: -1;
}
.outro-cta:hover { color: var(--ink); border-color: var(--brass); }
.outro-cta:hover::before { transform: scaleY(1); }
.outro-cta i {
  width: 2.4rem;
  height: 1px;
  background: currentColor;
  transition: width 0.5s var(--ease-lux);
}
.outro-cta:hover i { width: 3.4rem; }

.footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 var(--pad-x) clamp(1.6rem, 4vh, 2.6rem);
  color: rgba(250, 247, 241, 0.6);
}
.footer-mark { line-height: 0; }
.footer-logo {
  display: block;
  width: clamp(230px, 36vw, 470px);
  height: auto;
}
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: right;
}
.footer-meta a.flink {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s var(--ease-lux);
}
.footer-meta a.flink:hover { color: var(--brass-bright); }
/* Small, non-distracting build credit */
.cine-badge {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  margin-top: 1.1rem;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: none;
  color: rgba(250, 247, 241, 0.4);
  text-decoration: none;
  transition: color 0.3s var(--ease-lux);
}
.cine-badge:hover { color: rgba(250, 247, 241, 0.82); }
.cine-badge .kf-heart { color: var(--brass-bright); font-size: 0.92em; }
.cine-badge .kf-mark {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}
.cine-badge b { font-weight: 500; letter-spacing: 0.04em; }
@media (max-width: 768px) {
  .footer { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }
  .cine-badge { align-self: flex-start; }
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 990;
  background: rgba(15, 13, 11, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 5vw, 4rem);
  opacity: 0;
  visibility: hidden;
}
.lightbox.is-open { visibility: visible; }
.lightbox-stage {
  max-width: min(1400px, 92vw);
  max-height: 86svh;
}
.lightbox-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 86svh;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: clamp(1.2rem, 4vh, 2.4rem);
  right: var(--pad-x);
  background: none;
  border: 0;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.6rem;
}
.lightbox-close:hover { color: var(--brass-bright); }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .grain, .hero-scrollline::after { animation: none; }
  .morph-real, .duskfade-dusk { opacity: 1; }
  .morph-paper, .duskfade-day { opacity: 0; }
  * { transition-duration: 0.01ms !important; }
}
