:root {
  --navy: #16323A;
  --navy-dark: #0E2126;
  --teal: #52868D;
  --teal-light: #A9C9C6;
  --gold: #B8873C;
  --gold-light: #D9AD5F;
  --gold-deep: #8F6425;
  --cream: #FBFAF6;
  --cream-dark: #F0EAE0;
  --ink: #26343A;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 16px 40px rgba(14, 33, 38, 0.14);
  --serif: "Playfair Display", "Songti SC", "Noto Serif SC", "Georgia", serif;
  --sans: "PingFang SC", "Noto Sans SC", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid rgba(30, 69, 79, 0.08);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 44px; width: auto; }
.brand-market {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  border-left: 1px solid var(--teal-light);
  padding-left: 10px;
  margin-left: 2px;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.lang-toggle {
  display: flex;
  border: 1px solid var(--teal-light);
  border-radius: 999px;
  overflow: hidden;
}
.lang-toggle button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--navy);
}
.lang-toggle button.active { background: var(--navy); color: #fff; }
.nav-cta {
  background: var(--gold);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700 !important;
}
.mobile-nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  color: #fff;
  background: var(--navy-dark);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg-layer {
  position: absolute;
  inset: -2%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: heroKenBurns 30s infinite;
  will-change: opacity, transform;
}
.hero-bg-layer:nth-child(1) { animation-delay: 0s; }
.hero-bg-layer:nth-child(2) { animation-delay: 6s; }
.hero-bg-layer:nth-child(3) { animation-delay: 12s; }
.hero-bg-layer:nth-child(4) { animation-delay: 18s; }
.hero-bg-layer:nth-child(5) { animation-delay: 24s; }
@keyframes heroKenBurns {
  0%   { opacity: 0; transform: scale(1) translate(0, 0); }
  3%   { opacity: 1; transform: scale(1.015) translate(-0.2%, -0.2%); }
  18%  { opacity: 1; transform: scale(1.07) translate(-1%, -1%); }
  20%  { opacity: 0; transform: scale(1.08) translate(-1.1%, -1.1%); }
  100% { opacity: 0; transform: scale(1.08) translate(-1.1%, -1.1%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg-layer { animation: none !important; opacity: 0; }
  .hero-bg-layer:first-child { opacity: 1; }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10,25,29,0.55) 0%, rgba(10,25,29,0.62) 45%, rgba(10,25,29,0.88) 100%),
    linear-gradient(90deg, rgba(10,25,29,0.55) 0%, rgba(10,25,29,0.15) 55%, rgba(10,25,29,0.05) 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: radial-gradient(circle at 82% 75%, rgba(217,173,95,0.14), transparent 45%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 2; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(217,173,95,0.4);
  padding: 8px 18px;
  border-radius: 999px;
  margin-bottom: 28px;
  backdrop-filter: blur(6px);
}
.hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 8px var(--gold-light);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 5.2vw, 60px);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  max-width: 820px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.hero p.lead {
  font-size: 18px;
  max-width: 620px;
  color: rgba(255,255,255,0.88);
  margin: 0 0 34px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #fff; box-shadow: 0 10px 26px rgba(143,100,37,0.4); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.55); }
.btn-navy { background: var(--navy); color: #fff; }

.hero-stats {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 28px;
}
.hero-stats .stat b {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  color: var(--gold-light);
}
.hero-stats .stat span {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}

/* ---------- Section shell ---------- */
section { padding: 96px 0; }
.section-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 12px;
  display: block;
}
h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 38px);
  color: var(--navy);
  margin: 0 0 14px;
}
.section-head p { color: #5B6B70; font-size: 16px; margin: 0; }
.divider {
  width: 56px;
  height: 2px;
  margin: 0 auto 22px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.about-copy .divider, .lead-side .divider { margin-left: 0; }

/* ---------- Why Spain ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.why-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.why-card .icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--cream-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
}
.why-card h3 { font-family: var(--serif); font-size: 19px; color: var(--navy); margin: 0 0 10px; }
.why-card p { font-size: 14.5px; color: #5B6B70; margin: 0; }

/* ---------- Market strip ---------- */
.market {
  background: var(--navy);
  color: #fff;
}
.market .section-head p { color: rgba(255,255,255,0.72); }
.market .eyebrow { color: var(--gold-light); }
.market h2 { color: #fff; }
.market-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.market-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  padding: 26px 22px;
}
.market-card b {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--gold-light);
  display: block;
  margin-bottom: 8px;
}
.market-card span { font-size: 13.5px; color: rgba(255,255,255,0.8); }

/* ---------- Process ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
.process-step {
  position: relative;
  padding: 28px 22px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.process-step .num {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--gold);
  margin-bottom: 10px;
}
.process-step h3 { font-size: 16.5px; color: var(--navy); margin: 0 0 8px; font-family: var(--serif); }
.process-step p { font-size: 13.5px; color: #5B6B70; margin: 0; }

/* ---------- Listings ---------- */
.listings-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}
.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cream-dark);
  color: var(--navy);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.tier-pill::before { content: "●"; color: var(--gold); }

