/*
 * Project-enquiry sheet (#kt-enquiry-sheet) and its dimming overlay.
 *
 * Authored as a 760px-wide card (natural height 640.25px). Above 1280×720,
 * pages that enable it (data-scale-* attributes + js/core/scale-to-fit.js)
 * magnify the whole card; the scaler's footprint (.enquiry-footprint) is then
 * fixed at the viewport centre and the card sits at its origin.
 *
 * States on <body> (enquiry.js):
 *   .is-enquiry-open     — opening/open: the card rises 820ms, content resolves
 *                          from blur in three staggered groups;
 *   .is-enquiry-closing  — (with .is-enquiry-open) 1380ms exit downwards.
 * Responsive variants: phone portrait (≤620px) and short landscape screens
 * (≤1000×700 and compact touch landscape) which use a two-column card.
 */

/* Scroll lock for whichever element scrolls the page (document or body). */
html:has(> body.is-enquiry-open),
body.is-enquiry-open,
body.is-enquiry-closing {
  overflow: hidden;
}

/* ----- Overlay ----- */

.enquiry-overlay {
  position: fixed;
  inset: 0;
  /* Above every homepage modal (≤ 99999) so contact is never buried. */
  z-index: 100000;
  background: rgb(0 0 0 / 0.79);
  backdrop-filter: blur(8px) saturate(0.62);
  -webkit-backdrop-filter: blur(8px) saturate(0.62);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1ms linear, visibility 0s linear 1380ms;
}

body.is-enquiry-open .enquiry-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 1ms linear, visibility 0s linear 0s;
}

body.is-enquiry-closing .enquiry-overlay {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transition: opacity 1380ms cubic-bezier(0.4, 0, 0.18, 1);
}

/* Flat, unblurred variant for pages with heavy composited image layers. */
.enquiry-overlay--solid {
  background: rgb(2 7 7 / 0.86);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ----- Card ----- */

.enquiry {
  --enquiry-ivory: #f0eadf;
  --enquiry-soft: rgb(240 234 223 / 0.72);
  --enquiry-quiet: rgb(240 234 223 / 0.44);
  --enquiry-gold: #d9aa60;
  --enquiry-teal: #39c0b6;
  --enquiry-exit: clamp(96px, 7.5vw, 144px);
  --enquiry-hidden: translate(-50%, calc(-50% + 100% + var(--enquiry-exit))) scale(0.92);
  --enquiry-shown: translate(-50%, -50%) scale(1);
  --enquiry-content-offset: clamp(22px, 1.72vw, 33px);

  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100001;
  box-sizing: border-box;
  width: min(760px, calc(100vw - 42px));
  padding: 16px;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgb(217 170 96 / 0.74);
  border-radius: 38px;
  background:
    linear-gradient(135deg, rgb(217 170 96 / 0.14), transparent 18%, transparent 78%, rgb(57 192 182 / 0.11)),
    #0a1614;
  box-shadow:
    0 44px 100px rgb(0 0 0 / 0.8),
    0 0 0 4px rgb(217 170 96 / 0.075),
    inset 0 1px rgb(255 242 213 / 0.18);
  font-family: var(--font-sans);
  visibility: hidden;
  pointer-events: none;
  filter: blur(10px);
  transform: var(--enquiry-hidden);
  will-change: transform, opacity;
  transition:
    transform 820ms cubic-bezier(0.16, 1, 0.28, 1),
    filter 620ms ease,
    box-shadow 820ms ease,
    visibility 0s linear 1380ms;
}

body.is-enquiry-open .enquiry {
  visibility: visible;
  pointer-events: auto;
  filter: blur(0);
  transform: var(--enquiry-shown);
  transition:
    transform 820ms cubic-bezier(0.16, 1, 0.28, 1),
    filter 620ms ease,
    box-shadow 820ms ease,
    visibility 0s linear 0s;
}

body.is-enquiry-closing .enquiry {
  opacity: 0;
  visibility: visible;
  filter: none;
  pointer-events: none;
  transform: var(--enquiry-hidden);
  transition:
    transform 1380ms cubic-bezier(0.4, 0, 0.18, 1),
    opacity 1380ms cubic-bezier(0.4, 0, 0.18, 1),
    visibility 0s linear 1380ms;
}

/* Simple mode (gallery, places, about-us): the open state is gone while the
   card leaves, so its frame falls back to the older teal-and-bronze shadow
   (no transition) exactly as on those original pages. */
body.is-enquiry-closing:not(.is-enquiry-open) .enquiry {
  box-shadow:
    0 -34px 110px rgb(0 0 0 / 0.64),
    0 24px 92px rgb(0 0 0 / 0.48),
    0 0 0 1px rgb(255 255 255 / 0.055) inset,
    0 0 0 2px rgb(224 177 105 / 0.08),
    0 0 62px rgb(65 190 179 / 0.08),
    0 0 100px rgb(194 135 55 / 0.16),
    inset 0 1px 0 rgb(255 236 200 / 0.13);
}

/* A single light sweep across the card once it has arrived. */
.enquiry::after {
  content: "";
  position: absolute;
  inset: -24% -70%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    transparent 32%,
    rgb(84 219 205 / 0.04) 39%,
    rgb(255 241 198 / 0.22) 47%,
    rgb(186 124 43 / 0.12) 54%,
    transparent 66%
  );
  opacity: 0;
  transform: translateX(-42%) skewX(-14deg);
}

