/*
 * Homepage overlays (js/home/overlays.js), built on the modal shell in
 * css/components/modal.css:
 *
 *   .service-modal   #ktPrimaryServiceModal — iframe host for proof panels,
 *                    service carousels, decision fields, consultancy and
 *                    project delivery (variant modifiers below)
 *   .contrast-modal  #ktAdvisoryContrastModal — html/consequences.html
 *   .prep-modal      #ktBathhousePreparationModal — html/preparation-morph.html
 *   .epoxy-modal     #ktEpoxyGroutModal — inline images + copy panel
 *   .offer-shell     full-viewport host of html/what-we-offer-modal.html
 *
 * Large screens: panels carry js/core/scale-to-fit.js attributes; the
 * primary-service panel's canvas changes with the variant (overlays.js).
 */

/* =========================================================
   Shared paint
   ========================================================= */

.service-modal__backdrop,
.prep-modal__backdrop {
  background:
    radial-gradient(ellipse 120% 70% at 50% -4%, rgba(58, 44, 26, 0.42) 0%, transparent 62%),
    radial-gradient(ellipse 90% 50% at 50% 110%, rgba(0, 0, 0, 0.6) 0%, transparent 64%),
    rgba(8, 7, 5, 0.84);
  backdrop-filter: blur(18px) saturate(1.08);
}

/* Bronze close button (primary service, preparation, epoxy). */
.service-modal__close,
.prep-modal__close,
.epoxy-modal__close {
  width: 44px;
  height: 44px;
  background: linear-gradient(180deg, rgba(40, 33, 24, 0.94), rgba(14, 12, 9, 0.97));
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(228, 212, 188, 0.16);
}

.prep-modal__close,
.epoxy-modal__close {
  top: -22px;
  right: -22px;
  border: 1px solid rgb(214 164 91 / 0.76);
}

.prep-modal__close span,
.epoxy-modal__close span {
  background: rgb(214 164 91 / 0.96);
}

