/* ============================================================
   CALI HOME CONSTRUCTORS — style.css
   Design System: Warm editorial minimalism
   Fonts: Cormorant Garamond (display) + DM Sans (body)
   ============================================================ */

/* ── 1. CSS Custom Properties ─────────────────────────────── */
:root {
  /* Colors */
  --bg:          #F7F5F2;           /* warm off-white */
  --surface:     #FFFFFF;
  --surface-alt: #F0EDE8;           /* soft cream */
  --accent:      #B5651D;           /* burnt sienna / construction orange */
  --accent-dark: #8B4513;
  --text-primary: #1C1A17;
  --text-secondary: #6B6560;
  --text-light:  #9A9490;
  --border:      #E2DDD8;
  --shadow-sm:   0 2px 12px rgba(0,0,0,0.06);
  --shadow-md:   0 8px 32px rgba(0,0,0,0.10);
  --shadow-lg:   0 20px 60px rgba(0,0,0,0.13);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Spacing */
  --section-gap: clamp(64px, 8vw, 120px);
  --container:   1240px;
  --navbar-h:    72px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur: 0.3s;
}

/* ── 2. Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

ul { list-style: none; }

/* ── 3. NAVBAR ────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(247, 245, 242, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--dur) var(--ease);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  height: var(--navbar-h);
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Brand */
.navbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.navbar__logo {
  display: flex;
  align-items: center;
  transition: transform var(--dur) var(--ease);
}

.navbar__brand:hover .navbar__logo { transform: scale(1.05); }

.navbar__name {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Desktop links */
.navbar__links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width var(--dur) var(--ease);
}

.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { width: 100%; }

/* CTA nav link */
.nav-link--cta {
  background: var(--accent);
  color: #fff !important;
  padding: 10px 22px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  font-weight: 500;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.nav-link--cta::after { display: none; }
.nav-link--cta:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* Hamburger */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  width: 36px; height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar__hamburger span {
  display: block;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
}

.navbar__hamburger span:nth-child(1) { width: 100%; }
.navbar__hamburger span:nth-child(2) { width: 70%; }
.navbar__hamburger span:nth-child(3) { width: 85%; }

/* Hamburger → X */
.navbar__hamburger.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
  width: 100%;
}
.navbar__hamburger.active span:nth-child(2) {
  opacity: 0; transform: scaleX(0);
}
.navbar__hamburger.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
  width: 100%;
}

/* Mobile Menu */
.navbar__mobile {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 0 16px;
  animation: slideDown 0.25s var(--ease) forwards;
}

.navbar__mobile[hidden] { display: none; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mobile-link {
  padding: 14px clamp(20px, 4vw, 48px);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.mobile-link:last-child { border-bottom: none; }
.mobile-link:hover { color: var(--accent); background: var(--surface-alt); }

/* ── 4. CAROUSEL ──────────────────────────────────────────── */
.carousel {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 480px;
  max-height: 900px;
  margin-top: var(--navbar-h);
  overflow: hidden;
}

.carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.75s var(--ease);
}

.carousel__slide {
  flex: 0 0 100%;
  position: relative;
  overflow: hidden;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  transition: transform 6s ease-out;
}

/* Subtle Ken Burns when active */
.carousel__slide.active img {
  transform: scale(1);
}

/* Dark gradient overlay */
.carousel__slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(28,26,23,0.55) 0%,
    rgba(28,26,23,0.15) 40%,
    transparent 70%
  );
}

/* Caption */
.carousel__caption {
  position: absolute;
  bottom: clamp(60px, 8%, 90px);
  left: clamp(20px, 6vw, 80px);
  z-index: 2;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s 0.4s var(--ease), transform 0.6s 0.4s var(--ease);
}

.carousel__slide.active .carousel__caption {
  opacity: 1;
  transform: translateY(0);
}

.carousel__caption span {
  font-family: var(--font-display);
  font-size: clamp(20px, 3.5vw, 36px);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}

/* Arrows */
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 0.2s;
}

.carousel__arrow:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.9);
  transform: translateY(-50%) scale(1.08);
}

.carousel__arrow svg { width: 22px; height: 22px; }
.carousel__arrow--prev { left: clamp(12px, 3vw, 40px); }
.carousel__arrow--next { right: clamp(12px, 3vw, 40px); }

