/* ================================================
   THE MADAME X MANSION — Redesigned Styles
   Textural Backgrounds, Gilded Age Elegance
   ================================================ */

/* === RESET & BASE === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #0a0a0a;
  --ivory: #f5f0e8;
  --gold: #c5a55a;
  --gold-light: #d4b96e;
  --burgundy: #5c1a1a;
  --burgundy-deep: #3d1010;
  --lavender: #9b8fa3;
  --lavender-muted: #7a6f84;
  --cream: #ebe5d9;
  --dark-card: rgba(15, 15, 15, 0.85);
  --border-subtle: rgba(197, 165, 90, 0.15);
  --border-gold: rgba(197, 165, 90, 0.3);
  --motion-duration: 600ms;
  --motion-texture-duration: 900ms;
  --motion-interaction-duration: 240ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-distance: 16px;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: 'Crimson Text', Georgia, serif;
  background: var(--black);
  color: var(--ivory);
  line-height: 1.7;
  overflow-x: clip;
}

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

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--gold-light);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* === FONTS === */
.font-display {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

/* === NOISE OVERLAY === */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* === TEXTURE BACKGROUNDS (fixed, crossfade) === */
.texture-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* A stable canvas avoids texture resizing as mobile browser chrome moves. */
@supports (height: 100lvh) {
  .texture-background {
    bottom: auto;
    height: 100lvh;
  }
}

.texture-bg-fixed {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  pointer-events: none;
}

.texture-incoming {
  opacity: 0;
}

/* Per-section texture divs hidden — replaced by fixed layers in JS */
.texture-bg {
  display: none;
}

/* Fixed overlay sits on top of fixed textures, below content */
.texture-overlay-fixed {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.6);
  z-index: 0;
  pointer-events: none;
}

/* Per-section overlays no longer needed — keep transparent for spacing */
.texture-overlay {
  display: none;
}

.texture-overlay.overlay-heavy {
  display: none;
}

/* === NAVIGATION === */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: rgba(10, 10, 10, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color var(--motion-interaction-duration) ease;
}

.site-nav.scrolled {
  background: rgba(10, 10, 10, 0.92);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ivory);
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-links a.active {
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ivory);
  margin: 5px 0;
  transition: transform var(--motion-interaction-duration) var(--motion-ease), opacity var(--motion-interaction-duration) ease;
}

.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-mobile {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0a0a0a;
  padding: 5rem 2rem 2rem;
  flex-direction: column;
  gap: 0;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity var(--motion-interaction-duration) ease, visibility 0s var(--motion-interaction-duration);
}

.nav-mobile.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

html.menu-open {
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
}

.nav-mobile a {
  font-family: 'Jost', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ivory);
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border-subtle);
  display: block;
  -webkit-tap-highlight-color: rgba(197, 165, 90, 0.2);
  cursor: pointer;
}

.nav-mobile a:active {
  color: var(--gold);
}

.nav-mobile a.active { color: var(--gold); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

/* === SECTION COMMON === */
section {
  position: relative;
  overflow: hidden;
}

/* Make sure main content sits above fixed bg layers */
main, .site-footer {
  position: relative;
  z-index: 1;
}

.section-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.ornament-line {
  display: block;
  width: 50px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

.ornament-diamond {
  color: var(--gold);
  font-size: 0.6rem;
  opacity: 0.6;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 1rem;
}

.section-sub {
  text-align: center;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--lavender);
  max-width: 650px;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

/* === HERO === */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-ornament {
  --reveal-opacity: 0.6;
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0.6;
  margin: 0.5rem 0;
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.1;
  margin: 0.5rem 0;
}

.hero-address {
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 1.5rem;
}

.hero-tagline {
  font-size: 1.4rem;
  font-style: italic;
  color: var(--lavender);
  margin: 1rem 0 0.5rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  cursor: pointer;
  z-index: 2;
}

.hero-scroll-text {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.5;
}

.hero-scroll-arrow {
  color: var(--gold);
  opacity: 0.5;
  font-size: 1.2rem;
  animation: bobArrow 2s ease-in-out infinite;
}

@keyframes bobArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (max-width: 768px) {
  .hero-scroll {
    display: none;
  }
}

/* === PAGE HERO (inner pages) === */
.page-hero {
  min-height: 50vh;
  min-height: 50svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 2rem 3rem;
}

.page-hero.page-hero-short {
  min-height: 45vh;
  min-height: 45svh;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.page-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.page-hero-sub {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--lavender);
  line-height: 1.6;
}

/* === BUTTONS === */
.btn-gold {
  display: inline-block;
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  background: var(--gold);
  color: var(--black);
  border: 1px solid var(--gold);
  transition: background-color var(--motion-interaction-duration) ease, border-color var(--motion-interaction-duration) ease, color var(--motion-interaction-duration) ease;
  cursor: pointer;
}

.btn-gold:hover {
  background: var(--gold-light);
  color: var(--black);
}

.btn-outline {
  display: inline-block;
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border-gold);
  transition: background-color var(--motion-interaction-duration) ease, border-color var(--motion-interaction-duration) ease, color var(--motion-interaction-duration) ease;
}

.btn-outline:hover {
  background: rgba(197, 165, 90, 0.1);
  color: var(--gold-light);
}

.btn-gold-lg {
  display: inline-block;
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 1.1rem 2.5rem;
  background: var(--gold);
  color: var(--black);
  border: 1px solid var(--gold);
  transition: background-color var(--motion-interaction-duration) ease, border-color var(--motion-interaction-duration) ease, color var(--motion-interaction-duration) ease;
}

.btn-gold-lg:hover {
  background: var(--gold-light);
  color: var(--black);
}

.btn-full {
  display: block;
  width: 100%;
  text-align: center;
}

.text-link {
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  transition: color 0.3s;
}

.text-link:hover { color: var(--gold-light); }

/* === INTRO SECTION (homepage) === */
.intro-section {
  padding: 6rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  text-align: center;
}

.intro-text {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.intro-sub {
  font-size: 1.1rem;
  color: var(--lavender);
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* === BUILDING HIGHLIGHT (homepage) === */
.building-highlight {
  padding: 5rem 2rem;
}

.building-highlight-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
}

.building-highlight-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 2.5rem 0;
  text-align: center;
}

.building-highlight-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2.5rem;
}

