/* ==========================================================================
   Katie Wilson Homes — Coastal Classic
   Core stylesheet: tokens, layout, header, footer, shared components
   ========================================================================== */

:root {
  /* Brand palette — per Coastal Classic Brand Guide */
  --coastal-blue: #6b8596;
  --warm-taupe: #d6c8b3;
  --champagne: #bda77e;
  --soft-ivory: #f7f5f2;
  --charcoal: #1e1e1e;
  --white: #fff;

  /* Extended tones derived from the logo artwork */
  --navy: #1f3247;
  --navy-deep: #16242f;
  --coastal-light: #a9bcc8;
  --coastal-mist: #eef2f4;
  --champagne-light: #d8c7a4;
  --champagne-deep: #a08a62;

  /* Text */
  --ink: #1e1e1e;
  --text: #4a5560;
  --muted: #7d8892;
  --line: #e6e1d9;
  --line-soft: #f0ece5;

  /* Type */
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: "Montserrat", system-ui, -apple-system, sans-serif;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow-sm: 0 4px 24px rgba(31, 50, 71, .06);
  --shadow: 0 18px 60px rgba(31, 50, 71, .10);
  --shadow-lg: 0 30px 90px rgba(31, 50, 71, .14);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--white); overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -.005em;
  line-height: 1.14;
  margin: 0;
}

.shell { width: min(1220px, calc(100% - 44px)); margin-inline: auto; }
.section-pad { padding: 118px 0; }
.section-pad-sm { padding: 84px 0; }
.bg-ivory { background: var(--soft-ivory); }
.bg-mist { background: var(--coastal-mist); }

/* Shared section heading ---------------------------------------------------*/
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--champagne-deep);
  margin-bottom: 20px;
}
.kicker::before { content: ""; width: 30px; height: 1px; background: var(--champagne); }
.kicker.centered::after { content: ""; width: 30px; height: 1px; background: var(--champagne); }
.kicker.inverse { color: var(--champagne-light); }
.kicker.inverse::before, .kicker.inverse::after { background: var(--champagne-light); }

.section-heading { max-width: 660px; margin-bottom: 58px; }
.section-heading.centered { margin-inline: auto; text-align: center; }
.section-heading h2 { font-size: clamp(34px, 4.2vw, 52px); margin-bottom: 20px; }
.section-heading p { font-size: 15px; line-height: 1.85; color: var(--text); margin: 0; }

/* Buttons ------------------------------------------------------------------*/
.btn {
  min-height: 54px;
  padding: 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .35s var(--ease), color .35s var(--ease),
              border-color .35s var(--ease), transform .35s var(--ease);
}
.btn svg { width: 15px; height: 15px; stroke-width: 1.6; }
.btn:hover { transform: translateY(-2px); }
.btn-sm { min-height: 46px; padding: 0 22px; font-size: 10px; }

.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-gold { background: var(--champagne); color: var(--white); }
.btn-gold:hover { background: var(--champagne-deep); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-light {
  border-color: rgba(255, 255, 255, .45);
  color: var(--white);
  background: rgba(255, 255, 255, .06);
}
.btn-light:hover { background: var(--white); color: var(--navy); border-color: var(--white); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--navy);
  border-bottom: 1px solid var(--champagne);
  padding-bottom: 5px;
  transition: gap .3s var(--ease), color .3s var(--ease);
}
.text-link svg { width: 14px; height: 14px; }
.text-link:hover { gap: 13px; color: var(--champagne-deep); }

