/* =========================================================
   HUWGA - LANDING PAGE v4
   Hub layout: logo dead-centre, three panels around it.
   Commercial (top-left), New Build (top-right),
   Renovation (bottom - triangular/trapezoidal).
   Dividing lines radiate from logo hub.
   Mobile: three equal vertical strips.
   ========================================================= */

/* ---------- resets ---------- */
*, *::before, *::after { box-sizing: border-box; }

.landing-body {
  background: #0f1012;
  margin: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  font-family: 'Jost', sans-serif;
}

/* ============================================================
   STAGE - full viewport, panels positioned absolute inside
   ============================================================ */
.landing {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ============================================================
   PANELS - clip-path layout (desktop)

   Hub is at 50% 48% (slightly above centre feels more balanced).
   C  = top-left  triangle:  top-left corner → top-right of left half → hub → left edge mid
   NB = top-right triangle:  hub → top-right-of-right-half → top-right corner → right edge mid
   RU = bottom trapezoid:    left bottom corner → hub-left-diagonal → hub → hub-right-diagonal → right bottom corner

   Clip paths tile perfectly - each shares edges with its neighbours.
   ============================================================ */

/* Hub coordinates: cx=50%, cy=48% */
/* We express as percentages so it scales to any viewport */

.panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: block;
  cursor: pointer;
  text-decoration: none;
  /* clip-path set per panel below */
}

/* DESKTOP clip-paths - panels tile the full screen from hub at 50%,48% */

/*
  Three panels tile the full viewport from hub at (50%, 48%):

  Commercial  (top-left):  top-left → top-centre → hub → bottom-left
  New Build   (top-right): top-centre → top-right → bottom-right → hub
  Renovation  (bottom):    bottom-left → hub → bottom-right

  The vertical divider between C and NB sits exactly at x=50%.
  The two diagonals run from hub → bottom-left and hub → bottom-right.
*/

.panel--commercial {
  clip-path: polygon(
    0%   0%,      /* top-left corner */
    50%  0%,      /* top edge - dead centre */
    50%  48%,     /* hub */
    0%   100%     /* bottom-left corner */
  );
}

.panel--newbuild {
  clip-path: polygon(
    50%  0%,      /* top edge - dead centre */
    100% 0%,      /* top-right corner */
    100% 100%,    /* bottom-right corner */
    50%  48%      /* hub */
  );
}

.panel--renovation {
  clip-path: polygon(
    0%   100%,    /* bottom-left corner */
    50%  48%,     /* hub */
    100% 100%     /* bottom-right corner */
  );
}

/* Background fills the full viewport for each panel (clip does the masking) */
.panel__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  /* --px / --py are set by landing.js for the mouse parallax */
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) scale(1.06);
  transition: transform .7s cubic-bezier(.22,.61,.36,1),
              filter .5s ease;
  filter: brightness(0.72);
}

.panel--commercial .panel__bg { inset: 0 50% 0 0; }   /* left half */
.panel--newbuild   .panel__bg { inset: 0 0 0 50%; }   /* right half */
.panel--renovation .panel__bg { inset: 48% 0 0 0; }   /* hub down to bottom */

/* darken siblings, brighten hovered */
.landing:has(.panel:hover) .panel__bg            { filter: brightness(0.42); }
.landing:has(.panel:hover) .panel:hover .panel__bg { filter: brightness(1.0); transform: translate3d(var(--px, 0px), var(--py, 0px), 0) scale(1.12); }

/* colour veils for legibility */
.panel__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.panel--commercial .panel__veil {
  background: radial-gradient(ellipse at 25% 30%,
    rgba(10,12,14,.05) 0%,
    rgba(10,12,14,.55) 100%);
}
.panel--renovation .panel__veil {
  background: radial-gradient(ellipse at 50% 85%,
    rgba(28,22,14,.05) 0%,
    rgba(28,22,14,.65) 100%);
}
.panel--newbuild .panel__veil {
  background: radial-gradient(ellipse at 80% 30%,
    rgba(22,28,24,.05) 0%,
    rgba(22,28,24,.60) 100%);
}

/* ============================================================
   PANEL CONTENT - positioned in each panel's "open" zone
   Commercial: top-left quadrant
   New Build: top-right quadrant
   Renovation: bottom-centre
   ============================================================ */
.panel__content {
  position: absolute;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none; /* clicks go through to the <a> */
}

.panel--commercial .panel__content {
  top: 18%;
  left: 7%;
  max-width: 38%;
}

.panel--newbuild .panel__content {
  top: 18%;
  right: 7%;
  left: auto;
  max-width: 38%;
  align-items: flex-end;
  text-align: right;
}

.panel--renovation .panel__content {
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  text-align: center;
  max-width: 50%;
}

/* pill labels */
.panel__pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background: rgba(255,255,255,.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 10px;
  white-space: nowrap;
}

