/* ==========================================================================
   Mirentha — the shared frame. 2026-10 redesign ("Drawn to measure").

   Loaded by every page on the site, the main pages and every app page:
   the colour and type tokens, the menu bar, the phone menu, the footer
   and the cookie note. Everything here is namespaced .mx- so it can sit
   beside styles.css and the app page kit without either touching it.

   The main pages add site.css on top. App pages keep their own kit and
   stylesheet; this file only gives them the menu bar and the footer.

   Colour comes from the mark itself: teal and gold for the strokes, the
   coral dot (used for the dot and nothing else).
   ========================================================================== */

:root {
  --mx-paper: #F3F6F7;
  --mx-band: #E7EDEF;
  --mx-white: #FFFFFF;
  --mx-ink: #0D2530;
  --mx-ink-2: #3E5661;          /* body text: 7.1:1 on paper */
  --mx-ink-3: #4F6670;          /* labels and captions: 5.6:1 on paper */
  --mx-teal: #046081;
  --mx-teal-deep: #03506A;
  --mx-teal-light: #7FC4DE;
  --mx-gold: #D5A73F;
  --mx-gold-deep: #C08C30;
  --mx-coral: #E05E4F;          /* the dot. Nothing else */
  --mx-night: #0B1D25;
  --mx-night-2: #10262F;
  --mx-night-3: #07151B;
  --mx-on-night: #E8EEF0;
  --mx-on-night-2: #9FB3BB;
  --mx-on-night-3: #8AA1AA;
  --mx-guide: rgba(4, 96, 129, .17);
  --mx-line: rgba(4, 96, 129, .2);
  --mx-line-dk: rgba(127, 196, 222, .16);

  --mx-sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mx-mono: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --mx-header-h: 72px;
  --mx-max: 1440px;
  --mx-pad: clamp(20px, 5.6vw, 80px);
  --mx-ease: cubic-bezier(.22, 1, .36, 1);
}
@media (max-width: 959px) {
  :root { --mx-header-h: 60px; }
}

/* The old frame's scroll bar along the top of app pages (made by scripts.js)
   belongs to the pill nav this file replaces. */
.scroll-progress { display: none !important; }

/* --- Shared bits ------------------------------------------------------- */

.mx-mono {
  font-family: var(--mx-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.mx-dot { color: var(--mx-coral); }

.mx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--mx-teal);
  color: #FFFFFF;
  font: 500 15px/1 var(--mx-sans);
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color .2s ease, transform .2s var(--mx-ease);
}
.mx-btn:hover { background: var(--mx-teal-deep); color: #FFFFFF; }
.mx-btn:active { transform: translateY(1px); }
.mx-btn--gold { background: var(--mx-gold); color: var(--mx-ink); }
.mx-btn--gold:hover { background: #E2B54C; color: var(--mx-ink); }
.mx-btn--sm { height: 42px; padding: 0 20px; font-size: 14px; }

.mx-skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--mx-ink);
  color: #FFFFFF;
  font: 500 14px/1 var(--mx-sans);
  text-decoration: none;
}
.mx-skip:focus { top: 12px; }

