/* ═══════════════════════════════════════════════════
   layout.css — shared header + footer for all sub-pages
   Mirrors the EXACT header from index.html (util bar + on-dark nav)
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --indigo-950: #0D0A24;
  --indigo-900: #14102E;
  --indigo-700: #2A246A;
  --indigo-600: #3A309A;
  --indigo-500: #4F44C4;
  --gold-500:   #F3B430;
  --gold-400:   #F9C859;
  --cyan-400:   #46D2FF;
  --cyan-glow:  rgba(70,210,255,.55);
  --sl-border:  rgba(255,255,255,.08);
  --sl-pad:     clamp(16px,6vw,80px);
  --maxw:       1240px;
  --gutter:     40px;
  --sans:       'Hanken Grotesk', system-ui, sans-serif;
  --mono:       'JetBrains Mono', ui-monospace, monospace;
}

/* ── RESET ─────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }

/* ── PAGE OFFSET for sticky util+header (42px util + 80px header = 122px) */
body.sl-page {
  padding-top: 0;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ── WRAP — same as index.html .wrap ─────────────── */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── UTILITY BAR ─────────────────────────────────── */
.util {
  background: #040312;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  font-family: var(--sans);
}
.util .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 42px;
}
.util-left { display: flex; gap: 26px; }
.util-left span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.util-left svg { opacity: .7; flex-shrink: 0; }
.util-right {
  display: flex;
  gap: 22px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.util-right a {
  color: rgba(255,255,255,.72);
  text-decoration: none;
  transition: color .15s;
}
.util-right a:hover { color: var(--gold-400); }
.util-right .portal-link {
  color: var(--gold-400);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── HEADER ─────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 400;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.1);
  transition: background .3s, box-shadow .3s, border-color .3s;
}
.header .wrap {
  display: flex;
  align-items: center;
  height: 80px;
  gap: 24px;
}

/* ── BRAND ───────────────────────────────────────── */
.brand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  position: relative;
}
.brand img { height: 38px; width: auto; display: block; }
.brand .logo-light { display: none; }

/* ── NAV LINKS ───────────────────────────────────── */
.nav {
  display: flex;
  gap: 2px;
  justify-content: center;
  flex: 1;
  min-width: 0;
}
/* top-level nav items — both plain <a> and dropdown wrappers */
.nav > a,
.nav-dd-wrap > .nav-top {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  color: rgba(255,255,255,.86);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .15s, color .15s;
  cursor: pointer;
  background: none;
  border: none;
}
.nav > a:hover,
.nav > a.sl-active,
.nav-dd-wrap:hover > .nav-top,
.nav-dd-wrap > .nav-top.sl-active {
  background: rgba(255,255,255,.10);
  color: #fff;
}
.nav > a svg, .nav-top svg { opacity: .6; flex-shrink: 0; }
.nav > a:hover svg, .nav > a.sl-active svg,
.nav-dd-wrap:hover .nav-top svg { opacity: 1; }

/* ── DROPDOWN ────────────────────────────────────── */
.nav-dd-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
/* Transparent bridge fills the gap between nav item and dropdown
   so the mouse never leaves the hover zone while moving down */
.nav-dd-wrap::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 12px;
  background: transparent;
  z-index: 599;
  display: none;
}
.nav-dd-wrap:hover::after,
.nav-dd-wrap.dd-open::after {
  display: block;
}
.nav-dd {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: rgba(10,8,30,.97);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 8px;
  min-width: 210px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s, visibility .18s, transform .18s;
  z-index: 600;
  pointer-events: none;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.nav-dd.dd-wide { min-width: 240px; }
/* CSS hover (instant open) */
.nav-dd-wrap:hover .nav-dd,
.nav-dd-wrap:focus-within .nav-dd,
/* JS-controlled open class (delayed close) */
.nav-dd-wrap.dd-open .nav-dd {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}
.nav-dd a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .14s, color .14s;
}
.nav-dd a:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-dd a.sl-active { color: #F3B430; }
.nav-dd-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--dd-dot, rgba(255,255,255,.25));
}
.nav-dd-sep {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 5px 8px;
}

/* ── HEADER CTA ──────────────────────────────────── */
.header-cta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 100px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  transition: transform .18s, box-shadow .18s, background .18s, color .18s;
}
.btn svg { width: 16px; height: 16px; }

.btn-talk {
  background: linear-gradient(120deg, var(--indigo-600), var(--indigo-500));
  color: #fff !important;
  border: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 12px 30px -12px var(--cyan-glow);
}
.btn-talk:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 16px 40px -12px var(--cyan-glow);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.8);
  padding: 10px 14px;
}
.btn-ghost:hover { border-color: rgba(255,255,255,.5); color: #fff; }

/* ── HAMBURGER ───────────────────────────────────── */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.15);
  background: none;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── ON-DARK VARIANT (always used on sub-pages) ──── */