.prep-modal__close:hover,
.prep-modal__close:focus-visible {
  border-color: rgb(214 164 91 / 0.92);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.54),
    0 0 22px rgba(184, 148, 31, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.prep-modal__close:hover span,
.prep-modal__close:focus-visible span,
.epoxy-modal__close:hover span,
.epoxy-modal__close:focus-visible span {
  background: rgb(214 164 91);
}

/* Frames fade out with the closing panel (primary service, preparation). */
.service-modal__frame,
.prep-modal__frame {
  opacity: 1;
  transition: opacity var(--modal-close-duration) var(--modal-ease-close);
}

.service-modal.is-closing .service-modal__frame,
.prep-modal.is-closing .prep-modal__frame {
  opacity: 0;
}

/* =========================================================
   Primary-service modal
   ========================================================= */

.service-modal {
  padding: clamp(24px, 3vw, 48px);
}

.service-modal__panel {
  width: min(1280px, 100%);
  height: calc(100dvh - clamp(48px, 6vw, 96px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(212, 180, 129, 0.28);
  background: #0a0908;
  box-shadow:
    0 60px 140px rgba(0, 0, 0, 0.68),
    0 0 0 1px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(228, 212, 188, 0.1);
}

.service-modal__close {
  top: 18px;
  right: 18px;
  border: 1px solid rgba(212, 180, 129, 0.36);
  outline: none;
}

.service-modal__close span {
  background: rgba(232, 218, 196, 0.92);
}

.service-modal__close:hover,
.service-modal__close:focus-visible {
  border-color: rgba(224, 178, 110, 0.55);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.54),
    0 0 22px rgba(214, 164, 91, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.service-modal__close:hover span,
.service-modal__close:focus-visible span {
  background: rgba(255, 239, 203, 1);
}

.service-modal__frame {
  background: #0a0908;
}

/* Loading notice; after 12 s it becomes a recovery panel (Retry / Open Page). */
.service-modal__status {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(80%, 32rem);
  color: rgba(241, 199, 125, 0.8);
  font: 400 14px/1.6 var(--font-sans);
  text-align: center;
  pointer-events: none;
}

.service-modal__status[data-recovery] {
  pointer-events: auto;
  padding: 18px;
  border: 1px solid rgba(241, 199, 125, 0.4);
  border-radius: 6px;
  background: rgba(8, 16, 13, 0.96);
}

.service-modal__status :is(button, a) {
  display: inline-block;
  margin: 12px 6px 0;
  padding: 7px 12px;
  border: 1px solid rgba(241, 199, 125, 0.6);
  border-radius: 3px;
  background: transparent;
  color: #f1c77d;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.service-modal__status :is(button, a):focus-visible {
  outline: 2px solid #f1c77d;
  outline-offset: 3px;
}

.service-modal__status[hidden] {
  display: none;
}

/* --- Advisory variant: decision fields, consultancy, project delivery.
   Edge to edge; the 1280×720 canvas is magnified above 720p. --- */
.service-modal.service-modal--advisory {
  padding: 0;
}

.service-modal--advisory .service-modal__panel {
  width: 100%;
  height: 100dvh;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.service-modal--advisory .service-modal__frame {
  background: transparent;
}

.service-modal--advisory .service-modal__close {
  border-color: rgba(241, 199, 125, 0.42);
  background: linear-gradient(180deg, rgba(47, 27, 51, 0.94), rgba(16, 9, 18, 0.97));
}

/* --- Mobile portrait, phone landscape and compact touch landscape:
   edge-to-edge frame. --- */
@media (max-width: 900px) and (orientation: portrait),
       (max-width: 900px) and (max-height: 500px),
       (pointer: coarse) and (orientation: landscape) and (min-width: 1100px) and (max-width: 1180px) and (max-height: 780px) {
  .service-modal {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .service-modal__panel {
    width: 100%;
    max-width: none;
    height: 100svh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .service-modal__close {
    top: max(10px, env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
  }

  .service-modal__frame {
    min-height: 100%;
  }
}

/* --- Landscape carousels on phones and compact touch tablets. --- */
@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape),
       (pointer: coarse) and (orientation: landscape) and (min-width: 1100px) and (max-width: 1180px) and (max-height: 780px) {
  .service-modal--landscape-carousel {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .service-modal--landscape-carousel .service-modal__panel {
    width: 100%;
    max-width: none;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* --- Proof panels: a contained card with the homepage visible around it;
   each proof document draws its own close control. --- */
.service-modal.service-modal--proof {
  align-items: center;
  justify-content: center;
  padding: 0;
}

.service-modal--proof .service-modal__backdrop {
  background: rgba(6, 5, 4, 0.42);
  backdrop-filter: blur(5px) saturate(1.02);
}

.service-modal--proof .service-modal__panel {
  width: min(76vw, 1240px);
  max-width: min(76vw, 1240px);
  height: min(55svh, 580px);
  max-height: min(55svh, 580px);
  border: 1px solid rgba(222, 184, 116, 0.42);
  border-radius: 18px;
  background: transparent;
  box-shadow:
    0 36px 90px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(50, 31, 13, 0.72),
    inset 0 1px 0 rgba(255, 226, 165, 0.13),
    inset 0 -1px 0 rgba(72, 43, 17, 0.52);
}

.service-modal--proof .service-modal__frame {
  background: transparent;
}

.service-modal--proof .service-modal__close {
  display: none;
}

@media (max-height: 500px) and (orientation: landscape) {
  .service-modal--proof .service-modal__panel {
    width: 88vw;
    max-width: 88vw;
    height: 84svh;
    max-height: 84svh;
  }
}

/* Responsive proof height is measured from its content, with a viewport cap. */
@media (max-width: 900px), (pointer: coarse) and (max-width: 1400px) {
  .service-modal--proof .service-modal__panel {
    width: min(1040px, calc(100vw - 32px));
    max-width: none;
    height: var(--proof-content-height, min(620px, calc(100svh - 32px)));
    max-height: calc(100svh - 32px);
    border-radius: 12px;
  }

  .service-modal--proof .service-modal__frame {
    min-height: 0;
    min-width: 0;
  }
}

@media (max-width: 900px) and (orientation: portrait),
       (pointer: coarse) and (max-width: 1100px) and (orientation: portrait) {
  .service-modal--proof .service-modal__panel { width: min(720px, calc(100vw - 32px)); }
}

@media (max-width: 680px) and (orientation: portrait) {
  .service-modal--proof .service-modal__panel { width: calc(100vw - 16px); }
}

@media (max-width: 900px), (pointer: coarse) and (max-width: 1400px) {
  .service-modal--proof .service-modal__panel,
  .service-modal--proof .service-modal__frame { transition: none; }
  .service-modal--proof .service-modal__backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* =========================================================
   Advisory contrast modal (consequences)
   ========================================================= */

.contrast-modal {
  --modal-open-duration: 820ms;
  --modal-lift: 34px;
  --modal-scale: 0.965;
  --modal-close-open-delay: 180ms, 0s, 0s, 0s;
  --modal-close-exit: opacity 533ms var(--modal-ease-close);
  align-items: stretch;
}

.contrast-modal__backdrop {
  background:
    radial-gradient(ellipse 120% 70% at 50% -4%, rgba(38, 54, 70, 0.46) 0%, transparent 62%),
    radial-gradient(ellipse 90% 50% at 50% 110%, rgba(0, 0, 0, 0.6) 0%, transparent 64%),
    rgba(5, 8, 12, 0.82);
  backdrop-filter: blur(18px) saturate(1.08);
}

.contrast-modal__panel {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 40% at 50% -8%, rgba(72, 104, 132, 0.16) 0%, transparent 64%),
    linear-gradient(180deg, rgba(16, 22, 30, 0.99) 0%, rgba(7, 10, 15, 1) 100%);
  box-shadow:
    0 60px 140px rgba(0, 0, 0, 0.68),
    0 0 0 1px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(196, 212, 228, 0.12);
}

/* Hairline along the top edge. */
.contrast-modal__panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(214, 164, 91, 0.42) 26%,
    rgba(196, 212, 228, 0.7) 50%,
    rgba(214, 164, 91, 0.42) 74%,
    transparent 100%
  );
  box-shadow: 0 0 18px rgba(148, 184, 212, 0.28);
}

.contrast-modal__close {
  top: clamp(18px, calc(1.25vw + 2px), 26px);
  right: clamp(18px, calc(1.25vw + 2px), 26px);
  width: clamp(44px, calc(1.25vw + 28px), 52px);
  height: clamp(44px, calc(1.25vw + 28px), 52px);
  border: 0;
  background: linear-gradient(180deg, rgba(28, 38, 50, 0.94), rgba(10, 14, 20, 0.97));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.46);
  outline: none;
}

.contrast-modal__close span {
  width: clamp(16px, calc(0.625vw + 8px), 20px);
  background: rgba(196, 212, 228, 0.92);
}

/* Magnified 1280×720 canvas: the close button keeps its 720p size. */
.contrast-modal__panel[data-scale-active] .contrast-modal__close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
}

.contrast-modal__panel[data-scale-active] .contrast-modal__close span {
  width: 16px;
}

.contrast-modal__close:hover,
.contrast-modal__close:focus-visible {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.54),
    0 0 22px rgba(214, 164, 91, 0.18);
}

.contrast-modal__close:hover span,
.contrast-modal__close:focus-visible span {
  background: rgba(255, 239, 203, 1);
}

.contrast-modal__frame {
  background: #070a0f;
}

/* Reduced motion (as the original): no panel/backdrop transitions and no
   panel offset; the close button keeps its fade-in but not its fade-out. */
@media (prefers-reduced-motion: reduce) {
  .contrast-modal :is(.contrast-modal__backdrop, .contrast-modal__panel) {
    transition: none !important;
  }

  .contrast-modal .contrast-modal__panel {
    transform: none !important;
  }

  .contrast-modal.is-closing .contrast-modal__close {
    transition: none !important;
  }
}

/* =========================================================
   Bathhouse preparation modal ("Beneath the finish")
   ========================================================= */

.prep-modal__stage,
.prep-modal__stage-scaler {
  display: contents;
}

.prep-modal__panel {
  width: min(1180px, calc(100% - 56px));
  height: min(560px, calc(100dvh - 72px));
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-radius: 4px;
  border: 1px solid rgba(212, 180, 129, 0.28);
  background:
    radial-gradient(ellipse 90% 40% at 50% -8%, rgba(184, 148, 31, 0.12) 0%, transparent 64%),
    linear-gradient(180deg, rgba(20, 17, 14, 0.99) 0%, rgba(9, 8, 7, 1) 100%);
  box-shadow:
    0 60px 140px rgba(0, 0, 0, 0.68),
    0 0 0 1px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(228, 212, 188, 0.1);
}

.prep-modal__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: inherit;
}

.prep-modal__close {
  z-index: 12;
}

.prep-modal__frame {
  background: #0a1219;
}

/* 1080p band: the 1180×560 panel is magnified 1.5× as one composition
   (above 1920px wide scale-to-fit.js fits it to the window instead). */
@media (min-width: 1600px) and (max-width: 1920px) and (min-height: 900px) and (max-height: 1250px) {
  .prep-modal__stage {
    display: block;
    position: relative;
    flex: 0 0 auto;
    width: 1770px;
    height: 840px;
    overflow: visible;
  }

  .prep-modal__stage-scaler {
    display: block;
    position: absolute;
    inset: 0 auto auto 0;
    width: 1180px;
    height: 560px;
    transform: scale(1.5);
    transform-origin: top left;
  }

  .prep-modal__panel {
    width: 1180px;
    max-width: none;
    height: 560px;
    max-height: none;
  }
}

/* Phones and tablet portrait: near full-screen panel for the stacked layout. */
@media (max-width: 760px), (max-width: 900px) and (orientation: portrait) {
  .prep-modal {
    padding: 10px 0;
  }

  .prep-modal__panel {
    width: min(100%, calc(100% - 16px));
    margin-inline: auto;
    height: min(94dvh, calc(100dvh - 20px));
    max-height: calc(100dvh - 16px);
  }

  .prep-modal__close {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
  }
}

/* =========================================================
   Epoxy grout modal
   ========================================================= */

/* Note: the epoxy modal keeps its transitions under reduced motion (only the
   Web Animations exit is skipped), as in the original. */
.epoxy-modal {
  --modal-ease-open: cubic-bezier(0.22, 0.61, 0.36, 1);
  --modal-ease-close: cubic-bezier(0.4, 0, 0.2, 1);
  --modal-open-duration: 560ms;
  --modal-close-duration: 920ms;
  --modal-close-backdrop-delay: 180ms;
  --modal-lift: 34px;
  --modal-scale: 0.965;
  --modal-close-open-delay: 180ms, 0s, 0s, 0s;
  --modal-close-exit: opacity 598ms var(--modal-ease-close);
  --epoxy-line: rgba(214, 164, 91, 0.12);
  padding: clamp(24px, 3vw, 48px);
}

.epoxy-modal__backdrop {
  background:
    radial-gradient(ellipse 92% 56% at 50% 4%, rgba(128, 88, 42, 0.48) 0%, transparent 62%),
    radial-gradient(ellipse 80% 42% at 16% 78%, rgba(105, 174, 165, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 84% 48% at 50% 110%, rgba(0, 0, 0, 0.7) 0%, transparent 64%),
    linear-gradient(rgba(255, 247, 232, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 247, 232, 0.018) 1px, transparent 1px),
    rgba(7, 6, 4, 0.88);
  background-size: auto, auto, auto, 56px 56px, 56px 56px, auto;
  backdrop-filter: blur(20px) saturate(1.1);
}

.epoxy-modal__panel {
  width: min(1480px, 100%);
  max-height: calc(100dvh - clamp(48px, 6vw, 96px));
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-radius: 4px;
  border: 1px solid rgba(214, 164, 91, 0.34);
  background:
    linear-gradient(90deg, rgba(214, 164, 91, 0.12), transparent 18%, transparent 82%, rgba(214, 164, 91, 0.12)),
    radial-gradient(ellipse 80% 42% at 50% -10%, rgba(255, 232, 188, 0.14) 0%, transparent 64%),
    linear-gradient(180deg, rgba(21, 17, 13, 0.99) 0%, rgba(7, 6, 4, 1) 100%);
  box-shadow:
    0 64px 150px rgba(0, 0, 0, 0.7),
    0 24px 62px rgba(92, 56, 22, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 247, 232, 0.12);
}

/* Top hairline and the outer drafting frame. */
.epoxy-modal__panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(214, 164, 91, 0.5) 26%,
    rgba(255, 247, 232, 0.78) 50%,
    rgba(214, 164, 91, 0.5) 74%,
    transparent 100%
  );
  box-shadow: 0 0 20px rgba(214, 164, 91, 0.28);
}

.epoxy-modal__panel::after {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border: 1px solid rgba(214, 164, 91, 0.12);
  border-radius: 6px;
  pointer-events: none;
  background:
    linear-gradient(rgba(214, 164, 91, 0.14), rgba(214, 164, 91, 0.14)) 0 50% / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(214, 164, 91, 0.12), rgba(214, 164, 91, 0.12)) 50% 0 / 1px 100% no-repeat;
  opacity: 0.62;
}

.epoxy-modal__close {
  outline: none;
}

.epoxy-modal__close:hover,
.epoxy-modal__close:focus-visible {
  border-color: rgb(214 164 91 / 0.92);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.54),
    0 0 22px rgba(184, 148, 31, 0.18),
    0 0 0 3px rgb(214 164 91 / 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.epoxy-modal__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 350px) minmax(0, 1fr);
  align-items: stretch;
  min-height: clamp(500px, 64vh, 720px);
  overflow: hidden;
  border-radius: inherit;
}

.epoxy-modal__media {
  position: relative;
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--epoxy-line);
  background: #080604;
}

