/* ============================
   Site chrome: the v2 nav and footer, shared by every page
   ============================ */
:root {
  --hp-max: 1600px;
  --hp-gutter: clamp(20px, 5.4vw, 96px);
  --hp-nav-height: 64px;
  --hp-green: #24684F;
  --hp-green-hover: #2B7A5D;
  --hp-gray: #262827;
  --hp-gray-hover: #313432;
  --hp-text-muted: rgba(255, 255, 255, 0.64);
}

/* ---------- Nav (v2) ---------- */
.navbar--v2 {
  padding: 0;
  height: var(--hp-nav-height);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0);
  transition: background var(--transition), box-shadow 0.2s ease;
}
.navbar--v2.is-scrolled { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08); }

/* Footer rows on the same container as the nav */
.footer { padding-left: 0; padding-right: 0; }
.footer-top,
.footer-wordmark,
.footer-bottom {
  max-width: calc(var(--hp-max) + 2 * var(--hp-gutter));
  padding-left: var(--hp-gutter);
  padding-right: var(--hp-gutter);
}
.navbar--v2 .nav-inner {
  max-width: calc(var(--hp-max) + 2 * var(--hp-gutter));
  padding: 0 var(--hp-gutter);
}
.navbar--v2 .nav-logo-img { height: 18px; }
.navbar--v2 .nav-links { gap: 28px; }
.navbar--v2 .nav-link,
.navbar--v2 .nav-dropdown-trigger { font-size: 14px; }
.navbar--v2 .nav-btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  font-size: 14px;
  border-radius: 999px;
  background: var(--hp-green);
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}
.navbar--v2 .nav-btn:hover { opacity: 1; background: var(--hp-green-hover); }
.navbar--v2 .nav-right { gap: 8px; }
.navbar--v2 .nav-divider { display: none; }

/* Every top-level item is a pill, so an open menu's trigger can light up without shifting the row */
.navbar--v2 .nav-links { gap: 4px; }
.navbar--v2 .nav-links > a,
.navbar--v2 .nav-mega-trigger,
.navbar--v2 .nav-right > .nav-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  transition: color var(--transition), background-color 0.2s ease;
}
@media (hover: hover) {
  .navbar--v2 .nav-links > a:hover,
  .navbar--v2 .nav-mega-trigger:hover,
  .navbar--v2 .nav-right > .nav-link:hover { background: rgba(255, 255, 255, 0.08); }
}
.navbar--v2 .nav-links > a:focus-visible,
.navbar--v2 .nav-right > .nav-link:focus-visible { background: rgba(255, 255, 255, 0.08); }
.nav-mega-trigger {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color var(--transition), background-color 0.2s ease;
}
.nav-mega-trigger:hover,
.nav-mega-trigger[aria-expanded="true"] { color: var(--text-primary); }
.nav-mega-trigger[aria-expanded="true"] { background: rgba(255, 255, 255, 0.08); }
.nav-mega-trigger:focus-visible,
.nav-mega a:focus-visible { outline: 2px solid var(--text-primary); outline-offset: -2px; }

/* Mega menu: one panel under the links. Sections sit on top of each other; the active one is shown,
   and components.js sets --x so a switch slides toward the menu you moved to. Square corners like
   the rest of the site. */
.nav-mega {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 1001;
  width: min(520px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0D100F;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.nav-mega.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.nav-mega-viewport {
  position: relative;
  overflow: hidden;
  transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-mega-section {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--x, 0px));
  transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-mega-section.is-active { opacity: 1; pointer-events: auto; }

.nav-mega-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.nav-mega-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  transition: background-color 0.2s ease;
}
.nav-mega-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-mega-title { font-size: 14px; font-weight: 500; line-height: 20px; color: var(--text-primary); }
.nav-mega-desc { font-size: 13.5px; line-height: 1.45; color: var(--hp-text-muted); text-wrap: pretty; }
.nav-mega-item svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: #fff;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .nav-mega-item:hover { background: rgba(255, 255, 255, 0.04); }
  .nav-mega-item:hover svg { opacity: 1; transform: none; }
}
.nav-mega-item:focus-visible svg { opacity: 1; transform: none; }
@media (max-width: 860px) {
  .nav-mega { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-mega-section { transform: none; }
  .nav-mega-viewport { transition: none; }
}

@media (min-width: 769px) {
  /* Links sit on the true page center, independent of logo/CTA widths */
  .navbar--v2 .nav-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }
  .navbar--v2 .nav-group { display: contents; }
  .navbar--v2 .nav-logo-wrap { justify-self: start; }
  .navbar--v2 .nav-right { justify-self: end; }
}
@media (min-width: 861px) and (max-width: 960px) {
  .navbar--v2 .nav-links { gap: 2px; }
  .navbar--v2 .nav-links > a,
  .navbar--v2 .nav-mega-trigger,
  .navbar--v2 .nav-right > .nav-link { padding: 0 8px; }
  .navbar--v2 .nav-right { gap: 6px; }
}
@media (min-width: 769px) and (max-width: 860px) {
  .navbar--v2 .nav-inner { display: flex; }
  .navbar--v2 .nav-group { display: none; }
  .navbar--v2 .nav-hamburger { display: flex; }
}