.header.on-dark {
  background: rgba(7,6,22,.92);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--sl-border);
}
.header.on-dark .brand .logo-dark  { display: none; }
.header.on-dark .brand .logo-light { display: block; }
.header.on-dark .nav > a { color: rgba(255,255,255,.86); }
.header.on-dark .nav > a:hover,
.header.on-dark .nav > a.sl-active {
  background: rgba(255,255,255,.10);
  color: #fff;
}

/* ── MOBILE DRAWER ───────────────────────────────── */
.sl-drawer {
  display: none;
  position: sticky;
  top: 80px;
  left: 0;
  right: 0;
  background: #0D0A24;
  border-bottom: 1px solid var(--sl-border);
  z-index: 399;
  padding: 16px var(--gutter) 20px;
  flex-direction: column;
  gap: 4px;
}
.sl-drawer.sl-open { display: flex; }
.sl-drawer a {
  font-family: var(--sans);
  font-size: .95rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  transition: background .2s, color .2s;
}
.sl-drawer a:hover,
.sl-drawer a.sl-active { background: rgba(255,255,255,.07); color: #fff; }
.sl-drawer .sl-cta-m {
  margin-top: 8px;
  text-align: center;
  background: linear-gradient(120deg, var(--indigo-600), var(--indigo-500));
  color: #fff !important;
  font-weight: 700;
  border-radius: 8px;
  padding: 12px;
}

/* ── FOOTER ─────────────────────────────────────── */
.sl-footer {
  background: #130F35;
  border-top: 1px solid var(--sl-border);
  padding: 56px var(--gutter) 32px;
  font-family: var(--sans);
}
.sl-footer-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.sl-footer-brand img { height: 30px; display: block; margin-bottom: 16px; }
.sl-footer-brand p {
  font-size: .85rem;
  color: rgba(255,255,255,.4);
  line-height: 1.7;
  max-width: 240px;
  margin-bottom: 16px;
}
.sl-footer-brand address {
  font-style: normal;
  font-size: .8rem;
  color: rgba(255,255,255,.28);
  line-height: 1.75;
}
.sl-footer-brand address .gold { color: var(--gold-500); }
.sl-footer-col h5 {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  margin: 0 0 16px;
}
.sl-footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
.sl-footer-col ul li a {
  font-size: .85rem;
  color: rgba(255,255,255,.48);
  text-decoration: none;
  transition: color .2s;
}
.sl-footer-col ul li a:hover { color: #fff; }

.sl-footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.sl-footer-bottom span { font-size: .78rem; color: rgba(255,255,255,.22); }
.sl-footer-bottom-links { display: flex; gap: 20px; }
.sl-footer-bottom-links a {
  font-size: .78rem;
  color: rgba(255,255,255,.3);
  text-decoration: none;
  transition: color .2s;
}
.sl-footer-bottom-links a:hover { color: rgba(255,255,255,.6); }

/* ── STANDARD CONTENT CONTAINER ─────────────────── */
.sl-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(16px,6vw,80px);
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media(max-width:1240px) {
  .header .wrap { gap: 16px; }
  .nav { gap: 0; }
  .nav > a { font-size: 13px; padding: 8px 9px; }
  .nav > a svg { width: 9px; height: 9px; }
}
@media(max-width:1040px) {
  .nav { display: none; }
  .header-cta { display: none; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
}
@media(max-width:680px) {
  .util-left { display: none; }
  .wrap { padding: 0 20px; }
  .sl-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media(max-width:500px) {
  .sl-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .sl-footer-brand p,
  .sl-footer-brand address { max-width: 100%; }
}

/* ── VIEW TRANSITIONS — only body swaps; header/footer stay naturally persistent ── */
@view-transition { navigation: auto; }

/* Header, util bar, footer: opt out — they live outside #page-content and
   never change. Giving them view-transition-name causes the browser to lift
   them out of sticky context during the snapshot, producing a visible shake. */
.util, .header, .sl-footer { view-transition-name: none; }

main#page-content { view-transition-name: page-main; }

/* Page body: quick fade + subtle upward slide */
::view-transition-old(page-main) { animation: 140ms ease-out both vt-slide-out; }
::view-transition-new(page-main) { animation: 180ms ease-in  50ms both vt-slide-in; }
@keyframes vt-slide-out { to   { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-slide-in  { from { opacity: 0; transform: translateY(6px);  } }