body.is-enquiry-open:not(.is-enquiry-closing) .enquiry::after {
  animation: enquiry-sheen 1180ms cubic-bezier(0.19, 1, 0.22, 1) 320ms forwards;
}

/* Inner panel: teal glows, a faint 82px grid and a ghosted "KT". */
.enquiry__shell {
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  padding: 40px 40px 30px;
  border: 1px solid rgb(217 170 96 / 0.38);
  border-radius: 27px;
  background:
    radial-gradient(circle at 3% 0%, rgb(57 192 182 / 0.29), transparent 35%),
    radial-gradient(circle at 92% 12%, rgb(57 192 182 / 0.14), transparent 30%),
    linear-gradient(90deg, rgb(255 255 255 / 0.018) 1px, transparent 1px) 0 0 / 82px 100%,
    linear-gradient(rgb(255 255 255 / 0.014) 1px, transparent 1px) 0 0 / 100% 82px,
    linear-gradient(127deg, #132421 0%, #091310 48%, #0b1c19 100%);
  box-shadow: inset 0 1px rgb(255 255 255 / 0.1), inset 0 -28px 70px rgb(0 0 0 / 0.22);
}

.enquiry__shell::before {
  content: "KT";
  position: absolute;
  right: 28px;
  bottom: 84px;
  color: rgb(217 170 96 / 0.028);
  font: 500 184px/0.7 var(--font-serif);
  letter-spacing: -0.09em;
  pointer-events: none;
}

.enquiry__shell::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgb(217 170 96 / 0.1);
  border-radius: 20px;
  pointer-events: none;
}

/* Content resolves from blur in three staggered groups. */
.enquiry__shell > * {
  filter: blur(8px);
  transform: translateY(var(--enquiry-content-offset));
  transition:
    transform 620ms cubic-bezier(0.16, 1, 0.28, 1),
    filter 560ms ease;
}

body.is-enquiry-open .enquiry__shell > * {
  filter: blur(0);
  transform: translateY(0);
}

body.is-enquiry-open .enquiry__close,
body.is-enquiry-open .enquiry__kicker,
body.is-enquiry-open .enquiry__title { transition-delay: 180ms; }
body.is-enquiry-open .enquiry__copy,
body.is-enquiry-open .enquiry__brief,
body.is-enquiry-open .enquiry__actions { transition-delay: 340ms; }
body.is-enquiry-open .enquiry__foot { transition-delay: 560ms; }

.enquiry__close {
  position: absolute;
  top: 21px;
  right: 21px;
  z-index: 4;
  box-sizing: border-box;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(217 170 96 / 0.62);
  border-radius: 50%;
  background: rgb(5 14 12 / 0.74);
  color: rgb(240 234 223 / 0.88);
  font: 300 32px/1 Arial, sans-serif;
  cursor: pointer;
}

.enquiry__close:hover {
  border-color: var(--enquiry-gold);
  background: #10231f;
}

.enquiry__kicker {
  margin: 0 84px 21px 0;
  color: var(--enquiry-gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.27em;
  text-transform: uppercase;
}

.enquiry__kicker::after {
  content: "";
  display: inline-block;
  width: 68px;
  height: 1px;
  margin: 0 0 4px 17px;
  background: linear-gradient(90deg, rgb(217 170 96 / 0.75), transparent);
}

.enquiry__title {
  max-width: 650px;
  margin: 0;
  color: var(--enquiry-ivory);
  font: 500 clamp(48px, 6.1vw, 69px)/0.96 var(--font-serif);
  letter-spacing: -0.035em;
}

.enquiry__title-accent {
  color: var(--enquiry-gold);
  text-shadow: 0 0 24px rgb(217 170 96 / 0.1);
}

.enquiry__copy {
  max-width: 560px;
  margin: 24px 0 28px;
  color: var(--enquiry-soft);
  font-size: 18px;
  line-height: 1.55;
}

/* "Information to include" strip. */
.enquiry__brief {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 26px;
  border-block: 1px solid rgb(217 170 96 / 0.25);
}

.enquiry__brief-item {
  padding: 12px 15px 11px;
  color: rgb(240 234 223 / 0.56);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

.enquiry__brief-item + .enquiry__brief-item {
  border-left: 1px solid rgb(217 170 96 / 0.18);
}

.enquiry__brief-item::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: var(--enquiry-teal);
  box-shadow: 0 0 10px rgb(57 192 182 / 0.6);
}

/* Contact actions: WhatsApp, Email, Text, Call. */
.enquiry__actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(76px, 1fr);
  gap: 12px;
}