/* Header -------------------------------------------------------------------*/
.utility-bar {
  background: var(--navy);
  color: rgba(255, 255, 255, .85);
  font-size: 11px;
  letter-spacing: .08em;
}
.utility-inner {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  gap: 28px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.utility-inner p { margin: 0; display: flex; align-items: center; gap: 9px; }
.utility-inner p svg { width: 13px; height: 13px; color: var(--champagne-light); }
.utility-links { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.utility-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  color: var(--white);
  font-weight: 600;
  transition: color .25s, border-color .25s, background .25s;
}
.utility-links a svg { width: 13px; height: 13px; color: var(--champagne-light); }
.utility-links a:hover { color: var(--white); border-color: var(--champagne-light); background: rgba(255, 255, 255, .08); }
.utility-label-mobile { display: none; }

.nav-wrap {
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  z-index: 100;
}
.nav-wrap.is-sticky {
  z-index: 100;
  position: fixed;
  top: 0; left: 0; right: 0;
  box-shadow: var(--shadow-sm);
  animation: navDrop .4s var(--ease);
}
@keyframes navDrop { from { transform: translateY(-100%); } to { transform: translateY(0); } }

.nav-inner { min-height: 96px; display: flex; align-items: center; gap: 28px; }
.brand { flex: 0 0 auto; width: 270px; }
.brand img { width: 100%; height: auto; }

.desktop-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.desktop-nav a {
  position: relative;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--navy);
  padding: 6px 0;
  transition: color .3s;
  white-space: nowrap;
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--champagne);
  transition: right .35s var(--ease);
}
.desktop-nav a:hover::after, .desktop-nav a.is-active::after { right: 0; }
.desktop-nav a.is-active { color: var(--champagne-deep); }
.desktop-nav .nav-home-search {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: color .25s, border-color .25s, background .25s;
}
.desktop-nav .nav-home-search::after { display: none; }
.desktop-nav .nav-home-search:hover,
.desktop-nav .nav-home-search.is-active { color: var(--white); border-color: var(--champagne); background: var(--champagne); }
.desktop-nav .nav-home-search .svg-icon { width: 18px; height: 18px; }
.desktop-nav .nav-home-search .nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-actions { display: flex; align-items: center; gap: 16px; }

.menu-toggle {
  display: none;
  width: 46px; height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  padding: 0;
  position: relative;
  cursor: pointer;
}
.menu-toggle span {
  position: absolute;
  left: 13px;
  width: 18px; height: 1px;
  background: var(--navy);
  transition: transform .3s var(--ease), opacity .3s;
}
.menu-toggle span:first-child { top: 19px; }
.menu-toggle span:last-child { top: 26px; }
.menu-toggle.active span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle.active span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu { display: none; }

/* Footer -------------------------------------------------------------------*/
.site-footer { background: var(--navy-deep); color: rgba(255, 255, 255, .68); padding: 84px 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 52px;
  padding-bottom: 60px;
}
.footer-brand .footer-logo {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 22px;
  width: 250px;
  margin-bottom: 24px;
}
.footer-brand p { font-size: 13.5px; line-height: 1.85; margin: 0 0 22px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 40px; height: 40px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  transition: background .3s, border-color .3s, color .3s;
}
.footer-social a svg { width: 16px; height: 16px; }
.footer-social a:hover { background: var(--champagne); border-color: var(--champagne); color: var(--white); }

.footer-col strong {
  display: block;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: .01em;
}
.footer-col a, .footer-col span {
  display: block;
  font-size: 13.5px;
  margin-bottom: 12px;
  transition: color .25s;
}
.footer-col a:hover { color: var(--champagne-light); }
.footer-col .with-icon { display: flex; align-items: flex-start; gap: 11px; }
.footer-col .with-icon svg { width: 15px; height: 15px; margin-top: 4px; color: var(--champagne); flex: 0 0 auto; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 26px 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12px;
}
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-disclaimer {
  font-size: 11px;
  line-height: 1.8;
  color: rgba(255, 255, 255, .42);
  padding-bottom: 34px;
  max-width: 900px;
}

