/* HeyHi design system: the header, its Products menu, the phone menu sheet, the footer and back-to-top. */

/* ---------- Header ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--night-text);
  /* Solid by default so it works without JavaScript; clear only while the page sits at the very top */
  background: color-mix(in srgb, var(--night-900) 93%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 1px 0 var(--night-line);
  transition: background-color 0.3s, box-shadow 0.3s;
}
.site-nav.is-top:not(.is-open) { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Every page's first section takes .band--first, which leaves room for the fixed header above its content */
.band--first { padding-top: calc(var(--nav-h) + clamp(48px, 6vw, 96px)); }

.site-nav__inner { display: flex; align-items: center; gap: 28px; height: var(--nav-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--night-text); text-decoration: none; }
.brand .mark { width: 30px; }
.brand__word { font-size: 21px; font-weight: 760; font-stretch: 112%; letter-spacing: -0.03em; }

.site-nav__links { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-pill);
  background: transparent; cursor: pointer;
  font-size: 14.5px; font-weight: 520; color: var(--night-muted); text-decoration: none; transition: color 0.2s, background-color 0.2s;
}
.nav-link:hover, .nav-link[aria-expanded="true"], .nav-link[aria-current="page"] { color: var(--night-text); background: rgba(140, 180, 230, 0.08); }
.nav-link .icon { width: 14px; height: 14px; transition: transform 0.25s var(--ease); }
.nav-link[aria-expanded="true"] .icon { transform: rotate(180deg); }

/* Products menu: a panel of every product, from config/products.yml */
.nav-products { position: relative; }
.nav-products__panel {
  position: absolute; top: calc(100% + 12px); left: -12px; width: min(560px, calc(100vw - 32px));
  padding: 10px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--night-700), var(--night-850));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 0 1px var(--night-line-strong), 0 40px 90px -30px rgba(0, 3, 10, 0.9);
}
.nav-products__list {
  list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  /* However many products there are, the menu fits the window and scrolls */
  max-height: calc(100dvh - var(--nav-h) - 120px); overflow-y: auto; overscroll-behavior: contain;
}
.nav-product { display: grid; gap: 6px; padding: 14px; border-radius: var(--r-md); text-decoration: none; transition: background-color 0.2s; }
.nav-product:hover, .nav-product:focus-visible { background: rgba(140, 180, 230, 0.08); }
.nav-product__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nav-product__name { font-size: 15px; font-weight: 650; font-stretch: 104%; color: var(--night-text); }
.nav-product__tagline { font-size: 13.5px; line-height: 1.45; color: var(--night-muted); }
.nav-products__all {
  display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding: 12px 14px; border-top: 1px solid var(--night-line);
  font-size: 13.5px; font-weight: 560; color: var(--night-text); text-decoration: none;
}
.nav-products__all:hover { color: var(--signal); }

.site-nav__right { display: flex; align-items: center; gap: 14px; flex: none; }
.nav-phone {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  font-family: var(--font-mono); font-stretch: var(--mono-w); font-size: 12px; letter-spacing: 0.02em; color: var(--night-muted);
}
.nav-phone .dot { color: var(--ok); }
.nav-phone b { color: var(--night-text); font-weight: 500; }
.nav-phone:hover b { color: var(--signal); }

.menu-toggle {
  display: none; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%;
  border: 1px solid var(--night-line-strong); background: transparent; color: var(--night-text); cursor: pointer;
}
.menu-toggle .icon { width: 20px; height: 20px; }
.menu-toggle__close, .site-nav.is-open .menu-toggle__open { display: none; }
.site-nav.is-open .menu-toggle__close { display: block; }

/* The phone menu sheet: only on small screens, and only while open */
.site-menu { display: none; }

@media (max-width: 1120px) { .nav-phone__label { display: none; } }
@media (max-width: 980px) {
  .site-nav__links, .nav-phone { display: none; }
  .site-nav__inner { justify-content: space-between; }
  .menu-toggle { display: grid; }
  .site-nav.is-open .site-menu { display: block; max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; padding-bottom: 24px; border-top: 1px solid var(--night-line); }
  .site-menu__heading { margin-top: 18px; font-family: var(--font-mono); font-stretch: var(--mono-w); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--night-faint); }
  .site-menu__list { list-style: none; display: grid; padding-top: 6px; }
  .site-menu__list a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px;
    font-size: 18px; font-weight: 560; font-stretch: 106%; text-decoration: none; border-bottom: 1px solid var(--night-line);
  }
  .site-menu__foot { display: grid; gap: 16px; margin-top: 22px; }
  .site-menu__phone { text-align: center; font-family: var(--font-mono); font-stretch: var(--mono-w); font-size: 13px; color: var(--night-muted); text-decoration: none; }
  .site-menu__phone b { color: var(--night-text); font-weight: 500; }
}
@media (max-width: 420px) { .nav-cta { display: none; } }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; overflow: hidden; padding-block: clamp(64px, 7vw, 104px) 96px; /* clear of the AI launcher */
  background: var(--night-950); color: var(--night-muted); font-size: 14.5px; border-top: 1px solid var(--night-line);
}
.site-footer__top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.site-footer__brand { display: grid; gap: 16px; align-content: start; max-width: 22rem; }
.site-footer__brand p { line-height: 1.6; }
.site-footer__say { display: flex; align-items: baseline; gap: 10px; color: var(--night-text); }
.site-footer__say .mono { font-size: 12.5px; color: var(--voice); }
.site-footer__col { display: grid; gap: 14px; align-content: start; }
.site-footer__heading { font-family: var(--font-mono); font-stretch: var(--mono-w); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--night-faint); }
.site-footer__col ul { list-style: none; display: grid; gap: 10px; }
.site-footer__col a, .site-footer__link-button { color: var(--night-muted); text-decoration: none; transition: color 0.2s; }
.site-footer__col a:hover, .site-footer__link-button:hover { color: var(--night-text); }
.site-footer__link-button { padding: 0; border: 0; background: none; cursor: pointer; font-size: inherit; }
.site-footer__status { margin-left: 8px; font-family: var(--font-mono); font-stretch: var(--mono-w); font-size: 11px; color: var(--night-faint); }
.site-footer__contact li { display: flex; align-items: center; gap: 10px; }
.site-footer__contact .icon { color: var(--night-faint); }
.site-footer__word {
  margin-top: clamp(48px, 7vw, 96px); text-align: center; user-select: none;
  font-size: clamp(5rem, 1rem + 19vw, 19rem); font-stretch: 116%; font-weight: 820; letter-spacing: -0.06em; line-height: 0.78;
  color: transparent; background: linear-gradient(180deg, rgba(150, 192, 240, 0.16), rgba(150, 192, 240, 0.015) 85%); -webkit-background-clip: text; background-clip: text;
}
.site-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--night-line); font-size: 13.5px; }
.site-footer__bottom .mono { font-size: 11.5px; letter-spacing: 0.04em; }
@media (max-width: 900px) { .site-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .site-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .site-footer__top { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--night-800); color: var(--night-text); border: 1px solid var(--night-line-strong);
  box-shadow: 0 16px 40px -16px rgba(0, 3, 10, 0.8);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top__icon { transform: rotate(-90deg); }
