:root {
  --bg-from: #0a1a30;
  --bg-via: #10294d;
  --bg-to: #071224;
  --accent: #d4b06a;
  --accent-soft: rgba(212, 176, 106, 0.38);
  --ink: #f3ede0;
  --ink-muted: rgba(243, 237, 224, 0.72);
  --btn-radius: 14px;
  --body-font: 'Inter', sans-serif;
  --heading-font: 'Cormorant Garamond', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--body-font);
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 50% -12%, var(--bg-via) 0%, transparent 62%),
    radial-gradient(900px 600px at 110% 110%, rgba(212, 176, 106, 0.07) 0%, transparent 55%),
    linear-gradient(168deg, var(--bg-from) 0%, var(--bg-to) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 22px 18px calc(40px + env(safe-area-inset-bottom));
  position: relative;
  min-height: 100vh;
}

/* entrance */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ---------- top utility trigger ---------- */
.topbar-trigger {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  z-index: 20;
}
.topbar-trigger:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.35); }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: 34px; }

.headshot-ring {
  width: 112px; height: 112px;
  margin: 0 auto 16px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(140deg, #e7cd93, var(--accent) 45%, #8f6f33);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(212, 176, 106, 0.08);
}
.headshot {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid var(--bg-from);
}

.name {
  font-family: var(--heading-font);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 30px;
  line-height: 1.15;
}
.name-primary { color: var(--ink); }
.name-suffix { color: var(--accent); font-style: italic; font-weight: 500; font-size: 0.78em; }

.bio {
  margin: 12px auto 0;
  max-width: 480px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  font-weight: 400;
}

.cta-contact {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--body-font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #18233a;
  background: linear-gradient(135deg, #e9d09a 0%, var(--accent) 55%, #b98f47 100%);
  box-shadow: 0 8px 22px rgba(212, 176, 106, 0.28), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: all 0.25s ease;
}
.cta-contact:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(212, 176, 106, 0.4); }

/* ---------- groups & links ---------- */
.content { margin-top: 34px; }
.group { margin-bottom: 30px; }

.group-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.group-label .rule { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-soft)); }
.group-label .rule:last-child { background: linear-gradient(90deg, var(--accent-soft), transparent); }
.label-text {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.links { display: flex; flex-direction: column; gap: 12px; }

.link-btn {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 60px;
  padding: 10px 46px 10px 12px;
  border-radius: var(--btn-radius);
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

/* button styles */
.btn-glass-gold {
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.018));
  border: 1px solid var(--accent-soft);
  backdrop-filter: blur(8px);
}
.btn-solid-gold {
  background: linear-gradient(135deg, #e9d09a, var(--accent) 60%, #bb9148);
  color: #18233a;
  border: none;
}
.btn-outline-gold {
  background: transparent;
  border: 1.5px solid var(--accent-soft);
}
.link-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
}
.link-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.10), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.link-btn:hover::after { left: 130%; }

.link-thumb {
  width: 42px; height: 42px;
  border-radius: calc(var(--btn-radius) - 5px);
  object-fit: cover;
  margin-right: 12px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.link-thumb-icon {
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(212, 176, 106, 0.12);
  border: 1px solid var(--accent-soft) !important;
}

.link-title { flex: 1; text-align: center; padding: 0 4px; }

.link-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  opacity: 0.55;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.link-btn:hover .link-arrow { opacity: 1; transform: translateY(-50%) translate(2px, -2px); }

/* per-link animations */
@keyframes anim-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.018); } }
.anim-pulse { animation: anim-pulse 2.4s ease-in-out infinite; }

@keyframes anim-glow {
  0%,100% { box-shadow: 0 0 0 rgba(212,176,106,0); }
  50% { box-shadow: 0 0 22px rgba(212,176,106,0.35); }
}
.anim-glow { animation: anim-glow 2.8s ease-in-out infinite; }

@keyframes anim-shimmer-sweep { 0% { left: -80%; } 60%, 100% { left: 130%; } }
.anim-shimmer::after { animation: anim-shimmer-sweep 3s ease-in-out infinite; }

@keyframes anim-wiggle {
  0%, 88%, 100% { transform: rotate(0); }
  90% { transform: rotate(-1deg); }
  92% { transform: rotate(1.4deg); }
  94% { transform: rotate(-1deg); }
  96% { transform: rotate(0.6deg); }
}
.anim-wiggle { animation: anim-wiggle 5s ease-in-out infinite; }

@keyframes anim-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.anim-float { animation: anim-float 3.2s ease-in-out infinite; }

/* ---------- listings carousel ---------- */
.carousel { display: flex; align-items: center; gap: 8px; }

.car-arrow {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
}
.car-arrow:disabled { opacity: 0.25; cursor: default; }
.car-arrow:not(:disabled):hover { border-color: var(--accent); transform: scale(1.06); }