.epoxy-modal__media--right {
  border-right: 0;
  border-left: 1px solid var(--epoxy-line);
}

.epoxy-modal__media-slot {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: clamp(500px, 64vh, 720px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(184, 148, 31, 0.08), transparent 58%),
    linear-gradient(180deg, rgba(18, 15, 12, 0.92), rgba(8, 7, 6, 0.98));
}

/* Inset frame and vignette/grid over each image. */
.epoxy-modal__media-slot::before {
  content: "";
  position: absolute;
  inset: clamp(18px, 2vw, 30px);
  z-index: 2;
  border: 1px solid rgba(255, 247, 232, 0.18);
  border-radius: 2px;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.34),
    0 0 32px rgba(0, 0, 0, 0.28);
}

.epoxy-modal__media-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 6, 4, 0.5) 0%, transparent 18%, transparent 82%, rgba(7, 6, 4, 0.55) 100%),
    linear-gradient(180deg, rgba(7, 6, 4, 0.34) 0%, transparent 30%, transparent 70%, rgba(7, 6, 4, 0.48) 100%),
    linear-gradient(rgba(255, 247, 232, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 247, 232, 0.024) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
}

.epoxy-modal__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: saturate(0.92) contrast(1.04) brightness(0.86);
}

.epoxy-modal__media--left .epoxy-modal__img {
  object-position: 47% 50%;
}

