/* =========================================================
   Havenmark Realty — landing page styles
   ========================================================= */

:root {
  --ink:        #16211f;
  --ink-soft:   #4d5b58;
  --ink-faint:  #7b8886;
  --brand:      #134e4a;
  --brand-deep: #0d3936;
  --accent:     #c9973f;
  --accent-soft:#f3e4c6;
  --paper:      #ffffff;
  --paper-alt:  #f7f5f1;
  --line:       #e4e0d8;

  --radius:     14px;
  --radius-lg:  22px;
  --shadow-sm:  0 1px 2px rgba(22,33,31,.06), 0 4px 14px rgba(22,33,31,.05);
  --shadow-md:  0 10px 34px rgba(22,33,31,.10);
  --shadow-lg:  0 24px 60px rgba(22,33,31,.16);

  --wrap:       1160px;
  --gutter:     24px;
  --section-y:  clamp(64px, 9vw, 116px);

  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 .5em;
  font-weight: 600;
  letter-spacing: -.015em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.35rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.85rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1.1em; }

a { color: var(--brand); text-decoration-color: rgba(19,78,74,.3); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

ul { margin: 0; padding: 0; list-style: none; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brand); color: #fff; padding: 12px 20px; border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- shared bits ---------- */
.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .9em;
}
.eyebrow-light { color: var(--accent-soft); }

.section { padding-block: var(--section-y); }
.section-alt { background: var(--paper-alt); }
.section-dark { background: var(--brand-deep); color: rgba(255,255,255,.78); }
.section-dark h2, .section-dark h3, .section-dark strong { color: #fff; }

.section-head { max-width: 660px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-lede { font-size: 1.06rem; margin-bottom: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--sans); font-size: .95rem; font-weight: 600; line-height: 1;
  padding: 14px 24px; border: 1px solid transparent; border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: #241a05; box-shadow: 0 8px 20px rgba(201,151,63,.28); }
.btn-primary:hover { background: #d8a851; box-shadow: 0 12px 26px rgba(201,151,63,.36); }

.btn-dark { background: var(--brand); color: #fff; }
.btn-dark:hover { background: var(--brand-deep); }

.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.45); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.2); border-color: #fff; }

.btn-lg { padding: 17px 32px; font-size: 1rem; }
.btn-block { width: 100%; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding-block: 18px;
  transition: background-color .3s ease, box-shadow .3s ease, padding .3s ease;
}
.site-header.scrolled {
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 1px 0 var(--line), 0 8px 24px rgba(22,33,31,.06);
  padding-block: 11px;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 1.32rem; font-weight: 600; letter-spacing: -.02em;
  color: #fff; text-decoration: none; transition: color .3s ease;
}
.logo svg { width: 30px; height: 30px; flex: none; }
.logo em { font-style: normal; font-weight: 400; opacity: .72; }
.site-header.scrolled .logo { color: var(--brand); }

.nav { display: flex; align-items: center; gap: 34px; }
.nav ul { display: flex; gap: 30px; }
.nav a {
  color: rgba(255,255,255,.9); text-decoration: none; font-size: .95rem; font-weight: 500;
  position: relative; transition: color .25s ease;
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px;
  background: var(--accent); transition: right .25s ease;
}
.nav a:hover::after, .nav a.active::after { right: 0; }
.site-header.scrolled .nav a { color: var(--ink); }
.nav a.active { color: var(--accent); }
.site-header.scrolled .nav a.active { color: var(--brand); }
.nav-cta::after { display: none; }
.site-header.scrolled .nav-cta { color: #241a05; }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 11px 10px;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: space-between;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease, background-color .3s ease;
}
.site-header.scrolled .nav-toggle span { background: var(--ink); }
.nav-toggle[aria-expanded="true"] span { background: var(--ink); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative; isolation: isolate;
  min-height: min(92vh, 860px);
  display: flex; align-items: center;
  padding-block: 160px 72px;
  color: #fff; overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0; z-index: -2;
  background:
    url('https://images.pexels.com/photos/106399/pexels-photo-106399.jpeg?auto=compress&cs=tinysrgb&w=1900') center 60% / cover no-repeat,
    var(--brand-deep);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(105deg, rgba(9,38,36,.92) 0%, rgba(9,38,36,.72) 45%, rgba(9,38,36,.35) 100%),
    linear-gradient(to top, rgba(9,38,36,.75), transparent 45%);
}

.hero-inner { max-width: 880px; }
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero-sub {
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
  color: rgba(255,255,255,.84);
  max-width: 56ch; margin-bottom: 2em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: clamp(48px, 7vw, 78px); }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin: 0; padding-top: 32px; border-top: 1px solid rgba(255,255,255,.22);
  max-width: 760px;
}
.hero-stats dt {
  font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600;
  color: #fff; line-height: 1.1;
}
.hero-stats dd {
  margin: 6px 0 0; font-size: .85rem; color: rgba(255,255,255,.68);
  letter-spacing: .02em;
}

/* =========================================================
   About
   ========================================================= */
.about-grid {
  display: grid; grid-template-columns: 1fr 1.08fr;
  gap: clamp(40px, 6vw, 84px); align-items: center;
}
.about-media { position: relative; }
.about-media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.about-badge {
  position: absolute; right: -18px; bottom: 34px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 18px 22px; max-width: 250px;
  border-left: 4px solid var(--accent);
}
.about-badge strong { display: block; font-family: var(--serif); color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
.about-badge span { font-size: .87rem; line-height: 1.5; display: block; }

.about-copy h2 { margin-bottom: .55em; }

.check-list { margin: 0 0 2em; display: grid; gap: 12px; }
.check-list li { position: relative; padding-left: 34px; font-size: .98rem; }
.check-list li::before {
  content: ''; position: absolute; left: 0; top: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23996f1f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4 10-10'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* =========================================================
   Listings
   ========================================================= */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 30px;
}
.card {
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .3s ease, box-shadow .3s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.card-media { position: relative; overflow: hidden; }
.card-media img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.3,1);
}
.card:hover .card-media img { transform: scale(1.05); }

.tag {
  position: absolute; top: 14px; left: 14px;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 13px; border-radius: 999px; color: #fff;
  backdrop-filter: blur(4px);
}
.tag-sale { background: rgba(19,78,74,.92); }
.tag-rent { background: rgba(43,84,138,.92); }
.tag-new  { background: rgba(180,120,28,.94); }

.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.card-loc {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .55em;
}
.card h3 { margin-bottom: .3em; }
.card-price {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--brand);
  margin-bottom: 1em;
}
.card-price span { font-family: var(--sans); font-size: .85rem; font-weight: 500; color: var(--ink-faint); }

