/* ==========================================================================
   Sixth Protocol — foundations
   Design tokens, reset, shared chrome (header, mobile menu, footer, buttons)
   and the keyframe library. Loaded by every page.

   Accent tokens below are the `cyan` theme resolved by fx.js applyTheme();
   they are re-written at runtime on :root when a different accent is chosen.
   ========================================================================== */

:root {
  /* Accent, kept in sync with THEMES.brand in assets/js/fx.js. --ac1 is the
     logo blue, so the mark never sits next to a slightly different blue. */
  --ac1: #3b82c6;
  --ac2: #2563eb;
  /* Accent as text. The fill blue is 3.9:1 on this background, short of AA, so
     text uses a darkened cut. fx.js recomputes this per theme on load. */
  --acText: #3473af;
  --acBorder: rgba(59, 130, 198, .5);
  --acGlow: rgba(59, 130, 198, .32);
  --acSpot: rgba(59, 130, 198, .08);
  --acSoft: rgba(59, 130, 198, .14);
  --acFaint: rgba(59, 130, 198, .05);
  --ac2Soft: rgba(37, 99, 235, .12);

  /* The logo blue. Same value as --ac1 by design. */
  --brand: #3b82c6;

  /* Surface + ink */
  --bg: #fafbfd;
  --panel: #fff;
  --ink: #0b1220;
  --on-accent: #04070d;

  --ink-65: rgba(15, 23, 42, .65);
  --ink-62: rgba(15, 23, 42, .62);
  --ink-60: rgba(15, 23, 42, .6);
  --ink-55: rgba(15, 23, 42, .55);
  --ink-48: rgba(15, 23, 42, .48);
  --ink-45: rgba(15, 23, 42, .45);
  --ink-40: rgba(15, 23, 42, .4);
  --ink-35: rgba(15, 23, 42, .35);
  --ink-30: rgba(15, 23, 42, .3);
  --ink-28: rgba(15, 23, 42, .28);

  /* Hairlines, graded light → heavy */
  --hair-1: rgba(11, 18, 38, .06);
  --hair-2: rgba(11, 18, 38, .07);
  --hair-3: rgba(11, 18, 38, .08);
  --hair-4: rgba(11, 18, 38, .1);
  --hair-5: rgba(11, 18, 38, .14);
  --tint: rgba(11, 18, 38, .024);
  --tint-soft: rgba(11, 18, 38, .02);

  /* Layout */
  --shell: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --header-h: 64px;
  --section-y: clamp(84px, 10vw, 150px);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: clip;
}

a { color: var(--acText); text-decoration: none; }
a:hover { color: var(--ac2); }

img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; }
input, textarea, button { font-family: inherit; }
[hidden] { display: none !important; }

::selection { background: rgba(59, 130, 198, .3); color: #08213a; }

:focus-visible {
  outline: 2px solid var(--ac1);
  outline-offset: 3px;
  border-radius: 4px;
}

.sp-skip {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -160%);
  z-index: 200;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--hair-5);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  transition: transform .2s ease;
}
.sp-skip:focus-visible { transform: translate(-50%, 0); }

.sp-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Motion library
   -------------------------------------------------------------------------- */

@keyframes spDrift1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(56px, -38px) scale(1.1); }
  100% { transform: translate(-28px, 30px) scale(.96); }
}
@keyframes spDrift2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-64px, 44px) scale(1.07); }
  100% { transform: translate(36px, -26px) scale(.97); }
}
@keyframes spMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes spGrad {
  from { background-position: 0% center; }
  to   { background-position: 200% center; }
}
@keyframes spPulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.3); }
}
@keyframes spDot {
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(12px); }
}
@keyframes spOrbit    { from { transform: rotate(0deg); }   to { transform: rotate(360deg); } }
@keyframes spOrbitRev { from { transform: rotate(0deg); }   to { transform: rotate(-360deg); } }
/* Drifting logo tiles. Three vectors so a cluster never moves in unison; the
   float lives on an inner element because the slot owns the centring transform. */
@keyframes spFloatA { from { transform: translate(0, 0); }   to { transform: translate(7px, -15px); } }
@keyframes spFloatB { from { transform: translate(0, 0); }   to { transform: translate(-10px, -9px); } }
@keyframes spFloatC { from { transform: translate(0, 0); }   to { transform: translate(9px, 11px); } }

@keyframes spPing {
  0%   { transform: translate(-50%, -50%) scale(.5);  opacity: .9; }
  100% { transform: translate(-50%, -50%) scale(1.7); opacity: 0; }
}

/* The `motion` prop and the OS setting both park every looping animation.
   Scroll-triggered effects are handled in JS by fx.js. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

:root[data-motion="reduced"] {
  --sp-loop-state: paused;
}
:root[data-motion="reduced"] .sp-anim,
:root[data-motion="reduced"] [data-orbit-anim] {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  html { --sp-loop-state: paused; }
  .sp-anim,
  [data-orbit-anim] { animation-play-state: paused !important; }
}

/* The `ambient` prop toggles the drifting background auras. */
:root[data-ambient="false"] .sp-aura { display: none; }

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.sp-shell {
  max-width: var(--shell);
  margin-inline: auto;
}

.sp-section {
  position: relative;
  padding: var(--section-y) var(--gutter);
}

.sp-section--ruled { border-top: 1px solid var(--hair-1); }

.sp-eyebrow {
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--acText);
  margin-bottom: 18px;
}

.sp-h2 {
  margin: 0;
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.06;
}