.epoxy-modal__media--right .epoxy-modal__img {
  object-position: 52% 50%;
}

/* Copy panel (centre column on desktop, overlay on small screens). */
.epoxy-modal__copy {
  position: relative;
  z-index: 4;
  display: flex;
  min-height: 100%;
  border-left: 1px solid rgba(214, 164, 91, 0.16);
  border-right: 1px solid rgba(214, 164, 91, 0.16);
  box-shadow:
    -18px 0 50px rgba(0, 0, 0, 0.26),
    18px 0 50px rgba(0, 0, 0, 0.28);
}

.epoxy-modal__copy-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 2vw, 26px);
  padding: clamp(34px, 3.4vw, 54px) clamp(22px, 2.35vw, 32px);
  overflow: visible;
  background:
    linear-gradient(90deg, rgba(214, 164, 91, 0.34), rgba(244, 234, 216, 0.42), rgba(214, 164, 91, 0.22)) top / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(214, 164, 91, 0.18), rgba(244, 234, 216, 0.22), rgba(214, 164, 91, 0.12)) bottom / 100% 1px no-repeat,
    radial-gradient(ellipse at 50% -8%, rgba(255, 232, 188, 0.16), transparent 50%),
    radial-gradient(circle at 12% 20%, rgba(105, 174, 165, 0.08), transparent 32%),
    linear-gradient(165deg, rgba(40, 27, 18, 0.96), rgba(10, 8, 6, 0.98) 68%);
  box-shadow:
    inset 0 0 0 1px rgba(214, 164, 91, 0.15),
    inset 0 1px 0 rgba(255, 247, 232, 0.12),
    0 30px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(10px) saturate(1.04);
}