.card-specs {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: .88rem; color: var(--ink-soft);
}
.card-specs li { position: relative; }
.card-specs li + li::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 3px; border-radius: 50%; background: var(--ink-faint);
}

.listings-note { text-align: center; margin: 44px 0 0; color: var(--ink-faint); }

/* =========================================================
   Services
   ========================================================= */
.services {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.service {
  background: #fff; padding: 38px 34px 34px;
  transition: background-color .3s ease;
}
.service:hover { background: var(--paper-alt); }
.service-icon {
  width: 50px; height: 50px; border-radius: 13px;
  background: var(--accent-soft); color: #8a6519;
  display: grid; place-items: center; margin-bottom: 20px;
}
.service-icon svg { width: 25px; height: 25px; }
.service h3 { margin-bottom: .45em; }
.service p { margin: 0; font-size: .96rem; }

/* =========================================================
   Testimonials
   ========================================================= */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 26px; }
.quote {
  margin: 0; padding: 34px 32px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
}
.stars { color: var(--accent); letter-spacing: .18em; font-size: 1rem; margin-bottom: 18px; }
.quote blockquote {
  margin: 0 0 26px; font-size: 1.03rem; line-height: 1.68;
  color: rgba(255,255,255,.86); flex: 1;
}
.quote figcaption { display: flex; align-items: center; gap: 14px; margin-top: auto; }
.quote figcaption img {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid rgba(255,255,255,.25);
}
.quote figcaption span { display: flex; flex-direction: column; font-size: .85rem; color: rgba(255,255,255,.6); }
.quote figcaption strong { font-size: .97rem; font-weight: 600; }

/* =========================================================
   Agents
   ========================================================= */
.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 26px; }
.agent {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: #fff;
  transition: transform .3s ease, box-shadow .3s ease;
}
.agent:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.agent img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: center 25%; }
.agent-body { padding: 22px 24px 26px; }
.agent h3 { margin-bottom: .15em; font-size: 1.16rem; }
.agent-role {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: .9em;
}
.agent-bio { font-size: .92rem; margin-bottom: 1em; }
.agent-contact { font-size: .87rem; word-break: break-word; }