.car-window { flex: 1; overflow: hidden; border-radius: 16px; }
.car-track { display: flex; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.car-page { min-width: 100%; display: flex; gap: 12px; }

.listing-card {
  flex: 1;
  min-width: 0;
  background: linear-gradient(150deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015));
  border: 1px solid var(--accent-soft);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.listing-card.clickable { cursor: pointer; }
.listing-card.clickable:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 28px rgba(0,0,0,0.4); }
.listing-card.spacer { visibility: hidden; border: none; }

.listing-photo { position: relative; aspect-ratio: 4 / 3; background: rgba(255,255,255,0.03); }
.listing-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-placeholder {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  color: var(--accent-soft);
}

.status-chip {
  position: absolute;
  top: 8px; right: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}
.status-active { background: linear-gradient(135deg, #4ade80, #16a34a); color: #06281a; }
.status-pending { background: #7c3aed; color: #fff; }
.status-sold { background: #2563eb; color: #fff; }
.status-coming-soon { background: linear-gradient(135deg, #e9d09a, #c9a45a); color: #18233a; }

.listing-info { padding: 10px 12px 12px; }
.listing-price {
  font-family: var(--heading-font);
  font-size: 19px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.listing-address {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.car-dots { display: flex; justify-content: center; gap: 7px; margin-top: 12px; }
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.18);
  transition: all 0.2s ease;
  padding: 0;
}
.dot.on { background: var(--accent); width: 18px; border-radius: 4px; }

/* ---------- footer ---------- */
.footer { margin-top: 44px; text-align: center; }
.footer-logo { height: 30px; opacity: 0.85; filter: brightness(0) invert(0.92); margin-bottom: 8px; }
.footer-text { font-size: 12px; color: var(--ink-muted); letter-spacing: 0.04em; }
.footer-fine { margin-top: 4px; font-size: 10.5px; color: rgba(243,237,224,0.4); }

/* ---------- sheets / modals ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 18, 0.66);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 640px;
  background: linear-gradient(180deg, #122947, #0c1d36);
  border: 1px solid var(--accent-soft);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 12px 18px calc(22px + env(safe-area-inset-bottom));
  animation: slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.sheet-handle {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.18);
  margin: 0 auto 14px;
}

.sheet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 12px;
  background: none;
  border: none;
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease;
  text-align: left;
}
.sheet-row:hover { background: rgba(255,255,255,0.06); }
.sheet-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(212,176,106,0.1);
  border: 1px solid var(--accent-soft);
  flex-shrink: 0;
}

.qr-modal, .contact-modal {
  background: linear-gradient(180deg, #122947, #0c1d36);
  border: 1px solid var(--accent-soft);
  border-radius: 20px;
  padding: 26px;
  margin: auto;
  max-width: 360px;
  width: calc(100% - 40px);
  text-align: center;
  animation: slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.contact-modal { max-width: 420px; text-align: left; max-height: 86vh; overflow-y: auto; }

.qr-canvas { border-radius: 14px; max-width: 100%; }
.qr-caption { margin-top: 12px; font-size: 13px; color: var(--ink-muted); }
.qr-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

.mini-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 600;
  color: #18233a;
  background: linear-gradient(135deg, #e9d09a, var(--accent) 60%, #b98f47);
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}
.mini-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(212,176,106,0.3); }
.mini-btn.ghost {
  background: transparent;
  border: 1px solid var(--accent-soft);
  color: var(--ink);
}
.mini-btn:disabled { opacity: 0.6; cursor: default; }

/* contact form */
.contact-title { font-family: var(--heading-font); font-size: 24px; letter-spacing: 0.04em; color: var(--ink); }
.contact-sub { font-size: 13px; color: var(--ink-muted); margin: 4px 0 16px; }

.field {
  width: 100%;
  margin-bottom: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}
.field:focus { border-color: var(--accent); }
.field::placeholder { color: rgba(243,237,224,0.45); }
select.field { appearance: none; }
select.field option { color: #18233a; }
textarea.field { resize: vertical; }

.hp { position: absolute; left: -9999px; opacity: 0; height: 0; }

.form-error { color: #f0a0a0; font-size: 13px; margin-bottom: 10px; }

.contact-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.contact-done { text-align: center; padding: 10px 0; }
.done-check {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #18233a;
  background: linear-gradient(135deg, #e9d09a, var(--accent));
}
.contact-done h3 { font-family: var(--heading-font); font-size: 22px; margin-bottom: 6px; }
.contact-done p { font-size: 13.5px; color: var(--ink-muted); margin-bottom: 18px; }

.toast {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #18233a;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 100;
  box-shadow: 0 8px 22px rgba(0,0,0,0.4);
  animation: slide-up 0.25s ease;
}

/* ---------- viewer ---------- */
.viewer-shell { display: flex; flex-direction: column; min-height: 100vh; }

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(7, 18, 36, 0.92);
  border-bottom: 1px solid var(--accent-soft);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.viewer-brand {
  font-family: var(--heading-font);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.viewer-brand span { color: var(--accent); font-style: italic; font-weight: 500; font-size: 0.8em; }
.viewer-title {
  flex: 1;
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-actions { display: flex; gap: 8px; }

.viewer-frame { flex: 1; width: 100%; border: none; min-height: calc(100vh - 60px); background: #fff; }
.viewer-image-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 20px;
}
.viewer-image-wrap img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,0.5); }

.viewer-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--ink-muted);
  padding: 40px;
  text-align: center;
}

.viewer-fallback {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-muted);
  padding: 10px;
  background: rgba(7, 18, 36, 0.9);
}
.viewer-fallback a { color: var(--accent); }

/* ---------- loading ---------- */
.loading-shimmer {
  height: 4px;
  width: 180px;
  margin: 46vh auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(212,176,106,0.12), var(--accent), rgba(212,176,106,0.12));
  background-size: 200% 100%;
  animation: loadbar 1.2s linear infinite;
}
@keyframes loadbar { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- mobile ---------- */
@media (max-width: 480px) {
  /* avoid fixed-background jank/repaint issues on iOS Safari */
  body { background-attachment: scroll; }

  .page { padding: 18px 14px calc(36px + env(safe-area-inset-bottom)); }
  .hero { padding-top: 24px; }
  .content { margin-top: 28px; }
  .name { font-size: 26px; }
  .bio { font-size: 13.5px; }

  /* listings: hide arrows and rely on swipe + dots so cards get full width */
  .carousel { gap: 0; }
  .car-arrow { display: none; }
  .listing-price { font-size: 16px; }
  .listing-address { font-size: 11px; }

  /* comfortable tap targets */
  .topbar-trigger { width: 44px; height: 44px; }
  .mini-btn { padding: 11px 18px; }
  .dot { width: 9px; height: 9px; }
  .dot.on { width: 20px; }

  /* dynamic viewport height accounts for mobile browser toolbars (falls back to vh) */
  .map-modal { width: calc(100% - 20px); height: min(82dvh, 720px); }
  .contact-modal { max-height: 88dvh; }

  .viewer-title { display: none; }
}

@media (max-width: 360px) {
  .car-page { gap: 8px; }
  .listing-info { padding: 8px 10px 10px; }
  .listing-price { font-size: 15px; }
}

/* ---------- contact card (inside Get In Touch) ---------- */
.contact-card {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--accent-soft);
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
}
.cc-photo {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}
.cc-name { font-family: var(--heading-font); font-size: 17px; letter-spacing: 0.05em; color: var(--ink); }
.cc-line { font-size: 11px; color: var(--ink-muted); margin: 1px 0 5px; }
.cc-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.cc-links a { color: var(--accent); text-decoration: none; }
.cc-links a:hover { text-decoration: underline; }

/* ---------- map card (last carousel slide) ---------- */
.map-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  color: var(--accent);
  text-align: center;
  padding: 18px 10px;
  border-style: dashed;
}
.map-card:hover { border-style: solid; }
.map-card-title { font-family: var(--heading-font); font-size: 16px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink); line-height: 1.25; }
.map-card-sub { font-size: 10.5px; color: var(--ink-muted); }

/* ---------- map modal ---------- */
.map-modal {
  background: linear-gradient(180deg, #122947, #0c1d36);
  border: 1px solid var(--accent-soft);
  border-radius: 20px;
  margin: auto;
  width: calc(100% - 28px);
  max-width: 920px;
  height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--accent-soft);
}
.map-title { font-family: var(--heading-font); font-size: 18px; color: var(--ink); }
.map-title span { font-size: 12px; color: var(--ink-muted); font-family: var(--body-font); }
#ju-map { flex: 1; min-height: 0; background: #0c1d36; position: relative; }
.map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  font-size: 13px;
  z-index: 500;
  pointer-events: none;
}
.map-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px;
  font-size: 11.5px;
  color: var(--ink-muted);
  border-top: 1px solid var(--accent-soft);
}
.map-legend i {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  vertical-align: -1px;
}
.map-pop { font-family: 'Inter', sans-serif; }
.map-pop img { width: 190px; max-width: 100%; border-radius: 8px; display: block; margin-bottom: 6px; }
.map-pop-price { font-weight: 700; font-size: 15px; color: #0a1a30; }
.map-pop-addr { font-size: 12px; color: #44506a; }
.map-pop-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
