/* Villas.jsx — Luxury scrolling experience showcasing the 5 Novus villas
 *
 * Sections:
 *  1. Cinematic hero with parallax + scroll indicator
 *  2. Intro statement that fades in on scroll
 *  3. Each villa: full-bleed alternating layout with scroll-pinned imagery
 *  4. Feature grid (chef-grade kitchens, private pools, etc.)
 *  5. Map / neighborhoods strip
 *  6. Closing CTA
 */

function VillasPage() {
  React.useEffect(() => {
    // Smooth scroll for anchor links
    document.documentElement.style.scrollBehavior = 'smooth';
    // Re-run scroll reveal after this page mounts
    if (window.setupScrollReveal) {
      setTimeout(window.setupScrollReveal, 100);
    }
    return () => { document.documentElement.style.scrollBehavior = ''; };
  }, []);

  const villas = (window.NOVUS_PROPERTIES || []).filter(p => p.kind === 'villa').slice(0, 5);
  const [activeVilla, setActiveVilla] = React.useState(villas[0] && villas[0].id);

  // Scroll-spy: highlight the villa currently in view within the quick-nav
  React.useEffect(() => {
    if (!villas.length) return;
    const observer = new IntersectionObserver((entries) => {
      entries.forEach(entry => {
        if (entry.isIntersecting) {
          const id = entry.target.getAttribute('data-villa-id');
          if (id) setActiveVilla(id);
        }
      });
    }, { rootMargin: '-45% 0px -45% 0px', threshold: 0 });
    villas.forEach(v => {
      const el = document.getElementById(`villa-${v.id}`);
      if (el) observer.observe(el);
    });
    return () => observer.disconnect();
  }, [villas.length]);

  return (
    <>
      <style>{`
        /* ===== Villas page bespoke styles ===== */
        .villas-page { background: var(--sand-50); overflow-x: hidden; }

        /* Cinematic hero */
        .villas-hero {
          position: relative; min-height: 100vh; min-height: 100svh;
          overflow: hidden;
          display: flex; flex-direction: column; justify-content: flex-end;
          color: #fff;
        }
        .villas-hero-bg {
          position: absolute; inset: 0;
          background: url('https://images.unsplash.com/photo-1613977257363-707ba9348227?auto=format&fit=crop&w=2400&q=80') center/cover no-repeat;
          will-change: transform;
          animation: heroZoom 18s ease-out forwards;
        }
        .villas-hero-overlay {
          position: absolute; inset: 0;
          background:
            linear-gradient(180deg, rgba(10,31,51,0.4) 0%, rgba(10,31,51,0.15) 35%, rgba(10,31,51,0.85) 100%);
        }
        @keyframes heroZoom {
          from { transform: scale(1.15); }
          to { transform: scale(1.0); }
        }

        .villas-hero-inner {
          position: relative; z-index: 2;
          padding: 0 6vw 80px;
          max-width: 1300px;
          width: 100%; margin: 0 auto;
        }
        .villas-hero-overline {
          font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
          font-weight: 600; color: var(--horizon-200);
          display: inline-flex; align-items: center; gap: 12px;
          opacity: 0; transform: translateY(20px);
          animation: heroFade 1s var(--ease-novus) 0.4s forwards;
        }
        .villas-hero-overline::before {
          content: ''; width: 30px; height: 1px; background: var(--horizon-200);
        }
        .villas-hero-title {
          font-family: var(--font-display); font-weight: 400;
          font-size: clamp(48px, 8vw, 124px);
          line-height: 0.96; letter-spacing: -0.025em;
          color: #fff; margin: 18px 0 18px;
          max-width: 1100px; text-wrap: balance;
          opacity: 0; transform: translateY(30px);
          animation: heroFade 1.2s var(--ease-novus) 0.6s forwards;
        }
        .villas-hero-title em { font-style: italic; font-family: var(--font-display); color: var(--sun-amber); }
        .villas-hero-sub {
          font-size: clamp(15px, 1.5vw, 19px);
          color: rgba(255,255,255,0.88); max-width: 560px;
          line-height: 1.6;
          opacity: 0; transform: translateY(20px);
          animation: heroFade 1.2s var(--ease-novus) 0.9s forwards;
        }
        @keyframes heroFade {
          to { opacity: 1; transform: translateY(0); }
        }

        .villas-hero-meta {
          display: flex; gap: 32px; margin-top: 36px; flex-wrap: wrap;
          opacity: 0; transform: translateY(20px);
          animation: heroFade 1.2s var(--ease-novus) 1.2s forwards;
        }
        .villas-hero-meta-item {
          color: rgba(255,255,255,0.7); font-size: 12px;
          display: flex; flex-direction: column; gap: 6px;
        }
        .villas-hero-meta-item strong {
          font-family: var(--font-display); font-weight: 400;
          font-size: 32px; color: #fff; letter-spacing: -0.01em;
          line-height: 1;
        }
        .villas-hero-meta-item span {
          text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600;
          font-size: 10px;
        }

        .scroll-indicator {
          position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
          color: rgba(255,255,255,0.65); font-size: 10px; letter-spacing: 0.24em;
          text-transform: uppercase; font-weight: 600; z-index: 3;
          display: flex; flex-direction: column; align-items: center; gap: 12px;
          opacity: 0; animation: heroFade 1s var(--ease-novus) 1.6s forwards;
        }
        .scroll-indicator-line {
          width: 1px; height: 40px; background: linear-gradient(to bottom, var(--sun-amber), transparent);
          animation: scrollPulse 2.2s ease-in-out infinite;
        }
        @keyframes scrollPulse {
          0%, 100% { transform: scaleY(0.6); opacity: 0.5; transform-origin: top; }
          50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
        }

        /* Intro statement */
        .villas-intro {
          padding: clamp(80px, 14vw, 160px) 6vw;
          max-width: 1100px; margin: 0 auto;
          text-align: center;
        }
        .villas-intro-overline {
          font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
          color: var(--sun-amber); font-weight: 600;
          display: inline-flex; align-items: center; gap: 12px;
          margin-bottom: 28px;
        }
        .villas-intro-overline::before, .villas-intro-overline::after {
          content: ''; width: 24px; height: 1px; background: var(--sun-amber);
        }
        .villas-intro-title {
          font-family: var(--font-display); font-weight: 400;
          font-size: clamp(32px, 5vw, 64px);
          letter-spacing: -0.02em; line-height: 1.1;
          color: var(--navy-900); margin: 0 0 24px; text-wrap: balance;
        }
        .villas-intro-title em { font-style: italic; color: var(--sun-coral); }
        .villas-intro-body {
          font-size: clamp(15px, 1.4vw, 18px); line-height: 1.75;
          color: var(--ink-700); max-width: 720px; margin: 0 auto;
        }

        /* Villa section — alternating full-bleed */
        .villa-section {
          position: relative;
          padding: clamp(60px, 10vw, 120px) 0;
          overflow: hidden;
        }
        .villa-section:nth-child(even) {
          background: linear-gradient(180deg, transparent, rgba(252,172,100,0.04) 50%, transparent);
        }
        .villa-inner {
          max-width: 1300px; margin: 0 auto;
          padding: 0 6vw;
          display: grid; grid-template-columns: 1fr 1fr;
          gap: clamp(40px, 6vw, 90px); align-items: center;
        }
        .villa-section.reverse .villa-inner {
          direction: rtl;
        }
        .villa-section.reverse .villa-inner > * { direction: ltr; }

        @media (max-width: 900px) {
          .villa-inner { grid-template-columns: 1fr; gap: 32px; }
          .villa-section.reverse .villa-inner { direction: ltr; }
        }

        .villa-media {
          position: relative;
          border-radius: 24px; overflow: hidden;
          aspect-ratio: 4/5;
          box-shadow:
            0 4px 16px rgba(10,31,51,0.08),
            0 24px 60px rgba(10,31,51,0.12);
          will-change: transform;
        }
        .villa-media img {
          width: 100%; height: 100%; object-fit: cover; display: block;
          transition: transform 800ms var(--ease-novus);
        }
        .villa-media:hover img { transform: scale(1.04); }

        .villa-media-overlay {
          position: absolute; left: 20px; bottom: 20px;
          padding: 8px 14px;
          background: rgba(255,255,255,0.95);
          backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
          border-radius: 999px;
          font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
          color: var(--navy-900); text-transform: uppercase;
        }

        .villa-content {
          display: flex; flex-direction: column; gap: 24px;
        }
        .villa-number {
          font-family: var(--font-display); font-style: italic;
          font-weight: 400; font-size: 14px;
          color: var(--sun-amber);
          letter-spacing: 0.04em;
        }
        .villa-number::before { content: '— '; }
        .villa-name {
          font-family: var(--font-display); font-weight: 400;
          font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.02em;
          color: var(--navy-900); margin: 0; line-height: 1.05;
        }
        .villa-name em { font-style: italic; }
        .villa-location {
          font-size: 13px; color: var(--ink-500); font-weight: 500;
          letter-spacing: 0.04em;
          display: inline-flex; align-items: center; gap: 8px;
        }
        .villa-location-dot {
          display: inline-block; width: 4px; height: 4px; border-radius: 999px;
          background: var(--sun-coral);
        }
        .villa-tagline {
          font-size: clamp(15px, 1.3vw, 17px);
          line-height: 1.7; color: var(--ink-700);
          max-width: 480px;
        }
        .villa-features {
          display: grid; grid-template-columns: repeat(2, 1fr);
          gap: 12px;
          padding: 24px 0;
          border-top: 1px solid var(--line);
          border-bottom: 1px solid var(--line);
          margin: 6px 0;
        }
        .villa-feature {
          display: flex; align-items: center; gap: 12px;
          font-size: 14px; color: var(--ink-700);
        }
        .villa-feature-icon {
          width: 32px; height: 32px; border-radius: 8px;
          background: rgba(245,166,89,0.12);
          color: var(--sun-amber-strong, #C7821B);
          display: flex; align-items: center; justify-content: center;
          flex-shrink: 0;
        }
        .villa-cta-row {
          display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
          margin-top: 8px;
        }
        .villa-rate {
          display: flex; flex-direction: column; gap: 2px;
        }
        .villa-rate strong {
          font-family: var(--font-display); font-weight: 400;
          font-size: 30px; color: var(--navy-900);
          letter-spacing: -0.01em; line-height: 1;
          font-feature-settings: 'tnum';
        }
        .villa-rate span {
          font-size: 11px; color: var(--ink-500); font-weight: 500;
          letter-spacing: 0.08em; text-transform: uppercase;
        }
        .villa-rating {
          display: flex; align-items: center; gap: 6px;
          font-size: 13px; color: var(--ink-500);
        }
        .villa-rating-stars { color: var(--sun-amber); font-size: 15px; }

        /* Floating big number behind each villa */
        .villa-bignum {
          position: absolute;
          font-family: var(--font-display); font-style: italic;
          font-weight: 400;
          font-size: clamp(180px, 28vw, 360px);
          color: var(--sun-amber);
          opacity: 0.06;
          line-height: 1; letter-spacing: -0.04em;
          pointer-events: none;
          top: 50%; transform: translateY(-50%);
          z-index: 0;
        }
        .villa-section:nth-child(odd) .villa-bignum { right: -3vw; }
        .villa-section:nth-child(even) .villa-bignum { left: -3vw; }
        .villa-inner { position: relative; z-index: 1; }

        /* Features highlight strip */
        .features-strip {
          background: var(--navy-900);
          color: #fff;
          padding: clamp(80px, 12vw, 140px) 6vw;
          position: relative;
          overflow: hidden;
        }
        .features-strip::before {
          content: ''; position: absolute;
          top: -100px; right: -100px;
          width: 500px; height: 500px;
          background: radial-gradient(circle, rgba(245,166,89,0.18), transparent 70%);
          pointer-events: none;
        }
        .features-strip-inner {
          max-width: 1300px; margin: 0 auto;
          position: relative; z-index: 1;
        }
        .features-strip-title {
          font-family: var(--font-display); font-weight: 400;
          font-size: clamp(32px, 4.5vw, 56px); letter-spacing: -0.02em;
          color: #fff; margin: 14px 0 60px; max-width: 720px; line-height: 1.1;
        }
        .features-strip-title em { font-style: italic; color: var(--sun-amber); }
        .features-grid {
          display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
          gap: 32px;
        }
        .feature-tile {
          padding: 32px 28px 28px;
          background: rgba(255,255,255,0.04);
          border: 1px solid rgba(255,255,255,0.08);
          border-radius: 18px;
          transition: all 400ms var(--ease-novus);
        }
        .feature-tile:hover {
          background: rgba(255,255,255,0.08);
          border-color: rgba(245,166,89,0.4);
          transform: translateY(-4px);
        }
        .feature-tile-icon {
          width: 48px; height: 48px;
          border-radius: 12px;
          background: linear-gradient(135deg, var(--sun-coral), var(--sun-amber));
          color: #fff;
          display: flex; align-items: center; justify-content: center;
          margin-bottom: 20px;
          box-shadow: 0 8px 24px rgba(245,166,89,0.32);
        }
        .feature-tile h3 {
          font-family: var(--font-display); font-weight: 400;
          font-size: 22px; letter-spacing: -0.01em;
          color: #fff; margin: 0 0 8px;
        }
        .feature-tile p {
          font-size: 13px; line-height: 1.6;
          color: rgba(255,255,255,0.68);
          margin: 0;
        }

        /* Closing CTA */
        .villas-cta {
          padding: clamp(80px, 14vw, 160px) 6vw;
          background: linear-gradient(180deg, var(--sand-50), var(--sand-100));
          text-align: center;
        }
        .villas-cta-inner { max-width: 720px; margin: 0 auto; }
        .villas-cta-title {
          font-family: var(--font-display); font-weight: 400;
          font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.02em;
          color: var(--navy-900); margin: 0 0 18px; line-height: 1.1;
        }
        .villas-cta-title em { font-style: italic; color: var(--sun-coral); }
        .villas-cta-body {
          font-size: clamp(15px, 1.3vw, 17px); line-height: 1.7;
          color: var(--ink-700); margin: 0 0 36px;
        }
        .villas-cta-buttons {
          display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
        }

        /* ===== Quick-nav (sticky villa jump bar) ===== */
        .villa-quicknav {
          position: sticky; top: 64px; z-index: 40;
          background: rgba(251,248,243,0.86);
          backdrop-filter: blur(18px) saturate(160%);
          -webkit-backdrop-filter: blur(18px) saturate(160%);
          border-bottom: 1px solid var(--line);
        }
        @media (min-width: 900px) { .villa-quicknav { top: 72px; } }
        .villa-quicknav-inner {
          max-width: 1300px; margin: 0 auto; padding: 0 6vw;
          display: flex; align-items: center; gap: 8px;
          overflow-x: auto; scrollbar-width: none;
          -webkit-overflow-scrolling: touch;
        }
        .villa-quicknav-inner::-webkit-scrollbar { display: none; }
        .villa-quicknav-label {
          font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
          font-weight: 600; color: var(--ink-500); white-space: nowrap;
          padding-right: 8px; flex-shrink: 0;
        }
        .villa-quicknav-link {
          font-size: 13px; font-weight: 500; color: var(--ink-700);
          text-decoration: none; white-space: nowrap; flex-shrink: 0;
          padding: 16px 14px; position: relative;
          transition: color 200ms var(--ease-novus);
        }
        .villa-quicknav-link:hover { color: var(--navy-700); }
        .villa-quicknav-link.active { color: var(--navy-900); font-weight: 600; }
        .villa-quicknav-link.active::after {
          content: ''; position: absolute; left: 14px; right: 14px; bottom: 0;
          height: 2px; border-radius: 2px;
          background: linear-gradient(90deg, var(--sun-coral), var(--sun-amber));
        }

        /* ===== Neighborhoods strip ===== */
        .hoods {
          padding: clamp(70px, 11vw, 130px) 6vw;
          max-width: 1300px; margin: 0 auto;
        }
        .hoods-head {
          text-align: center; max-width: 720px; margin: 0 auto 56px;
        }
        .hoods-title {
          font-family: var(--font-display); font-weight: 400;
          font-size: clamp(30px, 4.5vw, 56px); letter-spacing: -0.02em;
          color: var(--navy-900); margin: 14px 0 18px; line-height: 1.1;
        }
        .hoods-title em { font-style: italic; color: var(--sun-coral); }
        .hoods-body {
          font-size: clamp(14px, 1.3vw, 17px); line-height: 1.7; color: var(--ink-700);
        }
        .hoods-grid {
          display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
          gap: 18px;
        }
        .hood-card {
          position: relative; border-radius: 18px; overflow: hidden;
          aspect-ratio: 3/4; display: flex; flex-direction: column;
          justify-content: flex-end; color: #fff; text-decoration: none;
          box-shadow: var(--shadow-soft);
          transition: transform 400ms var(--ease-novus), box-shadow 400ms var(--ease-novus);
        }
        .hood-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
        .hood-card-bg {
          position: absolute; inset: 0; background-size: cover; background-position: center;
          transition: transform 800ms var(--ease-novus);
        }
        .hood-card:hover .hood-card-bg { transform: scale(1.06); }
        .hood-card::after {
          content: ''; position: absolute; inset: 0;
          background: linear-gradient(180deg, rgba(10,31,51,0) 30%, rgba(10,31,51,0.82) 100%);
        }
        .hood-card-content { position: relative; z-index: 1; padding: 22px; }
        .hood-card-count {
          font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
          font-weight: 600; color: var(--sun-amber); margin-bottom: 6px;
        }
        .hood-card-name {
          font-family: var(--font-display); font-weight: 400; font-size: 24px;
          letter-spacing: -0.01em; line-height: 1.1;
        }

        /* ===== Reviews ===== */
        .villas-reviews {
          padding: clamp(70px, 12vw, 140px) 6vw;
          background: linear-gradient(180deg, var(--sand-50), rgba(165,207,230,0.08));
        }
        .villas-reviews-inner { max-width: 1300px; margin: 0 auto; }
        .villas-reviews-head { text-align: center; max-width: 760px; margin: 0 auto 56px; }
        .villas-reviews-title {
          font-family: var(--font-display); font-weight: 400;
          font-size: clamp(30px, 4.5vw, 56px); letter-spacing: -0.02em;
          color: var(--navy-900); margin: 14px 0 0; line-height: 1.1;
        }
        .villas-reviews-title em { font-style: italic; color: var(--sun-coral); }
        .review-cols {
          columns: 3 300px; column-gap: 24px;
        }
        .review-card {
          break-inside: avoid; margin: 0 0 24px;
          background: #fff; border: 1px solid var(--line); border-radius: 16px;
          padding: 26px 24px; box-shadow: var(--shadow-soft);
        }
        .review-stars { color: var(--sun-amber); font-size: 14px; letter-spacing: 2px; margin-bottom: 12px; }
        .review-text { font-size: 14px; line-height: 1.65; color: var(--ink-700); margin: 0 0 18px; }
        .review-meta { display: flex; align-items: center; gap: 12px; }
        .review-avatar {
          width: 38px; height: 38px; border-radius: 999px; flex-shrink: 0;
          background: linear-gradient(135deg, var(--sun-coral), var(--sun-amber));
          color: #fff; display: flex; align-items: center; justify-content: center;
          font-weight: 600; font-size: 15px;
        }
        .review-author { font-weight: 600; font-size: 14px; color: var(--navy-900); }
        .review-where { font-size: 12px; color: var(--ink-500); }

        /* ===== FAQ ===== */
        .villas-faq { padding: clamp(70px, 12vw, 140px) 6vw; max-width: 860px; margin: 0 auto; }
        .villas-faq-head { text-align: center; margin-bottom: 48px; }
        .villas-faq-title {
          font-family: var(--font-display); font-weight: 400;
          font-size: clamp(30px, 4.5vw, 52px); letter-spacing: -0.02em;
          color: var(--navy-900); margin: 14px 0 0; line-height: 1.1;
        }
        .villas-faq-title em { font-style: italic; color: var(--sun-coral); }
        .faq-item { border-bottom: 1px solid var(--line); }
        .faq-q {
          width: 100%; background: none; border: none; cursor: pointer;
          display: flex; align-items: center; justify-content: space-between; gap: 20px;
          padding: 24px 4px; text-align: left;
          font-family: var(--font-display); font-weight: 400; font-size: clamp(18px, 2vw, 23px);
          color: var(--navy-900); letter-spacing: -0.01em;
          transition: color 200ms var(--ease-novus);
        }
        .faq-q:hover { color: var(--navy-700); }
        .faq-icon {
          flex-shrink: 0; width: 26px; height: 26px; color: var(--sun-coral);
          transition: transform 300ms var(--ease-novus);
        }
        .faq-item.open .faq-icon { transform: rotate(45deg); }
        .faq-a {
          max-height: 0; overflow: hidden;
          transition: max-height 380ms var(--ease-novus), opacity 300ms var(--ease-novus);
          opacity: 0;
        }
        .faq-item.open .faq-a { max-height: 320px; opacity: 1; }
        .faq-a-inner { padding: 0 4px 24px; font-size: 15px; line-height: 1.7; color: var(--ink-700); }

        /* ===== Comparison table ===== */
        .villas-compare { padding: clamp(70px, 11vw, 130px) 6vw; max-width: 1300px; margin: 0 auto; }
        .villas-compare-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
        .villas-compare-title {
          font-family: var(--font-display); font-weight: 400;
          font-size: clamp(30px, 4.5vw, 56px); letter-spacing: -0.02em;
          color: var(--navy-900); margin: 14px 0 0; line-height: 1.1;
        }
        .villas-compare-title em { font-style: italic; color: var(--sun-coral); }
        .compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
        .compare-table {
          width: 100%; min-width: 680px; border-collapse: collapse;
          font-size: 14px; color: var(--ink-700);
        }
        .compare-table thead th {
          text-align: left; padding: 0 0 18px; vertical-align: bottom;
          border-bottom: 1px solid var(--line);
        }
        .compare-villa-name {
          font-family: var(--font-display); font-weight: 400; font-size: 22px;
          color: var(--navy-900); letter-spacing: -0.01em; line-height: 1.1;
        }
        .compare-villa-hood { font-size: 11px; color: var(--ink-500); margin-top: 4px; font-weight: 500; }
        .compare-table .row-label {
          font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
          font-weight: 600; color: var(--ink-500); white-space: nowrap;
          padding: 16px 24px 16px 0; vertical-align: middle;
        }
        .compare-table tbody td {
          padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line);
          vertical-align: middle;
        }
        .compare-table tbody tr:last-child td { border-bottom: 0; }
        .compare-rate { font-family: var(--font-display); font-size: 19px; color: var(--navy-900); font-feature-settings: 'tnum'; }
        .compare-rating { color: var(--sun-amber); font-weight: 600; }
        .compare-cta {
          display: inline-block; padding: 9px 16px; border-radius: 999px;
          font-size: 12px; font-weight: 600; text-decoration: none;
          background: var(--navy-900); color: #fff;
          transition: background 200ms var(--ease-novus);
        }
        .compare-cta:hover { background: var(--navy-700); }
        .compare-col-head { padding-left: 16px; }
      `}</style>

      <div className="villas-page">
        {/* ===== HERO ===== */}
        <section className="villas-hero">
          <div className="villas-hero-bg" />
          <div className="villas-hero-overlay" />
          <div className="villas-hero-inner">
            <div className="villas-hero-overline">NOVUS RESIDENTIALS · THE VILLA COLLECTION</div>
            <h1 className="villas-hero-title">
              Waterfront villas. <em>One standard</em> of hospitality.
            </h1>
            <p className="villas-hero-sub">
              From bayfront estates to sunset terraces, each Novus villa is a hand-selected residence —
              held to a single standard of service, design, and care.
            </p>
            <div className="villas-hero-meta">
              <div className="villas-hero-meta-item">
                <strong>Miami</strong>
                <span>& Bimini</span>
              </div>
              <div className="villas-hero-meta-item">
                <strong>Waterfront</strong>
                <span>Villas</span>
              </div>
              <div className="villas-hero-meta-item">
                <strong>4.9★</strong>
                <span>Guest rated</span>
              </div>
              <div className="villas-hero-meta-item">
                <strong>Direct</strong>
                <span>Best rate</span>
              </div>
            </div>
          </div>
          <div className="scroll-indicator">
            <div className="scroll-indicator-line" />
            <span>SCROLL</span>
          </div>
        </section>

        {/* ===== QUICK-NAV ===== */}
        <nav className="villa-quicknav" aria-label="Jump to a villa">
          <div className="villa-quicknav-inner">
            <span className="villa-quicknav-label">The collection</span>
            {villas.map(v => (
              <a
                key={v.id}
                href={`#villa-${v.id}`}
                className={`villa-quicknav-link ${activeVilla === v.id ? 'active' : ''}`}
              >
                {v.name}
              </a>
            ))}
          </div>
        </nav>

        {/* ===== INTRO ===== */}
        <section className="villas-intro reveal">
          <div className="villas-intro-overline">THE COLLECTION</div>
          <h2 className="villas-intro-title">
            Waterfront villas across Miami,<br/>
            <em>refined hospitality</em> in every detail.
          </h2>
          <p className="villas-intro-body">
            We don't manage homes — we host stays. Every Novus villa is selected for its location, design,
            and the quiet luxury it offers. Our concierge knows each property like it's their own; our
            housekeeping standards never drop, regardless of season or guest. This is what we mean by
            <em> nos vemos pronto</em>.
          </p>
        </section>

        {/* ===== VILLA SECTIONS ===== */}
        {villas.map((v, i) => (
          <VillaSection key={v.id} villa={v} index={i + 1} reverse={i % 2 === 1} />
        ))}

        {/* ===== COMPARISON TABLE ===== */}
        <section className="villas-compare reveal">
          <div className="villas-compare-head">
            <div className="villas-intro-overline">AT A GLANCE</div>
            <h2 className="villas-compare-title">
              Compare the <em>collection</em>.
            </h2>
          </div>
          <div className="compare-scroll">
            <table className="compare-table">
              <thead>
                <tr>
                  <th />
                  {villas.map(v => (
                    <th key={v.id} className="compare-col-head">
                      <div className="compare-villa-name">{v.name}</div>
                      <div className="compare-villa-hood">{v.neighborhood}</div>
                    </th>
                  ))}
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td className="row-label">Bedrooms</td>
                  {villas.map(v => <td key={v.id} style={{ paddingLeft: 16 }}>{v.bedrooms}</td>)}
                </tr>
                <tr>
                  <td className="row-label">Bathrooms</td>
                  {villas.map(v => <td key={v.id} style={{ paddingLeft: 16 }}>{v.bathrooms}</td>)}
                </tr>
                <tr>
                  <td className="row-label">Sleeps</td>
                  {villas.map(v => <td key={v.id} style={{ paddingLeft: 16 }}>{v.maxGuests} guests</td>)}
                </tr>
                <tr>
                  <td className="row-label">Rating</td>
                  {villas.map(v => (
                    <td key={v.id} style={{ paddingLeft: 16 }}>
                      <span className="compare-rating">★ {v.rating}</span>
                      <span style={{ color: 'var(--ink-500)', fontSize: 12 }}> ({v.reviews})</span>
                    </td>
                  ))}
                </tr>
                <tr>
                  <td className="row-label">From / night</td>
                  {villas.map(v => (
                    <td key={v.id} style={{ paddingLeft: 16 }}>
                      <span className="compare-rate">${v.rate.toLocaleString()}</span>
                    </td>
                  ))}
                </tr>
                <tr>
                  <td className="row-label" />
                  {villas.map(v => (
                    <td key={v.id} style={{ paddingLeft: 16 }}>
                      <a href={`property-${v.id}.html`} className="compare-cta">View →</a>
                    </td>
                  ))}
                </tr>
              </tbody>
            </table>
          </div>
        </section>

        {/* ===== NEIGHBORHOODS ===== */}
        <section className="hoods reveal">
          <div className="hoods-head">
            <div className="villas-intro-overline">WHERE YOU'LL STAY</div>
            <h2 className="hoods-title">
              Miami, <em>neighborhood by neighborhood</em>.
            </h2>
            <p className="hoods-body">
              Our villas sit across the city's most coveted waterfronts and arts districts —
              each one chosen for what's just outside the door.
            </p>
          </div>
          <div className="hoods-grid">
            {NOVUS_HOODS.map(h => (
              <a key={h.name} href={h.anchor} className="hood-card">
                <div className="hood-card-bg" style={{ backgroundImage: `url('${h.photo}')` }} />
                <div className="hood-card-content">
                  <div className="hood-card-count">{h.count}</div>
                  <div className="hood-card-name">{h.name}</div>
                </div>
              </a>
            ))}
          </div>
        </section>

        {/* ===== FEATURES STRIP ===== */}
        <section className="features-strip reveal">
          <div className="features-strip-inner">
            <div className="villas-hero-overline" style={{ color: 'var(--sun-amber)' }}>WHAT EVERY VILLA OFFERS</div>
            <h2 className="features-strip-title">
              Five-star <em>residences</em> — held to one standard.
            </h2>
            <div className="features-grid">
              {[
                { icon: 'home', title: 'Designer interiors', body: 'Each villa is styled in collaboration with Miami\'s leading interior designers — bay views framed, art curated, light considered.' },
                { icon: 'pool', title: 'Private pools', body: 'Heated year-round, lit at night, with sunset-facing loungers and full towel service on arrival.' },
                { icon: 'chef', title: 'Chef-grade kitchens', body: 'Full Wolf or Bosch appliance suites, restaurant-quality knives, and a private chef on call when you want it.' },
                { icon: 'concierge', title: '24/7 concierge', body: 'Reservations, transport, experiences, and the quiet things you didn\'t think to ask for. Miguel responds within minutes.' },
                { icon: 'clean', title: 'Hotel-grade housekeeping', body: 'Mid-stay refreshes, turn-down service for longer bookings, all linens hotel-laundered. Nothing skipped.' },
                { icon: 'secure', title: 'Smart-home secure', body: 'Keyless entry with personal codes, full smart-home automation, monitored security, and discretion across every stay.' },
              ].map(f => (
                <div key={f.title} className="feature-tile">
                  <div className="feature-tile-icon">
                    <FeatureIcon name={f.icon} />
                  </div>
                  <h3>{f.title}</h3>
                  <p>{f.body}</p>
                </div>
              ))}
            </div>
          </div>
        </section>

        {/* ===== REVIEWS ===== */}
        <section className="villas-reviews reveal">
          <div className="villas-reviews-inner">
            <div className="villas-reviews-head">
              <div className="villas-intro-overline">FROM OUR GUESTS</div>
              <h2 className="villas-reviews-title">
                Five-star rated. <em>Every stay</em>, one standard.
              </h2>
            </div>
            <div className="review-cols">
              {(window.MORE_REVIEWS || []).slice(0, 9).map((r, i) => (
                <div key={i} className="review-card">
                  <div className="review-stars">{'★'.repeat(r.stars || 5)}</div>
                  <p className="review-text">{r.text}</p>
                  <div className="review-meta">
                    <div className="review-avatar">{r.name.charAt(0)}</div>
                    <div>
                      <div className="review-author">{r.name}</div>
                      <div className="review-where">{r.country} · {r.date}</div>
                    </div>
                  </div>
                </div>
              ))}
            </div>
          </div>
        </section>

        {/* ===== FAQ ===== */}
        <section className="villas-faq reveal">
          <div className="villas-faq-head">
            <div className="villas-intro-overline">GOOD TO KNOW</div>
            <h2 className="villas-faq-title">
              Before you <em>book</em>.
            </h2>
          </div>
          {VILLA_FAQS.map((f, i) => (
            <FaqItem key={i} q={f.q} a={f.a} />
          ))}
        </section>

        {/* ===== CLOSING CTA ===== */}
        <section className="villas-cta">
          <div className="villas-cta-inner">
            <span className="sun-bullet" />
            <div className="villas-intro-overline" style={{ marginTop: 18 }}>BOOK YOUR STAY</div>
            <h2 className="villas-cta-title">
              Which villa <em>feels like yours</em>?
            </h2>
            <p className="villas-cta-body">
              Tell us your dates and we'll match you to the right villa.
              Pricing is real-time across all 5 residences — book directly with us for the best rate.
            </p>
            <div className="villas-cta-buttons">
              <a href="booking.html" className="btn btn-primary" style={{ padding: '14px 32px', fontSize: 14 }}>
                Check availability
              </a>
              <a href="contact.html" className="btn btn-secondary" style={{ padding: '14px 32px', fontSize: 14 }}>
                Talk to a host
              </a>
            </div>
          </div>
        </section>
      </div>
    </>
  );
}

