:root {
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --bg-card: #f4f9ff;
  --bg-subtle: #e0f2fe;
  --border: rgba(2, 132, 199, 0.16);
  --border-strong: rgba(2, 132, 199, 0.30);
  --text: #0c2340;
  --text-secondary: #1e3a5f;
  --muted: #52667a;
  --blue: #0284c7;
  --blue-bright: #0ea5e9;
  --sky: #38bdf8;
  --gold: #d97706;
  --gold-bright: #f59e0b;
  --emerald: #10b981;
  --emerald-bright: #059669;
  --teal: #0d9488;
  --amber: #d97706;
  --amber-bright: #b45309;
  --danger: #dc2626;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-card: 0 20px 50px rgba(2, 132, 199, 0.10);
  --target-size: 24px;
  color-scheme: light;
  accent-color: var(--blue-bright);
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

:where([role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) {
  display: inline-flex;
  align-items: center;
}

.hidden {
  display: none !important;
}

h1, h2, h3, th {
  text-wrap: balance;
}

p, li {
  text-wrap: pretty;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(5.25rem + env(safe-area-inset-top, 0px));
  scroll-padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  container-type: scroll-state;
}

:target {
  scroll-margin-top: calc(5.25rem + env(safe-area-inset-top, 0px));
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 65% 42% at 12% 4%, rgba(14, 165, 233, 0.16) 0%, transparent 62%),
    radial-gradient(ellipse 52% 38% at 88% 10%, rgba(245, 158, 11, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 55% 40% at 82% 48%, rgba(56, 189, 248, 0.14) 0%, transparent 62%),
    radial-gradient(ellipse 60% 42% at 15% 78%, rgba(14, 165, 233, 0.13) 0%, transparent 64%),
    radial-gradient(ellipse 48% 35% at 75% 92%, rgba(251, 191, 36, 0.11) 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f4f9ff 50%, #ffffff 100%);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  min-block-size: 100dvh;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img, video, svg {
  max-inline-size: 100%;
}

img, video {
  block-size: auto;
}

:where(a, code) {
  overflow-wrap: anywhere;
}

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding-inline: clamp(16px, 3vw, 24px);
}

/* =========================================================================
   EXECUTIVE NAVIGATION BAR (Responsive Native Popover + Inline Bar)
   ========================================================================= */
.nav-wrap,
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  transition: transform 0.22s ease;
}

@container scroll-state((scrolled: bottom) and (scrollable: top)) {
  .site-header:not(:focus-within):not(:has(.site-menu:popover-open)) {
    transform: translateY(-110%);
  }
}

.site-header.is-hidden:not(:focus-within):not(:has(.site-menu:is(:popover-open, .\:popover-open))) {
  transform: translateY(-110%);
}

.site-header.is-measuring * {
  transition: none !important;
}

.top-nav {
  max-width: 1220px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(2, 132, 199, 0.18);
  border-radius: 16px;
  padding: 9px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  box-shadow: 0 14px 36px rgba(2, 132, 199, 0.10);
}

.site-header:not(.is-wide) .brand-mark {
  margin-inline-end: auto;
}

.site-header.is-wide .top-nav {
  flex-wrap: nowrap;
}

.site-header.is-wide .top-nav > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-button {
  anchor-name: --menu-button;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-inline-size: 0;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.brand-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: block;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.footer-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
  animation: pulseDot 2.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.22); }
}

.brand-subtag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.30);
  color: var(--amber-bright);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  transition: color 0.16s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

@supports not selector(:popover-open) {
  [popover]:not(.\:popover-open) {
    display: none;
  }
}

.site-header .site-menu[popover] {
  position: fixed;
  inset: auto;
  inset-block-start: calc(4.75rem + env(safe-area-inset-top, 0px));
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: max(1rem, env(safe-area-inset-right, 0px));
  inline-size: min(82dvw, 20rem);
  max-inline-size: calc(100dvw - 2rem);
  block-size: fit-content;
  max-block-size: calc(100dvh - 6rem);
  margin-block-start: 0.5rem;
  padding: 10px;
  list-style: none;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(12, 35, 64, 0.18);
  color: var(--text);
  opacity: 0;
  translate: 0 -6px;
  transition: opacity 0.18s ease, translate 0.18s ease, display 0.18s ease, overlay 0.18s ease;
  transition-behavior: allow-discrete;
}