/* Page loader -------------------------------------------------------------*/
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--navy-deep);
  display: grid;
  place-items: center;
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
.page-loader-inner { text-align: center; padding: 0 24px; }
.page-loader img {
  width: 240px;
  max-width: 64vw;
  margin: 0 auto 28px;
  padding: 20px 26px;
  background: var(--white);
  border-radius: var(--radius);
  opacity: 0;
  animation: loaderFade .9s var(--ease) forwards;
}
.loader-rule {
  width: 150px;
  max-width: 48vw;
  height: 1px;
  margin: 0 auto 18px;
  background: rgba(255, 255, 255, .18);
  position: relative;
  overflow: hidden;
}
.loader-rule::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--champagne);
  transform: translateX(-100%);
  animation: loaderSweep 1.15s var(--ease) infinite;
}
.page-loader span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .26em;
  color: rgba(255, 255, 255, .5);
  opacity: 0;
  animation: loaderFade .9s var(--ease) .18s forwards;
}
@keyframes loaderFade { to { opacity: 1; } }
@keyframes loaderSweep {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(0); }
  100% { transform: translateX(100%); }
}
body.loaded .page-loader { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .page-loader img, .page-loader span { animation: none; opacity: 1; }
  .loader-rule::after { animation: none; transform: none; }
}

/* Reveal animation ---------------------------------------------------------*/
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Back to top --------------------------------------------------------------*/
.to-top {
  position: fixed;
  right: 26px; bottom: 26px;
  width: 46px; height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .35s, transform .35s, background .3s;
  z-index: 90;
}
.to-top svg { width: 17px; height: 17px; }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--champagne); }

/* Skip link ----------------------------------------------------------------*/
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  z-index: 999;
  font-size: 12px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Responsive ---------------------------------------------------------------*/
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 44px; }
}

@media (max-width: 1180px) {
  .section-pad { padding: 84px 0; }
  .section-pad-sm { padding: 64px 0; }
  .nav-inner { min-height: 78px; gap: 18px; }
  .brand { width: 186px; }
  .desktop-nav { display: none; }
  .nav-actions { margin-left: auto; }
  .nav-actions .btn { display: none; }
  .menu-toggle { display: block; }

  .mobile-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100%;
    height: 100dvh;
    background: var(--white);
    padding: 26px 26px calc(40px + env(safe-area-inset-bottom));
    padding-top: calc(26px + env(safe-area-inset-top));
    z-index: 200;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .45s var(--ease), visibility .45s;
  }
  .mobile-menu.open { transform: none; visibility: visible; }
  /* backdrop-filter on the header creates a containing block for fixed
     children, which offsets the panel — drop it while the menu is open. */
  body.menu-open .nav-wrap { backdrop-filter: none; }
  /* Spacer row so the close button never overlaps the first link */
  .mobile-menu::before {
    content: "";
    display: block;
    flex: 0 0 auto;
    height: 52px;
  }
  /* Close button lives inside the panel, above its own content */
  .menu-toggle.active {
    position: fixed;
    top: calc(24px + env(safe-area-inset-top));
    right: 22px;
    z-index: 201;
    background: var(--white);
  }
  .mobile-menu a {
    display: block;
    flex: 0 0 auto;
    font-family: var(--display);
    font-size: 26px;
    line-height: 1.3;
    color: var(--navy);
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .mobile-menu .nav-home-search .svg-icon { display: none; }
  .mobile-menu a:first-of-type { padding-top: 0; }
  .mobile-menu .btn {
    display: inline-flex;
    flex: 0 0 auto;
    width: 100%;
    margin-top: 26px;
    border-bottom: 0;
    font-family: var(--body);
    font-size: 11px;
  }
  .mobile-menu .btn-primary { color: var(--white); }
  .utility-inner { flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 10.5px; }
  .utility-links { gap: 20px; justify-content: center; }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 34px); }
  .section-pad { padding: 66px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 38px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .utility-bar { padding: 0; }
  .utility-inner { min-height: 52px; padding: 6px 0; }
  .utility-inner > p { display: none; }
  .utility-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 4px; }
  .utility-links a { justify-content: center; gap: 5px; min-width: 0; padding: 8px 3px; font-size: 9.5px; letter-spacing: .035em; }
  .utility-links a svg { width: 12px; height: 12px; flex: 0 0 auto; }
  .utility-label-desktop { display: none; }
  .utility-label-mobile { display: inline; white-space: nowrap; }
}