/* Dots */
.carousel__dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 10px;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.7);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.dot.active {
  background: #fff;
  transform: scale(1.3);
  border-color: #fff;
}

.dot:hover { background: rgba(255,255,255,0.5); }

/* ── 5. HERO TEXT ─────────────────────────────────────────── */
.hero {
  padding: var(--section-gap) clamp(20px, 6vw, 80px);
  text-align: center;
  max-width: var(--container);
  margin: 0 auto;
}

.hero__eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 28px;
}

.hero__sub {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 44px;
  line-height: 1.75;
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 36px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--accent);
}

.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(181, 101, 29, 0.32);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--text-primary);
  transform: translateY(-2px);
}

/* Decorative divider */
.hero__rule {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: var(--section-gap);
}

.hero__rule span:not(.rule__diamond) {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.rule__diamond {
  width: 8px; height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ── 6. FEATURE SECTIONS ──────────────────────────────────── */
.features {
  padding-bottom: var(--section-gap);
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) clamp(20px, 6vw, 80px);
}

/* Alternating backgrounds */
.feature:nth-child(even) {
  background: var(--surface-alt);
  max-width: 100%;
  padding-left: calc(50% - var(--container)/2 + clamp(20px, 6vw, 80px));
  padding-right: calc(50% - var(--container)/2 + clamp(20px, 6vw, 80px));
}

/* Even rows: image comes first in grid */
.feature--image-left {
  direction: ltr; /* ensure order */
}

/* Text block */
.feature__label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.feature__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1.18;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.feature__body {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Image block */
.feature__image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3;
  position: relative;
}

.feature__image img {
  transition: transform 0.7s var(--ease);
}

.feature__image:hover img {
  transform: scale(1.04);
}

/* ── 7. FOOTER ────────────────────────────────────────────── */
.footer {
  background: var(--text-primary);
  color: rgba(255,255,255,0.75);
  padding-top: clamp(48px, 7vw, 88px);
}

.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 80px) clamp(48px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 1fr;
  gap: clamp(32px, 5vw, 64px);
}

.footer__col--brand {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer__logo svg { border-radius: 6px; }

.footer__slogan {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255,255,255,0.6);
  max-width: 280px;
}

/* Social icons */
.footer__social {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}

.social-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  transition: all var(--dur) var(--ease);
}

.social-icon svg { width: 18px; height: 18px; }

.social-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* Footer heading */
.footer__heading {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

/* Footer list */
.footer__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
}

.footer__icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent);
}

.footer__list a {
  color: rgba(255,255,255,0.65);
  transition: color var(--dur) var(--ease);
}

.footer__list a:hover { color: var(--accent); }

address { font-style: normal; }

/* Nav list */
.footer__list--nav {
  gap: 12px;
}

.footer__list--nav a {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 2px;
}

.footer__list--nav a::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--dur) var(--ease);
}

.footer__list--nav a:hover { color: rgba(255,255,255,0.95); }
.footer__list--nav a:hover::after { width: 100%; }

/* Bottom bar */
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px clamp(20px, 6vw, 80px);
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
}

/* ── 8. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {

  /* Navbar */
  .navbar__links { display: none; }
  .navbar__hamburger { display: flex; }

  /* Features: stack vertically */
  .feature,
  .feature:nth-child(even) {
    grid-template-columns: 1fr;
    padding-left: clamp(20px, 5vw, 48px);
    padding-right: clamp(20px, 5vw, 48px);
    max-width: 100%;
  }

  /* Image always on top on mobile */
  .feature--text-left .feature__text { order: 2; }
  .feature--text-left .feature__image { order: 1; }
  .feature--image-left .feature__image { order: 1; }
  .feature--image-left .feature__text { order: 2; }

  /* Footer */
  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer__col--brand {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
  }

  .footer__slogan { flex: 1 1 200px; }
}

@media (max-width: 600px) {

  /* Carousel arrows smaller */
  .carousel__arrow { width: 38px; height: 38px; }
  .carousel__arrow svg { width: 18px; height: 18px; }

  /* Footer single column */
  .footer__inner {
    grid-template-columns: 1fr;
  }

  .footer__col--brand { flex-direction: column; }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }
}

/* ── 9. Utilities / Accessibility ─────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Subtle scroll-fade for feature sections (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
  .feature {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }

  .feature.visible {
    opacity: 1;
    transform: none;
  }
}