.highlight-feature {
  padding: 1.5rem;
  border: 1px solid var(--border-subtle);
  background: var(--dark-card);
}

.highlight-feature h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.highlight-feature p {
  font-size: 0.95rem;
  color: var(--cream);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .building-highlight-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .building-highlight-features {
    grid-template-columns: 1fr;
  }
}

/* === PREVIEW SECTION (homepage apartments) === */
.preview-section {
  padding: 6rem 2rem;
}

.preview-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.preview-card {
  background: var(--dark-card);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: transform var(--motion-interaction-duration) var(--motion-ease), border-color var(--motion-interaction-duration) ease;
  color: var(--ivory);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .preview-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-4px);
    color: var(--ivory);
  }
}

.preview-card-img {
  height: 200px;
  overflow: hidden;
}

.preview-card-info {
  padding: 1.5rem;
}

.preview-card-info h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.unit-specs {
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.3rem;
}

.unit-detail {
  font-size: 0.95rem;
  color: var(--lavender);
}

.preview-more {
  text-align: center;
}

/* === PLACEHOLDER IMAGES === */
.placeholder-img {
  background: linear-gradient(135deg, rgba(92, 26, 26, 0.3) 0%, rgba(10, 10, 10, 0.8) 50%, rgba(197, 165, 90, 0.15) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.placeholder-img.placeholder-lg {
  min-height: 350px;
}

.placeholder-img.placeholder-dim {
  opacity: 0.5;
}

.placeholder-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--lavender-muted);
}

.placeholder-label-sm {
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lavender-muted);
}

/* === CTA SECTION === */
.cta-section {
  padding: 6rem 2rem;
  text-align: center;
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  margin-bottom: 1rem;
}

.cta-content p {
  font-size: 1.15rem;
  color: var(--lavender);
  margin-bottom: 2rem;
}

/* === STORY PAGE === */
.story-section {
  padding: 2rem 2rem 4rem;
}

.story-content-wrap {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.story-featured-image {
  margin-bottom: 2.5rem;
  text-align: center;
}

.story-featured-image img {
  max-height: 500px;
  margin: 0 auto;
  border: 1px solid var(--border-subtle);
}

.image-caption {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--lavender-muted);
  margin-top: 1rem;
  font-style: italic;
}

.story-beats {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.beat-card {
  padding: 1.5rem 2rem;
  border-left: 1px solid var(--border-subtle);
  margin-left: 1rem;
}

.beat-date {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.75rem;
}

.beat-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.beat-card p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--cream);
}

.story-inline-image {
  margin: 1rem 0 1rem 1rem;
  padding-left: 2rem;
  border-left: 1px solid var(--border-subtle);
}

.story-inline-image img {
  max-height: 400px;
  border: 1px solid var(--border-subtle);
}

/* === BUILDING SECTION (on story page) === */
.building-section {
  padding: 4rem 2rem;
}

.building-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
}

.building-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin: 3rem 0;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 300;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.stat-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--lavender);
}

