/* ============================================================
   Nilaya Atelier — style.css
   Tokens, type, and layout per MASTER.md. Warm-earth editorial.
   ============================================================ */

:root {
  /* Color */
  --bone: #F3EEE6;
  --bone-2: #ECE4D7;
  --ink: #211C18;
  --ink-soft: #3A332D;
  --stone: #6B635A;
  --clay: #B5532A;
  --clay-deep: #9A4421;
  --line: #DAD2C6;
  --espresso: #1A1613;
  --espresso-2: #241E19;
  --bone-on-dark: #EDE6D9;
  --stone-on-dark: #A89E92;

  /* Type */
  --font-display: "Playfair Display", Georgia, serif;
  --font-sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --text-display: clamp(3rem, 7.4vw, 7.4rem);
  --text-h2: clamp(2.2rem, 5.2vw, 4.4rem);
  --text-h3: clamp(1.4rem, 2.4vw, 2rem);
  --text-body: clamp(1.02rem, 1.25vw, 1.18rem);
  --text-label: 0.72rem;

  /* Radii / shadow */
  --r-sm: 2px;
  --r-md: 4px;
  --r-pill: 999px;
  --shadow-cta: 0 12px 40px rgba(154, 68, 33, 0.18);

  /* Motion */
  --t-fast: 120ms;
  --t-med: 320ms;
  --t-slow: 900ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --side-pad: 6vw;
  --copy-zone: 52vw;
  --z-canvas: 1;
  --z-overlay: 2;
  --z-sections: 4;
  --z-header: 60;
  --z-loader: 100;
}

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

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }

body {
  font-family: var(--font-sans);
  background: var(--bone);
  color: var(--ink);
  font-size: var(--text-body);
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: var(--clay); color: var(--bone); }

a { color: inherit; text-decoration: none; }

img, canvas { display: block; }

/* Focus visibility (a11y) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- Shared type helpers ---------- */
.section-label {
  font-family: var(--font-sans);
  font-size: var(--text-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--clay);
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-body {
  margin-top: 1.6rem;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: 1.7;
}

/* ============================================================
   LOADER
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  background: var(--bone);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s var(--ease-out), visibility 0.8s;
}
#loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-inner { width: min(520px, 80vw); }

.loader-brand {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 1.8rem;
}
.loader-brand span { color: var(--clay); margin-left: 0.4ch; font-style: italic; }

.loader-track {
  height: 2px;
  width: 100%;
  background: var(--line);
  overflow: hidden;
}
#loader-bar {
  height: 100%;
  width: 0%;
  background: var(--clay);
  transition: width 0.25s var(--ease-out);
}
.loader-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}
.loader-cap {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--stone);
}
#loader-percent {
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
#loader-percent::after { content: "%"; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  padding: clamp(1rem, 2vw, 1.6rem) var(--side-pad);
}
/* Top scrim keeps dark nav readable over bright photography.
   Taller than the header with a multi-stop fade so it dissolves into
   the image with no visible seam (especially on mobile). */
.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  height: calc(100% + 3.5rem);
  background: linear-gradient(
    to bottom,
    rgba(243, 238, 230, 0.92) 0%,
    rgba(243, 238, 230, 0.62) 42%,
    rgba(243, 238, 230, 0.22) 74%,
    rgba(243, 238, 230, 0) 100%
  );
  pointer-events: none;
  opacity: 1;
  transition: opacity var(--t-med) var(--ease-out);
}
.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav-logo em { color: var(--clay); font-style: italic; font-weight: 500; margin-left: 0.35ch; }