.enquiry__action {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 31px 1fr auto;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  padding: 13px 18px;
  border: 1px solid rgb(217 170 96 / 0.7);
  border-radius: 16px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.055), transparent 42%), rgb(3 12 11 / 0.72);
  box-shadow: inset 0 0 0 7px rgb(217 170 96 / 0.045), 0 9px 22px rgb(0 0 0 / 0.22);
  color: inherit;
  text-decoration: none;
  transition: border-color 240ms ease, transform 240ms ease, background 240ms ease;
}

.enquiry__action::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgb(57 192 182 / 0.14), transparent 68%);
  opacity: 0;
  transition: opacity 240ms ease;
}

.enquiry__action:hover {
  border-color: var(--enquiry-gold);
  background-color: rgb(10 28 25 / 0.9);
  transform: translateY(-2px);
}

.enquiry__action:hover::before {
  opacity: 1;
}

.enquiry__action-icon,
.enquiry__action-copy,
.enquiry__action-arrow {
  position: relative;
}

.enquiry__action-icon {
  color: var(--enquiry-teal);
}

.enquiry__action-icon svg {
  display: block;
  width: 29px;
}

.enquiry__action-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.enquiry__action-name {
  color: var(--enquiry-gold);
  font: 600 24px/1 var(--font-serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.enquiry__action-detail {
  overflow: hidden;
  color: var(--enquiry-quiet);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.enquiry__action-arrow {
  color: rgb(217 170 96 / 0.72);
  font-size: 20px;
  transition: transform 200ms ease;
}

.enquiry__action:hover .enquiry__action-arrow {
  transform: translateX(4px);
}

.enquiry__foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 2px 0;
  color: rgb(217 170 96 / 0.68);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.enquiry__foot::before {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgb(217 170 96 / 0.4), transparent);
}

.enquiry__foot span {
  order: -1;
}

.enquiry :focus-visible {
  outline: 2px solid var(--enquiry-gold);
  outline-offset: 4px;
}

@keyframes enquiry-sheen {
  0% { opacity: 0; transform: translateX(-42%) skewX(-14deg); }
  18% { opacity: 1; }
  72% { opacity: 0.72; }
  100% { opacity: 0; transform: translateX(42%) skewX(-14deg); }
}

/* ----- Phone portrait ----- */

@media (max-width: 620px) {
  .enquiry {
    --enquiry-hidden: translate(-50%, calc(100% + 96px)) scale(0.92);
    --enquiry-shown: translate(-50%, 0) scale(1);
    top: 14px;
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 28px);
    padding: 9px;
    border-radius: 27px;
  }

  .enquiry__shell {
    min-height: calc(100dvh - 46px);
    display: flex;
    flex-direction: column;
    padding: 34px 22px 24px;
    border-radius: 20px;
  }

  .enquiry__copy,
  .enquiry__brief,
  .enquiry__foot {
    display: none;
  }

  .enquiry__close {
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .enquiry__kicker {
    margin-right: 55px;
    font-size: 10px;
  }

  .enquiry__kicker::after {
    width: 34px;
    margin-left: 10px;
  }

  .enquiry__title {
    font-size: clamp(40px, 12.5vw, 56px);
  }

  .enquiry__actions {
    grid-template-columns: 1fr;
    margin-top: auto;
  }
}

/* ----- Short landscape screens: two-column card filling the height ----- */

@media (orientation: landscape) and (max-width: 1000px) and (max-height: 700px),
       (pointer: coarse) and (orientation: landscape) and (min-width: 1100px) and (max-width: 1180px) and (max-height: 780px) {
  .enquiry {
    --enquiry-hidden: translate(-50%, calc(-50% + 100% + 96px)) scale(0.92);
    --enquiry-shown: translate(-50%, -50%) scale(1);
    top: 50%;
    width: min(820px, calc(100vw - 24px));
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 16px);
    padding: 9px;
    border-radius: 26px;
  }

  .enquiry__shell {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-content: space-between;
    column-gap: 24px;
    row-gap: clamp(4px, 1.4dvh, 8px);
    padding: clamp(15px, 5dvh, 28px) 28px clamp(12px, 3.5dvh, 20px);
    border-radius: 19px;
  }

  .enquiry__shell::after {
    inset: 7px;
    border-radius: 14px;
  }

  .enquiry__shell::before {
    right: 18px;
    bottom: 44px;
    font-size: 100px;
  }

  .enquiry__close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }

  .enquiry__kicker {
    grid-column: 1 / -1;
    margin: 0 48px 0 0;
    font-size: 11px;
    letter-spacing: 0.2em;
  }

  .enquiry__kicker::after {
    width: 30px;
    margin-left: 9px;
  }

  .enquiry__title {
    grid-column: 1;
    align-self: center;
    max-width: none;
    font-size: clamp(33px, 5vw, 42px);
    line-height: 0.94;
  }

  .enquiry__copy {
    grid-column: 2;
    align-self: center;
    max-width: none;
    margin: 0;
    font-size: 16px;
    line-height: 1.38;
  }

  .enquiry__brief {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .enquiry__brief-item {
    padding: clamp(5px, 1.6dvh, 9px) 6px;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0.07em;
  }

  .enquiry__brief-item::before {
    width: 3px;
    height: 3px;
    margin-right: 5px;
  }

  .enquiry__actions {
    grid-column: 1 / -1;
    grid-auto-rows: minmax(clamp(52px, 12dvh, 60px), 1fr);
    gap: 8px;
  }

  .enquiry__action {
    min-height: clamp(52px, 12dvh, 60px);
    grid-template-columns: 23px minmax(0, 1fr);
    gap: 8px;
    padding: clamp(6px, 1.8dvh, 9px) 12px;
    border-radius: 13px;
  }

  .enquiry__action-icon svg { width: 22px; }
  .enquiry__action-copy { gap: 2px; }

  .enquiry__action-name {
    font-size: 19px;
    letter-spacing: 0.035em;
  }

  .enquiry__action-detail {
    overflow: visible;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0.025em;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .enquiry__action-arrow { display: none; }

  .enquiry__foot {
    grid-column: 1 / -1;
    margin: 0 2px;
    font-size: 9.5px;
    line-height: 1.3;
    letter-spacing: 0.1em;
  }
}

/* Homepage on phones/tablets: the homepage drops every backdrop blur for
   scrolling performance; the overlay keeps only its dark tint. */
@media (max-width: 767px), (min-width: 768px) and (max-width: 1180px), (pointer: coarse) and (min-width: 768px) {
  body:has(.site-header--home) .enquiry-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ----- Large screens ----- */

/* Scaled card (homepage, about): the footprint is centred in the viewport and
   the card keeps its 1280×720 motion distances, magnified with it. */
@media (min-width: 1281px) and (min-height: 721px) {
  .enquiry-footprint {
    /* Beats the inline position:relative written by scale-to-fit.js. */
    position: fixed !important;
    left: 50%;
    top: 50%;
    z-index: 100001;
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  .enquiry[data-scale-active] {
    --enquiry-exit: 96px;
    --enquiry-content-offset: 22px;
  }
}

/* Unscaled card (gallery, places) on ≥1921×1081 screens: type follows the
   site-wide high-res type scale. */
@media (min-width: 1921px) and (min-height: 1081px) {
  .enquiry:not([data-scale-active]) {
    --enquiry-hi-9: clamp(9px, min(0.46875vw, 0.833333vh), 13.95px);
  }
  .enquiry:not([data-scale-active]) .enquiry__close { font-size: clamp(32px, min(1.666667vw, 2.962963vh), 48px); }
  .enquiry:not([data-scale-active]) .enquiry__kicker { font-size: clamp(13px, min(0.677083vw, 1.203704vh), 20.15px); }
  .enquiry:not([data-scale-active]) .enquiry__title { font-size: clamp(69px, min(3.59375vw, 6.388889vh), 100.05px); }
  .enquiry:not([data-scale-active]) .enquiry__copy { font-size: clamp(18px, min(0.9375vw, 1.666667vh), 27px); }
  .enquiry:not([data-scale-active]) .enquiry__brief-item,
  .enquiry:not([data-scale-active]) .enquiry__action-detail,
  .enquiry:not([data-scale-active]) .enquiry__foot { font-size: var(--enquiry-hi-9); }
  .enquiry:not([data-scale-active]) .enquiry__action-name { font-size: clamp(24px, min(1.25vw, 2.222222vh), 36px); }
  .enquiry:not([data-scale-active]) .enquiry__action-arrow { font-size: clamp(20px, min(1.041667vw, 1.851852vh), 30px); }
}

/* ----- Reduced motion ----- */

@media (prefers-reduced-motion: reduce) {
  .enquiry {
    --enquiry-hidden: translate(-50%, -50%) scale(1);
    filter: none !important;
  }

  .enquiry::after {
    animation: none !important;
  }

  .enquiry-overlay,
  .enquiry,
  .enquiry::after,
  .enquiry__shell > * {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}

@media (max-width: 620px) and (prefers-reduced-motion: reduce) {
  .enquiry {
    --enquiry-hidden: translate(-50%, 0) scale(1);
  }
}