.listings-search {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 12px;
  background: #fff;
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.listings-search input,
.listings-search select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--navy);
  background: #fff;
}
.listings-search button {
  padding: 11px 22px;
  border: none;
  border-radius: 8px;
  background: var(--gold);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
.listings-search button:hover { background: var(--gold-dark, #a8862f); }
.listings-count { font-size: 13px; color: #5B6B70; margin: -14px 0 22px; }

.listing-photos-badge {
  position: absolute; bottom: 14px; right: 14px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 11.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.listing-media { cursor: pointer; }

.listing-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 20, 30, 0.82);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.listing-modal-overlay[hidden] { display: none; }
.listing-modal {
  background: #fff;
  border-radius: var(--radius);
  max-width: 920px; width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.listing-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: rgba(0,0,0,0.5); color: #fff;
  border: none; border-radius: 999px;
  width: 34px; height: 34px; font-size: 18px;
  cursor: pointer; z-index: 2;
}
.listing-modal-gallery {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--cream-dark);
}
.listing-modal-gallery img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.listing-modal-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.5); color: #fff; border: none;
  width: 38px; height: 38px; border-radius: 999px;
  font-size: 18px; cursor: pointer;
}
.listing-modal-nav.prev { left: 14px; }
.listing-modal-nav.next { right: 14px; }
.listing-modal-thumbs {
  display: flex; gap: 8px; padding: 12px; overflow-x: auto;
}
.listing-modal-thumbs img {
  width: 64px; height: 48px; object-fit: cover; border-radius: 6px;
  cursor: pointer; opacity: 0.6; flex-shrink: 0;
}
.listing-modal-thumbs img.active { opacity: 1; outline: 2px solid var(--gold); }
.listing-modal-body { padding: 8px 28px 28px; }
.listing-modal-body .listing-price { font-size: 26px; }

.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.listing-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.listing-media {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--teal-light), var(--cream-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  position: relative;
}
.listing-media img { width: 100%; height: 100%; object-fit: cover; }
.listing-badge {
  position: absolute; top: 14px; left: 14px;
  background: var(--gold); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.listing-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.listing-price { font-family: var(--serif); font-size: 22px; color: var(--navy); margin: 0 0 4px; }
.listing-loc { font-size: 13px; color: var(--teal); margin: 0 0 12px; font-weight: 600; }
.listing-specs {
  display: flex; gap: 14px;
  font-size: 12.5px; color: #5B6B70;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cream-dark);
}
.listing-usp { font-size: 13.5px; color: #445; margin: 0 0 18px; flex: 1; }
.listing-card .btn { align-self: flex-start; padding: 10px 20px; font-size: 13px; }

.listings-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: #5B6B70;
}
.listings-empty .icon { font-size: 34px; margin-bottom: 14px; }

/* ---------- Legal & Experience ---------- */
.legal {
  background: var(--navy);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.legal::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 88% 12%, rgba(217,173,95,0.16), transparent 40%),
                     radial-gradient(circle at 6% 90%, rgba(82,134,141,0.22), transparent 45%);
  pointer-events: none;
}
.legal .container { position: relative; z-index: 1; }
.legal-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 60px;
  align-items: center;
}
.legal-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/5;
  border: 1px solid rgba(217,173,95,0.35);
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.legal-media img { width: 100%; height: 100%; object-fit: cover; }
.legal-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(14,33,38,0.55) 0%, transparent 45%);
}
.legal-copy .eyebrow { color: var(--gold-light); }
.legal-copy h2 { color: #fff; text-align: left; }
.legal-copy .divider { margin-left: 0; }
.legal-copy > p { color: rgba(255,255,255,0.72); font-size: 15.5px; max-width: 520px; margin: 0 0 32px; }
.legal-points { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; }
.legal-point { display: flex; gap: 14px; }
.legal-point .ico {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(217,173,95,0.14);
  border: 1px solid rgba(217,173,95,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.legal-point h4 { margin: 0 0 4px; font-size: 14.5px; color: #fff; font-weight: 700; }
.legal-point p { margin: 0; font-size: 13px; color: rgba(255,255,255,0.68); line-height: 1.5; }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-media {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy), var(--teal));
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.about-media img { max-width: 220px; }
.about-copy h2 { text-align: left; }
.about-list { list-style: none; margin: 24px 0 0; padding: 0; }
.about-list li {
  display: flex; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--cream-dark);
  font-size: 14.5px;
  color: #445;
}
.about-list li::before { content: "✓"; color: var(--gold); font-weight: 700; }

/* ---------- Event banner ---------- */
.event-banner {
  background: linear-gradient(120deg, var(--gold), var(--gold-light));
  color: #fff;
}
.event-banner .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.event-banner .eyebrow { color: rgba(255,255,255,0.85); }
.event-banner h2 { color: #fff; margin-bottom: 6px; }
.event-banner p { color: rgba(255,255,255,0.9); margin: 0; }
.event-banner .btn-navy { flex-shrink: 0; }

/* ---------- Lead form ---------- */
.lead-wrap {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
}
.lead-side {
  background: var(--navy);
  color: #fff;
  padding: 48px 40px;
}
.lead-side h3 { font-family: var(--serif); font-size: 24px; margin: 0 0 16px; }
.lead-side p { color: rgba(255,255,255,0.78); font-size: 14.5px; margin: 0 0 28px; }
.lead-contact { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 14px; }
.lead-contact .ico {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wechat-qr {
  width: 56px; height: 56px; margin-left: auto;
  border-radius: 8px; background: #fff; padding: 4px;
  flex-shrink: 0;
}
.lead-form { padding: 48px 40px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12.5px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: 0.04em; }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid #DDE3E1;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--cream);
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-submit { margin-top: 8px; width: 100%; justify-content: center; }
.form-note { font-size: 12px; color: #8A9599; margin-top: 12px; }
.form-status { font-size: 13.5px; margin-top: 12px; display: none; }
.form-status.success { display: block; color: #1E7A4C; }
.form-status.error { display: block; color: #B23B3B; }

/* ---------- Footer ---------- */
footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.7);
  padding: 56px 0 28px;
  font-size: 13.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand img { height: 40px; margin-bottom: 14px; }
.footer-brand p { max-width: 320px; color: rgba(255,255,255,0.55); }
footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 16px; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: 10px; }
footer a { text-decoration: none; color: rgba(255,255,255,0.65); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(255,255,255,0.4);
  font-size: 12.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .why-grid, .market-grid, .process-grid { grid-template-columns: repeat(2, 1fr); }
  .listings-grid { grid-template-columns: repeat(2, 1fr); }
  .listings-search { grid-template-columns: 1fr 1fr; }
  .about { grid-template-columns: 1fr; }
  .legal-grid { grid-template-columns: 1fr; }
  .legal-media { aspect-ratio: 16/9; }
  .lead-wrap { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .nav-links { display: none; }
  .why-grid, .market-grid, .process-grid, .listings-grid { grid-template-columns: 1fr; }
  .listings-search { grid-template-columns: 1fr; }
  .listing-modal-body { padding: 8px 18px 22px; }
  .legal-points { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  .event-banner .inner { flex-direction: column; align-items: flex-start; }
}