.nav-links {
  display: flex;
  gap: 2.2rem;
  list-style: none;
}
.nav-links a {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.2rem 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cta {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.6rem 1.2rem;
  border-radius: var(--r-pill);
  transition: border-color var(--t-med) var(--ease-out), color var(--t-med) var(--ease-out);
}
.nav-cta:hover { border-color: var(--clay); color: var(--clay); }

/* Wrapper is layout-transparent on desktop so logo / links / CTA keep
   their original spread; on mobile it becomes a slide-down drawer. */
.nav-menu { display: contents; }
.nav-logo, .nav-toggle { position: relative; z-index: 2; }

/* Hamburger (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;          /* icon aligns to the right content gutter */
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0;
  background: var(--ink);
  transform-origin: center;
  transition: transform 0.35s var(--ease-out), opacity 0.25s var(--ease-out);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out),
              background-color var(--t-med) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out),
              border-color var(--t-med) var(--ease-out),
              color var(--t-med) var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--clay-deep);
  color: var(--bone);
  padding: 0.95rem 1.9rem;
  border: 1px solid var(--clay-deep);
}
.btn-primary:hover {
  background: var(--clay);
  border-color: var(--clay);
  transform: translateY(-1px);
  box-shadow: var(--shadow-cta);
}
.btn-primary:active { transform: translateY(1px); box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  padding: 0.95rem 1.4rem;
  border: 1px solid transparent;
  position: relative;
}
.btn-ghost::after {
  content: "";
  position: absolute;
  left: 1.4rem; right: 1.4rem; bottom: 0.7rem;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0.0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out), background-color var(--t-med);
}
.btn-ghost:hover { color: var(--clay); }
.btn-ghost:hover::after { transform: scaleX(1); background: var(--clay); }

/* ============================================================
   HERO
   ============================================================ */
.hero-standalone {
  position: relative;
  z-index: var(--z-sections);
  min-height: 100dvh;
  background: var(--bone);
  display: flex;
  align-items: center;
  /* Top padding reserves space below the fixed header so the eyebrow never collides with the logo */
  padding: clamp(7rem, 15vh, 11rem) var(--side-pad) clamp(3rem, 7vh, 5rem);
}
.hero-grid { width: 100%; max-width: 1500px; margin: 0 auto; }

.hero-label { margin-bottom: 1.8rem; }

.hero-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-display);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 16ch;
}
/* padding-bottom gives italic descenders (g, y, p) room inside the overflow:hidden
   clip box used for the word-rise reveal; negative margin keeps line spacing tight */
.hero-heading .line { display: block; overflow: hidden; padding-bottom: 0.18em; margin-bottom: -0.1em; }
.hero-heading .w { display: inline-block; will-change: transform; }
.hero-heading .it { font-style: italic; color: var(--clay); }

.hero-tagline {
  margin-top: 2rem;
  max-width: 44ch;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--ink-soft);
  line-height: 1.7;
}
.hero-actions {
  margin-top: 2.6rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* Thin descending thread (design accent, not a scroll label) */
.hero-thread {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: clamp(48px, 8vh, 96px);
  overflow: hidden;
  transform: translateX(-50%);
}
.hero-thread span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--clay));
  transform-origin: top;
  animation: thread 2.6s var(--ease-out) infinite;
}
@keyframes thread {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ============================================================
   CANVAS (fixed journey)
   ============================================================ */
.canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: var(--z-canvas);
  background: var(--bone);
  clip-path: circle(0% at 50% 50%);
  will-change: clip-path;
}
#canvas { width: 100%; height: 100%; }

#dark-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--espresso);
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   SCROLL CONTAINER + SECTIONS
   ============================================================ */
#scroll-container {
  position: relative;
  z-index: var(--z-sections);
  height: 900vh;
  overflow-x: clip;
}
.scroll-section {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  pointer-events: none;
  overflow-x: clip;
}
.scroll-section .section-inner,
.scroll-section .stats-wrap { pointer-events: auto; }

.align-left { justify-content: flex-start; padding-left: var(--side-pad); padding-right: var(--copy-zone); }
.align-right { justify-content: flex-end; padding-right: var(--side-pad); padding-left: var(--copy-zone); }

.align-left .section-inner,
.align-right .section-inner { max-width: 42vw; }

/* Soft readability scrim behind side copy, tinted to bone */
.section-content .section-inner {
  position: relative;
}
.section-content .section-inner::before {
  content: "";
  position: absolute;
  inset: -8% -18% -8% -14%;
  background: radial-gradient(120% 90% at 30% 50%, rgba(243, 238, 230, 0.92), rgba(243, 238, 230, 0));
  z-index: -1;
}
.align-right .section-inner::before {
  background: radial-gradient(120% 90% at 70% 50%, rgba(243, 238, 230, 0.92), rgba(243, 238, 230, 0));
}

.section-heading .it { font-style: italic; color: var(--clay); }

/* ---------- Practice list (section E) ---------- */
.practice-list { list-style: none; margin-top: 2rem; }
.practice-list li {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line);
}
.practice-list li:first-child { border-top: 1px solid var(--line); }
.practice-name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 500;
  color: var(--ink);
}
.practice-desc {
  display: block;
  margin-top: 0.3rem;
  color: var(--stone);
  font-size: 0.98rem;
}