.panel--commercial .panel__pill { color: var(--co-amber); border-color: rgba(201,123,61,.5); }
.panel--newbuild   .panel__pill { color: var(--hb-sand);  border-color: rgba(220,210,192,.45); }
.panel--renovation .panel__pill { color: #d4a96a;         border-color: rgba(212,169,106,.45); }

/* headings */
.panel__title {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 3.1rem);
  line-height: 1.1;
  margin: 0 0 10px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.panel--commercial .panel__title {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -.015em;
}

/* descriptions - hidden on smaller screens, shown when there's space */
.panel__desc {
  font-size: 1.18rem;
  font-weight: 300;
  line-height: 1.65;
  opacity: .88;
  margin: 0 0 16px;
  display: none;
}
@media (min-width: 1100px) { .panel__desc { display: block; } }

/* CTA buttons */
.panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: #fff;
  padding: 11px 20px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
  pointer-events: auto;
}
.panel--commercial .panel__cta:hover { background: var(--co-amber); border-color: var(--co-amber); }
.panel--newbuild   .panel__cta:hover { background: var(--hb-slate); border-color: var(--hb-slate); }
.panel--renovation .panel__cta:hover { background: #8a5c2e;         border-color: #8a5c2e; }
.panel__cta i { transition: transform .3s var(--ease); }
.panel__cta:hover i { transform: translateX(4px); }

/* ============================================================
   DIVIDER LINES - SVG overlay, traces the Y-shaped split
   ============================================================ */
.landing-dividers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.landing-dividers svg {
  width: 100%;
  height: 100%;
}

/* ============================================================
   HUB NODE - logo dead-centre at the junction
   ============================================================ */
.landing-hub {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  pointer-events: none;
}

.landing-hub__ring {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:#4b606080;
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow:
    0 0 0 8px rgba(255,255,255,.04),
    0 0 0 16px rgba(255,255,255,.02),
    0 24px 48px rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.landing-hub__ring img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  pointer-events: auto;
  cursor: default;
}

/* strapline below hub */
.landing-hub__strapline {
  margin-top: 22px;
  font-family: 'Comfortaa', sans-serif;
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,.9);
  text-align: center;
  text-shadow: 0 1px 10px rgba(0,0,0,.7);
  white-space: nowrap;
  pointer-events: none;
}

.landing-hub__sub {
  margin-top: 8px;
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  text-align: center;
  white-space: nowrap;
}

/* ============================================================
   CONTACT strip - top right, above everything
   ============================================================ */
.landing-contact {
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
}
.landing-contact a {
  font-family: 'Jost', sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.82);
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  transition: color .25s;
}
.landing-contact a:hover { color: #fff; }
.landing-contact .landing-contact--call {
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 100px;
  padding: 8px 16px;
}
.landing-contact .landing-contact--call:hover { background: rgba(255,255,255,.2); }

/* ============================================================
   MOBILE - stack vertically: Commercial / New Build / Renovation
   ============================================================ */
@media (max-width: 767.98px) {
  .landing-body {
    overflow-y: auto;      /* allow scroll if strips need more room */
    height: auto;
    min-height: 100dvh;
  }

  .landing {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
  }

  /* reset clip-paths on mobile */
  .panel {
    position: relative;
    clip-path: none !important;
    flex: 1 1 auto;
    min-height: 33.333dvh;   /* roughly equal thirds, but can grow */
    overflow: visible;        /* never clip content on mobile */
    inset: auto;
    display: flex;
    align-items: center;      /* centre content vertically within each strip */
  }

  /* backgrounds fill the whole strip on mobile */
  .panel--commercial .panel__bg,
  .panel--renovation .panel__bg,
  .panel--newbuild   .panel__bg {
    inset: 0;
  }

  /* hide the SVG dividers and hub ring on mobile */
  .landing-dividers { display: none; }
  .landing-hub      { display: none; }
  .landing-contact  { display: none; }

  /* reset content positioning - back to normal flow */
  .panel__content,
  .panel--commercial .panel__content,
  .panel--renovation .panel__content,
  .panel--newbuild .panel__content {
    position: relative;
    top: auto; left: auto; right: auto; bottom: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
    padding: 24px;
  }

  /* keep the first (top) panel's content clear of the logo strip */
  .panel--commercial .panel__content {
    padding-top: 120px;
  }

  /* mobile logo strip at top */
  .landing-mobile-top {
    display: flex !important;
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 50;
    flex-direction: column;
    align-items: center;
    padding: 18px 16px 0;
    pointer-events: none;
  }
  .landing-mobile-top img {
    height: 56px;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,.6));
  }
  .landing-mobile-top span {
    font-family: 'Comfortaa', sans-serif;
    font-size: 0.92rem;
    color: rgba(255,255,255,.85);
    margin-top: 6px;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 6px rgba(0,0,0,.6);
    text-align: center;
  }

  .panel__title { font-size: clamp(1.5rem, 6vw, 2rem); }
  .panel__cta   { font-size: 0.78rem; padding: 9px 16px; }

  /* darken sibling on tap - :has() works on mobile too */
  .landing:has(.panel:hover) .panel:not(:hover) .panel__bg {
    filter: brightness(0.72); /* don't darken as aggressively on mobile */
  }
}

