/* ============================================================
   CAVARO — Luxury Renovation Homepage
   Palette: #111111 bg · #F7F5F2 light · #B08D57 accent
   ============================================================ */

:root {
  --bg:        #111111;
  --bg-2:      #161616;
  --bg-3:      #1c1c1c;
  --ink:       #F7F5F2;
  --ink-soft:  rgba(247, 245, 242, 0.62);
  --ink-faint: rgba(247, 245, 242, 0.34);
  --line:      rgba(247, 245, 242, 0.12);
  --accent:    #B08D57;
  --accent-soft: rgba(176, 141, 87, 0.85);

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-2: cubic-bezier(0.16, 1, 0.3, 1);

  --pad: clamp(1.5rem, 5vw, 7rem);
  --maxw: 1600px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.6rem;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.lede {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin-top: 1.6rem;
}

em { font-style: italic; }

/* ---------- Layout ---------- */
.section { padding: clamp(5rem, 12vw, 11rem) var(--pad); }

.section-head { max-width: var(--maxw); margin: 0 auto; }
.section-head.section { padding-bottom: clamp(2.5rem, 5vw, 4rem); }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 1.15rem 2.4rem;
  border: 1px solid var(--accent);
  color: var(--ink);
  overflow: hidden;
  transition: color 0.5s var(--ease), border-color 0.5s var(--ease);
  isolation: isolate;
}
.btn::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--ease-2);
  z-index: -1;
}
.btn:hover { color: #fff; border-color: var(--accent); }
.btn:hover::before { transform: scaleX(1); }
.btn--solid { background: transparent; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.6s var(--ease), backdrop-filter 0.6s var(--ease),
              border-color 0.6s var(--ease), padding 0.6s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 2rem var(--pad);
  transition: padding 0.6s var(--ease);
}
.nav.scrolled {
  background: rgba(17, 17, 17, 0.72);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  border-bottom-color: var(--line);
}
.nav.scrolled .nav__inner { padding-top: 1.2rem; padding-bottom: 1.2rem; }

/* gentle top scrim so the logo + links read over bright hero imagery;
   fades out once the solid scrolled nav takes over */
.nav::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 160px; z-index: -1;
  background: linear-gradient(180deg, rgba(8,8,8,0.6) 0%, rgba(8,8,8,0.22) 45%, transparent 100%);
  opacity: 1; transition: opacity 0.6s var(--ease); pointer-events: none;
}
.nav.scrolled::before { opacity: 0; }

.nav__logo { display: block; line-height: 0; }
.nav__logo img {
  height: clamp(54px, 5.2vw, 74px); width: auto; display: block;
  transition: height 0.6s var(--ease), filter 0.6s var(--ease);
}
.nav.scrolled .nav__logo img { height: clamp(44px, 4vw, 56px); }
/* lift the gold off bright imagery before the nav gains its dark backdrop */
.nav:not(.scrolled) .nav__logo img { filter: drop-shadow(0 2px 14px rgba(0,0,0,0.5)); }
.nav__links { display: flex; gap: 2.6rem; }
.nav__links a {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.4s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease-2);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
/* legibility over bright hero imagery (top of page, before scrim) */
.nav:not(.scrolled) .nav__links a,
.nav:not(.scrolled) .nav__cta { text-shadow: 0 1px 14px rgba(0,0,0,0.55); }

.nav__cta {
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0.85rem 1.6rem; border: 1px solid var(--line);
  transition: border-color 0.45s var(--ease), color 0.45s var(--ease);
}
.nav__cta:hover { border-color: var(--accent); color: var(--accent); }

