/* Davila's Remodeling and Construction — homepage concept
   Design language: Heritage Craft (type, spacing, composition, motion ONLY)
   Palette: Davila's real brand blue #020087 (nav/wordmark/buttons on their live
   site), deepened and lifted within the blue family. Warm neutrals sit under
   their wood-heavy photography. No em dashes anywhere, including comments. */

:root {
  /* Brand color family (theirs) */
  --royal:        #020087;   /* their exact brand blue */
  --royal-deep:   #01015c;   /* deepened for hovers */
  --ink:          #07072e;   /* near-black navy for dark sections */
  --ink-2:        #0c0c3f;   /* lighter dark variant */
  --periwinkle:   #a3adff;   /* their blue lifted, for accents on dark */
  --periwinkle-soft: rgba(163, 173, 255, 0.16);

  /* Neutrals */
  --parchment:    #f6f2e9;   /* warm off-white */
  --cream:        #ece6d8;   /* deeper warm light */
  --white:        #fdfcf9;

  /* Text */
  --text-dark:    #1d1d33;
  --text-body:    #47475c;
  --text-muted:   #71718a;
  --text-light:   #f2efe6;
  --text-light-muted: rgba(242, 239, 230, 0.92);

  /* Type */
  --font-display: 'EB Garamond', Georgia, serif;
  --font-body:    'Karla', 'Helvetica Neue', sans-serif;

  /* Layout */
  --gutter: clamp(1.5rem, 4vw, 3rem);
  --nav-height: 84px;

  /* Motion: minimal and dignified */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--parchment);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; }

.container { width: min(90%, 1100px); margin-inline: auto; }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  color: var(--text-dark);
}
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); max-width: 24ch; }
h3 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); max-width: 22ch; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-size: 0.74rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--royal); margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 32px; height: 1px; background: currentColor; opacity: 0.7; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.9rem 1.8rem; border-radius: 100px;
  font-family: var(--font-body); font-size: 0.92rem; font-weight: 500;
  letter-spacing: 0.05em; text-decoration: none; white-space: nowrap;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease),
              color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn--lg { padding: 1.05rem 2.2rem; }