.building-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.detail-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.detail-list li {
  font-size: 0.95rem;
  color: var(--cream);
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.detail-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
  opacity: 0.5;
}

.building-location {
  margin-top: 3rem;
}

.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 1.5rem;
  align-items: start;
}

.location-address {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.location-highlights li {
  font-size: 0.95rem;
  color: var(--lavender);
  padding: 0.3rem 0;
}

/* === APARTMENTS GRID === */
.apartments-grid-section {
  padding: 4rem 2rem 6rem;
}

.apartments-grid-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.apartment-card {
  background: var(--dark-card);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: transform var(--motion-interaction-duration) var(--motion-ease), border-color var(--motion-interaction-duration) ease;
  color: var(--ivory);
  text-decoration: none;
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  a.apartment-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-4px);
  }
}

.apartment-card-image {
  height: 200px;
}

.apartment-card-body {
  padding: 1.5rem;
}

.apartment-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.apartment-card-header h3 {
  font-size: 1.5rem;
  font-weight: 400;
}

.apartment-badge {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border-gold);
  color: var(--gold);
}

.apartment-size {
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--lavender);
  display: block;
  margin-bottom: 1rem;
}

.apartment-highlights {
  margin-bottom: 1.5rem;
}

.apartment-highlights li {
  font-size: 0.9rem;
  color: var(--cream);
  padding: 0.25rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.apartment-highlights li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
  opacity: 0.4;
  font-size: 0.8rem;
}

.apartment-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.apartment-price {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lavender);
}

.apartment-link {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.apartment-card-placeholder {
  opacity: 0.5;
}

.placeholder-text {
  font-size: 0.95rem;
  color: var(--lavender-muted);
  font-style: italic;
}

/* === AMENITIES === */
.amenities-section {
  padding: 4rem 2rem 6rem;
}

.amenities-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.amenity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.amenity-tag {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border-gold);
  color: var(--cream);
  transition: background-color var(--motion-interaction-duration) ease, border-color var(--motion-interaction-duration) ease, color var(--motion-interaction-duration) ease;
}

.amenity-tag:hover {
  background: rgba(197, 165, 90, 0.08);
}

/* === UNIT DETAIL PAGE === */
.unit-hero {
  padding: 8rem 2rem 3rem;
  text-align: center;
}

.unit-hero-content {
  position: relative;
  z-index: 2;
}

.back-link {
  --reveal-opacity: 0.7;
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-block;
  margin-bottom: 2rem;
  opacity: 0.7;
}

.back-link:hover { opacity: 1; --reveal-opacity: 1; }

.unit-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.unit-hero-meta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.unit-meta-item {
  font-family: 'Jost', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lavender);
}

.unit-meta-divider {
  color: var(--gold);
  opacity: 0.4;
}

/* Unit gallery */
.unit-gallery-section {
  padding: 3rem 2rem;
}

.unit-gallery-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
}

.unit-gallery-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 1rem;
}

.unit-gallery-main {
  grid-row: 1 / 3;
}

.unit-gallery-thumb {
  min-height: 110px;
}

.tour-placeholder {
  margin-top: 2rem;
  border: 1px dashed var(--border-gold);
  padding: 2rem;
  text-align: center;
}

.tour-icon {
  font-size: 2rem;
  color: var(--gold);
  opacity: 0.5;
}

.tour-placeholder .font-display {
  font-size: 1.3rem;
  color: var(--ivory);
  margin: 0.5rem 0;
}

.tour-coming-soon {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--lavender-muted);
}

/* Unit details */
.unit-details-section {
  padding: 4rem 2rem 6rem;
}

.unit-details-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
}

.unit-details-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: start;
}

.unit-details-main h2 {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 1rem;
}

.unit-details-main p {
  font-size: 1.05rem;
  color: var(--cream);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.unit-pricing-card {
  background: var(--dark-card);
  border: 1px solid var(--border-gold);
  padding: 2rem;
  text-align: center;
}

.unit-pricing-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.pricing-inquire {
  font-size: 1rem;
  color: var(--lavender);
  margin-bottom: 1.5rem;
}

.unit-pricing-card .btn-gold,
.unit-pricing-card .btn-outline {
  margin-bottom: 0.75rem;
}

/* Other units */
.other-units-section {
  padding: 4rem 2rem;
}

.other-units-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.other-units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.other-unit-card {
  background: var(--dark-card);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  text-align: center;
  color: var(--ivory);
  transition: background-color var(--motion-interaction-duration) ease, border-color var(--motion-interaction-duration) ease, color var(--motion-interaction-duration) ease;
}

.other-unit-card:hover {
  border-color: var(--border-gold);
  color: var(--ivory);
}

.other-unit-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.other-unit-card span {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lavender);
}