.site-header .site-menu[popover]:is(:popover-open, .\:popover-open) {
  display: grid;
  gap: 4px;
  opacity: 1;
  translate: 0 0;
}

@starting-style {
  .site-header .site-menu[popover]:is(:popover-open, .\:popover-open) {
    opacity: 0;
    translate: 0 -6px;
  }
}

.site-header .site-menu[popover] a {
  display: flex;
  align-items: center;
  inline-size: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
}

.site-header .site-menu[popover] a:hover,
.site-header .site-menu[popover] a:focus-visible {
  background: var(--bg-subtle);
  color: var(--blue);
}

.site-header .site-menu a[aria-current="page"] {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.site-header.is-wide .menu-button {
  display: none;
}

.site-header.is-wide .site-menu {
  position: static;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 18px;
  inline-size: auto;
  max-inline-size: none;
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  translate: none;
}

.site-header.is-wide .site-menu::backdrop {
  display: none;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.email-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--blue);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.10);
  border: 1px solid rgba(14, 165, 233, 0.28);
  white-space: nowrap;
}

.email-pill:hover {
  background: rgba(14, 165, 233, 0.18);
}

@media (max-width: 820px) {
  .email-pill {
    display: none;
  }
  .nav-actions:not(:has(> :not(.email-pill))) {
    display: none;
  }
}

@media (max-width: 640px) {
  .brand-subtag {
    display: none;
  }
  .top-nav {
    padding: 7px 10px;
    gap: 6px;
  }
  .brand-mark {
    font-size: clamp(0.66rem, 0.5rem + 0.75vw, 0.84rem);
    letter-spacing: 0.01em;
    gap: 5px;
  }
  .brand-logo {
    width: 22px;
    height: 22px;
  }
  .site-nav,
  .nav-actions {
    gap: 6px;
  }
  .top-nav .btn-sm {
    padding: 7px 9px;
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .nav-wrap,
  .site-header {
    padding-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px));
  }
  .top-nav {
    padding: 6px 8px;
    gap: 5px;
  }
  .top-nav .admin-label {
    display: none;
  }
  .top-nav .menu-button {
    padding: 6px 8px;
    gap: 5px;
  }
}

/* =========================================================================
   BUTTONS & INTERACTIVE CONTROLS
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-inline-size: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: normal;
}

.top-nav .btn {
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(2px);
}

.btn:focus-visible,
.chip:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.btn-sm {
  padding: 8px 13px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 13px 22px;
  font-size: 0.94rem;
}

.btn-emerald {
  background: linear-gradient(180deg, #10b981 0%, #059669 50%, #047857 100%);
  color: #ffffff;
  border-color: rgba(167, 243, 208, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 0 #065f46, 0 10px 26px rgba(5, 150, 105, 0.28);
}

.btn-emerald:hover {
  background: linear-gradient(180deg, #059669 0%, #047857 55%, #065f46 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 5px 0 #064e3b, 0 14px 32px rgba(4, 120, 87, 0.36);
}

.btn-emerald:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 #065f46, 0 4px 12px rgba(5, 150, 105, 0.24);
}

.btn-amber {
  background: linear-gradient(180deg, #fde047 0%, #fbbf24 45%, #f59e0b 100%);
  color: #0c2340;
  border-color: rgba(254, 240, 138, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 0 #b45309, 0 10px 24px rgba(245, 158, 11, 0.24);
}

.btn-amber:hover {
  background: linear-gradient(180deg, #fef08a 0%, #fde047 45%, #fbbf24 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 5px 0 #b45309, 0 14px 30px rgba(245, 158, 11, 0.32);
}

.btn-amber:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 0 #b45309, 0 4px 10px rgba(245, 158, 11, 0.2);
}

.btn-ghost {
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 0 #bae6fd, 0 8px 18px rgba(2, 132, 199, 0.12);
}

.btn-ghost:hover {
  background: linear-gradient(180deg, #ffffff 0%, #e0f2fe 100%);
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 5px 0 #bae6fd, 0 12px 22px rgba(2, 132, 199, 0.18);
}

.btn-ghost:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 0 #bae6fd, 0 3px 8px rgba(2, 132, 199, 0.12);
}

/* =========================================================================
   SHARED FOOTER
   ========================================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 max(6.25rem, calc(5rem + env(safe-area-inset-bottom, 0px)));
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.footer a {
  color: var(--emerald-bright);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
