/* SITE HEADER styles. Built to dist/assets/header.css.
   Colours and fonts are the brand variables defined in src/styles/main.css.
   All header motion lives here as CSS, using the site's one easing curve. */

.site-header {
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bar: 68px;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--bar); /* keeps the space before header.js runs, so nothing jumps */
  background: var(--color-ube-900);
  color: var(--color-ondark);
  font-family: var(--font-sans);
  /* 1px of the same colour below the bar hides any hairline between it and a purple hero */
  box-shadow: 0 1px 0 var(--color-ube-900);
  transition: transform 0.6s var(--ease), box-shadow 0.4s ease;
  view-transition-name: site-header;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--color-ube-900), 0 10px 30px rgb(23 8 51 / 0.28); }
.site-header.is-hidden { transform: translateY(-100%); box-shadow: none; }

.sh-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--bar);
  margin-inline: auto;
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  padding-inline: var(--gutter);
  background: var(--color-ube-900);
}

/* Logo */
.sh-logo { display: flex; align-items: center; gap: 10px; color: var(--color-ondark); text-decoration: none; }
.sh-mark { width: 24px; height: 38px; flex: none; transition: transform 0.6s var(--ease); }
.sh-logo:hover .sh-mark { transform: translateY(-2px) rotate(-4deg); }
.sh-name { display: grid; font-family: var(--font-display); font-size: 17px; line-height: 18px; letter-spacing: -0.01em; }
.sh-name b { font-weight: 600; }
.sh-name span { font-weight: 400; }

/* ------------------------------------------------------------ desktop bar */
.sh-right { display: flex; align-items: center; gap: 40px; }
.sh-nav { display: none; align-items: center; gap: 36px; }
.sh-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-block: 8px;
  border: 0;
  background: none;
  color: var(--color-ondark-2);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
}
.sh-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1.5px;
  background: var(--color-mango);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.sh-link:hover, .sh-link[aria-current], .sh-trigger[aria-expanded="true"] { color: var(--color-ondark); }
.sh-link:hover::after, .sh-link[aria-current]::after, .sh-trigger[aria-expanded="true"]::after { transform: scaleX(1); }
.sh-trigger::after { right: 15px; }

/* The small chevron beside "Services": two strokes that flip when open. */
.sh-caret {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.5s var(--ease), margin 0.5s var(--ease);
}
.sh-trigger[aria-expanded="true"] .sh-caret { margin-top: 3px; transform: rotate(225deg); color: var(--color-mango); }

.sh-cta {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--color-mango);
  color: var(--color-ube-900);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s var(--ease);
}
.sh-cta:hover { background: #ffc24d; transform: translateY(-1px); }
.sh-cta:active { transform: translateY(0) scale(0.98); }

/* -------------------------------------------------------------- mega menu */
.mm {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 100%;
  display: none;
  background: #fff;
  color: var(--color-ink);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 30px 60px -20px rgb(36 16 63 / 0.35);
  visibility: hidden;
  clip-path: inset(0 0 100% 0 round 0 0 24px 24px);
  transition: clip-path 0.45s var(--ease), visibility 0s linear 0.45s;
}
.mm.is-open {
  visibility: visible;
  clip-path: inset(0 0 -80px 0 round 0 0 24px 24px);
  transition: clip-path 0.75s var(--ease), visibility 0s;
}
.mm-wrap {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 7fr) minmax(0, 2.4fr);
  gap: 36px;
  margin-inline: auto;
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  padding: 36px var(--gutter) 30px;
}

/* Everything inside rises in, one after another; closing skips the wait. */
.mm-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.2s ease, transform 0.3s var(--ease);
}
.mm.is-open .mm-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.8s var(--ease);
  transition-delay: calc(90ms + var(--i) * 45ms);
}

