/* ============================================================
   THE LAS VEGAS REAL — Design System
   Keith Jones · Las Vegas Realtor
   Summerlin.com palette · Instrument Serif + Plus Jakarta Sans
   Dark cinematic + light editorial sections
   ============================================================ */

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

:root {
  /* Accent */
  --accent: #B44539;
  --accent-hover: #F37163;
  --accent-dark: #9B3B31;
  --accent-glow: rgba(180, 69, 57, 0.25);
  --accent-glow-strong: rgba(180, 69, 57, 0.5);

  /* Dark surfaces */
  --bg: #000;
  --surface-dark: #1D1D1D;

  /* Light surfaces */
  --surface-light: #FEFEFE;
  --surface-alt: #F1F1F1;
  --surface-warm: #FEF4F3;

  /* Text */
  --ink-1: #1D1D1D;
  --ink-2: #3E3E3E;
  --ink-3: #687789;
  --ink-on-dark: #FFF;

  /* Borders */
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);
  --border-light: rgba(0,0,0,0.08);
  --border-light-hover: rgba(0,0,0,0.16);

  /* Typography */
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --space-section: clamp(3rem, 6vw, 5rem);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 100px;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Durations */
  --dur-fast: 0.2s;
  --dur-normal: 0.4s;
  --dur-slow: 0.8s;
}

/* --- BASE STYLES --- */
html { font-size: 16px; scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-on-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--accent); color: #fff; }

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(3rem, 8vw, 6.5rem); }
h2 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-3);
}

/* --- LINE REVEAL SYSTEM --- */
.line {
  display: block;
  overflow: hidden;
  position: relative;
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
}

.line__inner {
  display: block;
  transform: translateY(110%);
  will-change: transform;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 40px var(--accent-glow);
}

.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 60px var(--accent-glow-strong);
  transform: translateY(-2px);
}

.btn--outline {
  background: rgba(255,255,255,0.08);
  color: var(--ink-on-dark);
  border: 1.5px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn--outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.btn--outline-dark {
  background: transparent;
  color: var(--ink-1);
  border: 1px solid var(--border-light-hover);
}

.btn--outline-dark:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--lg { padding: 1.25rem 3.5rem; font-size: 1rem; }
.btn--full { width: 100%; }

/* --- LAYOUT UTILITIES --- */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

.section {
  position: relative;
  z-index: 1;
  padding: var(--space-section) 0;
}

.section--dark {
  background: var(--bg);
  color: var(--ink-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--ink-on-dark);
}

.section--dark p { color: rgba(255,255,255,0.65); }

.section--alt {
  background: var(--surface-alt);
  color: var(--ink-1);
}

.section--alt p { color: var(--ink-2); }

.section--warm {
  background: var(--surface-warm);
  color: var(--ink-1);
}

.section--warm p { color: var(--ink-2); }

.section--light {
  background: var(--surface-light);
  color: var(--ink-1);
}

.section--light h1,
.section--light h2,
.section--light h3,
.section--light h4 {
  color: var(--ink-1);
}

.section--light p { color: var(--ink-2); }

.section-header {
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.section-header--center {
  text-align: center;
}

.section-header--center p {
  max-width: 600px;
  margin-inline: auto;
  color: var(--ink-3);
  margin-top: 1rem;
}

.section-header__eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: block;
}

.section-header__title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.grid { display: grid; gap: 2rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* --- WEBGL CANVAS --- */
#webgl {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- NAVIGATION --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.5rem, 4vw, 3rem);
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(-20px);
  transition: padding var(--dur-normal) var(--ease-out);
}

.nav--scrolled {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.nav__logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--ink-on-dark);
}

.nav__logo-accent { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav__links a {
  position: relative;
  transition: color 0.3s;
  color: var(--ink-on-dark);
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-normal) var(--ease-out);
}

.nav__links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__links a:hover { color: var(--accent); }

.nav__links a.is-active { color: var(--accent); }
.nav__links a.is-active::after { transform: scaleX(1); }

.nav__cta-btn {
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-normal), transform var(--dur-normal);
}

.nav__cta-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* Mobile burger */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}

.nav__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink-on-dark);
  transition: transform 0.3s, opacity 0.3s;
}

.nav__burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__burger.is-open span:nth-child(2) {
  opacity: 0;
}