/* =========================================================
   Contact
   ========================================================= */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.12fr;
  gap: clamp(40px, 6vw, 80px); align-items: start;
}
.contact-copy h2 { margin-bottom: .5em; }

.contact-details { display: grid; gap: 20px; margin-top: 34px; }
.contact-details li { display: flex; gap: 15px; align-items: flex-start; }
.contact-details svg { width: 22px; height: 22px; flex: none; color: var(--brand); margin-top: 3px; }
.contact-details span { display: flex; flex-direction: column; font-size: .96rem; }
.contact-details strong {
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; margin-bottom: 2px;
}

.contact-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(26px, 3.5vw, 40px); box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label {
  display: block; font-size: .86rem; font-weight: 600; color: var(--ink); margin-bottom: 7px;
}
.field .opt { font-weight: 400; color: var(--ink-faint); }

.field input, .field select, .field textarea {
  width: 100%; font-family: inherit; font-size: .97rem; color: var(--ink);
  padding: 13px 15px; background: var(--paper-alt);
  border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234d5b58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 17px;
  padding-right: 42px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; background: #fff; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(19,78,74,.13);
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; }

.field.invalid input, .field.invalid select, .field.invalid textarea {
  border-color: #c0392b; background: #fdf4f3;
}
.field.invalid input:focus, .field.invalid select:focus, .field.invalid textarea:focus {
  box-shadow: 0 0 0 3px rgba(192,57,43,.14);
}

.error { font-size: .82rem; color: #c0392b; margin: 6px 0 0; min-height: 0; }
.error:empty { display: none; }

.form-note { font-size: .82rem; color: var(--ink-faint); text-align: center; margin: 14px 0 0; }
.form-success {
  margin: 16px 0 0; padding: 14px 16px; border-radius: 10px;
  background: #ecf6f0; border: 1px solid #bfe0cc; color: #1d6b41;
  font-size: .92rem;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer { background: var(--brand-deep); color: rgba(255,255,255,.62); padding-top: clamp(56px, 7vw, 84px); }
.footer-inner {
  display: grid; grid-template-columns: 1.2fr 2fr; gap: clamp(34px, 5vw, 70px);
  padding-bottom: 52px;
}
.logo-light { color: #fff; margin-bottom: 16px; }
.footer-brand p { font-size: .93rem; max-width: 34ch; margin: 0; }

.footer-inner > * { min-width: 0; }
.footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.footer-nav > div { min-width: 0; }
/* Email/phone strings have no break opportunities — let them wrap on narrow screens. */
.footer-nav li, .footer-nav a { overflow-wrap: anywhere; }
.footer-nav h4 {
  color: #fff; font-family: var(--sans); font-size: .76rem; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; margin-bottom: 1.1em;
}
.footer-nav ul { display: grid; gap: 11px; font-size: .93rem; }
.footer-nav a { color: rgba(255,255,255,.62); text-decoration: none; transition: color .2s ease; }
.footer-nav a:hover { color: #fff; }

.footer-base {
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  padding-block: 22px; border-top: 1px solid rgba(255,255,255,.13);
  font-size: .85rem;
}
.footer-base p { margin: 0; }
.footer-credit a { color: rgba(255,255,255,.8); }

/* =========================================================
   Scroll reveal
   ========================================================= */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}
.reveal.visible { opacity: 1; transform: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 940px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-media { max-width: 480px; }
  .about-badge { right: 12px; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed; inset: 0 0 auto 0; z-index: 1;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; padding: 92px 24px 32px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%); visibility: hidden;
    transition: transform .38s cubic-bezier(.3,.8,.3,1), visibility .38s;
  }
  /* Keep the logo and toggle above the sliding panel. */
  .logo, .nav-toggle { position: relative; z-index: 2; }
  .site-header.menu-open .logo { color: var(--brand); }
  .nav.open { transform: translateY(0); visibility: visible; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav li { border-bottom: 1px solid var(--line); }
  .nav ul a, .site-header.scrolled .nav ul a {
    display: block; padding: 15px 2px; color: var(--ink); font-size: 1.05rem;
  }
  .nav a::after { display: none; }
  .nav-cta { margin-top: 22px; }
  .site-header .nav-cta { color: #241a05; }

  .hero { padding-block: 132px 64px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 26px 20px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  :root { --gutter: 18px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .footer-nav { grid-template-columns: 1fr 1fr; }
  .about-badge { position: static; max-width: none; margin-top: 16px; box-shadow: var(--shadow-sm); }
  .footer-base { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