.sp-lede {
  margin: 18px 0 0;
  max-width: 620px;
  font-size: clamp(15.5px, 1.6vw, 18px);
  line-height: 1.65;
  color: var(--ink-62);
}

.sp-grad-text {
  background: linear-gradient(100deg, var(--ac1), var(--ac2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sp-aura {
  position: absolute;
  border-radius: 50%;
  aspect-ratio: 1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Buttons + link affordances
   -------------------------------------------------------------------------- */

.sp-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  padding: 15px 30px;
  transition: transform .25s, box-shadow .25s, border-color .25s, color .25s;
}

.sp-btn--primary {
  background: linear-gradient(135deg, var(--ac1), var(--ac2));
  color: var(--on-accent);
}
.sp-btn--primary:hover { color: var(--on-accent); }

.sp-btn--ghost {
  border: 1px solid rgba(11, 18, 38, .16);
  color: var(--ink);
  font-weight: 500;
  padding: 14px 28px;
}

@media (hover: hover) {
  .sp-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 44px -10px var(--acGlow);
  }
  .sp-btn--ghost:hover {
    border-color: var(--acBorder);
    color: var(--acText);
    transform: translateY(-2px);
  }
}

.sp-arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: .18em;
  color: var(--acText);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.sp-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(250, 251, 253, .72);
  border-bottom: 1px solid var(--hair-1);
}

.sp-header__bar {
  max-width: var(--shell);
  margin-inline: auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-inline: var(--gutter);
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}
.sp-brand:hover { color: var(--ink); }

/* Numeral-only mark. The full lockup carries SIXTH inside the counter, which
   stops resolving below ~96px, so the chrome pairs the numeral with the
   wordmark instead. */
.sp-brand__mark {
  width: 29.9px;
  height: 40px;
  display: block;
  flex: none;
}

.sp-brand__name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .22em;
}

.sp-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.sp-nav__link {
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--ink-60);
  transition: color .2s;
}
.sp-nav__link:hover { color: var(--acText); }
.sp-nav__link[aria-current="page"] { color: var(--acText); }

.sp-nav__cta {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, var(--ac1), var(--ac2));
  color: var(--on-accent);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 999px;
  transition: transform .25s, box-shadow .25s;
}
.sp-nav__cta:hover { color: var(--on-accent); }

@media (hover: hover) {
  .sp-nav__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px -8px var(--acGlow);
  }
}

/* Hamburger — the design swaps nav for the burger below 800px */
.sp-burger {
  width: 42px;
  height: 42px;
  border: 1px solid var(--hair-5);
  border-radius: 12px;
  background: rgba(11, 18, 38, .03);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  flex: none;
}
.sp-burger span {
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  display: block;
}
.sp-burger span:last-child {
  width: 12px;
  background: var(--ac1);
  align-self: flex-start;
  margin-left: 12px;
}

@media (max-width: 799px) {
  .sp-nav { display: none; }
  .sp-burger { display: flex; }
}

/* --------------------------------------------------------------------------
   Mobile menu
   -------------------------------------------------------------------------- */

.sp-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(250, 251, 253, .97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 14px var(--gutter) 40px;
}

.sp-menu__bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sp-menu__brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.sp-menu__mark {
  width: 32.9px;
  height: 44px;
  display: block;
  flex: none;
}

.sp-menu__close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--hair-5);
  border-radius: 12px;
  background: rgba(11, 18, 38, .03);
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
}

.sp-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8vh;
}

.sp-menu__link {
  display: flex;
  align-items: baseline;
  gap: 16px;
  color: var(--ink);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -.02em;
  padding: 10px 0;
}
.sp-menu__link:hover { color: var(--ink); }
.sp-menu__link span {
  font-size: 11px;
  color: var(--acText);
}

.sp-menu__cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ac1), var(--ac2));
  color: var(--on-accent);
  font-weight: 600;
  font-size: 15px;
  padding: 16px 30px;
  border-radius: 999px;
}
.sp-menu__cta:hover { color: var(--on-accent); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.sp-footer {
  border-top: 1px solid var(--hair-2);
  padding: 44px var(--gutter);
}

.sp-footer__inner {
  max-width: var(--shell);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
}

.sp-footer__brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.sp-footer__mark {
  width: 23.9px;
  height: 32px;
  display: block;
  flex: none;
}
.sp-footer__name {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .22em;
}

.sp-footer__nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.sp-footer__link {
  font-size: 10.5px;
  letter-spacing: .16em;
  color: rgba(15, 23, 42, .5);
  transition: color .2s;
}
.sp-footer__link:hover { color: var(--acText); }

.sp-footer__legal {
  font-size: 10.5px;
  letter-spacing: .1em;
  color: rgba(15, 23, 42, .32);
}

/* --------------------------------------------------------------------------
   Shared atoms used across more than one page
   -------------------------------------------------------------------------- */

/* Status eyebrow with the pulsing signal dot */
.sp-eyebrow-live {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 11.5px;
  letter-spacing: .24em;
  color: var(--acText);
}
.sp-eyebrow-live__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ac1);
  box-shadow: 0 0 12px var(--ac1);
  animation: spPulse 2.4s ease-in-out infinite;
  display: inline-block;
  flex: none;
}

/* Pill chip */
.sp-tag {
  font-size: 10px;
  letter-spacing: .14em;
  border: 1px solid rgba(11, 18, 38, .15);
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--ink-60);
}
.sp-tag--accent { border-color: var(--acBorder); color: var(--acText); }

/* Current page in the mobile overlay */
.sp-menu__link[aria-current="page"] { color: var(--acText); }
.sp-menu__link[aria-current="page"]:hover { color: var(--acText); }