.btn--solid { background: var(--royal); color: var(--parchment); }
.btn--solid:hover { background: var(--royal-deep); transform: translateY(-2px); }
.btn--ghost { border: 1px solid rgba(242, 239, 230, 0.5); color: var(--text-light); }
.btn--ghost:hover { border-color: var(--periwinkle); color: var(--periwinkle); }
.btn--parchment { background: var(--parchment); color: var(--royal); }
.btn--parchment:hover { background: var(--white); transform: translateY(-2px); }
.btn--ghost-light { border: 1px solid rgba(242, 239, 230, 0.45); color: var(--text-light); }
.btn--ghost-light:hover { border-color: var(--parchment); background: rgba(242, 239, 230, 0.08); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.nav.is-solid { background: var(--ink); box-shadow: 0 8px 30px rgba(7, 7, 46, 0.35); }
.nav__inner {
  width: min(94%, 1240px); margin-inline: auto;
  height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.05; }
.brand__name {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 1.65rem; color: var(--text-light);
}
.brand__sub {
  font-size: 0.6rem; font-weight: 500; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--text-light-muted); margin-top: 0.25rem;
}
.nav__links { display: flex; gap: clamp(1.2rem, 2.4vw, 2.2rem); }
.nav__links a {
  font-size: 0.88rem; font-weight: 400; letter-spacing: 0.04em;
  color: var(--text-light); text-decoration: none;
  padding-block: 0.4rem;
  border-bottom: 1px solid transparent;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.nav__links a:hover { color: var(--periwinkle); border-color: var(--periwinkle); }

.burger {
  display: none; flex-direction: column; gap: 6px;
  background: none; border: 0; cursor: pointer;
  padding: 12px 8px; z-index: 80; position: relative;
}
.burger span {
  width: 26px; height: 2px; background: var(--text-light);
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.burger.is-open span:first-child { transform: translateY(4px) rotate(45deg); }
.burger.is-open span:last-child { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 70;
  background: var(--ink);
  display: flex; flex-direction: column; justify-content: center; gap: 3rem;
  padding: calc(var(--nav-height) + 1rem) var(--gutter) 3rem;
  opacity: 0; visibility: hidden; transform: translateY(-2%);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0.45s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.mobile-menu__links { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-menu__links a {
  font-family: var(--font-display); font-size: clamp(1.9rem, 8vw, 2.6rem);
  color: var(--text-light); text-decoration: none;
  padding-block: 0.45rem;
  border-bottom: 1px solid rgba(242, 239, 230, 0.08);
}
.mobile-menu__links a:hover { color: var(--periwinkle); }
.mobile-menu__foot { display: grid; gap: 1rem; justify-items: start; }
.mobile-menu__foot p { font-size: 0.85rem; color: var(--text-light-muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 580px;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
}
.hero__media { position: absolute; inset: -8% 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(200deg, rgba(7, 7, 46, 0.28) 0%, rgba(7, 7, 46, 0.55) 55%, rgba(7, 7, 46, 0.88) 100%);
}
.hero__content {
  position: relative; z-index: 2;
  width: min(90%, 1100px); margin-inline: auto;
  padding-bottom: clamp(3rem, 8vh, 5.5rem);
}
.hero__eyebrow { color: var(--periwinkle); }
.hero__title {
  font-size: clamp(2.6rem, 6.4vw, 4.8rem);
  color: var(--text-light); max-width: 17ch;
}
.hero-sub {
  margin-top: 1.4rem; max-width: 56ch;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  color: var(--text-light-muted);
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; }

/* ---------- Sections ---------- */
section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section--dark { background: var(--ink); }
.section--dark h2, .section--dark h3 { color: var(--text-light); }
.section--dark p { color: var(--text-light-muted); }
.section--dark .eyebrow { color: var(--periwinkle); }
.section--light { background: var(--parchment); }
.section--cream { background: var(--cream); }
.section--royal { background: var(--royal); }

/* ---------- Intro ---------- */
.intro__grid {
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
}
.intro__body { display: grid; gap: 1.2rem; padding-top: 0.6rem; }
.cred-strip {
  display: flex; flex-wrap: wrap; gap: 0.8rem;
  margin-top: clamp(2.2rem, 5vw, 3.2rem);
}
.cred-strip li {
  font-size: 0.76rem; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--periwinkle);
  border: 1px solid var(--periwinkle-soft);
  background: rgba(163, 173, 255, 0.06);
  padding: 0.6rem 1.1rem; border-radius: 100px;
}

/* ---------- Services ---------- */
.service { padding-block: clamp(2.6rem, 5.5vw, 4.2rem); }
.service__row {
  display: grid; grid-template-columns: 1.08fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.service--flip .service__row { grid-template-columns: 1fr 1.08fr; }
.service--flip .service__media { order: 2; }
.service__media {
  position: relative; overflow: hidden; border-radius: 4px;
  aspect-ratio: 4 / 3;
  box-shadow: 0 24px 60px rgba(7, 7, 46, 0.16);
}
.service__media img { width: 100%; height: 112%; object-fit: cover; }
.service__text { position: relative; }
.service__num {
  position: absolute; top: -2.1rem; right: 0;
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(4.5rem, 9vw, 7rem); line-height: 1;
  color: var(--royal); opacity: 0.1; pointer-events: none;
}
.service__text h3 { margin-bottom: 1rem; }
.service__list { margin-top: 1.4rem; display: grid; gap: 0.55rem; }
.service__list li {
  position: relative; padding-left: 1.5rem;
  font-size: 0.98rem; color: var(--text-body);
}
.service__list li::before {
  content: ""; position: absolute; left: 0; top: 0.72em;
  width: 14px; height: 1px; background: var(--royal);
}

/* ---------- Quote band (signature) ---------- */
.quote-band {
  position: relative; overflow: hidden;
  padding: clamp(5rem, 12vw, 9rem) 0;
  background: var(--ink);
}
.quote-band__media { position: absolute; inset: -12% 0; }
.quote-band__media img { width: 100%; height: 100%; object-fit: cover; }
.quote-band__scrim { position: absolute; inset: 0; background: rgba(7, 7, 46, 0.78); }
.quote-band__content { position: relative; z-index: 2; text-align: center; }
.quote-band blockquote p {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.5rem); line-height: 1.35;
  color: var(--text-light); max-width: 26ch; margin-inline: auto;
}
.quote-band figcaption {
  margin-top: 1.6rem;
  font-size: 0.76rem; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--periwinkle);
}

/* ---------- Why ---------- */
.why__grid {
  margin-top: clamp(2rem, 4.5vw, 3rem);
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid rgba(29, 29, 51, 0.14);
}
.why__grid li {
  font-family: var(--font-display); font-size: clamp(1.08rem, 1.8vw, 1.3rem);
  color: var(--text-dark);
  padding: 1.15rem 2.4rem 1.15rem 0;
  border-bottom: 1px solid rgba(29, 29, 51, 0.14);
  position: relative; padding-left: 2rem;
}
.why__grid li::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  transform: translateY(-50%);
  background: var(--royal);
}

/* ---------- Testimonials ---------- */
.testimonials__grid {
  margin-top: clamp(2rem, 4.5vw, 3rem);
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.6rem, 3.5vw, 3rem);
}
.testimonial {
  border: 1px solid rgba(163, 173, 255, 0.18);
  background: var(--ink-2);
  border-radius: 4px;
  padding: clamp(1.8rem, 3.5vw, 2.6rem);
  position: relative;
}
.testimonial::before {
  content: "\201C";
  position: absolute; top: 0.4rem; left: 1.4rem;
  font-family: var(--font-display); font-size: 4.4rem; line-height: 1;
  color: var(--periwinkle); opacity: 0.35;
}
.testimonial blockquote p {
  font-family: var(--font-display); font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  line-height: 1.5; color: var(--text-light);
  padding-top: 1.6rem;
}
.testimonial figcaption {
  margin-top: 1.4rem;
  font-size: 0.76rem; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--periwinkle);
}