.mm-title { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.mm-text { margin: 12px 0 0; color: var(--color-body); font-size: 15px; line-height: 1.5; }
.mm-all, .mm-help a { display: inline-flex; align-items: center; gap: 8px; color: var(--color-ube-600); font-size: 15px; font-weight: 600; text-decoration: none; }
.mm-all { margin-top: 18px; }
.mm-arrow { width: 17px; height: 17px; transition: transform 0.5s var(--ease); }
.mm-all:hover .mm-arrow, .mm-help a:hover .mm-arrow { transform: translateX(5px); }
.mm-help { display: grid; gap: 4px; margin-top: 28px; padding: 16px 18px; border-radius: 14px; background: var(--color-ube-100); font-size: 14px; color: var(--color-body); }

.mm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: -10px 0 0; padding: 0; list-style: none; }
.mm-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  height: 100%;
  padding: 14px;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.35s ease;
}
.mm-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--color-ube-100);
  color: var(--color-ube-600);
  transition: background-color 0.35s ease, color 0.35s ease, transform 0.6s var(--ease);
}
.mm-ic { width: 22px; height: 22px; }
.mm-copy { display: grid; gap: 3px; flex: 1; }
.mm-copy b { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.mm-copy span { color: var(--color-body); font-size: 14px; line-height: 1.45; }
.mm-go { width: 18px; height: 18px; margin-top: 3px; color: var(--color-ube-600); opacity: 0; transform: translateX(-8px); transition: opacity 0.3s ease, transform 0.5s var(--ease); }
.mm-card:hover, .mm-card:focus-visible { background: var(--color-paper); }
.mm-card:hover .mm-icon, .mm-card:focus-visible .mm-icon { background: var(--color-ube-900); color: var(--color-mango); transform: rotate(-6deg) scale(1.04); }
.mm-card:hover .mm-go, .mm-card:focus-visible .mm-go { opacity: 1; transform: none; }

.mm-feature { display: grid; align-content: start; gap: 4px; color: inherit; text-decoration: none; }
.mm-shot { display: block; overflow: hidden; margin-bottom: 12px; border-radius: 14px; aspect-ratio: 16 / 10; background: var(--color-ube-100); }
.mm-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; transform: scale(1.08); transition: transform 1.2s var(--ease); }
.mm.is-open .mm-shot img { transform: scale(1); }
.mm.is-open .mm-feature:hover .mm-shot img { transform: scale(1.05); }
.mm-flabel { color: var(--color-ube-600); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.mm-ftitle { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.mm-fgo { width: 20px; height: 20px; color: var(--color-ube-600); transition: transform 0.5s var(--ease); }
.mm-feature:hover .mm-fgo { transform: translate(3px, -3px); }
.mm-ftext { color: var(--color-body); font-size: 14px; line-height: 1.45; }

.mm-places {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  padding: 16px var(--gutter) 20px;
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: 14px;
}
.mm-places a { color: var(--color-ink); font-weight: 600; text-decoration: none; transition: color 0.3s ease; }
.mm-places a:hover { color: var(--color-ube-600); }
.mm-pin { width: 17px; height: 17px; color: var(--color-ube-600); }
.mm-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--color-ube-300); }

/* The page behind the open mega menu dims. */
.mm-scrim {
  position: fixed;
  z-index: 1;
  inset: var(--bar) 0 0 0; /* below the bar, so the bar itself stays bright */
  display: none;
  background: rgb(23 8 51 / 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.is-mega-open .mm-scrim { opacity: 1; pointer-events: auto; }

/* ---------------------------------------------- menu button (phones, tablets) */
.sh-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -9px;
  border: 0;
  background: none;
  color: var(--color-ondark);
  cursor: pointer;
}
/* Two bars that cross into an X. */
.sh-bars { position: relative; width: 24px; height: 14px; }
.sh-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.6s var(--ease), top 0.35s var(--ease) 0.25s, width 0.4s var(--ease);
}
.sh-bars span:first-child { top: 0; }
.sh-bars span:last-child { top: 12px; width: 70%; }
.sh-toggle:hover .sh-bars span:last-child { width: 100%; }
.is-menu-open .sh-bars span { top: 6px; width: 100%; transition: top 0.3s var(--ease), transform 0.6s var(--ease) 0.2s, width 0.3s var(--ease); }
.is-menu-open .sh-bars span:first-child { transform: rotate(45deg); }
.is-menu-open .sh-bars span:last-child { transform: rotate(-45deg); }

/* ------------------------------------------------------------- phone menu */
/* It opens as a circle growing from the menu button, then the links rise in. */
.sm {
  position: fixed;
  inset: var(--bar) 0 0 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-ube-900);
  visibility: hidden;
  clip-path: circle(0% at calc(100% - 34px) -34px);
  transition: clip-path 0.55s cubic-bezier(0.7, 0, 0.84, 0), visibility 0s linear 0.55s;
}
.is-menu-open .sm {
  visibility: visible;
  clip-path: circle(150% at calc(100% - 34px) -34px);
  transition: clip-path 0.9s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s;
}
html.menu-open { overflow: hidden; }

