:root {
  --bps-blue: #005A9C;
  --bps-blue-mid: #0566AD;
  --bps-blue-light: #0A73B8;
  --bps-green-ink: #2E7D1E;
  --bps-green-ring: #6CBE45;
  --bps-orange-ink: #C44D00;
  --bps-orange-ring: #F37021;
  --ink-primary: #0F172A;
  --ink-secondary: #334155;
  --surface-white: #FFFFFF;
  --focus-ring: #FDE047;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--surface-white);
  background: linear-gradient(135deg, var(--bps-blue) 0%, var(--bps-blue-mid) 55%, var(--bps-blue-light) 100%);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
}

/* Base interactive cursor and keyboard focus indicator (R-32, R-39) */
a[href],
button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a[href]:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* Background layers */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-map {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1160px, 94vw);
  height: auto;
  opacity: 0.22;
  user-select: none;
}

.bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Top bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 20px;
  pointer-events: none;
}

.top-brand {
  display: none;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.top-brand-logo {
  width: 34px;
  height: 34px;
  background: var(--surface-white);
  border-radius: 9999px;
  padding: 5px;
  object-fit: contain;
  flex-shrink: 0;
}

.top-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.top-brand-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--surface-white);
}

.top-brand-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--surface-white);
}

.motion-toggle {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  background: rgba(0, 48, 86, 0.72);
  color: var(--surface-white);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: background-color 180ms ease, transform 160ms ease, border-color 180ms ease;
}

.motion-toggle:hover {
  background: rgba(0, 36, 66, 0.9);
  border-color: var(--surface-white);
}

.motion-toggle:active {
  transform: scale(0.97);
}

.motion-icon-play {
  display: none;
}

.motion-toggle[aria-pressed="true"] .motion-icon-pause {
  display: none;
}

.motion-toggle[aria-pressed="true"] .motion-icon-play {
  display: block;
}

/* Main centered stage */
.portal-stage {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 32px;
  text-align: center;
}

/* Hero header */
.hero-header {
  max-width: 720px;
  transition: opacity 240ms ease, transform 240ms ease;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.1vw, 2.35rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--surface-white);
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 4px 16px;
  border-radius: 12px;
  background: var(--surface-white);
  box-shadow: 0 8px 20px rgba(0, 32, 64, 0.18);
  vertical-align: middle;
}

.brand-primary {
  color: var(--bps-blue);
  font-weight: 800;
}

.brand-accent {
  color: var(--bps-orange-ink);
  font-weight: 800;
}

.hero-subtitle {
  margin: 12px 0 8px;
  font-size: clamp(0.95rem, 1.5vw, 1.125rem);
  font-weight: 400;
  color: var(--surface-white);
}

.hero-agency {
  margin: 0;
}

.agency-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 8px;
  background: var(--surface-white);
  color: var(--bps-blue);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Launcher Hub */
