/* ============================================================
   MERIDIAN ESTATES — warm editorial minimalism
   warm white #faf7f2 · charcoal #1c1a17 · gold hairline #b39352
   ============================================================ */

:root {
  --paper: #faf7f2;
  --paper-deep: #f3eee4;
  --char: #1c1a17;
  --char-soft: #43403a;
  --gold: #b39352;
  --gold-ink: #7c6434;          /* AA-safe gold for small text on paper */
  --gold-faint: rgba(179, 147, 82, .34);
  --panel: #211e1a;             /* charcoal graphic panels */
  --sans: "Archivo", system-ui, -apple-system, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --ease: cubic-bezier(.22, .8, .3, 1);
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--char);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
h1, h2, h3, p, ul, figure { margin: 0; }
a { color: inherit; }

::selection { background: var(--gold); color: var(--paper); }

/* ---------- focus ---------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -3.5rem;
  z-index: 100;
  background: var(--char);
  color: var(--paper);
  padding: .6rem 1.1rem;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 4.5rem);
}

.section { padding-block: clamp(6rem, 11vw, 10.5rem); }

/* ============ header ============ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(250, 247, 242, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--gold-faint);
}
.header-inner {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 4.5rem);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: var(--char);
}
.brand-mark { width: 34px; height: 34px; color: var(--gold); flex: none; }
.brand-word {
  font-size: .84rem;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav {
  margin-left: auto;
  display: flex;
  gap: clamp(1.2rem, 2.5vw, 2.4rem);
}
.site-nav a {
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--char-soft);
  padding-block: .4rem;
  border-bottom: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.site-nav a:hover { color: var(--char); border-bottom-color: var(--gold); }

.header-cta {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--char);
  border: 1px solid var(--gold);
  padding: .62rem 1.4rem;
  transition: background-color .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.header-cta:hover { background: var(--char); color: var(--paper); border-color: var(--char); }

/* ============ buttons ============ */
.btn {
  display: inline-block;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2rem;
  border: 1px solid var(--char);
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn-solid { background: var(--char); color: var(--paper); }
.btn-solid:hover { background: transparent; color: var(--char); }
.btn-ghost { border-color: var(--gold); color: var(--char); }
.btn-ghost:hover { background: var(--char); border-color: var(--char); color: var(--paper); }
.btn-gold { border-color: var(--gold); color: var(--paper); }
.btn-gold:hover { background: var(--gold); color: var(--char); }

/* ============ 1 · hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding-bottom: clamp(5rem, 8vw, 6.5rem);
  background:
    radial-gradient(120% 90% at 82% 6%, rgba(179, 147, 82, .10), transparent 55%),
    linear-gradient(180deg, #fbf9f5 0%, var(--paper) 46%, var(--paper-deep) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  padding-block: calc(var(--header-h) + clamp(3rem, 6vw, 5rem)) 0;
}

.eyebrow {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 1.8rem;
}

.hero-title {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(2.7rem, 7.4vw, 5.9rem);
  line-height: 1.04;
  letter-spacing: -.022em;
  max-width: 13ch;
}
.hero-title em, .section-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
}

.hero-sub {
  max-width: 34rem;
  margin-top: 2rem;
  font-size: 1.1rem;
  color: var(--char-soft);
}

.hero-actions {
  margin-top: 2.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-art {
  position: relative;
  z-index: 1;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  pointer-events: none;
}
.hero-art svg { width: 100%; height: clamp(200px, 30vw, 430px); }

/* editorial photo band under the headline; overlaps the drawing's ground lines */
.hero-figure {
  position: relative;
  z-index: 2;
  margin-top: clamp(-72px, -5vw, -32px);
}
.hero-photo { aspect-ratio: 1672 / 941; }

.scroll-cue {
  position: absolute;
  z-index: 3;
  right: clamp(1.25rem, 5vw, 4.5rem);
  bottom: 1.9rem;
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
  color: var(--gold-ink);
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.scroll-cue svg { width: 11px; height: 40px; }
.scroll-cue svg path { animation: cue-drift 2.6s var(--ease) infinite; }
@keyframes cue-drift {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(5px); opacity: .55; }
}

/* SVG line-draw (pathLength="1" elements) — only when JS is present */
.js .d {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.4s var(--ease);
}
.js .in-view .d { stroke-dashoffset: 0; }
.js .d:nth-of-type(2n) { transition-delay: .3s; }
.js .d:nth-of-type(3n) { transition-delay: .55s; }

.art-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .22em;
  font-weight: 400;
}