.epoxy-modal__copy-inner::before,
.epoxy-modal__copy-inner::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.epoxy-modal__copy-inner::before {
  inset: clamp(12px, 1.1vw, 16px);
  border: 1px solid rgba(214, 164, 91, 0.18);
  background:
    linear-gradient(rgba(214, 164, 91, 0.12), rgba(214, 164, 91, 0.12)) 0 34% / 100% 1px no-repeat,
    linear-gradient(rgba(214, 164, 91, 0.09), rgba(214, 164, 91, 0.09)) 0 66% / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(214, 164, 91, 0.1), rgba(214, 164, 91, 0.1)) 50% 0 / 1px 100% no-repeat;
  opacity: 0.55;
}

.epoxy-modal__copy-inner::after {
  top: clamp(20px, 2vw, 30px);
  left: 50%;
  width: clamp(74px, 7vw, 112px);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(244, 234, 216, 0.72), rgba(214, 164, 91, 0.78), transparent);
  box-shadow: 0 0 20px rgba(214, 164, 91, 0.28);
  transform: translateX(-50%);
}

.epoxy-modal__copy-title {
  position: relative;
  z-index: 1;
  padding-bottom: 0.14em;
  margin-bottom: -0.08em;
  font-family: var(--font-serif);
  font-size: clamp(34px, 3vw, 54px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(95deg, #fff3d5 0%, #e0ad66 42%, #9d6331 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.5));
}

.epoxy-modal__copy-body {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(14px, 1.2vw, 18px);
}

.epoxy-modal__copy-body p {
  margin: 0;
  color: rgba(231, 220, 202, 0.8);
  font-size: clamp(14px, 1vw, 16px);
  line-height: 1.68;
  font-weight: 430;
}

.epoxy-modal__copy-body p:first-child {
  color: rgba(255, 247, 232, 0.93);
  font-size: clamp(15px, 1.08vw, 18px);
}

/* WHY EPOXY toggle and the copy overlay's own × exist on small screens only. */
.epoxy-modal__copy-toggle,
.epoxy-modal__copy-close {
  display: none;
}

/* 1080p band: the 1203.2×502 canvas is magnified as one composition; its
   viewport-driven internals are frozen at their 720p values. */
@media (min-width: 1281px) and (max-width: 1920px) and (min-height: 721px) and (max-height: 1080px) {
  .epoxy-modal__panel[data-scale-active] {
    max-height: none;
  }

  .epoxy-modal__panel[data-scale-active] :is(.epoxy-modal__layout, .epoxy-modal__media-slot) {
    min-height: 500px;
  }

  .epoxy-modal__panel[data-scale-active] .epoxy-modal__layout {
    height: 500px;
  }

  .epoxy-modal__panel[data-scale-active] .epoxy-modal__copy-inner {
    gap: 25.6px;
    padding: 43.52px 30.08px;
  }

  .epoxy-modal__panel[data-scale-active] .epoxy-modal__copy-inner::before {
    inset: 14.08px;
  }

  .epoxy-modal__panel[data-scale-active] .epoxy-modal__copy-inner::after {
    top: 25.6px;
    width: 89.6px;
  }

  .epoxy-modal__panel[data-scale-active] .epoxy-modal__copy-title {
    font-size: 38.4px;
  }

  .epoxy-modal__panel[data-scale-active] .epoxy-modal__copy-body {
    gap: 15.36px;
  }

  .epoxy-modal__panel[data-scale-active] .epoxy-modal__copy-body p {
    font-size: 14px;
  }

  .epoxy-modal__panel[data-scale-active] .epoxy-modal__copy-body p:first-child {
    font-size: 15px;
  }

  .epoxy-modal__panel[data-scale-active] .epoxy-modal__media-slot::before {
    inset: 25.6px;
  }
}

/* Tablets and phones: single column (portrait); the copy is larger. */
@media (max-width: 1080px) {
  .epoxy-modal {
    padding: clamp(18px, 4vw, 32px);
  }

  .epoxy-modal__panel {
    width: min(760px, 100%);
    max-height: calc(100dvh - 48px);
    overflow: hidden;
  }

  .epoxy-modal__panel::after {
    display: none;
  }

  .epoxy-modal__layout {
    grid-template-columns: 1fr;
    min-height: 0;
    overflow-y: auto;
  }

  .epoxy-modal__media,
  .epoxy-modal__media--right {
    border: 0;
  }

  .epoxy-modal__media-slot {
    min-height: 220px;
  }

  .epoxy-modal__copy {
    min-height: auto;
    border-top: 1px solid rgba(214, 164, 91, 0.16);
    border-bottom: 1px solid rgba(214, 164, 91, 0.16);
  }

  .epoxy-modal__close {
    top: 14px;
    right: 14px;
  }

  .epoxy-modal__copy-body p,
  .epoxy-modal__copy-body p:first-child {
    font-size: 19px;
  }
}

/* Copy overlay (phone portrait and every landscape ≤1080): two images, the
   copy opens over them from the WHY EPOXY toggle. */
@media (max-width: 767px) and (orientation: portrait), (max-width: 1080px) and (orientation: landscape) {
  .epoxy-modal__layout {
    position: relative;
  }

  .epoxy-modal__media,
  .epoxy-modal__media-slot {
    min-height: 0;
    height: 100%;
  }

  .epoxy-modal__media--left {
    grid-column: 1;
    grid-row: 1;
  }

  .epoxy-modal__copy {
    position: absolute;
    z-index: 8;
    min-height: 0;
    height: auto;
    overflow: hidden;
    border: 1px solid rgba(214, 164, 91, 0.5);
    border-radius: 3px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 247, 232, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-50%) scale(0.94);
    transition: opacity 220ms ease, visibility 0s linear 220ms, transform 260ms var(--modal-ease-open);
  }

  .epoxy-modal__copy-inner {
    min-height: 0;
    justify-content: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .epoxy-modal__copy-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 154px;
    height: 48px;
    padding: 0 20px;
    border: 1px solid rgba(214, 164, 91, 0.72);
    border-radius: 999px;
    color: #f4ead8;
    background: rgba(10, 8, 6, 0.88);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 247, 232, 0.12);
    backdrop-filter: blur(12px);
    font-size: 15px;
    font-weight: 760;
    letter-spacing: 0.2em;
    transform: translate(-50%, -50%);
    transition: opacity 180ms ease, transform 220ms ease;
  }

  .epoxy-modal__copy-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(214, 164, 91, 0.58);
    border-radius: 50%;
    background: rgba(10, 8, 6, 0.9);
  }

  .epoxy-modal__copy-close span {
    position: absolute;
    width: 15px;
    height: 1.5px;
    background: rgb(214 164 91 / 0.96);
  }

  .epoxy-modal__copy-close span:first-child {
    transform: rotate(45deg);
  }

  .epoxy-modal__copy-close span:last-child {
    transform: rotate(-45deg);
  }

  .epoxy-modal.is-copy-open .epoxy-modal__copy {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
    transition-delay: 0s;
  }

  .epoxy-modal.is-copy-open .epoxy-modal__copy-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