function VillaSection({ villa, index, reverse }) {
  return (
    <section
      id={`villa-${villa.id}`}
      data-villa-id={villa.id}
      className={`villa-section ${reverse ? 'reverse' : ''} reveal`}
      style={{ scrollMarginTop: '120px' }}
    >
      <div className="villa-bignum">{String(index).padStart(2, '0')}</div>
      <div className="villa-inner">
        <div className="villa-media">
          <img src={villa.photo} alt={villa.name} loading="lazy" />
          <div className="villa-media-overlay">{villa.badge}</div>
        </div>

        <div className="villa-content">
          <div>
            <div className="villa-number">No. {String(index).padStart(2, '0')}</div>
            <h2 className="villa-name">
              {villa.name.split(' ').slice(0, -1).join(' ')}{' '}
              <em>{villa.name.split(' ').slice(-1)}</em>
            </h2>
            <div className="villa-location" style={{ marginTop: 8 }}>
              <span className="villa-location-dot" />
              {villa.neighborhood}
            </div>
            {villa.address && (
              <div className="villa-address" style={{ marginTop: 6, fontSize: 13, color: 'var(--ink-500)', letterSpacing: '0.01em' }}>
                {villa.address}
              </div>
            )}

            {/* Specs — at-a-glance per property */}
            <div className="villa-specs" style={{
              display: 'flex', flexWrap: 'wrap', gap: '10px 22px', marginTop: 16,
              paddingTop: 16, borderTop: '1px solid var(--line)',
            }}>
              <span style={{ fontSize: 14, color: 'var(--ink-700)' }}>
                <strong style={{ color: 'var(--navy-900)' }}>{villa.bedrooms}</strong> Bedrooms
              </span>
              <span style={{ fontSize: 14, color: 'var(--ink-700)' }}>
                <strong style={{ color: 'var(--navy-900)' }}>{villa.bathrooms}</strong> Baths
              </span>
              <span style={{ fontSize: 14, color: 'var(--ink-700)' }}>
                Sleeps <strong style={{ color: 'var(--navy-900)' }}>{villa.maxGuests}</strong>
              </span>
            </div>
          </div>

          <p className="villa-tagline">{villa.tagline}</p>

          <div className="villa-features">
            {villa.facts.slice(0, 4).map((f, i) => (
              <div key={i} className="villa-feature">
                <div className="villa-feature-icon">
                  <FeatureIcon name={iconForFact(f)} />
                </div>
                <span>{f}</span>
              </div>
            ))}
          </div>

          <div className="villa-cta-row">
            <div className="villa-rate">
              <strong>${villa.rate.toLocaleString()}</strong>
              <span>per night</span>
            </div>
            <div className="villa-rating">
              <span className="villa-rating-stars">★</span>
              <strong style={{ color: 'var(--navy-900)' }}>{villa.rating}</strong>
              <span>({villa.reviews} stays)</span>
            </div>
            <div style={{ flex: 1 }} />
            <a href={`property-${villa.id}.html`} className="btn btn-primary" style={{ padding: '12px 22px', fontSize: 13 }}>
              View villa →
            </a>
          </div>
        </div>
      </div>
    </section>
  );
}