/* ============ section furniture ============ */
.section-head {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-bottom: clamp(2.6rem, 5vw, 4.2rem);
}
.section-head .index {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold-ink);
}
.section-head .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--gold-faint));
}
.section-head .kicker {
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.section-title {
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -.016em;
  max-width: 22ch;
}

.section-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.section-note {
  max-width: 26rem;
  color: var(--char-soft);
  font-size: .98rem;
}

/* ============ 2 · story ============ */
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: start;
}
.story-right p + p { margin-top: 1.4rem; }
.lede {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  font-weight: 400;
  line-height: 1.55;
}

.story-lower {
  margin-top: clamp(3.5rem, 7vw, 6.5rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}

.principles {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 2.2rem;
}
.principles li {
  border-top: 1px solid var(--gold-faint);
  padding-top: 1.4rem;
}
.principles .p-num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-ink);
  font-size: 1.05rem;
}
.principles h3 {
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: .06em;
  margin: .5rem 0 .55rem;
}
.principles p {
  font-size: .95rem;
  color: var(--char-soft);
}

/* ============ graphic panels ============ */
.panel {
  position: relative;
  overflow: hidden;
}
.panel svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.panel-charcoal {
  background:
    radial-gradient(130% 110% at 20% 0%, #2b271f 0%, transparent 60%),
    linear-gradient(160deg, #26221d 0%, var(--panel) 55%, #191713 100%);
  border: 1px solid rgba(179, 147, 82, .28);
}
.panel-paper {
  background:
    linear-gradient(165deg, #fdfbf7 0%, #f4efe4 100%);
  border: 1px solid var(--gold-faint);
}
/* photography panels — gold hairline frame, inner hairline mat */
.panel-photo {
  background: var(--panel);
  border: 1px solid rgba(179, 147, 82, .4);
}
.panel-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.panel-photo::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(179, 147, 82, .5);
  pointer-events: none;
}
.panel-caption {
  margin-top: .9rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--char-soft);
}
.cap-index {
  font-family: var(--sans);
  font-style: normal;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-right: .55rem;
}

.story-panel { aspect-ratio: 4 / 3; }
figure.story-panel { display: block; }
.story-lower figure { margin: 0; }

/* aspect helpers (zero CLS) */
.ar-4x5   { aspect-ratio: 4 / 5; }
.ar-3x4   { aspect-ratio: 4 / 5; }
.ar-16x10 { aspect-ratio: 16 / 10; }
.card-panel { aspect-ratio: 20 / 13; }

/* ============ 3 · residences ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem) clamp(2rem, 4vw, 3rem);
}
.card { min-width: 0; }
.card .panel { transition: border-color .35s var(--ease); }
.card:hover .panel { border-color: rgba(179, 147, 82, .6); }
.card-panel svg { transition: transform .6s var(--ease); }
.card:hover .card-panel svg { transform: scale(1.02); }

.card-body { padding-top: 1.5rem; }
.card-title {
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: -.01em;
}
.card-spec {
  margin-top: .45rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.card-note {
  margin-top: .85rem;
  max-width: 30rem;
  color: var(--char-soft);
  font-size: .98rem;
}
.card-price {
  margin-top: 1rem;
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--char);
  border-bottom: 1px solid var(--gold);
  padding-bottom: .15rem;
}

/* ============ 4 · gallery mosaic ============ */
.gallery { background: var(--paper-deep); }
.mosaic {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}
.m1 { grid-column: 1 / span 5; }
.m2 { grid-column: 6 / span 4; margin-top: 3.5rem; }
.m3 { grid-column: 10 / span 3; margin-top: 7rem; }
.m4 { grid-column: 1 / span 6; margin-top: 1rem; }
.m5 { grid-column: 7 / span 3; margin-top: 4rem; }
.m6 { grid-column: 10 / span 3; }
.mosaic-item { margin: 0; min-width: 0; }
.mosaic-item .panel { transition: border-color .35s var(--ease); }
.mosaic-item:hover .panel { border-color: rgba(179, 147, 82, .6); }

/* ============ 5 · visit (dark band) ============ */
.section-dark {
  background:
    radial-gradient(90% 130% at 85% 10%, rgba(179, 147, 82, .12), transparent 55%),
    linear-gradient(170deg, #232019 0%, var(--char) 60%, #14120f 100%);
  color: #efe9dd;
  padding-block: clamp(6rem, 11vw, 10rem);
}
.section-head.on-dark .index,
.section-head.on-dark .kicker { color: #cbb075; }
.section-head.on-dark .rule { background: linear-gradient(90deg, var(--gold), rgba(179, 147, 82, .15)); }
.section-title.on-dark { color: #f7f3ea; }

.visit-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.visit-copy p {
  margin-top: 1.5rem;
  max-width: 33rem;
  color: #d9d2c4;
}

.visit-action {
  border-left: 1px solid rgba(179, 147, 82, .4);
  padding-left: clamp(1.5rem, 3vw, 3rem);
  display: grid;
  gap: 1.3rem;
  justify-items: start;
}
.visit-label {
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #cbb075;
}
.visit-email {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  color: #f7f3ea;
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: .2rem;
  overflow-wrap: anywhere;
  transition: color .25s var(--ease);
}
.visit-email:hover { color: #cbb075; }
.visit-fine { font-size: .85rem; color: #a89f8d; }

/* ============ 6 · footer ============ */
.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--gold-faint);
  padding-block: 3.5rem 2.5rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--gold-faint);
}
.footer-brand .brand-mark { width: 30px; height: 30px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.footer-nav a {
  font-size: .76rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--char-soft);
  border-bottom: 1px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.footer-nav a:hover { color: var(--char); border-bottom-color: var(--gold); }

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .8rem 2rem;
  font-size: .85rem;
  color: var(--char-soft);
}
.footer-credit a {
  color: var(--gold-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  transition: color .25s var(--ease);
}
.footer-credit a:hover { color: var(--char); }

/* ============ reveal animation (JS-gated: content visible without JS) ============ */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity .9s var(--ease) var(--d, 0s),
    transform .9s var(--ease) var(--d, 0s);
  will-change: opacity, transform;
}
.js .reveal.in-view { opacity: 1; transform: none; }

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .d { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
  .scroll-cue svg path { animation: none; }
  .card-panel svg, .card .panel, .mosaic-item .panel { transition: none; }
}

/* ============ responsive ============ */
@media (max-width: 1024px) {
  .story-lower { grid-template-columns: 1fr; }
  .m1 { grid-column: 1 / span 6; }
  .m2 { grid-column: 7 / span 6; margin-top: 4rem; }
  .m3 { grid-column: 1 / span 6; margin-top: 0; }
  .m4 { grid-column: 7 / span 6; }
  .m5 { grid-column: 1 / span 6; margin-top: 0; }
  .m6 { grid-column: 7 / span 6; margin-top: 2rem; }
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .story-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .visit-grid { grid-template-columns: 1fr; }
  .visit-action {
    border-left: 0;
    border-top: 1px solid rgba(179, 147, 82, .4);
    padding-left: 0;
    padding-top: 2.2rem;
  }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  body { font-size: 1rem; }
  .brand-word { letter-spacing: .22em; font-size: .78rem; }
  .header-cta { padding: .5rem 1rem; }
  .hero-inner { padding-block: calc(var(--header-h) + 2.5rem) 0; }
  .hero-photo { aspect-ratio: 3 / 2; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .mosaic { grid-template-columns: 1fr; gap: 2.2rem; }
  .m1, .m2, .m3, .m4, .m5, .m6 {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .scroll-cue { display: none; }
  .footer-bottom { flex-direction: column; }
}