/* Phone portrait: images stacked, copy overlay across the middle. */
@media (max-width: 767px) and (orientation: portrait) {
  .epoxy-modal__panel {
    height: calc(100dvh - 36px);
    max-height: calc(100dvh - 36px);
  }

  .epoxy-modal__layout {
    height: 100%;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    overflow: hidden;
  }

  .epoxy-modal__media--right {
    grid-column: 1;
    grid-row: 2;
    border-top: 1px solid rgba(214, 164, 91, 0.2);
    border-left: 0;
  }

  .epoxy-modal__copy {
    inset: 50% 18px auto;
    max-height: calc(100% - 40px);
  }

  .epoxy-modal__copy-inner {
    max-height: calc(100dvh - 76px);
    padding: 34px 24px 26px;
  }
}

/* Landscape ≤1080: images side by side, copy overlay between them. */
@media (max-width: 1080px) and (orientation: landscape) {
  .epoxy-modal {
    padding: 10px 14px;
  }

  .epoxy-modal__panel {
    width: min(96vw, 1100px);
    max-height: calc(100dvh - 20px);
  }

  .epoxy-modal__layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    min-height: min(78dvh, 520px);
    max-height: calc(100dvh - 20px);
    overflow: hidden;
  }

  .epoxy-modal__media {
    border-right: 1px solid var(--epoxy-line);
  }

  .epoxy-modal__media--right {
    grid-column: 2;
    grid-row: 1;
    border-right: 0;
    border-left: 1px solid rgba(214, 164, 91, 0.2);
  }

  .epoxy-modal__copy {
    inset: 50% clamp(48px, 14vw, 150px) auto;
    max-height: calc(100% - 24px);
  }

  .epoxy-modal__copy-inner {
    height: auto;
    max-height: calc(100dvh - 44px);
    gap: 12px;
    padding: 28px 26px 24px;
  }

  .epoxy-modal__copy-title {
    font-size: clamp(22px, 3.2vw, 34px);
  }

  .epoxy-modal__copy-body p {
    line-height: 1.4;
  }

  .epoxy-modal__close {
    top: 10px;
    right: 10px;
  }
}