/* Inline icons matched to villa features */
function FeatureIcon({ name }) {
  const paths = {
    home: 'M3 12 12 3l9 9M5 10v11h14V10',
    pool: 'M2 18s2-1 4-1 3 1 6 1 4-1 6-1 4 1 4 1M2 22s2-1 4-1 3 1 6 1 4-1 6-1 4 1 4 1M6 14V5a2 2 0 0 1 2-2h3v11M18 14V5a2 2 0 0 0-2-2h-3v11',
    chef: 'M6 13a4 4 0 1 1 6.7-4.3M18 13a4 4 0 1 0-6.7-4.3M9 13h6v9H9z',
    concierge: 'M21 11.5a8.4 8.4 0 0 1-8.4 8.4 8.4 8.4 0 0 1-3.8-.9L3 21l1.9-5.6a8.4 8.4 0 0 1-.9-3.8 8.4 8.4 0 0 1 8.4-8.5 8.4 8.4 0 0 1 8.5 8.4z',
    clean: 'M3 6h18l-2 14H5L3 6zM10 11v5M14 11v5M9 6V3h6v3',
    secure: 'M12 2 4 6v6c0 5 3.4 8.9 8 10 4.6-1.1 8-5 8-10V6l-8-4zM9 12l2 2 4-4',
    bed: 'M3 18v-7h18v7M3 11V7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v4M6 11V8h5v3M13 11V8h5v3',
    bath: 'M9 6V3h6v3M4 12h16v3a4 4 0 0 1-4 4H8a4 4 0 0 1-4-4v-3zM4 12V8a2 2 0 0 1 2-2',
    view: 'M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z',
    boat: 'M2 20s4-3 10-3 10 3 10 3M5 17l7-12 7 12M12 5v12',
    sun: 'M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4',
    sleeps: 'M16 19a4 4 0 0 0-8 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM20 19a4 4 0 0 0-3-3.9M16 3.1A4 4 0 0 1 16 11',
    workspace: 'M4 4h16v12H4zM2 20h20M9 16v4M15 16v4',
  };
  return (
    <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
         strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
      <path d={paths[name] || paths.home} />
    </svg>
  );
}