/* Show mobile top bar only on mobile */
.landing-mobile-top { display: none; }

/* ============================================================
   ENTRANCE ANIMATION - pure CSS so it starts on first paint
   (no script needed) and runs on the compositor.
   ============================================================ */
@keyframes panel-in   { from { opacity: 0; transform: translate(var(--ix, 0px), var(--iy, 0px)); } to { opacity: 1; transform: none; } }
@keyframes fade-in    { from { opacity: 0; } to { opacity: 1; } }
@keyframes hub-in     { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes contact-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes hub-pulse  { to { box-shadow: 0 0 0 10px rgba(255,255,255,.06), 0 0 0 20px rgba(255,255,255,.025), 0 24px 48px rgba(0,0,0,.6); } }

@media (prefers-reduced-motion: no-preference) {
  .panel { animation: panel-in 1.1s cubic-bezier(.22,.61,.36,1) both; }
  .panel--commercial { --ix: -60px; --iy: -40px; }
  .panel--newbuild   { --ix:  60px; --iy: -40px; animation-delay: .08s; }
  .panel--renovation { --ix:   0px; --iy:  60px; animation-delay: .16s; }

  .landing-dividers { animation: fade-in .6s ease-out .76s both; }
  .landing-hub      { animation: hub-in .7s cubic-bezier(.34,1.4,.64,1) .91s both; }
  .landing-contact  { animation: contact-in .5s ease-out 1.31s both; }
  .landing-hub__ring{ animation: hub-pulse 2.2s ease-in-out 1.5s infinite alternate; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 767.98px) {
  /* mobile: each strip fades up from below */
  .panel--commercial, .panel--renovation, .panel--newbuild { --ix: 0px; --iy: 24px; }
}
/* ============================================================
   LEGAL STRIP - bottom of the landing splash
   ============================================================ */
.landing-legal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  padding: 0 24px;
  pointer-events: none;
}
.landing-legal a,
.landing-legal button,
.landing-legal span {
  pointer-events: auto;
  font-family: 'Jost', sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,.62);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: none;
  transition: color .25s;
}
.landing-legal a:hover,
.landing-legal button:hover { color: #fff; text-decoration: underline; }
.landing-legal span { opacity: .8; }

@media (max-width: 767.98px) {
  .landing-legal {
    position: static;
    padding: 22px 24px 30px;
    background: #24272A;
  }
}

/* ============================================================
   HUB LOGO AS A BUTTON - opens the About modal
   ============================================================ */
button.landing-hub__ring {
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  transition: background .35s ease, border-color .35s ease;
}
button.landing-hub__ring:hover { background: #4b6060b3; border-color: rgba(255,255,255,.34); }
button.landing-hub__ring img { cursor: pointer; transition: transform .45s cubic-bezier(.22,.61,.36,1); }
button.landing-hub__ring:hover img { transform: scale(1.05); }
button.landing-hub__ring:focus-visible,
.landing-mobile-top__logo:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 6px;
}

.landing-mobile-top__logo {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  border-radius: 8px;
}

/* ============================================================
   ABOUT MODAL (native <dialog>)
   ============================================================ */
.about-modal {
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  overflow: visible;
}
.about-modal::backdrop {
  background: rgba(10, 14, 14, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.about-modal[open] { animation: about-in .45s cubic-bezier(.22,.61,.36,1); }
.about-modal[open]::backdrop { animation: about-fade .35s ease; }

@keyframes about-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes about-fade { from { opacity: 0; } to { opacity: 1; } }

.about-modal__card {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 44px 44px 38px;
  border-radius: 28px;
  background: rgba(52, 68, 68, .9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.75);
  text-align: center;
}

.about-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s ease;
}
.about-modal__close:hover { background: rgba(255,255,255,.18); }
.about-modal__close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.about-modal__icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .9;
  margin: 0 auto 18px;
  display: block;
}
.about-modal__eyebrow {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: .7rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 10px;
}
.about-modal__title {
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.15;
  margin: 0 0 20px;
  color: #fff;
}
.about-modal p {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 1.04rem;
  line-height: 1.75;
  color: rgba(255,255,255,.88);
  margin: 0 0 14px;
}
.about-modal p:last-of-type { margin-bottom: 0; }

.about-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}
.about-modal__btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Jost', sans-serif;
  font-size: .9rem;
  letter-spacing: .06em;
  color: #fff;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  transition: background .25s ease, color .25s ease;
}
.about-modal__btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.about-modal__btn--primary { background: #fff; color: #344444; border-color: #fff; }
.about-modal__btn--primary:hover { background: rgba(255,255,255,.86); color: #344444; }
.about-modal__btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (max-width: 575.98px) {
  .about-modal__card { padding: 40px 22px 28px; border-radius: 22px; }
  .about-modal__btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .about-modal[open],
  .about-modal[open]::backdrop { animation: none; }
}