/* ---------- Stats (dark scrim, centered) ---------- */
.section-stats {
  justify-content: center;
  text-align: center;
  padding: 0 var(--side-pad);
}
.stats-wrap { max-width: 1000px; color: var(--bone-on-dark); }
.stats-label { color: var(--clay); margin-bottom: 2.5rem; display: block; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 9vw, 7rem);
  font-weight: 500;
  line-height: 1;
  color: var(--bone-on-dark);
  font-variant-numeric: tabular-nums;
}
.stat .stat-label {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--stone-on-dark);
  font-weight: 500;
}
.stats-note {
  margin: 3rem auto 0;
  max-width: 48ch;
  color: var(--stone-on-dark);
  font-size: 1.02rem;
}

/* ---------- CTA (normal flow over held villa frame) ---------- */
.section-cta-final {
  position: relative;
  z-index: var(--z-sections);
  min-height: 100dvh;
  display: flex;
  align-items: center;
}
.section-cta-final .section-inner {
  position: relative;
  max-width: 46vw;
}
.section-cta-final .section-inner::before {
  content: "";
  position: absolute;
  inset: -10% -18% -10% -14%;
  background: radial-gradient(120% 100% at 28% 50%, rgba(243, 238, 230, 0.94), rgba(243, 238, 230, 0));
  z-index: -1;
}
.cta-label { margin-bottom: 1.4rem; display: block; }
.cta-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cta-button { margin-top: 2.2rem; }

/* ============================================================
   FOOTER (dark close)
   ============================================================ */
.site-footer {
  position: relative;
  z-index: var(--z-sections);
  background: var(--espresso);
  color: var(--bone-on-dark);
  padding: clamp(4rem, 9vw, 8rem) var(--side-pad) 2.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 500;
}
.footer-logo em { color: var(--clay); font-style: italic; margin-left: 0.35ch; }
.footer-line { margin-top: 1rem; color: var(--stone-on-dark); max-width: 32ch; }

.footer-cap {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--stone-on-dark);
  margin-bottom: 1rem;
}
.footer-col p { margin-bottom: 0.4rem; }
.footer-col a:not(.btn) { transition: color var(--t-med) var(--ease-out); }
.footer-col a:not(.btn):hover { color: var(--clay); }
.footer-btn { margin-top: 0.4rem; }

.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  max-width: 1400px;
  padding-top: 1.6rem;
  border-top: 1px solid var(--espresso-2);
  font-size: 0.84rem;
  color: var(--stone-on-dark);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  :root { --copy-zone: 40vw; }
  .align-left .section-inner,
  .align-right .section-inner,
  .section-cta-final .section-inner { max-width: 52vw; }
}