function iconForFact(fact) {
  const f = fact.toLowerCase();
  if (/bedroom/.test(f)) return 'bed';
  if (/bath/.test(f)) return 'bath';
  if (/pool/.test(f)) return 'pool';
  if (/view|skyline|bay/.test(f)) return 'view';
  if (/sleep/.test(f)) return 'sleeps';
  if (/dock|boat|canal/.test(f)) return 'boat';
  if (/sunset/.test(f)) return 'sun';
  if (/workspace/.test(f)) return 'workspace';
  return 'home';
}

/* FAQ accordion item */
function FaqItem({ q, a }) {
  const [open, setOpen] = React.useState(false);
  return (
    <div className={`faq-item ${open ? 'open' : ''}`}>
      <button className="faq-q" onClick={() => setOpen(o => !o)} aria-expanded={open}>
        <span>{q}</span>
        <svg className="faq-icon" width="26" height="26" viewBox="0 0 24 24" fill="none"
             stroke="currentColor" strokeWidth="1.6" strokeLinecap="round">
          <path d="M12 5v14M5 12h14" />
        </svg>
      </button>
      <div className="faq-a">
        <div className="faq-a-inner">{a}</div>
      </div>
    </div>
  );
}

/* Neighborhoods — derived from the villa collection's locations */
const NOVUS_HOODS = [
  { name: 'Treasure Island', count: '3 villas', anchor: '#villa-villa-gaia',
    photo: 'https://images.unsplash.com/photo-1613977257363-707ba9348227?auto=format&fit=crop&w=900&q=80' },
  { name: 'North Bay Village', count: '1 villa', anchor: '#villa-villa-eros',
    photo: 'https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?auto=format&fit=crop&w=1500&q=80' },
  { name: 'Biscayne Bay', count: '1 villa', anchor: '#villa-villa-artemis',
    photo: 'https://images.unsplash.com/photo-1582719478250-c89cae4dc85b?auto=format&fit=crop&w=900&q=80' },
];