/* === CONTACT PAGE === */
.contact-section {
  padding: 4rem 2rem 6rem;
}

.contact-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: start;
}

.contact-info h2 {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 2rem;
}

.contact-detail {
  margin-bottom: 1.5rem;
}

.contact-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.5rem;
}

.contact-map {
  margin-top: 2rem;
}

/* Apply banner */
.apply-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: rgba(197, 165, 90, 0.1);
  border: 1px solid var(--border-gold);
  margin-bottom: 2rem;
}

.apply-banner-icon {
  color: var(--gold);
}

.apply-banner-text {
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Form styles */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(15, 15, 15, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--ivory);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-input::placeholder {
  color: var(--lavender-muted);
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.btn-submit {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  padding: 1rem;
  border: none;
}

.apply-coming-soon {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

/* === FOOTER === */
.site-footer {
  background: #050505;
  padding: 4rem 2rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}

.footer-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.footer-sub {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--lavender);
  margin-bottom: 2rem;
}

.footer-nav {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.footer-nav a {
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ivory);
}

.footer-nav a:hover { color: var(--gold); }

.footer-contact {
  font-size: 0.9rem;
  color: var(--lavender);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.footer-divider {
  width: 40px;
  height: 1px;
  background: var(--gold);
  opacity: 0.3;
  margin: 1.5rem auto;
}

.footer-legal {
  font-size: 0.8rem;
  color: var(--lavender-muted);
  margin-bottom: 0.5rem;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--lavender-muted);
  opacity: 0.6;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .building-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .building-details {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .location-grid {
    grid-template-columns: 1fr;
  }

  .unit-details-grid {
    grid-template-columns: 1fr;
  }

  .unit-gallery-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .beat-card {
    padding: 2rem 1.5rem;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
  }
}

@media (max-width: 480px) {
  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .apartments-grid-content {
    grid-template-columns: 1fr;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }
}

/* === SHARED MOTION === */
/* Readable by default; JS opts individual elements into one-time reveals. */
[data-reveal] {
  transition: transform var(--motion-interaction-duration) var(--motion-ease),
    border-color var(--motion-interaction-duration) ease,
    background-color var(--motion-interaction-duration) ease,
    color var(--motion-interaction-duration) ease;
}

.reveal-pending:not(.revealed) {
  opacity: 0;
  transform: translate3d(0, var(--motion-distance), 0);
  transition: none;
}

/* Keyframes run even when a reveal happens before the first browser paint. */
@keyframes revealContent {
  from {
    opacity: 0;
    transform: translate3d(0, var(--motion-distance), 0);
  }
  to {
    opacity: var(--reveal-opacity, 1);
    transform: translate3d(0, 0, 0);
  }
}

[data-reveal].revealed:not(.reveal-complete) {
  animation: revealContent var(--motion-duration) var(--motion-ease) backwards;
}

.apartment-card-placeholder {
  --reveal-opacity: 0.5;
}

/* Hero words enter in a short sequence on every page, including the homepage. */
:is(.hero-content, .page-hero-content, .unit-hero-content)[data-reveal] {
  transition: none;
}

:is(.hero-content, .page-hero-content, .unit-hero-content)[data-reveal].revealed {
  animation: none;
}

:is(.hero-content, .page-hero-content, .unit-hero-content).revealed:not(.reveal-complete) > * {
  animation: revealContent var(--motion-duration) var(--motion-ease) backwards;
  animation-delay: var(--reveal-delay, 0ms);
}

:is(.hero-content, .page-hero-content, .unit-hero-content) > :nth-child(2) { --reveal-delay: 80ms; }
:is(.hero-content, .page-hero-content, .unit-hero-content) > :nth-child(3) { --reveal-delay: 160ms; }
:is(.hero-content, .page-hero-content, .unit-hero-content) > :nth-child(4) { --reveal-delay: 240ms; }
:is(.hero-content, .page-hero-content, .unit-hero-content) > :nth-child(5) { --reveal-delay: 320ms; }
:is(.hero-content, .page-hero-content, .unit-hero-content) > :nth-child(6) { --reveal-delay: 400ms; }

[data-reveal]:focus-within,
[data-reveal]:focus-within > * {
  animation: none !important;
}

[id] {
  scroll-margin-top: 6rem;
}

@media (max-width: 768px) {
  :root {
    --motion-duration: 480ms;
    --motion-distance: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal-pending:not(.revealed) {
    opacity: 1;
    transform: none;
  }

  .apartment-card-placeholder.reveal-pending:not(.revealed) {
    opacity: 0.5;
  }

  .preview-card:hover, a.apartment-card:hover {
    transform: none;
  }
}