.sm-watermark {
  position: absolute;
  right: -48px;
  bottom: 40px;
  width: 260px;
  height: auto;
  color: var(--color-ondark);
  opacity: 0;
  transform: translateY(40px) rotate(-8deg);
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
  pointer-events: none;
}
.sm-watermark path:first-child { fill: var(--color-mango); }
.is-menu-open .sm-watermark { opacity: 0.06; transform: none; transition: opacity 1.4s ease 0.4s, transform 1.6s var(--ease) 0.4s; }

.sm-in { opacity: 0; transform: translateY(28px); transition: opacity 0.2s ease, transform 0.3s var(--ease); }
.is-menu-open .sm-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.9s var(--ease);
  transition-delay: calc(180ms + var(--i) * 55ms);
}

.sm nav { position: relative; }
.sm-list { margin: 0; padding: 10px 20px 0; list-style: none; }
.sm-list > li { border-bottom: 1px solid rgb(183 154 230 / 0.25); }
.sm-row { display: flex; align-items: center; justify-content: space-between; }
.sm-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex: 1;
  padding: 16px 0;
  color: var(--color-ondark);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: color 0.3s ease, transform 0.5s var(--ease);
}
.sm-link:active { transform: translateX(4px); }
.sm-num { width: 22px; flex: none; color: var(--color-ube-300); font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; }
.sm-link[aria-current] { color: var(--color-mango); }
.sm-link[aria-current] .sm-num { color: var(--color-mango); }

/* Plus that turns into a minus. */
.sm-expand { display: grid; place-items: center; width: 48px; height: 48px; margin-right: -12px; border: 0; background: none; color: var(--color-mango); cursor: pointer; }
.sm-pm { position: relative; width: 20px; height: 20px; }
.sm-pm::before, .sm-pm::after { content: ""; position: absolute; left: 0; top: 9px; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.6s var(--ease); }
.sm-pm::after { transform: rotate(90deg); }
.sm-expand[aria-expanded="true"] .sm-pm::before { transform: rotate(180deg); }
.sm-expand[aria-expanded="true"] .sm-pm::after { transform: rotate(180deg); }

.sm-sub { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.6s var(--ease), visibility 0s linear 0.6s; }
.sm-sub.is-open { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.sm-sub > ul { overflow: hidden; margin: 0; padding: 0 0 0 36px; list-style: none; }
.sm-sub li { opacity: 0; transform: translateX(-10px); transition: opacity 0.2s ease, transform 0.3s var(--ease); }
.sm-sub.is-open li { opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.7s var(--ease); transition-delay: calc(60ms + var(--j) * 40ms); }
.sm-sublink { display: flex; align-items: center; gap: 12px; padding: 11px 0; color: var(--color-ondark-2); font-size: 18px; font-weight: 500; line-height: 1.3; text-decoration: none; transition: color 0.3s ease; }
.sm-sublink:active { color: var(--color-ondark); }
.sm-subic { width: 22px; height: 22px; flex: none; color: var(--color-ube-300); }
.sm-all { display: inline-flex; align-items: center; gap: 8px; padding: 12px 0 22px; color: var(--color-mango); font-size: 16px; font-weight: 600; text-decoration: none; }
.sm-arrow { width: 18px; height: 18px; }

.sm-actions { position: relative; display: grid; gap: 12px; margin-top: auto; padding: 28px 20px; }
.sm-quote, .sm-ghost { display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; font-size: 16px; font-weight: 600; line-height: 1.2; text-decoration: none; transition: transform 0.3s var(--ease), background-color 0.3s ease; }
.sm-quote:active, .sm-ghost:active { transform: scale(0.98); }
.sm-quote { padding: 17px 22px; background: var(--color-mango); color: var(--color-ube-900); }
.sm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sm-ghost { padding: 14px 12px; border: 1.5px solid rgb(214 203 234 / 0.6); color: var(--color-ondark); }
.sm-ic { width: 20px; height: 20px; flex: none; }
.sm-place { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 0; color: var(--color-ondark-2); font-size: 15px; }
.sm-pin { width: 17px; height: 17px; color: var(--color-mango); }

/* ----------------------------------------------------------------- desktop */
@media (min-width: 1024px) {
  .site-header { --bar: 84px; }
  .sh-nav { display: flex; }
  .sh-cta { display: inline-flex; }
  .mm, .mm-scrim { display: block; }
  .mm-places { display: flex; }
  .sh-toggle, .sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header *, .site-header *::before, .site-header *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