.launcher-hub {
  position: relative;
  width: 560px;
  max-width: 100%;
  height: 340px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.launcher-hub[data-open="true"] ~ .hero-header,
body.hub-is-open .hero-header {
  opacity: 0.25;
  transform: translateY(-8px);
}

.hub-trigger {
  position: relative;
  z-index: 4;
  width: 192px;
  height: 192px;
  padding: 26px;
  border-radius: 9999px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  background: var(--surface-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 32px rgba(0, 28, 56, 0.24);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms ease, box-shadow 260ms ease;
}

.hub-trigger:hover {
  transform: scale(1.03);
}

.hub-trigger:active {
  transform: scale(0.98);
}

.launcher-hub[data-open="true"] .hub-trigger {
  transform: translateY(54px) scale(1.03);
  border-color: var(--bps-orange-ring);
  box-shadow: 0 0 0 6px rgba(243, 112, 33, 0.28), 0 18px 38px rgba(0, 28, 56, 0.3);
}

.hub-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  pointer-events: none;
  animation: hubPulse 2.8s ease-out infinite;
}

.launcher-hub[data-open="true"] .hub-pulse {
  animation: none;
  opacity: 0;
}

@keyframes hubPulse {
  0% {
    transform: scale(0.96);
    opacity: 0.75;
  }
  80%,
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

.hub-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
}

/* Radial Orbs (Desktop & Tablet) */
.radial-menu {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.orb-link {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 148px;
  height: 148px;
  padding: 14px;
  border-radius: 9999px;
  background: var(--surface-white);
  color: var(--ink-primary);
  text-decoration: none;
  border: 2.5px solid var(--orb-ring, var(--bps-blue));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 26px rgba(0, 28, 56, 0.22);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.45);
  pointer-events: none;
  transition:
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease,
    background-color 160ms ease;
}

.orb-link[data-accent="blue"] {
  --orb-ring: #005A9C;
  --orb-ink: #005A9C;
}

.orb-link[data-accent="green"] {
  --orb-ring: #6CBE45;
  --orb-ink: #2E7D1E;
}

.orb-link[data-accent="orange"] {
  --orb-ring: #F37021;
  --orb-ink: #C44D00;
}

.launcher-hub[data-open="true"] .orb-link {
  opacity: 1;
  pointer-events: auto;
}

.launcher-hub[data-open="true"] .orb-link[data-slot="top"] {
  transform: translate(-50%, calc(-50% - 142px)) scale(1);
}

.launcher-hub[data-open="true"] .orb-link[data-slot="left"] {
  transform: translate(calc(-50% - 196px), calc(-50% + 36px)) scale(1);
}

.launcher-hub[data-open="true"] .orb-link[data-slot="right"] {
  transform: translate(calc(-50% + 196px), calc(-50% + 36px)) scale(1);
}

.launcher-hub[data-open="true"] .orb-link:hover,
.launcher-hub[data-open="true"] .orb-link:focus-visible {
  background: #F8FAFC;
}

.launcher-hub[data-open="true"] .orb-link[data-slot="top"]:hover,
.launcher-hub[data-open="true"] .orb-link[data-slot="top"]:focus-visible {
  transform: translate(-50%, calc(-50% - 148px)) scale(1.06);
}

.launcher-hub[data-open="true"] .orb-link[data-slot="left"]:hover,
.launcher-hub[data-open="true"] .orb-link[data-slot="left"]:focus-visible {
  transform: translate(calc(-50% - 200px), calc(-50% + 32px)) scale(1.06);
}

.launcher-hub[data-open="true"] .orb-link[data-slot="right"]:hover,
.launcher-hub[data-open="true"] .orb-link[data-slot="right"]:focus-visible {
  transform: translate(calc(-50% + 200px), calc(-50% + 32px)) scale(1.06);
}

.launcher-hub[data-open="true"] .orb-link:active {
  background: #E2E8F0;
}

.orb-icon {
  width: 34px;
  height: 34px;
  color: var(--orb-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.orb-icon svg {
  width: 100%;
  height: 100%;
}

.orb-label {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-primary);
  text-align: center;
  word-break: break-word;
}

/* Hint line */
.hub-hint {
  margin: 4px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--surface-white);
  transition: opacity 200ms ease;
}

body.hub-is-open .hub-hint {
  opacity: 0;
}

/* Reserved tooltip slot prevents vertical layout jump */
.tooltip-slot {
  min-height: 62px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 460px;
}

.orb-tooltip {
  width: 100%;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--surface-white);
  border: 2px solid var(--tooltip-ring, var(--bps-blue));
  color: var(--ink-primary);
  box-shadow: 0 10px 24px rgba(0, 28, 56, 0.18);
  text-align: center;
}

.orb-tooltip[data-accent="blue"] {
  --tooltip-ring: #005A9C;
}

.orb-tooltip[data-accent="green"] {
  --tooltip-ring: #6CBE45;
}

.orb-tooltip[data-accent="orange"] {
  --tooltip-ring: #F37021;
}

.orb-tooltip-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.orb-tooltip-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-secondary);
}

/* Quote pill (glassmorphism element #1) */
.quote-pill {
  margin-top: 10px;
  max-width: 580px;
  padding: 12px 22px;
  border-radius: 16px;
  background: rgba(0, 42, 78, 0.44);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.quote-text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--surface-white);
  transition: opacity 220ms ease;
}

/* Noscript fallback */
.noscript-links {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.noscript-links a {
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--surface-white);
  color: var(--bps-blue);
  font-weight: 700;
  text-decoration: none;
}

/* Mobile Dock & Bottom Sheet (hidden on desktop) */
.mobile-dock {
  display: none;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 22, 42, 0.68);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-panel {
  width: 100%;
  max-width: 540px;
  max-height: 82dvh;
  overflow-y: auto;
  background: var(--surface-white);
  color: var(--ink-primary);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(0, 20, 45, 0.25);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.sheet-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid #CBD5E1;
  background: var(--surface-white);
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 150ms ease;
}

.sheet-close:hover {
  background: #F1F5F9;
}

.sheet-close:active {
  background: #E2E8F0;
}

.sheet-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid var(--card-ring, #CBD5E1);
  background: var(--surface-white);
  color: var(--ink-primary);
  text-decoration: none;
  text-align: left;
  transition: background-color 150ms ease, transform 150ms ease;
}

.sheet-card[data-accent="blue"] {
  --card-ring: #005A9C;
  --card-ink: #005A9C;
  --card-tint: #EFF6FF;
}

.sheet-card[data-accent="green"] {
  --card-ring: #6CBE45;
  --card-ink: #2E7D1E;
  --card-tint: #F0FDF4;
}

.sheet-card[data-accent="orange"] {
  --card-ring: #F37021;
  --card-ink: #C44D00;
  --card-tint: #FFF7ED;
}