@media (max-width: 768px) {
  :root { --side-pad: 7vw; }

  /* Mobile navigation: hamburger + full-height slide-down drawer */
  .nav-toggle { display: flex; }
  .nav-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1.6rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    min-height: 100dvh;
    z-index: 1;
    background: var(--bone);
    padding: clamp(5.5rem, 16vh, 9rem) var(--side-pad) clamp(3rem, 8vh, 5rem);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.5s var(--ease-out), opacity 0.4s var(--ease-out), visibility 0.5s;
  }
  .nav-menu.is-open { transform: translateY(0); opacity: 1; visibility: visible; }

  .nav-menu .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.4rem;
    width: 100%;
  }
  .nav-menu .nav-links a {
    font-family: var(--font-display);
    font-size: clamp(2rem, 9vw, 2.8rem);
    font-weight: 500;
    padding: 0;
  }
  .nav-menu .nav-links a::after { bottom: -3px; }
  .nav-menu .nav-cta {
    margin-top: 0.6rem;
    font-size: 1rem;
    padding: 0.85rem 1.6rem;
  }

  #scroll-container { height: 650vh; }

  /* Collapse side zones to centered copy with a readable backdrop */
  .align-left, .align-right {
    justify-content: center;
    padding-left: var(--side-pad);
    padding-right: var(--side-pad);
    text-align: center;
  }
  .align-left .section-inner,
  .align-right .section-inner,
  .section-cta-final .section-inner { max-width: 100%; }

  .scroll-section.section-content .section-inner,
  .section-cta-final .section-inner {
    background: rgba(243, 238, 230, 0.86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 2rem 1.6rem;
    border-radius: var(--r-md);
  }
  .section-content .section-inner::before,
  .align-right .section-inner::before,
  .section-cta-final .section-inner::before { display: none; }
  .section-body { margin-left: auto; margin-right: auto; }

  .practice-list { text-align: left; }
  .stats-grid { grid-template-columns: 1fr; gap: 2.2rem; }

  /* Buttons sitting inside the centered copy cards stretch to fit the
     card instead of overflowing its padding when text-aligned center */
  .section-cta-final .cta-button { width: 100%; }

  .hero-heading { max-width: 100%; }
  .hero-actions { gap: 0.6rem; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-base { flex-direction: column; gap: 0.6rem; text-align: center; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
}

/* ============================================================
   BUTTON-AS-TRIGGER RESETS
   "Start a conversation" triggers are <button> so they open the
   modal without anchor side-effects; normalise their chrome.
   ============================================================ */
button.btn { border: none; font-family: var(--font-sans); }
button.nav-cta {
  font-family: var(--font-sans);
  background: transparent;
  cursor: pointer;
  line-height: 1.2;
}

/* ============================================================
   CONTACT MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), visibility 0.4s var(--ease-out);
}
.modal.is-open { opacity: 1; visibility: visible; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 22, 19, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative;
  width: min(1000px, 100%);
  max-height: 90dvh;
  overflow: auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--bone);
  border-radius: var(--r-md);
  box-shadow: 0 40px 120px rgba(26, 22, 19, 0.45);
  transform: translateY(24px) scale(0.985);
  transition: transform 0.5s var(--ease-out);
}
.modal.is-open .modal-dialog { transform: none; }

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 3;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--r-pill);
  background: rgba(243, 238, 230, 0.92);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.modal-close:hover { background: var(--clay); color: var(--bone); }

.modal-form-panel { padding: clamp(1.8rem, 3.2vw, 2.8rem); }
.modal-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0.6rem 0 1.6rem;
}
.modal-title .it { font-style: italic; color: var(--clay); }

.modal-form .field { margin-bottom: 1.1rem; }
.modal-form label {
  display: block;
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--stone);
  margin-bottom: 0.5rem;
}
.modal-form input,
.modal-form textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bone-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.75rem 0.9rem;
  transition: border-color var(--t-med) var(--ease-out), background var(--t-med) var(--ease-out);
}
.modal-form input::placeholder,
.modal-form textarea::placeholder { color: var(--stone); opacity: 0.7; }
.modal-form input:focus,
.modal-form textarea:focus { outline: none; border-color: var(--clay); background: var(--bone); }
.modal-form textarea { resize: vertical; min-height: 96px; }
.modal-submit { width: 100%; margin-top: 0.4rem; }
.modal-success { margin-top: 1rem; color: var(--clay-deep); font-weight: 600; }

.modal-info-panel {
  background: var(--espresso);
  color: var(--bone-on-dark);
  padding: clamp(1.8rem, 3.2vw, 2.6rem);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.modal-info-cap {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--stone-on-dark);
  margin-bottom: 0.4rem;
}
.modal-info-block p { line-height: 1.6; }
.modal-info-panel a { transition: color var(--t-med) var(--ease-out); }
.modal-info-panel a:hover { color: var(--clay); }
.modal-map-wrap {
  margin-top: auto;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--espresso-2);
}
.modal-map {
  display: block;
  width: 100%;
  height: 190px;
  border: 0;
  filter: grayscale(0.35) contrast(0.95) brightness(0.95);
}

@media (max-width: 760px) {
  .modal-dialog { grid-template-columns: 1fr; max-height: 92dvh; }
  .modal-map { height: 170px; }
}

/* ============================================================
   WORK TEASER (landing -> projects)
   ============================================================ */
.section-work-teaser {
  position: relative;
  z-index: var(--z-sections);
  background: var(--bone);
  padding: clamp(5rem, 12vh, 9rem) var(--side-pad);
}
.work-teaser-head {
  max-width: 1500px;
  margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}
.work-teaser-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-top: 0.8rem;
}
.work-teaser-title .it { font-style: italic; color: var(--clay); }
.work-teaser-link {
  position: relative;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  padding-bottom: 2px;
}
.work-teaser-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}
.work-teaser-link:hover::after { transform: scaleX(1); }