/* Booking FAQs — calm, transactional brand voice */
const VILLA_FAQS = [
  { q: 'How do I book directly with Novus?',
    a: 'Use the Check availability button on any villa — you\'ll book directly with us, not through an OTA. Direct guests get the best rate, our full concierge, and a real person on the other end of every message.' },
  { q: 'What\'s included in every stay?',
    a: 'Hotel-grade housekeeping, fresh hotel-laundered linens, a stocked welcome, fast Wi-Fi, and 24/7 concierge access. Pools are heated year-round and lit at night. Anything beyond that — private chef, transfers, experiences — we arrange on request.' },
  { q: 'Is there a minimum stay?',
    a: 'Most villas have a two-night minimum, with longer minimums over holidays and high-season weekends. Extended stays of a month or more are welcome and priced accordingly — just ask.' },
  { q: 'Can you arrange a private chef or yacht day?',
    a: 'Yes. Our concierge books private chefs, the Galeon 500 yacht charter, transfers, and in-villa spa — often within minutes. Tell us what you have in mind and we\'ll handle the details.' },
  { q: 'How does check-in work?',
    a: 'Keyless entry with a personal code, sent before arrival. For late flights, a host can meet you in person with the keys. Our digital check-in app walks you through everything — identity, agreement, and your concierge — before you arrive.' },
];

window.VillasPage = VillasPage;