.nav__burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile overlay */
.nav__mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
  overscroll-behavior: none;
  touch-action: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Extra layer to cover any gap below the overlay */
.nav__mobile-overlay::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  bottom: -200px;
  height: 300px;
  background: #000;
  z-index: -1;
}

/* Also cover the top for notch area */
.nav__mobile-overlay::before {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  top: -100px;
  height: 200px;
  background: #000;
  z-index: -1;
}

html.menu-open,
body.menu-open {
  overflow: hidden !important;
  overflow: clip !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
}

.nav__mobile-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav__mobile-overlay a {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--ink-on-dark);
  transition: color 0.3s;
}

.nav__mobile-overlay a:hover { color: var(--accent); }

/* --- LOADER (home only) --- */
.loader {
  position: fixed;
  inset: 0;
  background: var(--surface-dark);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.loader__text {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--ink-on-dark);
  letter-spacing: -0.02em;
}

.loader__bar {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loader__progress {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 20px var(--accent-glow-strong);
}

.loader__count {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* --- HERO (full viewport, video background) --- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35) 0%,
    rgba(0,0,0,0.15) 25%,
    rgba(0,0,0,0.25) 50%,
    rgba(0,0,0,0.5) 75%,
    rgba(0,0,0,0.85) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  text-shadow: 0 2px 20px rgba(0,0,0,0.6), 0 1px 4px rgba(0,0,0,0.4);
}

.hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
  text-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 80px rgba(0,0,0,0.5);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ink-on-dark);
  margin-bottom: 2rem;
}

.hero__accent {
  color: var(--accent);
  font-style: italic;
}

.hero__sub {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin-bottom: 3rem;
  font-weight: 300;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  opacity: 0;
}

.hero__scroll {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  opacity: 0;
}

.hero__scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.3; transform: scaleY(0.6); }
}

/* Hero short variant (inner pages) */
.hero--short {
  min-height: auto;
  padding: clamp(7rem, 12vw, 9rem) 0 clamp(2.5rem, 4vw, 3.5rem);
}

.hero--short .hero__title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
}

/* --- PILLAR CARDS --- */
.pillar-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.pillar-card {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  opacity: 0;
  transform: translateY(60px);
  transition: transform 0.6s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.pillar-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.pillar-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

.pillar-card:hover .pillar-card__img { transform: scale(1.08); }

.pillar-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.2) 70%, transparent 100%);
  pointer-events: none;
  transition: background 0.4s;
}

.pillar-card:hover .pillar-card__overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0.3) 80%, rgba(0,0,0,0.1) 100%);
}

.pillar-card__content {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 2rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.pillar-card__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin-bottom: 0.75rem;
  display: block;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.pillar-card .pillar-card__title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: #fff !important;
  margin-bottom: 0.75rem;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.4);
}

.pillar-card .pillar-card__text {
  font-size: 0.875rem;
  color: #fff !important;
  line-height: 1.6;
  margin-bottom: 1rem;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.pillar-card__arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-hover);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: gap 0.3s var(--ease-out);
}

.pillar-card:hover .pillar-card__arrow { gap: 0.85rem; }

.pillar-card__arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease-out);
}

.pillar-card:hover .pillar-card__arrow svg { transform: translateX(4px); }

/* --- LISTING CARDS --- */
.listings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

