/* HauteRenovation: the frosted "vitrine" white, used on a few chosen surfaces only (written by the glass pass).

   Where, and why (everywhere else the page keeps its plain warm ground):
   1. the top bar once the page scrolls: the page slides under a frosted strip (every page);
   2. the desktop "Services" panel: it opens over the page, which shows through it, blurred;
   3. the phone menu (.mnav): the same frosted sheet over the page;
   4. the home reviews: three glass cards over a soft field (a warm light, a cool shade, tile joints);
   5. the contact page's e-mail and address rows: one small glass card over the same field (the form keeps
      its own white card, form.css);
   6. the closing band's call to action (every page but the contact page, which already has the form).
   The field behind 4-6 has fine tile joints on purpose: crisp around the glass, melted behind it, which is
   what makes the glass read as glass. Text stays ink or muted on a light glass (contrast above 4.5:1).
   Without backdrop-filter, or with "reduce transparency", every surface is solid. */

:root {
  --glass-rgb: 252 251 249;                 /* a white a touch warmer than #fff, so it sits on #f4f2ee */
  --glass-solid: #fbfaf8;
  --glass-edge: rgb(255 255 255 / .75);     /* the lit rim of the pane */
  --glass-shadow: 0 0 0 1px rgb(20 33 43 / .06), 0 1px 2px rgb(20 33 43 / .04), 0 24px 48px -28px rgb(20 33 43 / .30);
  /* the field behind the glass: a warm light, a cool shade and fine tile joints, faded at its edges */
  --glass-field:
    radial-gradient(38% 52% at 22% 34%, rgb(194 80 27 / .26), transparent 70%),
    radial-gradient(42% 58% at 80% 70%, rgb(20 33 43 / .16), transparent 72%),
    radial-gradient(30% 40% at 58% 20%, rgb(232 176 120 / .30), transparent 70%),
    repeating-linear-gradient(0deg, rgb(20 33 43 / .07) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, rgb(20 33 43 / .07) 0 1px, transparent 1px 56px);
  --glass-field-mask: radial-gradient(closest-side, #000 55%, transparent);
}

/* ------------------------------------------------------------------ the fields (decor, behind the glass) */
.reviews, #devis.section--form, body:not(:has(.form--devis)) footer.closing { position: relative; isolation: isolate; }
/* the fields reach a little past their box: the section clips them, so the page never scrolls sideways */
main > section:has(.reviews), #devis.section--form, body:not(:has(.form--devis)) footer.closing { overflow-x: clip; }
.reviews::before,
#devis.section--form::before,
body:not(:has(.form--devis)) footer.closing::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  background: var(--glass-field);
  -webkit-mask: var(--glass-field-mask); mask: var(--glass-field-mask);
}
.reviews::before { inset: -64px -6% -48px; }
#devis.section--form::before { top: 34%; height: 520px; left: -4%; width: 46%;
  background-position: 0 0; background-image:
    radial-gradient(34% 40% at 40% 62%, rgb(194 80 27 / .24), transparent 70%),
    radial-gradient(40% 46% at 70% 40%, rgb(20 33 43 / .14), transparent 72%),
    repeating-linear-gradient(0deg, rgb(20 33 43 / .07) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, rgb(20 33 43 / .07) 0 1px, transparent 1px 56px); }
body:not(:has(.form--devis)) footer.closing::before { top: 0; height: min(760px, 100%); left: -4%; right: -4%; }
@media (max-width: 1023px) {
  #devis.section--form::before { left: -12%; width: auto; right: -12%; top: 18%; height: 560px; }
}

/* ------------------------------------------------------------------ the panes: solid first, glass where it can */
.reviews .review,
.contact__aside .rows,
body:not(:has(.form--devis)) footer.closing .closing__cta {
  background: var(--glass-solid);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
}

/* 4. the reviews: cards instead of a rule above each quote */
.reviews .review { padding: var(--s-5); border-top: 1px solid var(--glass-edge); align-content: start; }

/* 5. the contact rows (e-mail, address) */
.contact__aside .rows { padding: var(--s-2) var(--s-5); margin: 0; }
.contact__aside .rows > li:last-child { border-bottom: 0; }

/* 6. the closing call to action */
body:not(:has(.form--devis)) footer.closing .closing__cta { padding: var(--s-7); }
@media (max-width: 1023px) { body:not(:has(.form--devis)) footer.closing .closing__cta { padding: var(--s-6); } }
@media (max-width: 639px)  { body:not(:has(.form--devis)) footer.closing .closing__cta { padding: var(--s-5) var(--s-4); } }

/* 1. the bar: its glass is a layer under its content (::before), never the bar itself, so the bar stays
   no containing block for the fixed phone menu and no backdrop root for the Services panel inside it */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bg); opacity: 0; transition: opacity .3s ease;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  /* 1. the bar, once scrolled */
  html.is-scrolled .nav:not(.is-open) { background-color: transparent; border-bottom-color: rgb(20 33 43 / .08); }
  html.is-scrolled .nav:not(.is-open)::before {
    opacity: 1;
    background: rgb(var(--glass-rgb) / .88);
    -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
    box-shadow: inset 0 -1px 0 rgb(255 255 255 / .5);
  }

  /* 2. the desktop Services panel */
  @media (min-width: 1024px) {
    .nav__menu {
      background: rgb(var(--glass-rgb) / .9);
      -webkit-backdrop-filter: blur(28px) saturate(1.7); backdrop-filter: blur(28px) saturate(1.7);
      border-top-color: rgb(20 33 43 / .06);
      box-shadow: inset 0 1px 0 rgb(255 255 255 / .6), 0 30px 60px -30px rgb(20 33 43 / .35);
    }
  }

  /* 3. the phone menu */
  @media (max-width: 1023px) {
    .nav.is-open .mnav {
      background: rgb(var(--glass-rgb) / .9);
      -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
    }
    .nav.is-open .mnav .mnav__urgent { background: rgb(20 33 43 / .06); }
    .nav.is-open .mnav .mnav__link[aria-current="page"], .nav.is-open .mnav .mnav__link:active { background: rgb(20 33 43 / .06); }
  }

  /* 4-6. the panes */
  .reviews .review,
  .contact__aside .rows,
  body:not(:has(.form--devis)) footer.closing .closing__cta {
    background: linear-gradient(160deg, rgb(var(--glass-rgb) / .78), rgb(var(--glass-rgb) / .58));
    -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .85), var(--glass-shadow);
  }
}

/* the visitor asked for less transparency: every pane is solid, the fields go */
@media (prefers-reduced-transparency: reduce) {
  html.is-scrolled .nav:not(.is-open) { background-color: var(--bg); }
  html.is-scrolled .nav:not(.is-open)::before { opacity: 0; }
  .nav__menu, .nav.is-open .mnav { background: var(--bg) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .reviews .review, .contact__aside .rows, body:not(:has(.form--devis)) footer.closing .closing__cta {
    background: var(--glass-solid) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  .reviews::before, #devis.section--form::before, body:not(:has(.form--devis)) footer.closing::before { display: none; }
}
@media (max-width: 1023px) { .contact__aside .rows { margin-bottom: var(--s-5); } }