/* Mobile nav, after Linear's: Sign in and Get Started stay in the bar next to a two-line menu button,
   and the menu fills the screen with every group open under a small label */
.nav-mobile-actions { display: none; }
.nav-mobile-signin { font-size: 13px; color: rgba(255, 255, 255, 0.64); transition: color 0.2s ease; }
.nav-mobile-signin:hover { color: var(--text-primary); }
.nav-mobile-cta {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--hp-green);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}
.nav-mobile-cta:hover { background: var(--hp-green-hover); }
.navbar--v2 .nav-hamburger { gap: 6px; width: 32px; height: 32px; margin: 0 -7px 0 10px; }
.navbar--v2 .nav-hamburger span {
  width: 18px;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.navbar--v2 .nav-hamburger span:nth-child(2) { display: none; }
.navbar--v2 .nav-hamburger.open span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.navbar--v2 .nav-hamburger.open span:nth-child(3) { transform: translateY(-3.75px) rotate(-45deg); }
@media (max-width: 860px) {
  .navbar--v2 .nav-mobile-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
  deck-header.is-menu-open .navbar--v2 { background: #0D100F; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08); }
}
@media (max-width: 359px) {
  .nav-mobile-signin { display: none; }
}
/* --sbw is the scrollbar width the lock removes (set in components.js), so nothing shifts */
html.has-mobile-menu { overflow: hidden; padding-right: var(--sbw, 0px); }
html.has-mobile-menu .navbar--v2 { padding-right: var(--sbw, 0px); }
deck-header[variant="v2"] .mobile-menu {
  display: flex;
  top: var(--hp-nav-height);
  padding: 8px var(--hp-gutter) 48px;
  background: #0D100F;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
deck-header[variant="v2"] .mobile-menu.open { opacity: 1; visibility: visible; transition-delay: 0s; }
.mobile-menu-group { display: flex; flex-direction: column; padding-top: 28px; }
.mobile-menu-label { margin: 0 0 8px; font-size: 13px; color: rgba(255, 255, 255, 0.48); }
deck-header[variant="v2"] .mobile-menu a {
  align-self: flex-start;
  padding: 6px 0;
  border: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
}
deck-header[variant="v2"] .mobile-menu a:hover { color: var(--text-primary); }
deck-header[variant="v2"] .mobile-menu.open .mobile-menu-group { animation: hpMenuIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
deck-header[variant="v2"] .mobile-menu.open .mobile-menu-group:nth-child(2) { animation-delay: 0.04s; }
deck-header[variant="v2"] .mobile-menu.open .mobile-menu-group:nth-child(3) { animation-delay: 0.08s; }
@keyframes hpMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  deck-header[variant="v2"] .mobile-menu.open .mobile-menu-group { animation: none; }
}

/* ---------- Buttons ---------- */
.hp-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-primary);
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.2s ease, padding 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Hover arrow: padding moves from left to right so the label shifts over without the button changing width */
.hp-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 11px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) {
  .hp-btn:hover { padding: 0 32px 0 12px; }
  .hp-btn:hover::after { opacity: 1; transform: none; }
}
.hp-btn:focus-visible { padding: 0 32px 0 12px; }
.hp-btn:focus-visible::after { opacity: 1; transform: none; }
.hp-btn:active { transform: scale(0.98); }
.hp-btn:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}
.hp-btn-primary { background: var(--hp-green); }
.hp-btn-secondary { background: var(--hp-gray); }
@media (hover: hover) {
  .hp-btn-primary:hover { background: var(--hp-green-hover); }
  .hp-btn-secondary:hover { background: var(--hp-gray-hover); }
}

/* ---------- CTA (homepage variant: <deck-cta hp-buttons hp-dots>) ----------
   :where() keeps these at the specificity of the base rules so page stylesheets can still override them */
:where(.deck-cta--hp) .deck-cta-heading { max-width: 600px; font-size: clamp(40px, 5vw, 72px); }
:where(.deck-cta--hp) .deck-cta-subtitle { font-size: 20px; }
.deck-cta:where(.deck-cta--hp) {
  position: relative;
  overflow: hidden;
  padding: clamp(120px, 13vw, 220px) 24px;
}
:where(.deck-cta--hp) .deck-cta-inner { position: relative; z-index: 1; }
:where(.deck-cta--hp) .deck-cta-dots {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}
@media (max-width: 900px) {
  :where(.deck-cta--hp) .deck-cta-subtitle { font-size: 18px; }
}
@media (max-width: 768px) {
  .deck-cta:where(.deck-cta--hp) { padding: 96px 16px; }
}
:where(.deck-cta--hp) .deck-cta-actions { gap: 12px; }