:where(.mx-header, .mx-menu, .mx-footer, .mx-cookie) :focus-visible {
  outline: 2px solid var(--mx-teal-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- The menu bar ------------------------------------------------------ */

.mx-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--mx-header-h);
  background: rgba(243, 246, 247, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid rgba(4, 96, 129, .16);
  font-family: var(--mx-sans);
  transition: transform .35s var(--mx-ease);
}
.mx-header.is-tucked { transform: translateY(-100%); }
.mx-header__in {
  max-width: var(--mx-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--mx-pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  box-sizing: border-box;
}
.mx-logo {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--mx-ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mx-logo img { display: block; width: 32px; height: 32px; }
.mx-logo span { font: 500 21px/1 var(--mx-sans); letter-spacing: -0.01em; }
.mx-nav { display: flex; align-items: center; gap: 36px; }
.mx-nav a {
  position: relative;
  color: var(--mx-ink-2);
  font: 400 15px/1 var(--mx-sans);
  text-decoration: none;
  padding: 8px 0;
  transition: color .2s ease;
}
.mx-nav a:hover, .mx-nav a[aria-current] { color: var(--mx-ink); }
.mx-nav a[aria-current]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: currentColor;
}
.mx-header__end { justify-self: end; display: flex; align-items: center; gap: 8px; }
.mx-menu-btn {
  display: none;
  width: 48px;
  height: 48px;
  margin-right: -12px;
  border: 0;
  background: none;
  color: var(--mx-ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mx-menu-btn svg { width: 24px; height: 24px; }

/* Dark grounds (Crownwind, Talespoke): the same bar in night. */
.mx-header--dark {
  background: rgba(11, 29, 37, .82);
  border-bottom-color: var(--mx-line-dk);
}
.mx-header--dark .mx-logo,
.mx-header--dark .mx-menu-btn,
.mx-header--dark .mx-nav a:hover,
.mx-header--dark .mx-nav a[aria-current] { color: var(--mx-on-night); }
.mx-header--dark .mx-nav a { color: var(--mx-on-night-2); }
.mx-header--dark .mx-btn { background: var(--mx-gold); color: var(--mx-ink); }

@media (max-width: 959px) {
  .mx-header__in { grid-template-columns: 1fr auto; }
  .mx-nav, .mx-header__cta { display: none; }
  .mx-menu-btn { display: inline-flex; }
  .mx-logo img { width: 28px; height: 28px; }
  .mx-logo span { font-size: 19px; }
}

/* --- The phone menu ---------------------------------------------------- */

.mx-menu {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  background: var(--mx-night);
  color: var(--mx-on-night);
  font-family: var(--mx-sans);
  overflow: hidden auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s;
}
.mx-menu[hidden] { display: none; }
.mx-menu.is-open { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.mx-menu__top {
  flex: none;
  height: var(--mx-header-h);
  padding: 0 var(--mx-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--mx-line-dk);
  box-sizing: border-box;
}
.mx-menu__top .mx-logo { color: var(--mx-on-night); }
.mx-menu__top .mx-menu-btn { display: inline-flex; color: var(--mx-on-night); }
.mx-menu__links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 24px var(--mx-pad) 0;
}
.mx-menu__links a {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid rgba(127, 196, 222, .14);
  color: var(--mx-on-night);
  text-decoration: none;
  transform: translateY(8px);
  opacity: 0;
  transition: transform .45s var(--mx-ease), opacity .45s ease;
}
.mx-menu.is-open .mx-menu__links a { transform: none; opacity: 1; }
.mx-menu.is-open .mx-menu__links a:nth-child(2) { transition-delay: .04s; }
.mx-menu.is-open .mx-menu__links a:nth-child(3) { transition-delay: .08s; }
.mx-menu.is-open .mx-menu__links a:nth-child(4) { transition-delay: .12s; }
.mx-menu.is-open .mx-menu__links a:nth-child(5) { transition-delay: .16s; }
.mx-menu.is-open .mx-menu__links a:nth-child(6) { transition-delay: .2s; }
.mx-menu__links .mx-mono { color: var(--mx-gold); font-size: 10px; }
.mx-menu__links b { font-weight: 400; font-size: clamp(32px, 9.6vw, 44px); line-height: 1.05; letter-spacing: -0.03em; }
.mx-menu__mark {
  position: absolute;
  right: 14px;
  bottom: 124px;
  width: min(290px, 70vw);
  height: auto;
  overflow: visible;
  pointer-events: none;
}
.mx-menu__end {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 32px var(--mx-pad) max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mx-menu__end .mx-btn { height: 54px; font-size: 16px; }
.mx-menu__end p { margin: 0; text-align: center; font-size: 14px; color: var(--mx-on-night-2); }
html.mx-menu-open { overflow: hidden; }
@media (min-width: 960px) { .mx-menu { display: none; } }

/* --- The footer -------------------------------------------------------- */

.mx-footer {
  position: relative;
  overflow: hidden;
  background: var(--mx-night-3);
  color: var(--mx-on-night);
  font-family: var(--mx-sans);
}
.mx-footer__plot {
  position: absolute;
  left: 0;
  bottom: 64px;
  width: 100%;
  height: 220px;
  opacity: .55;
  pointer-events: none;
}
.mx-footer__in {
  position: relative;
  max-width: var(--mx-max);
  margin: 0 auto;
  padding: 88px var(--mx-pad) 40px;
  box-sizing: border-box;
}
.mx-footer__top {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 48px;
  align-items: start;
}
.mx-footer__brand { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 20px; }
.mx-footer__mark { margin: 0; font: 500 clamp(56px, 6vw, 80px)/.95 var(--mx-sans); letter-spacing: -0.035em; color: var(--mx-on-night); }
.mx-footer__brand p:not(.mx-footer__mark) { margin: 0; font-size: 16px; line-height: 1.6; color: var(--mx-on-night-2); }
.mx-footer__nav { grid-column: 7 / span 6; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.mx-footer__nav div { display: flex; flex-direction: column; gap: 12px; }
.mx-footer__nav .mx-mono { margin: 0 0 6px; color: var(--mx-on-night-3); }
.mx-footer__nav a { color: var(--mx-on-night-2); font-size: 15px; line-height: 1.4; text-decoration: none; transition: color .2s ease; }
.mx-footer__nav a:hover { color: var(--mx-on-night); }
.mx-footer__base {
  margin-top: 260px;
  padding-top: 22px;
  border-top: 1px solid var(--mx-line-dk);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}
.mx-footer__base p { margin: 0; color: var(--mx-on-night-3); }
@media (max-width: 959px) {
  .mx-footer__brand, .mx-footer__nav { grid-column: 1 / -1; }
  .mx-footer__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .mx-footer__in { padding-top: 64px; }
  .mx-footer__plot { height: 150px; bottom: 60px; }
  .mx-footer__base { margin-top: 170px; }
}

/* --- The cookie note (pages with a form) --------------------------------- */

.mx-cookie {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 1050;
  width: min(380px, calc(100vw - 40px));
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--mx-night);
  color: var(--mx-on-night-2);
  font: 400 14px/1.55 var(--mx-sans);
  box-shadow: 0 24px 48px -24px rgba(7, 21, 27, .6);
  box-sizing: border-box;
  transform: translateY(16px);
  opacity: 0;
  visibility: hidden;
  transition: transform .4s var(--mx-ease), opacity .3s ease, visibility 0s linear .4s;
}
.mx-cookie.is-visible { transform: none; opacity: 1; visibility: visible; transition: transform .4s var(--mx-ease), opacity .3s ease; }
.mx-cookie p { margin: 0; }
.mx-cookie a { color: var(--mx-teal-light); }
.mx-cookie__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.mx-cookie button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--mx-line-dk);
  background: none;
  color: var(--mx-on-night);
  font: 500 14px/1 var(--mx-sans);
  cursor: pointer;
}
.mx-cookie button.is-primary { border-color: var(--mx-gold); background: var(--mx-gold); color: var(--mx-ink); }

@media (prefers-reduced-motion: reduce) {
  .mx-header, .mx-menu, .mx-menu__links a, .mx-cookie { transition: none !important; }
  .mx-menu__links a { transform: none; opacity: 1; }
}