.nav__menu {
  display: none; background: none; border: 0; cursor: pointer;
  width: 30px; height: 18px; position: relative;
}
.nav__menu span {
  position: absolute; left: 0; width: 100%; height: 1px; background: var(--ink);
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.nav__menu span:nth-child(1) { top: 4px; }
.nav__menu span:nth-child(2) { bottom: 4px; }
.nav.open .nav__menu span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.nav.open .nav__menu span:nth-child(2) { bottom: 9px; transform: rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; height: 100svh; min-height: 640px;
  display: flex; align-items: center;
  padding: 0 var(--pad);
  overflow: hidden;
}
.hero__media {
  position: absolute; inset: 0; z-index: -2;
  animation: heroIn 1.9s var(--ease-2) both;
}
.hero__img {
  width: 100%; height: 122%;
  will-change: transform;          /* parallax translate handled in JS */
  filter: brightness(0.82) saturate(1.03);  /* even shadow over the image for text legibility */
}
@keyframes heroIn {
  from { transform: scale(1.14); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.hero__overlay {
  position: absolute; inset: 0; z-index: -1;
  /* exposure scrim for legibility (not decorative) — robust across swapped images.
     Stronger left + bottom pools so the eyebrow / sub-headline read over bright sunsets. */
  background:
    linear-gradient(180deg, rgba(10,10,10,0.6) 0%, rgba(10,10,10,0.26) 36%, rgba(10,10,10,0.86) 100%),
    linear-gradient(90deg, rgba(10,10,10,0.82) 0%, rgba(10,10,10,0.5) 26%, rgba(10,10,10,0.16) 54%, transparent 74%);
}

.hero__content { max-width: 1100px; }
.hero .eyebrow { text-shadow: 0 1px 18px rgba(0,0,0,0.65); }
.hero__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 7.4vw, 6.6rem);
  line-height: 1.04;
  letter-spacing: -0.005em;
  text-shadow: 0 2px 44px rgba(0,0,0,0.4);
}
.hero__title em {
  font-style: italic;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}
.hero__sub {
  margin-top: 2rem;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: rgba(247,245,242,0.9);
  max-width: 40ch;
  font-weight: 300;
  text-shadow: 0 1px 22px rgba(0,0,0,0.7);
}
.hero__actions { margin-top: 3rem; }

.scrollcue {
  position: absolute; bottom: 2.6rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
  color: var(--ink-soft);
}
.scrollcue__line {
  width: 1px; height: 54px; background: var(--ink-faint); position: relative; overflow: hidden;
}
.scrollcue__line::after {
  content: ""; position: absolute; left: 0; top: -54px;
  width: 100%; height: 54px; background: var(--accent);
  animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue {
  0% { transform: translateY(0); }
  60%, 100% { transform: translateY(108px); }
}
.scrollcue__text {
  font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase;
}

/* ============================================================
   PHILOSOPHY
   ============================================================ */
.philosophy__grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2.5rem, 7vw, 8rem); align-items: center;
}
.media-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 5; }
.media-frame img {
  height: 116%; will-change: transform;
  transition: transform 1.2s var(--ease);
}
.philosophy__media:hover .media-frame img { transform: scale(1.05); }

/* ============================================================
   CINEMATIC FULL-BLEED BANDS
   ============================================================ */
.band {
  position: relative;
  height: clamp(560px, 90vh, 1040px);
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.band__media { position: absolute; inset: 0; }
.band__media img {
  position: absolute; inset: 0; height: 120%; will-change: transform;
}
.band__overlay {
  position: absolute; inset: 0;
  /* legibility scrim — concentrated at the base where the copy sits, image stays bright above */
  background:
    linear-gradient(0deg, rgba(15,15,15,0.8) 0%, rgba(15,15,15,0.18) 34%, transparent 58%),
    linear-gradient(90deg, rgba(15,15,15,0.42) 0%, rgba(15,15,15,0.04) 46%, transparent 66%);
  transition: opacity 0.8s var(--ease);
}
.band--right { justify-content: flex-end; text-align: right; }
.band--right .band__overlay {
  background:
    linear-gradient(0deg, rgba(15,15,15,0.8) 0%, rgba(15,15,15,0.18) 34%, transparent 58%),
    linear-gradient(270deg, rgba(15,15,15,0.42) 0%, rgba(15,15,15,0.04) 46%, transparent 66%);
}
.band__content {
  position: relative; z-index: 2;
  padding: clamp(2.5rem, 7vw, 6.5rem);
  max-width: 640px;
}
.band--right .band__content { margin-left: auto; }
.band--right .band__desc { margin-left: auto; }
.band__index {
  font-family: var(--serif);
  font-size: 0.95rem; letter-spacing: 0.3em; color: var(--accent);
  display: block; margin-bottom: 1.6rem;
}
.band__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.1rem, 4vw, 3.8rem); line-height: 1.06;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}
.band__desc {
  margin-top: 1.6rem; color: rgba(247,245,242,0.82);
  max-width: 40ch; font-size: clamp(0.98rem, 1.2vw, 1.12rem);
  text-shadow: 0 1px 20px rgba(0,0,0,0.5);
}

