/* Navigation and hero */

/* Fixed + transparent over the hero; js adds .solid after a small scroll */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav.solid {
  background: rgba(10, 15, 26, 0.94);
  border-bottom-color: var(--line);
}
.nav-in { display: flex; align-items: center; height: var(--nav-h); gap: 28px; }
.brand {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  font-weight: 700; font-size: 17px; letter-spacing: 0.18em; text-decoration: none;
}
.brand img { height: 30px; width: auto; }

.menu { display: flex; align-items: center; gap: 26px; margin-left: auto; font-size: 14.5px; }
.menu > a:not(.btn), .dd-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  color: var(--text-2); font: inherit; text-decoration: none;
  background: none; border: 0; cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
}
.dd-btn span {
  margin-left: 8px; width: 7px; height: 7px; font-size: 0; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform var(--dur-fast) var(--ease);
}
.dd.open .dd-btn span { transform: rotate(-135deg) translateY(-2px); }
.menu > a:not(.btn):hover, .menu > a[aria-current="true"], .dd-btn[aria-current="true"], .dd:hover .dd-btn, .dd-btn:focus-visible { color: var(--text); }
.menu > a[aria-current="true"], .dd-btn[aria-current="true"] { box-shadow: inset 0 -2px 0 var(--accent); }

/* Products dropdown: hover/focus on mouse devices, tap-toggled .open everywhere (touch never gets reliable :hover/:focus) */
.dd { position: relative; }
.dd-panel {
  position: absolute; top: calc(100% + 12px); left: 50%; width: 400px; padding: 10px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r);
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility 0s linear var(--dur-fast);
}
/* hover bridge so the pointer can cross the gap between button and panel */
.dd-panel::before { content: ""; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
@media (hover: hover) and (pointer: fine) {
  .dd:hover .dd-panel, .dd:focus-within .dd-panel {
    opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s;
  }
}
.dd.open .dd-panel { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.dd.shut .dd-panel { opacity: 0; visibility: hidden; }
.dd-panel a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r); color: var(--text); text-decoration: none;
}
.dd-panel a:hover, .dd-panel a:focus-visible { background: var(--surface); }
.dd-panel small { display: block; color: var(--text-3); font-size: 12px; }
.pill { font: 400 10.5px var(--mono); padding: 3px 8px; border-radius: var(--r); white-space: nowrap; }
.pill.live { color: var(--green); background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.25); }
.pill.soon { color: var(--amber); background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25); }