.work-teaser-grid {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
}
.work-card { display: block; }
.work-card-media {
  overflow: hidden;
  border-radius: var(--r-sm);
  aspect-ratio: 4 / 5;
  background: var(--bone-2);
}
.work-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}
.work-card:hover .work-card-media img { transform: scale(1.05); }
.work-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 1rem;
}
.work-card-name {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 500;
  color: var(--ink);
}
.work-card-loc {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone);
  white-space: nowrap;
}
@media (max-width: 860px) {
  .work-teaser-grid { grid-template-columns: 1fr; gap: 2rem; }
  .work-card-media { aspect-ratio: 16 / 10; }
}

/* ============================================================
   SUB-PAGE: shared page hero
   ============================================================ */
.page-hero {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(9rem, 18vh, 13rem) var(--side-pad) clamp(2.5rem, 5vh, 4rem);
}
.page-hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-display);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 16ch;
  margin-top: 1.4rem;
}
.page-hero-title .it { font-style: italic; color: var(--clay); }
.page-hero-sub {
  margin-top: 1.6rem;
  max-width: 50ch;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.7;
}

/* ============================================================
   SUB-PAGE: projects listing (editorial rows)
   ============================================================ */
.projects-list {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(2rem, 5vh, 4rem) var(--side-pad) clamp(5rem, 10vh, 8rem);
  display: flex;
  flex-direction: column;
  gap: clamp(4rem, 9vh, 8rem);
}
.project-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
.project-row:nth-child(even) { grid-template-columns: 0.85fr 1.15fr; }
.project-row:nth-child(even) .project-row-media { order: 2; }
.project-row:nth-child(even) .project-row-body { order: 1; }

.project-row-media {
  overflow: hidden;
  border-radius: var(--r-sm);
  aspect-ratio: 16 / 11;
  background: var(--bone-2);
}
.project-row-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}
.project-row:hover .project-row-media img { transform: scale(1.04); }

.project-index {
  font-size: var(--text-label);
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--clay);
}
.project-row-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0.6rem 0 0.4rem;
}
.project-row-loc {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone);
}
.project-row-summary {
  margin-top: 1.1rem;
  max-width: 46ch;
  color: var(--ink-soft);
  line-height: 1.7;
}
.project-row-cta {
  display: inline-block;
  position: relative;
  margin-top: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 2px;
}
.project-row-cta::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}
.project-row:hover .project-row-cta::after { transform: scaleX(1); }

@media (max-width: 860px) {
  .project-row,
  .project-row:nth-child(even) { grid-template-columns: 1fr; gap: 1.4rem; }
  .project-row-media,
  .project-row:nth-child(even) .project-row-media { order: 0; }
  .project-row-body,
  .project-row:nth-child(even) .project-row-body { order: 0; }
}

/* ============================================================
   SUB-PAGE: project detail
   ============================================================ */
.pd-hero {
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(8rem, 16vh, 11rem) var(--side-pad) 0;
}
.pd-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}
.pd-back {
  position: relative;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 2px;
}
.pd-back::before { content: "\2190"; margin-right: 0.5ch; color: var(--clay); }
.pd-back::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}
.pd-back:hover::after { transform: scaleX(1); }

.pd-eyebrow { display: block; }
.pd-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-display);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 18ch;
  margin: 0.8rem 0 0;
}
.pd-lede {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1.3;
  color: var(--ink-soft);
  max-width: 32ch;
  margin: 1.4rem 0 0;
}
.pd-hero-media {
  margin-top: clamp(2rem, 5vh, 3.5rem);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--bone-2);
}
.pd-hero-media img { width: 100%; height: 100%; object-fit: cover; }

.pd-body {
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(3rem, 7vh, 6rem) var(--side-pad);
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.pd-overview p {
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: 1.8;
  margin-bottom: 1.2rem;
  max-width: 60ch;
}
.pd-meta { border-top: 1px solid var(--line); }
.pd-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.pd-meta-key {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--stone);
}
.pd-meta-val { color: var(--ink); text-align: right; }

.pd-gallery {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--side-pad) clamp(4rem, 9vh, 8rem);
}
.pd-gallery-head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.pd-gallery-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.05;
  color: var(--ink);
  margin-top: 0.4rem;
}
.pd-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.8rem, 1.5vw, 1.4rem);
}
.pd-gallery-grid figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-sm);
  aspect-ratio: 4 / 3;
  background: var(--bone-2);
}
.pd-gallery-grid figure.wide { grid-column: 1 / -1; aspect-ratio: 16 / 8; }
.pd-gallery-grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}
.pd-gallery-grid figure:hover img { transform: scale(1.04); }

