/* ==========================================================================
   Rafael Gonzalez Real Estate — custom styles
   (Plain CSS layered on top of Tailwind's Play CDN utilities.)
   ========================================================================== */

:root {
  --header-h: 4rem;
  --brand-50: #f4f7fb;
  --brand-100: #e8eff7;
  --brand-600: #1e4b7a;
  --brand-700: #173a5e;
  --brand-950: #07121f;
  --accent-400: #d6a05a;
  --accent-500: #c88a4b;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

[id] {
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 3px;
  border-radius: 6px;
}

.text-balance {
  text-wrap: balance;
}

/* Heroicons-style outline icons */
.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.7;
}

.section-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.875rem, 1.35rem + 2vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* ---------- Header & navigation ---------- */
.site-header {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.site-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px -18px rgba(11, 27, 45, 0.35);
}

.desktop-nav .nav-link {
  position: relative;
  padding: 0.25rem 0;
}

.desktop-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-500);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease-out);
}

.desktop-nav .nav-link:hover::after,
.desktop-nav .nav-link.is-active::after {
  transform: scaleX(1);
}

.desktop-nav .nav-link.is-active {
  color: var(--brand-700);
}

.mobile-nav-link.is-active {
  background: var(--brand-50);
  color: var(--brand-700);
}

/* ---------- Hero ---------- */
.hero-overlay {
  background:
    radial-gradient(55% 45% at 82% 18%, rgba(214, 160, 90, 0.2), transparent 70%),
    linear-gradient(100deg, rgba(7, 18, 31, 0.95) 0%, rgba(11, 27, 45, 0.84) 48%, rgba(11, 27, 45, 0.55) 100%),
    linear-gradient(to top, rgba(7, 18, 31, 0.92) 0%, transparent 45%);
}

.hero-img {
  animation: hero-zoom 2.4s var(--ease-out) both;
}

.hero-animate > * {
  animation: rise 0.8s var(--ease-out) both;
}

.hero-animate > *:nth-child(1) { animation-delay: 0.05s; }
.hero-animate > *:nth-child(2) { animation-delay: 0.12s; }
.hero-animate > *:nth-child(3) { animation-delay: 0.19s; }
.hero-animate > *:nth-child(4) { animation-delay: 0.26s; }
.hero-animate > *:nth-child(5) { animation-delay: 0.33s; }

.hero-portrait {
  animation: rise 1s var(--ease-out) 0.25s both;
}

.hero-stats {
  animation: rise 0.9s var(--ease-out) 0.45s both;
}

.float-badge {
  animation: float 6s ease-in-out infinite;
}

/* ---------- Section backgrounds ---------- */
.reviews-bg {
  background:
    radial-gradient(50% 60% at 0% 0%, rgba(47, 95, 146, 0.45), transparent 70%),
    radial-gradient(40% 50% at 100% 100%, rgba(214, 160, 90, 0.16), transparent 70%);
}

/* ---------- Components ---------- */
.icon-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.875rem;
  height: 2.875rem;
  flex-shrink: 0;
  border-radius: 0.9rem;
  background: var(--brand-50);
  color: var(--brand-700);
  box-shadow: inset 0 0 0 1px var(--brand-100);
}

.lift {
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.35s ease;
}

.lift:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 24px 48px -24px rgba(11, 27, 45, 0.28);
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.75rem;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.filter-btn[aria-pressed="true"] {
  background: var(--accent-400);
  border-color: transparent;
  color: var(--brand-950);
}

.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.area-chip:hover {
  transform: translateY(-1px);
  border-color: var(--brand-600);
  background: var(--brand-50);
  color: var(--brand-700);
}

.area-chip .icon {
  color: var(--accent-500);
}

.copy-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.copy-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* ---------- Form ---------- */
.field-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}

.field {
  display: block;
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field::placeholder {
  color: #94a3b8;
}

.field:hover {
  border-color: #94a3b8;
}

.field:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 4px rgba(30, 75, 122, 0.12);
}

select.field {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1.1rem;
}

textarea.field {
  min-height: 8rem;
  resize: vertical;
}

.form-result {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid;
  font-size: 0.85rem;
  line-height: 1.5;
}

.form-result[data-state="success"] {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.form-result[data-state="error"] {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

/* ---------- Mobile action bar & toast ---------- */
.mobile-bar {
  padding-bottom: calc(0.625rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px -12px rgba(15, 23, 42, 0.18);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f172a;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.5);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

@media (min-width: 768px) {
  .toast {
    right: 1.5rem;
    bottom: 1.5rem;
  }
}

/* ---------- Animations ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.fade-in {
  animation: rise 0.5s var(--ease-out) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-zoom {
  from {
    transform: scale(1.08);
  }
  to {
    transform: scale(1);
  }
}

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
