/* =========================================================
   NESTLOOP — Design system
   Aesthetic: Editorial Warmth
   Deep forest green + warm off-white + editorial serif
   ========================================================= */

:root {
  /* Colour palette */
  --forest: #14532D;
  --forest-deep: #0B3A1F;
  --moss: #22C55E;
  --sage: #D1FAE5;
  --ink: #0F172A;
  --mist: #F7F5EF;
  --parchment: #FDFCF7;
  --line: #E7E4D9;
  --line-strong: #D6D2C3;
  --muted: #6B6B5F;
  --accent: #C2410C;        /* warm terracotta for highlights */
  --success: #16A34A;
  --warning: #F59E0B;

  /* Typography */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --max: 1240px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 40, 25, 0.08), 0 2px 4px rgba(15, 40, 25, 0.04);
  --shadow-lg: 0 20px 50px rgba(15, 40, 25, 0.10), 0 8px 16px rgba(15, 40, 25, 0.06);
  --shadow-xl: 0 30px 80px rgba(15, 40, 25, 0.15);

  /* Transitions */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* =========================================================
   Base
   ========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--forest); }
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.container {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.container-wide {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

/* =========================================================
   Navigation
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 239, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(231, 228, 217, 0.6);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--forest);
}

.brand:hover { color: var(--forest-deep); }

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav-links a {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 8px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--forest);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

.menu-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--ink);
  position: relative;
}
.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--ink);
}
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after  { top: 6px; }

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--forest);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, var(--shadow-md);
}
.btn-primary:hover {
  background: var(--forest-deep);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--parchment);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { color: var(--forest); }

.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: 10px; }

.btn-block { width: 100%; }

/* =========================================================
   Pills / badges / chips
   ========================================================= */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--sage);
  color: var(--forest);
  border: 1px solid rgba(20, 83, 45, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--moss);
}

.badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-verified { background: var(--sage); color: var(--forest); }
.badge-new { background: #FEF3C7; color: #92400E; }
.badge-featured { background: var(--forest); color: #fff; }

.eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 14px;
}

/* =========================================================
   Section headers
   ========================================================= */

section { padding: 84px 0; }
section.tight { padding: 56px 0; }
section.loose { padding: 120px 0; }

.section-head {
  max-width: 720px;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.section-head .lead {
  margin-top: 18px;
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.7;
}

.section-head h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--forest);
}

/* =========================================================
   Forms
   ========================================================= */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 0.8rem; color: var(--muted); }

input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--parchment);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(20, 83, 45, 0.12);
}

textarea { resize: vertical; min-height: 120px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Aliases used across pages */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.form-input { /* base styles already applied via tag selectors above */ }
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 640px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* =========================================================
   Cards
   ========================================================= */

.card {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* =========================================================
   Property card (reusable)
   ========================================================= */

.property-card {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.property-card .photo {
  aspect-ratio: 4 / 3;
  background: #e9e4d5;
  background-size: cover;
  background-position: center;
  position: relative;
}

.property-card .photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.25));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.property-card:hover .photo::after { opacity: 1; }

.property-card .photo-badges {
  position: absolute;
  top: 14px; left: 14px;
  display: flex; gap: 6px;
  z-index: 2;
}

.property-card .fav-btn {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  transition: transform 0.2s var(--ease);
  z-index: 2;
}
.property-card .fav-btn:hover { transform: scale(1.08); }

.property-card .body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.property-card .title-row { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.property-card h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.property-card .price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
}
.property-card .address { font-size: 0.88rem; color: var(--muted); }
.property-card .specs {
  display: flex; gap: 16px;
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.property-card .spec { display: inline-flex; align-items: center; gap: 5px; }

/* =========================================================
   Grids
   ========================================================= */

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

/* =========================================================
   Footer
   ========================================================= */

footer {
  background: var(--forest-deep);
  color: rgba(255, 255, 255, 0.85);
  padding: 80px 0 32px;
  margin-top: 60px;
}

footer .brand { color: #fff; }
footer a { color: rgba(255,255,255,0.75); }
footer a:hover { color: #fff; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 50px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-grid h5 {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.footer-grid ul { display: flex; flex-direction: column; gap: 10px; }
.footer-grid li { font-size: 0.93rem; }

.footer-tagline {
  max-width: 320px;
  margin-top: 14px;
  font-size: 0.93rem;
  color: rgba(255,255,255,0.68);
  line-height: 1.7;
}

.footer-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.55);
  flex-wrap: wrap;
  gap: 12px;
}

/* =========================================================
   Utilities
   ========================================================= */

.text-muted { color: var(--muted); }
.text-forest { color: var(--forest); }
.text-center { text-align: center; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 18px; }
.mt-lg { margin-top: 32px; }
.mt-xl { margin-top: 56px; }

.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
  margin: 24px 0;
}

.ornament {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--forest);
  margin: 0 0 22px;
  opacity: 0.6;
}

/* Leaf decoration */
.leaf-bg {
  position: absolute;
  pointer-events: none;
  opacity: 0.05;
  z-index: 0;
}

/* Subtle animated gradient for hero */
.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(34, 197, 94, 0.08), transparent 45%),
    radial-gradient(circle at 85% 70%, rgba(20, 83, 45, 0.06), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* =========================================================
   Animations
   ========================================================= */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fade-up { animation: fade-up 0.7s var(--ease) both; }
.fade-in { animation: fade-in 0.6s var(--ease) both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.40s; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-grid > div:nth-child(5) { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  section { padding: 56px 0; }
  .container { width: calc(100% - 32px); }

  .menu-toggle { display: inline-flex; }
  .nav-links {
    position: fixed;
    inset: 74px 0 auto 0;
    background: var(--mist);
    flex-direction: column;
    gap: 0;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; }

  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-2 { grid-template-columns: 1fr; gap: 32px; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-bottom { justify-content: center; text-align: center; }

  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .btn-lg { padding: 14px 22px; }
}