.burger {
  display: none; margin-left: auto; width: 44px; height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer; position: relative;
}
.burger span {
  position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text);
  transition: transform var(--dur-fast) var(--ease);
}
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 25px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Hero: flat ink, centred stack (logo, headline, announcement pill, CTAs) between two stepped block towers */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(560px, 78svh, 880px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--bg);
}
.hero-in { position: relative; padding: calc(var(--nav-h) + 40px) var(--gutter) 120px; max-width: 880px; }
.hero-logo { width: min(260px, 60vw); height: auto; margin: 0 auto 28px; }
.hero-title { font-size: clamp(34px, 5.6vw, 68px); line-height: 1.08; font-weight: 300; letter-spacing: -0.045em; margin: 0 auto 26px; max-width: 14em; }
.hero-title b { font-weight: 300; color: var(--block-2); }
.hero-pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 14px 4px 4px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface);
  font-size: 13px; color: var(--text); text-decoration: none; transition: border-color var(--dur-fast) var(--ease);
}
.hero-pill:hover { border-color: var(--accent); }
.hero-pill em { font: normal 400 11px var(--mono); letter-spacing: 0.1em; padding: 4px 8px; background: var(--block-3); color: #fff; }
.pillars-row {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 0;
  margin: 28px 0 28px; font: 400 12.5px var(--mono); letter-spacing: 0.16em; color: var(--text-2);
}
.pillars-row li { padding: 0 22px; }
.pillars-row li + li { border-left: 1px solid var(--line-2); }
.hero .ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Block towers: columns of --u squares rising from the bottom edge, mirrored left and right */
.hero-tower { --u: clamp(28px, 4.6vw, 64px); position: absolute; bottom: 0; z-index: -1; display: flex; align-items: flex-end; pointer-events: none; }
.hero-tower--l { left: clamp(0px, 6vw, 120px); }
.hero-tower--r { right: clamp(0px, 6vw, 120px); }
.hero-tower i { width: var(--u); }
.hero-tower--l i:nth-child(1) { height: calc(var(--u) * 1); background: var(--block-1); }
.hero-tower--l i:nth-child(2) { height: calc(var(--u) * 3); background: linear-gradient(var(--block-2) 0 33.4%, var(--block-3) 33.4% 66.7%, var(--block-4) 66.7%); }
.hero-tower--l i:nth-child(3) { height: calc(var(--u) * 2); background: linear-gradient(var(--block-1) 0 50%, var(--block-3) 50%); }
.hero-tower--r i:nth-child(1) { height: calc(var(--u) * 2); background: linear-gradient(var(--block-2) 0 50%, var(--block-4) 50%); }
.hero-tower--r i:nth-child(2) { height: calc(var(--u) * 4); background: linear-gradient(var(--block-1) 0 25%, var(--block-2) 25% 50%, var(--block-3) 50% 75%, var(--block-4) 75%); }
.hero-tower--r i:nth-child(3) { height: calc(var(--u) * 1); background: var(--block-2); }

@media (max-width: 960px) {
  .burger { display: block; }
  .menu {
    display: flex; visibility: hidden; opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility 0s linear var(--dur-fast);
    position: absolute; top: var(--nav-h); left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 12px max(var(--gutter), env(safe-area-inset-right)) 24px max(var(--gutter), env(safe-area-inset-left)); max-height: calc(100vh - var(--nav-h)); max-height: calc(100svh - var(--nav-h)); overflow-y: auto;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .menu.open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }
  /* Scrim: dims the page under the drawer so hero content stops competing; a tap on it closes the drawer (see nav.js) */
  .nav:has(.menu.open)::after {
    content: ""; position: fixed; inset: var(--nav-h) 0 0 0; z-index: -1;
    background: rgba(3, 6, 14, 0.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  }
  /* without JS the burger cannot work: lay the links out in the page flow instead */
  html:not(.js) .nav { position: absolute; background: var(--bg); }
  html:not(.js) .nav-in { flex-wrap: wrap; height: auto; min-height: var(--nav-h); }
  html:not(.js) .burger { display: none; }
  html:not(.js) .menu { display: flex; position: static; flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; gap: 4px 20px; padding: 0 0 14px; max-height: none; background: none; border: 0; visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
  html:not(.js) .menu > a:not(.btn), html:not(.js) .dd-btn { width: auto; border: 0; font-size: 14.5px; }
  html:not(.js) .dd-panel { display: none; }
  .menu > a:not(.btn), .dd-btn { border-bottom: 1px solid var(--line); font-size: 16px; width: 100%; }
  .dd-btn { justify-content: space-between; }
  .menu > a:not(.btn), .dd-btn { -webkit-tap-highlight-color: transparent; transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
  .menu > a:not(.btn):active, .dd-btn:active { background: var(--surface); color: var(--text); }
  .dd-panel small { font-size: 13px; }
  /* The CTA stays reachable on short screens: it sticks to the drawer bottom; the halo masks rows scrolling under it */
  html.js .menu .btn { margin-top: 16px; position: sticky; bottom: calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 0 0 12px var(--bg-2), 0 28px 0 12px var(--bg-2); }
  /* Products group is collapsed until tapped so the CTA is visible without scrolling */
  .dd-panel { display: none; position: static; left: auto; width: auto; margin: 6px 0 10px; opacity: 1; visibility: visible; transform: none; }
  /* .dd.open outranks the plain rule above, so the desktop centering transform must be reset here too */
  .dd.open .dd-panel { display: block; transform: none; }
  .dd-panel::before { display: none; }
  /* Opened drawer owns the scroll; the page behind stays put */
  html.menu-open { overflow: hidden; }
  @media (prefers-reduced-motion: reduce) { .menu { transition: none; transform: none; } }
  html { scrollbar-gutter: stable; }
  .menu { overscroll-behavior: contain; }
  /* keep the bar opaque while the menu is open so links never sit on the skyline */
  .nav:has(.menu.open) { background: var(--bg); border-bottom-color: var(--line); }
}

@media (max-width: 560px) {
  .pillars-row { font-size: 11px; letter-spacing: 0.1em; }
  .pillars-row li { padding: 0 10px; }
  .pillars-row li:last-child { border-left: 0; width: 100%; }
  .hero .ctas .btn { flex: 1 1 100%; }
  .hero-in { padding-bottom: 96px; }
  .hero-tower { --u: 22px; }
}

/* Short landscape phones: the hero hugs its content instead of forcing a tall block */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: 0; }
  .hero-in { padding-top: calc(var(--nav-h) + 16px); }
  .hero-logo { width: min(180px, 30vw); margin-bottom: 14px; }
}