.pd-next {
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(3rem, 6vh, 5rem) var(--side-pad);
  border-top: 1px solid var(--line);
}
.pd-next-link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1rem;
}
.pd-next-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.05;
  color: var(--ink);
  transition: color var(--t-med) var(--ease-out);
}
.pd-next-link:hover .pd-next-name { color: var(--clay); }
.pd-next-loc {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone);
}

@media (max-width: 860px) {
  .pd-body { grid-template-columns: 1fr; gap: 2rem; }
  .pd-gallery-grid { grid-template-columns: 1fr; }
  .pd-gallery-grid figure,
  .pd-gallery-grid figure.wide { aspect-ratio: 4 / 3; }
}

/* ============================================================
   LIGHTBOX (gallery zoom)
   ============================================================ */
.pd-gallery-grid img { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), visibility 0.4s var(--ease-out);
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 17, 15, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
}
.lightbox-img {
  max-width: min(1200px, 86vw);
  max-height: 82dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-sm);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  transform: scale(0.98);
  transition: transform 0.4s var(--ease-out);
}
.lightbox.is-open .lightbox-img { transform: none; }
.lightbox-count {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--stone-on-dark);
  font-variant-numeric: tabular-nums;
}

.lightbox-nav,
.lightbox-close {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  color: var(--bone-on-dark);
  background: rgba(243, 238, 230, 0.08);
  border-radius: var(--r-pill);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.lightbox-nav { width: 3rem; height: 3rem; font-size: 1.3rem; }
.lightbox-nav:hover { background: var(--clay); color: var(--bone); }
.lightbox-close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.6rem;
  background: rgba(243, 238, 230, 0.12);
}
.lightbox-close:hover { background: var(--clay); color: var(--bone); }

@media (max-width: 760px) {
  .lightbox { grid-template-columns: 1fr; }
  .lightbox-nav { position: absolute; bottom: clamp(1rem, 4vw, 2rem); }
  .lightbox-prev { left: clamp(1rem, 5vw, 2rem); }
  .lightbox-next { right: clamp(1rem, 5vw, 2rem); }
  .lightbox-img { max-width: 92vw; max-height: 72dvh; }
}

/* ============================================================
   FOOTER LEGAL LINKS
   ============================================================ */
.footer-legal {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-legal a {
  color: var(--stone-on-dark);
  font-size: 0.84rem;
  transition: color var(--t-med) var(--ease-out);
}
.footer-legal a:hover,
.footer-legal a[aria-current="page"] { color: var(--bone-on-dark); }

/* ============================================================
   LEGAL PAGES (privacy / terms / cookies)
   ============================================================ */
.legal-body {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(1rem, 3vh, 2rem) var(--side-pad) clamp(5rem, 10vh, 8rem);
  color: var(--ink-soft);
}
/* Keep a comfortable reading measure while staying left-aligned under
   the page hero (rather than centering a narrow column). */
.legal-body > * { max-width: 70ch; }
.legal-body .legal-lede {
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 2.6rem;
}
.legal-body h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 2.8rem 0 0.9rem;
}
.legal-body p { line-height: 1.75; margin-bottom: 1rem; }
.legal-body ul {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
}
.legal-body li {
  position: relative;
  padding-left: 1.4rem;
  line-height: 1.7;
  margin-bottom: 0.7rem;
}
.legal-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clay);
}
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-body a {
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--t-med) var(--ease-out);
}
.legal-body a:hover { color: var(--clay-deep); }
.legal-body .legal-note {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--stone);
  font-style: italic;
}

/* ============================================================
   ERROR PAGES (404 / 500)
   ============================================================ */
.error-page {
  max-width: 1500px;
  margin: 0 auto;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(9rem, 20vh, 14rem) var(--side-pad) clamp(5rem, 10vh, 8rem);
}
.error-code {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(5rem, 14vw, 11rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--clay);
  margin: 0.8rem 0 1.4rem;
}
.error-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-h2);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.error-title .it { font-style: italic; color: var(--clay); }
.error-sub {
  margin-top: 1.4rem;
  max-width: 48ch;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.7;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.4rem;
}
@media (max-width: 480px) {
  .error-actions { width: 100%; }
  .error-actions .btn { width: 100%; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-thread { display: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