/* =========================================================
   What We Offer frame shell
   The framed document draws its own backdrop, panel, motion and scaling;
   the host is a transparent full-viewport iframe.
   ========================================================= */

.offer-shell {
  position: fixed;
  inset: 0;
  z-index: 2147482400;
  background: transparent;
  opacity: 0;
  transition: opacity 680ms cubic-bezier(0.16, 1, 0.3, 1);
}

.offer-shell.is-open {
  opacity: 1;
}

/* Navigating away to the gallery: inert to the pointer. */
.offer-shell.is-navigating {
  pointer-events: none;
}

/* Parked under a child overlay (enquiry, service modal, consequences). */
.offer-shell.is-handing-off {
  z-index: 899;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

.offer-shell__frame {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* Host controls (overlays.js): present until the document reports ready.
   They fade in only if loading is slow, so a normal open never shows them;
   a failure shows them at once over a dimmed page. */
.offer-shell.has-recovery {
  background: rgba(4, 8, 7, 0.72);
}

.offer-shell__close,
.offer-shell__status {
  opacity: 0;
  transition: opacity 240ms ease;
}

.offer-shell.is-open.is-pending .offer-shell__close,
.offer-shell.is-open.is-pending .offer-shell__status {
  opacity: 1;
  transition-delay: 900ms;
}

.offer-shell.has-recovery .offer-shell__close,
.offer-shell.has-recovery .offer-shell__status {
  opacity: 1;
  transition-delay: 0ms;
}

.offer-shell__close {
  position: absolute;
  z-index: 3;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(228, 189, 116, 0.82);
  border-radius: 50%;
  background: rgba(112, 76, 29, 0.12);
  box-shadow: 0 0 0 1px rgba(201, 154, 74, 0.12), 0 0 18px rgba(228, 189, 116, 0.14);
  cursor: pointer;
}

.offer-shell__close:hover {
  border-color: #f0cf8e;
  background: rgba(154, 105, 38, 0.24);
}

.offer-shell__close:focus-visible {
  outline: 1px solid #f0cf8e;
  outline-offset: 4px;
}

.offer-shell__close::before,
.offer-shell__close::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 14px;
  left: 14px;
  height: 1px;
  background: rgba(255, 248, 234, 0.96);
  box-shadow: 0 0 5px rgba(228, 189, 116, 0.34);
}

.offer-shell__close::before { transform: rotate(45deg); }
.offer-shell__close::after { transform: rotate(-45deg); }

.offer-shell__close[hidden],
.offer-shell__status[hidden] {
  display: none;
}

@media (max-width: 900px),
       (pointer: coarse) and (orientation: landscape) and (min-width: 1100px) and (max-width: 1180px) and (max-height: 780px) {
  .offer-shell {
    display: none;
  }

  .offer-shell.is-open {
    display: block;
  }
}

/* =========================================================
   Phones, tablets and touch screens: no backdrop blur anywhere
   (the original disabled every backdrop filter on these routes).
   ========================================================= */
@media (max-width: 1180px), (pointer: coarse) and (min-width: 768px) {
  .modal .modal__backdrop,
  .epoxy-modal .epoxy-modal__copy-inner,
  .epoxy-modal .epoxy-modal__copy-toggle {
    backdrop-filter: none;
  }
}

/* Keep touch overlay entrances short and their recovery close control round. */
@media (max-width: 900px), (pointer: coarse) and (max-width: 1400px) {
  .offer-shell { transition-duration: 180ms; }

  .offer-shell__close {
    appearance: none;
    box-sizing: border-box;
    min-width: 46px;
    min-height: 46px;
    aspect-ratio: 1;
  }

  .offer-shell__close::before,
  .offer-shell__close::after {
    top: 50%;
    left: 50%;
    right: auto;
    width: 18px;
  }

  .offer-shell__close::before { transform: translate(-50%, -50%) rotate(45deg); }
  .offer-shell__close::after { transform: translate(-50%, -50%) rotate(-45deg); }
}

/* Do not expose a new proof iframe's unpainted canvas on tablet landscape. */
@media (pointer: coarse) and (min-width: 768px) and (max-width: 1400px) and (orientation: landscape) {
  .service-modal--proof:focus { outline: none; }
  .service-modal--proof .service-modal__panel,
  .service-modal--proof .service-modal__frame { background-color: #080705; }
  .service-modal--proof .service-modal__frame { color-scheme: dark; }
  .service-modal--proof .service-modal__frame:not([data-proof-paint-ready]) { visibility: hidden; opacity: 0; }
}