/* ---------- CTA ---------- */
.cta__inner { text-align: center; }
.cta .eyebrow { color: var(--periwinkle); }
.cta h2 { color: var(--parchment); margin-inline: auto; }
.cta__sub {
  margin: 1.2rem auto 0; max-width: 54ch;
  color: rgba(242, 239, 230, 0.78);
}
.cta__actions {
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: center; margin-top: 2.4rem;
}
.cta__meta {
  margin-top: 2.2rem; font-size: 0.86rem;
  letter-spacing: 0.04em; color: rgba(242, 239, 230, 0.6);
}

/* ---------- Footer ---------- */
.footer { background: var(--ink); padding: clamp(3rem, 6vw, 4.5rem) 0 0; }
.footer__grid {
  display: grid; grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.footer__brand p {
  margin-top: 1.1rem; font-size: 0.92rem;
  color: var(--text-light-muted); max-width: 34ch;
}
.footer__links { display: grid; gap: 0.2rem; align-content: start; }
.footer__links a, .footer__contact a {
  font-size: 0.92rem; color: var(--text-light-muted);
  text-decoration: none; padding-block: 0.65rem;
  transition: color 0.35s var(--ease);
}
.footer__links a:hover, .footer__contact a:hover { color: var(--periwinkle); }
.footer__contact { display: grid; gap: 0.2rem; align-content: start; }
.footer__contact a { display: block; }
.footer__contact p { font-size: 0.88rem; color: var(--text-light-muted); padding-block: 0.3rem; }
.footer__social { display: flex; gap: 1.4rem; margin-top: 0.6rem; }
.footer__social a { padding-block: 0.65rem; }
.footer__base {
  border-top: 1px solid rgba(242, 239, 230, 0.08);
  padding-block: 1.6rem;
}
.footer__base p { font-size: 0.8rem; color: rgba(242, 239, 230, 0.62); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); }
.no-js .reveal, .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 404 ---------- */
.error-section {
  min-height: 100vh; min-height: 100svh;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: calc(var(--nav-height) + 2rem) var(--gutter) 3rem;
}
.error__code {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(6rem, 18vw, 11rem); line-height: 1;
  color: var(--periwinkle); opacity: 0.22;
}
.error__title {
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  color: var(--text-light); margin-top: 0.6rem;
}
.error__body {
  margin: 1.2rem auto 2.2rem; max-width: 46ch;
  color: var(--text-light-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav__cta { display: none; }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .burger { display: flex; }
  .intro__grid { grid-template-columns: 1fr; }
  .service__row, .service--flip .service__row { grid-template-columns: 1fr; gap: 1.8rem; }
  .service--flip .service__media { order: 0; }
  .service__num { top: -1.4rem; }
  .testimonials__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 2.2rem; }
}
@media (max-width: 768px) {
  .hero { height: auto; min-height: 100svh; align-items: flex-end; padding-top: 6rem; }
}
@media (max-width: 640px) {
  .why__grid { grid-template-columns: 1fr; }
  .hero__ctas .btn, .cta__actions .btn { width: 100%; }
  .cred-strip li { font-size: 0.68rem; padding: 0.5rem 0.9rem; }
}
@media (max-width: 480px) {
  .hero { padding-top: 5rem; }
  .brand__name { font-size: 1.4rem; }
  .brand__sub { font-size: 0.52rem; }
}

/* ---------- Mobile drawer close control ---------- */
/* The burger doubles as the close (X), but the nav's own z-index traps it in a
   stacking context below the drawer, so it is painted over and cannot be tapped.
   This control lives inside the drawer, so it is always visible and always hits. */
#mobileMenu .mnav-close {
  position: absolute;
  top: max(0.85rem, env(safe-area-inset-top, 0px));
  right: 0.85rem;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: rgb(242, 239, 230);
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
#mobileMenu .mnav-close::before,
#mobileMenu .mnav-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 21px;
  height: 1.5px;
  margin: -0.75px 0 0 -10.5px;
  background: currentColor;
  border-radius: 2px;
}
#mobileMenu .mnav-close::before { transform: rotate(45deg); }
#mobileMenu .mnav-close::after { transform: rotate(-45deg); }
#mobileMenu .mnav-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