.sheet-card:hover {
  background: #F8FAFC;
}

.sheet-card:active {
  transform: scale(0.99);
  background: #F1F5F9;
}

.sheet-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--card-tint);
  color: var(--card-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sheet-card-icon svg {
  width: 26px;
  height: 26px;
}

.sheet-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sheet-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.sheet-card-desc {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink-secondary);
}

.sheet-card-host {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--card-ink);
}

/* Tablet / Medium viewport tier (768px - 959px) */
@media (max-width: 959px) and (min-width: 768px) {
  .launcher-hub {
    width: 480px;
    height: 310px;
  }

  .hub-trigger {
    width: 170px;
    height: 170px;
    padding: 22px;
  }

  .launcher-hub[data-open="true"] .hub-trigger {
    transform: translateY(48px) scale(1.03);
  }

  .orb-link {
    width: 132px;
    height: 132px;
    padding: 12px;
    gap: 6px;
  }

  .orb-icon {
    width: 28px;
    height: 28px;
  }

  .orb-label {
    font-size: 0.75rem;
  }

  .launcher-hub[data-open="true"] .orb-link[data-slot="top"] {
    transform: translate(-50%, calc(-50% - 126px)) scale(1);
  }

  .launcher-hub[data-open="true"] .orb-link[data-slot="left"] {
    transform: translate(calc(-50% - 174px), calc(-50% + 32px)) scale(1);
  }

  .launcher-hub[data-open="true"] .orb-link[data-slot="right"] {
    transform: translate(calc(-50% + 174px), calc(-50% + 32px)) scale(1);
  }

  .launcher-hub[data-open="true"] .orb-link[data-slot="top"]:hover,
  .launcher-hub[data-open="true"] .orb-link[data-slot="top"]:focus-visible {
    transform: translate(-50%, calc(-50% - 132px)) scale(1.05);
  }

  .launcher-hub[data-open="true"] .orb-link[data-slot="left"]:hover,
  .launcher-hub[data-open="true"] .orb-link[data-slot="left"]:focus-visible {
    transform: translate(calc(-50% - 178px), calc(-50% + 28px)) scale(1.05);
  }

  .launcher-hub[data-open="true"] .orb-link[data-slot="right"]:hover,
  .launcher-hub[data-open="true"] .orb-link[data-slot="right"]:focus-visible {
    transform: translate(calc(-50% + 178px), calc(-50% + 28px)) scale(1.05);
  }
}

/* Mobile viewport tier (< 768px) */
@media (max-width: 767px) {
  .top-bar {
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0, 48, 86, 0.56);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .top-brand {
    display: flex;
  }

  .motion-toggle {
    padding: 8px 10px;
  }

  .motion-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .portal-stage {
    padding: 76px 20px calc(94px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .hero-title {
    font-size: clamp(1.35rem, 5.2vw, 1.85rem);
  }

  .brand-pill {
    margin-left: 0;
    margin-top: 6px;
    padding: 4px 14px;
  }

  .launcher-hub {
    width: auto;
    height: auto;
    margin-top: 12px;
  }

  .radial-menu,
  .tooltip-slot {
    display: none;
  }

  .hub-trigger {
    width: 152px;
    height: 152px;
    padding: 20px;
  }

  .launcher-hub[data-open="true"] .hub-trigger {
    transform: none;
  }

  .hub-hint {
    margin-top: 6px;
    font-size: 0.8125rem;
  }

  .quote-pill {
    margin-top: 8px;
    padding: 10px 16px;
  }

  .quote-text {
    font-size: 0.875rem;
  }

  .mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: flex;
    justify-content: center;
    padding: 10px 20px calc(12px + env(safe-area-inset-bottom));
    background: rgba(0, 42, 78, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.22);
  }

  .dock-btn {
    width: 100%;
    max-width: 360px;
    min-height: 48px;
    padding: 10px 20px;
    border-radius: 14px;
    border: 2px solid var(--bps-orange-ring);
    background: var(--surface-white);
    color: var(--ink-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 18px rgba(0, 20, 45, 0.24);
    transition: background-color 150ms ease, transform 150ms ease;
  }

  .dock-btn svg {
    color: var(--bps-orange-ink);
  }

  .dock-btn:hover {
    background: #F8FAFC;
  }

  .dock-btn:active {
    transform: scale(0.98);
    background: #E2E8F0;
  }
}

/* Reduced motion & user pause overrides (R-39) */
body.motion-paused .hub-pulse {
  animation: none;
  opacity: 0;
}

body.motion-paused .orb-link,
body.motion-paused .hub-trigger,
body.motion-paused .hero-header,
body.motion-paused .quote-text {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .hub-pulse {
    animation: none;
    opacity: 0;
  }

  .orb-link,
  .hub-trigger,
  .hero-header,
  .quote-text,
  .motion-toggle,
  .dock-btn,
  .sheet-card {
    transition: none;
  }
}