/* ============================================================
   DUO + LIFESTYLE GRID (shared .tile)
   ============================================================ */
.duo, .gridfour {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; gap: clamp(1rem, 2vw, 1.6rem);
}
.duo { grid-template-columns: 1fr 1fr; }
.gridfour { grid-template-columns: repeat(4, 1fr); }

.tile { position: relative; overflow: hidden; }
.tile__media { position: relative; overflow: hidden; aspect-ratio: 3 / 2; }
.gridfour .tile__media { aspect-ratio: 4 / 5; }
.tile__media img {
  transition: transform 1.5s var(--ease), filter 1.2s var(--ease);
  filter: saturate(1) brightness(1.02);
}
.tile:hover .tile__media img { transform: scale(1.06); filter: saturate(1.02) brightness(1.06); }
.tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(15,15,15,0.6) 0%, rgba(15,15,15,0.05) 32%, transparent 52%);
}
.tile figcaption {
  position: absolute; left: 1.6rem; bottom: 1.4rem; z-index: 2;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.tile figcaption span {
  font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent);
}
.tile figcaption em {
  font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--ink);
  text-shadow: 0 1px 18px rgba(0,0,0,0.5);
}

/* ============================================================
   FEATURED HOMES — masonry
   ============================================================ */
.masonry {
  max-width: var(--maxw); margin: 0 auto;
  columns: 3; column-gap: clamp(1rem, 2vw, 2rem);
}
.masonry__item {
  break-inside: avoid; margin-bottom: clamp(1rem, 2vw, 2rem);
}
.masonry__media {
  position: relative; overflow: hidden; aspect-ratio: 4 / 3;
}
.masonry__item--tall .masonry__media { aspect-ratio: 3 / 4.4; }
.masonry__media img {
  transition: transform 1.4s var(--ease), filter 1.2s var(--ease);
  filter: saturate(0.94) brightness(0.94);
}
.masonry__item:hover .masonry__media img {
  transform: scale(1.06); filter: saturate(1) brightness(1);
}
.masonry__item figcaption {
  display: flex; flex-direction: column; gap: 0.25rem; padding: 1.1rem 0.2rem 0;
}
.masonry__item figcaption span {
  font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent);
}
.masonry__item figcaption em {
  font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--ink);
}

/* ============================================================
   MATERIAL PALETTE
   ============================================================ */