.listing-card {
  background: var(--surface-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.6s var(--ease-out), box-shadow 0.4s;
  opacity: 0;
  transform: translateY(40px);
}

.listing-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.listing-card__img-wrap {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.listing-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.listing-card:hover .listing-card__img { transform: scale(1.05); }

.listing-card__badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  z-index: 2;
}

.listing-card__badge--active { background: #2E7D32; }
.listing-card__badge--pending { background: #D4A017; }

.listing-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.listing-card__price {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--ink-1);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.listing-card__address {
  font-size: 0.9rem;
  color: var(--ink-2);
  margin-bottom: 1rem;
}

.listing-card__stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: var(--ink-3);
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.listing-card__stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* --- ABOUT SPLIT LAYOUT --- */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.about-split__img-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.about-split__img {
  width: 100%;
  height: auto;
  display: block;
}

.about-split__img-border {
  position: absolute;
  inset: -6px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  opacity: 0.3;
}

.about-split__content h2 {
  margin-bottom: 1.5rem;
}

.about-split__text {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.about-split__quote {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--accent);
  line-height: 1.5;
  padding-left: 1.5rem;
  border-left: 3px solid var(--accent);
  margin-top: 2rem;
}

/* --- MARQUEE --- */
.marquee {
  position: relative;
  z-index: 1;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: 3rem;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  will-change: transform;
  width: max-content;
}

.marquee__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* --- STATS BAR --- */
.stats-bar {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 6vw, 5rem) 0;
}

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

.stats-bar__item {
  opacity: 0;
  transform: translateY(30px);
}

.stat__number {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.stat__prefix,
.stat__suffix {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--accent);
}

.stat__label {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* Star rating animation */
.stat__number--stars {
  display: flex;
  gap: 0.2rem;
  justify-content: center;
  align-items: center;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1;
  min-height: clamp(2.5rem, 5vw, 3.5rem);
}

.stat__star {
  color: var(--accent);
  opacity: 0;
  transform: scale(0);
  display: inline-block;
}

.stat__number--stars.is-visible .stat__star {
  animation: starAppear 0.3s ease forwards;
}

/* Spread across 2s to match counter duration */
.stat__number--stars.is-visible .stat__star:nth-child(1) { animation-delay: 0s; }
.stat__number--stars.is-visible .stat__star:nth-child(2) { animation-delay: 0.2s; }
.stat__number--stars.is-visible .stat__star:nth-child(3) { animation-delay: 0.4s; }
.stat__number--stars.is-visible .stat__star:nth-child(4) { animation-delay: 0.6s; }
.stat__number--stars.is-visible .stat__star:nth-child(5) { animation-delay: 0.8s; }

@keyframes starAppear {
  0% { opacity: 0; transform: scale(0); }
  70% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* --- CTA SECTION --- */
.cta {
  position: relative;
  z-index: 1;
  padding: 0 clamp(1.5rem, 4vw, 3rem) clamp(3rem, 5vw, 4rem);
  text-align: center;
  background: radial-gradient(ellipse at 50% 80%, rgba(180, 69, 57, 0.12) 0%, transparent 60%);
}

/* Kill bottom padding on section directly before CTA */
.section--dark + .cta { margin-top: calc(-1 * var(--space-section) / 2); }

.cta__title {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.cta__sub {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  margin-bottom: 2rem;
  font-weight: 300;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.cta__actions { opacity: 0; }

.cta__email-wrap {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

.cta__email-input {
  flex: 1;
  padding: 1rem 1.25rem;
  background: var(--surface-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink-on-dark);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}

.cta__email-input:focus { border-color: var(--accent); }

.cta__email-input::placeholder { color: var(--ink-3); }

.cta__social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.cta__social a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink-on-dark);
  font-size: 1.1rem;
  transition: border-color 0.3s, color 0.3s;
}

.cta__social a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- FOOTER --- */
.footer {
  position: relative;
  z-index: 1;
  background: var(--surface-dark);
  padding: clamp(4rem, 8vw, 6rem) 0 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer__brand {
  max-width: 280px;
}

.footer__logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ink-on-dark);
  margin-bottom: 1rem;
}

.footer__tagline {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}

.footer__heading {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer__links a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  transition: color 0.3s;
}

.footer__links a:hover { color: var(--accent); }

.footer__contact-item {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.5rem;
}

.footer__social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.footer__social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  transition: border-color 0.3s, color 0.3s;
}

.footer__social a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer__bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

.mls-disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  line-height: 1.6;
  margin-top: 2rem;
  max-width: 800px;
  opacity: 0;
  transform: translateY(20px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* --- iOS zoom prevention for inputs --- */
@media (max-width: 768px) {
  input, select, textarea { font-size: 16px !important; }
}

/* --- Tablets & small desktops --- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }

  .pillar-cards { grid-template-columns: repeat(2, 1fr); }
  .listings-grid { grid-template-columns: repeat(2, 1fr); }

  .about-split { grid-template-columns: 1fr; text-align: center; }
  .about-split__img-wrap { max-width: 80%; margin: 0 auto; overflow: visible; border-radius: 0; }
  .about-split__img-border { display: none; }
  .about-split__quote { text-align: left; }

  .stats-bar__inner { grid-template-columns: repeat(2, 1fr); }

  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Mobile landscape / large phones --- */
@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__cta-btn { display: none; }
  .nav__burger { display: flex; }

  .pillar-cards { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .pillar-cards .pillar-card { aspect-ratio: 3/4; }
  .pillar-cards .pillar-card:last-child { grid-column: 1 / -1; aspect-ratio: 5/3; }
  .pillar-card__content { padding: 1rem; }
  .pillar-card .pillar-card__title { font-size: 1.1rem; margin-bottom: 0.4rem; }
  .pillar-card .pillar-card__text { font-size: 0.7rem; line-height: 1.4; margin-bottom: 0.5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .pillar-card__eyebrow { font-size: 0.55rem; margin-bottom: 0.4rem; }
  .pillar-card__arrow { font-size: 0.65rem; }
  .listings-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 0.5rem;
  }
  .listings-grid::-webkit-scrollbar { display: none; }
  .listings-grid > * {
    flex: 0 0 85%;
    scroll-snap-align: start;
    max-width: 85%;
  }
  .grid--2 { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: 1fr; }

  .stats-bar__inner { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

  .hero { min-height: 80vh; }
  .hero--short { min-height: 40vh; }
  .hero--short .hero__video { object-position: 35% 30%; transform: scale(1.3); }
  .hero__cta { flex-direction: column; align-items: center; flex-wrap: wrap; justify-content: center; }
  .hero__scroll { display: none; }

  .cta__email-wrap { flex-direction: column; }

  .footer__grid { grid-template-columns: 1fr 1fr; text-align: center; }
  .footer__brand { grid-column: 1 / -1; max-width: 100%; margin: 0 auto; }
  .footer__tagline { text-align: center; }
  .footer__social { justify-content: center; }
  .footer__links { align-items: center; }
  .footer__grid > div:last-child { grid-column: 1 / -1; }
  .footer__bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* --- Mobile landscape --- */
@media (max-height: 650px) and (orientation: landscape) {
  .pillar-cards { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .pillar-cards .pillar-card:last-child { grid-column: 1 / -1; aspect-ratio: 5/3; }

  .listings-grid {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    flex-wrap: nowrap;
  }
  .listings-grid::-webkit-scrollbar { display: none; }
  .listings-grid > * {
    flex: 0 0 30%;
    scroll-snap-align: start;
    max-width: 30%;
  }
}

/* Also catch tablets in landscape where 3 cards don't fit well */
@media (min-width: 769px) and (max-width: 1100px) {
  .pillar-cards .pillar-card:last-child { grid-column: 1 / -1; }
}

/* --- Small phones --- */
@media (max-width: 480px) {
  .hero { min-height: 70vh; }
  .hero__title { font-size: clamp(2.25rem, 10vw, 3.5rem); }
  .hero--short .hero__title { font-size: clamp(2rem, 8vw, 3rem); }
  .hero__sub { font-size: 0.9rem; }

  .section { padding: clamp(3rem, 8vw, 5rem) 0; }
  .wrap { padding: 0 1rem; }
  p { line-height: 1.6; }

  .stats-bar__inner { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
  .stat__number { font-size: clamp(1.2rem, 4vw, 1.8rem); min-height: 1.8rem; display: flex; align-items: flex-end; justify-content: center; }
  .stat__number--stars { font-size: 0.7rem; gap: 0.05rem; min-height: 1.8rem; }
  .stat__prefix, .stat__suffix { font-size: 0.9rem; }
  .stat__label { font-size: 0.5rem; margin-top: 0.25rem; }
  /* Stars appear instantly on mobile */
  .stat__number--stars.is-visible .stat__star:nth-child(1) { animation-delay: 0s; }
  .stat__number--stars.is-visible .stat__star:nth-child(2) { animation-delay: 0.05s; }
  .stat__number--stars.is-visible .stat__star:nth-child(3) { animation-delay: 0.1s; }
  .stat__number--stars.is-visible .stat__star:nth-child(4) { animation-delay: 0.15s; }
  .stat__number--stars.is-visible .stat__star:nth-child(5) { animation-delay: 0.2s; }

  .btn--lg { padding: 1rem 2.5rem; font-size: 0.9rem; }

  .listing-card__price { font-size: 1.35rem; }
}

/* --- Very small phones --- */
@media (max-width: 375px) {
  body { font-size: 15px; }
  .hero__title { font-size: clamp(2rem, 8vw, 3rem); }
}