.materials__grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.6rem);
}
.swatch { position: relative; overflow: hidden; aspect-ratio: 1 / 1; }
.swatch__media {
  position: absolute; inset: 0;
  background-color: var(--tone, #2a2a2a);
  /* subtle grain (SVG noise) for tactility — not a gradient */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  background-blend-mode: soft-light;
  transition: transform 1.6s var(--ease);
}
.swatch:hover .swatch__media { transform: scale(1.06); }
/* inner vignette to give the flat tone depth */
.swatch::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  box-shadow: inset 0 0 80px rgba(0,0,0,0.28);
}
.swatch figcaption {
  position: absolute; left: 1.5rem; bottom: 1.3rem; z-index: 2;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.swatch__name {
  font-family: var(--serif); font-size: 1.7rem; line-height: 1;
  color: var(--ink-on, var(--ink));
}
.swatch__meta {
  font-size: 0.62rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--ink-on, var(--ink)); opacity: 0.7;
  transform: translateY(6px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.swatch:hover .swatch__meta { opacity: 0.78; }
.swatch:hover .swatch__meta { opacity: 1; transform: translateY(0); }

/* ============================================================
   PROCESS
   ============================================================ */
.process__list {
  max-width: var(--maxw); margin: 0 auto; list-style: none;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}
.process__step { border-top: 1px solid var(--line); padding-top: 2rem; }
.process__num {
  font-family: var(--serif); font-size: 2.6rem; color: var(--accent);
  display: block; margin-bottom: 1.4rem; font-weight: 300;
}
.process__step h3 {
  font-family: var(--serif); font-weight: 400; font-size: 1.6rem;
  margin-bottom: 0.8rem;
}
.process__step p { color: var(--ink-soft); font-size: 0.98rem; max-width: 24ch; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { position: relative; padding: clamp(6rem, 14vw, 12rem) var(--pad); overflow: hidden; }
.contact__media { position: absolute; inset: 0; z-index: -2; }
.contact__media img { height: 120%; filter: brightness(0.66); }
.contact__overlay {
  position: absolute; inset: 0; z-index: -1;
  background: rgba(17,17,17,0.42);
}
.contact__panel {
  max-width: 640px; margin: 0 auto;
  background: rgba(17,17,17,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  padding: clamp(2.2rem, 5vw, 4rem);
}
.contact__panel .lede { margin-bottom: 2.6rem; }

.form { display: flex; flex-direction: column; gap: 1.4rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.field { display: flex; flex-direction: column; gap: 0.55rem; }
.field span {
  font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faint);
}
.field input, .field textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: var(--ink); font-family: var(--sans); font-size: 1rem; font-weight: 300;
  padding: 0.7rem 0; transition: border-color 0.4s var(--ease);
  resize: none;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field textarea:focus { outline: 0; border-bottom-color: var(--accent); }
.form__submit { margin-top: 1rem; align-self: flex-start; }
.form__note {
  font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer { padding: clamp(3.5rem, 7vw, 6rem) var(--pad); border-top: 1px solid var(--line); }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.2rem;
}
.footer__logo {
  width: clamp(200px, 28vw, 300px); height: auto;
  margin-bottom: 0.4rem;
}
.footer__tag { color: var(--ink-soft); font-size: 0.95rem; }
.footer__meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: center;
  margin-top: 1rem; font-size: 0.78rem; letter-spacing: 0.1em; color: var(--ink-faint);
}
.footer__meta a { color: var(--accent); }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(34px);
  transition: opacity 1.1s var(--ease-2), transform 1.1s var(--ease-2);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .masonry { columns: 2; }
  .gridfour { grid-template-columns: repeat(2, 1fr); }
  .process__list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__menu { display: block; }

  /* anchor hero copy to the lower third so the eyebrow clears the fixed nav logo */
  .hero { align-items: flex-end; padding-bottom: clamp(5.5rem, 20vw, 8rem); }
  .hero__content { width: 100%; }
  .hero .eyebrow { letter-spacing: 0.3em; margin-bottom: 1.2rem; }
  .scrollcue { display: none; }

  .nav.open .nav__links {
    display: flex; flex-direction: column; gap: 1.6rem;
    position: fixed; inset: 0; z-index: 90;
    background: rgba(17,17,17,0.97);
    backdrop-filter: blur(18px);
    align-items: center; justify-content: center; text-align: center;
  }
  .nav.open .nav__links a { font-size: 1.1rem; }

  .philosophy__grid { grid-template-columns: 1fr; }
  .media-frame { aspect-ratio: 3 / 2; }

  .band { height: 72vh; min-height: 460px; }
  .band--right, .band--right .band__content, .band--right .band__desc { text-align: left; margin-left: 0; }
  .band--right { justify-content: flex-start; }
  .band__content { padding: clamp(2.2rem, 8vw, 3.5rem); }

  .duo { grid-template-columns: 1fr; }
  .materials__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .masonry { columns: 1; }
  .gridfour { grid-template-columns: 1fr; }
  .process__list { grid-template-columns: 1fr; }
  .materials__grid { grid-template-columns: 1fr 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .hero { min-height: 580px; }
  .gridfour .tile__media { aspect-ratio: 3 / 2; }
}

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