/**
 * ═══════════════════════════════════════════════════════
 * SOVEREIGN SIGNAL — Core Design System (ss-core.css)
 * Single source of truth. Every page imports this.
 * Change here = change everywhere.
 * ═══════════════════════════════════════════════════════
 */

/* ═══ TOKENS ═══ */
:root {
  /* Typography */
  --ss-display: 'Syne', system-ui, sans-serif;
  --ss-body: 'Darker Grotesque', system-ui, sans-serif;
  --ss-mono: 'Space Mono', monospace;
  --ss-statement: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --ss-brand: 'Outfit', system-ui, sans-serif;

  /* Dark zone (hero, overlays) */
  --ss-void: #080d14;
  --ss-void-light: #0c1220;
  --ss-void-solid: #111827;
  --ss-void-panel: rgba(13,13,20,0.8);
  --ss-void-card: rgba(16,16,28,0.6);

  /* Light zone (body sections) */
  --ss-surface: #f0f2f5;
  --ss-surface-card: #ffffff;
  --ss-surface-alt: #fafbfe;

  /* Blue zone (CTA, footer) */
  --ss-blue: #0ea5e9;
  --ss-blue-dark: #0c4a6e;
  --ss-blue-mid: #0e7490;
  --ss-blue-gradient: linear-gradient(135deg, #0c4a6e 0%, #0e7490 50%, #0ea5e9 100%);

  /* Borders */
  --ss-border: rgba(255,255,255,0.06);
  --ss-border-mid: rgba(255,255,255,0.08);
  --ss-border-hover: rgba(255,255,255,0.12);
  --ss-border-strong: rgba(255,255,255,0.15);
  --ss-border-accent: rgba(108,60,224,0.3);
  --ss-border-light: rgba(0,0,0,0.06);
  --ss-border-light-hover: rgba(0,0,0,0.12);

  /* Text */
  --ss-text-primary: #f0ede8;
  --ss-text-secondary: #8a8a9a;
  --ss-text-muted: #5a5a6a;
  --ss-text-dim: #3a3a4a;
  --ss-text-dark: #1a1a2e;
  --ss-text-dark-secondary: #475569;

  /* Accent colors */
  --ss-violet: #6c3ce0;
  --ss-violet-glow: rgba(108,60,224,0.12);
  --ss-violet-soft: rgba(108,60,224,0.06);
  --ss-teal: #0ef5c2;
  --ss-teal-hover: #1cffd0;
  --ss-teal-glow: rgba(14,245,194,0.15);
  --ss-teal-soft: rgba(14,245,194,0.06);
  --ss-teal-border: rgba(14,245,194,0.3);
  --ss-teal-border-hover: rgba(14,245,194,0.5);
  --ss-coral: #ff4d4d;
  --ss-coral-glow: rgba(255,77,77,0.2);

  /* Gradients */
  --ss-gradient: linear-gradient(135deg, var(--ss-violet), var(--ss-teal));
  --ss-gradient-text: linear-gradient(135deg, #8b5cf6, #06d6a0);
  --ss-brand-gradient: linear-gradient(135deg, #0c4a6e, #0ea5e9, #38bdf8);

  /* Shape */
  --ss-radius-sm: 8px;
  --ss-radius: 12px;
  --ss-radius-lg: 20px;
  --ss-radius-xl: 28px;
  --ss-radius-pill: 100px;

  /* Motion — Choreography & Spatial Intelligence System (2026-04-09) */
  --ss-ease: cubic-bezier(0.16,1,0.3,1);
  --ss-ease-productive: cubic-bezier(0.2, 0, 0.38, 0.9);
  --ss-ease-entrance: cubic-bezier(0, 0, 0.38, 0.9);
  --ss-ease-exit: cubic-bezier(0.2, 0, 1, 0.9);
  --ss-duration-snap: 0ms;
  --ss-duration-micro: 80ms;
  --ss-duration-fast: 150ms;
  --ss-duration-moderate: 250ms;
  --ss-duration-slow: 400ms;
  --ss-duration-dramatic: 600ms;
  --ss-stagger-row: 20ms;

  /* Spacing — 4px harmonic scale */
  --ss-space-micro: 4px;
  --ss-space-compact: 8px;
  --ss-space-standard: 12px;
  --ss-space-section: 16px;
  --ss-space-module: 24px;
  --ss-space-stage: 32px;

  /* Layout — THE canonical widths */
  --ss-pad: 40px;
  --ss-pad-mobile: 20px;
  --ss-width-bounded: 1600px;
  --ss-width-content: 1200px;
  --ss-width-reading: 900px;
  --ss-width-narrow: 680px;
}

/* ═══ RESET & BASE ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100dvh;
  overflow: hidden;
}

body {
  font-family: var(--ss-body);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  background: var(--ss-void);
  color: var(--ss-text-primary);
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ═══════════════════════════════════════════════════════════════
   SHELL VISUAL IDENTITY — INDEPENDENT OF ALL COMPONENTS
   These rules are the SOLE authority for shell appearance.
   No component, page, or stage element may override these.
   Violation marker: grep for "SHELL-AUTHORITY" to audit.
   ═══════════════════════════════════════════════════════════════ */

/* SHELL-AUTHORITY: header — structural only.
   Visual properties owned by ss-core.css .ss-nav rules (line 185+).
   Shell JS renders .ss-nav class; this ID rule is legacy structural. */
#ss-shell-header {
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  height: 72px;
}

/* SHELL-AUTHORITY: stage container */
#ss-page-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative; /* Anchor for absolute-positioned children (welcome sequence cards) */
  z-index: 1;
  background: transparent; /* Transparent so child scenes (welcome gradient) show through. Body owns --ss-void fallback. */
}

/* SHELL-AUTHORITY: footer — structural only.
   Visual properties owned by ss-core.css .ss-footer rules (line 382+).
   Shell JS renders .ss-footer class; this ID rule is legacy structural. */
#ss-shell-footer {
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  margin-top: auto;
}
::selection { background: var(--ss-violet); color: white; }

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ═══ LAYOUT SYSTEM ═══
   
   Sections go FULL WIDTH. Backgrounds span edge to edge.
   Content inside uses width classes for constraint.
   
   .ss-pad        → standard side padding (40px desktop, 20px mobile)
   .ss-bounded    → max-width 1600px, centered (generous)
   .ss-content    → max-width 1200px, centered (standard)
   .ss-reading    → max-width 900px, centered (articles)
   .ss-narrow     → max-width 680px, centered (focused)
   .ss-full       → no max-width (true edge-to-edge content)
   
   Compose: <div class="ss-pad ss-bounded"> for padded + bounded
═══ */

.ss-pad { padding-left: var(--ss-pad); padding-right: var(--ss-pad); }
.ss-bounded { max-width: var(--ss-width-bounded); margin-left: auto; margin-right: auto; }
.ss-content { max-width: var(--ss-width-content); margin-left: auto; margin-right: auto; }
.ss-reading { max-width: var(--ss-width-reading); margin-left: auto; margin-right: auto; }
.ss-narrow { max-width: var(--ss-width-narrow); margin-left: auto; margin-right: auto; }
.ss-full { width: 100%; }

@media (max-width: 768px) {
  .ss-pad { padding-left: var(--ss-pad-mobile); padding-right: var(--ss-pad-mobile); }
}

/* ═══ NAV ═══ */
.ss-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ss-border-light);
  transition: background 0.3s, box-shadow 0.3s;
}
.ss-nav.scrolled {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}
.ss-nav-inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--ss-pad);
  /* NO max-width. Nav spans full viewport. */
}
.ss-nav-brand {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 0;
  text-decoration: none;
  font-family: var(--ss-brand); font-size: 28px; font-weight: 700;
  letter-spacing: 0.42em; text-transform: uppercase;
  background: var(--ss-brand-gradient);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1.1;
  flex-shrink: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.ss-nav-brand span {
  display: block; font-size: 22px; letter-spacing: 0.52em;
}
.ss-nav-links {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 52px;
  white-space: nowrap; z-index: 1;
}
.ss-nav-links a {
  font-family: var(--ss-mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ss-blue-dark);
  transition: color 0.3s;
}
.ss-nav-links a:hover { color: var(--ss-blue); }
.ss-nav-links a[href="/profile"] { display: none; }
.ss-nav-right {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  flex-wrap: nowrap; white-space: nowrap;
}
.ss-nav-social {
  display: flex; align-items: center; gap: 14px;
}
.ss-nav-social a {
  color: var(--ss-text-dark-secondary);
  transition: color 0.3s;
}
.ss-nav-social a:hover { color: var(--ss-blue); }
.ss-nav-social svg { width: 18px; height: 18px; }

/* ═══ PREMIUM LOGIN BUTTON ═══ */
.ss-login-premium {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 22px;
  font-family: var(--ss-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff;
  background: transparent;
  border: none; border-radius: var(--ss-radius-pill);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ss-ease), box-shadow 0.4s var(--ss-ease);
  white-space: nowrap;
  z-index: 1;
}
/* Animated gradient border layer */
.ss-login-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1.5px;
  background: linear-gradient(135deg, #a78bfa 0%, #0ef5c2 33%, #eab308 66%, #a78bfa 100%);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  border-radius: inherit;
  animation: ss-login-border 4s linear infinite;
  z-index: -2;
}
/* Glass interior */
.ss-login-premium::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: linear-gradient(135deg, rgba(10,12,18,0.92) 0%, rgba(20,22,30,0.88) 100%);
  border-radius: inherit;
  z-index: -1;
  transition: background 0.4s var(--ss-ease);
}
/* Gradient text */
.ss-login-text {
  background: linear-gradient(135deg, #c4b5fd 0%, #5eead4 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: filter 0.3s;
}
@keyframes ss-login-border {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* Hover: glass becomes more translucent, glow appears */
.ss-login-premium:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 24px rgba(14,245,194,0.12),
    0 0 48px rgba(167,139,250,0.08),
    0 4px 12px rgba(0,0,0,0.3);
}
.ss-login-premium:hover::after {
  background: linear-gradient(135deg, rgba(10,12,18,0.75) 0%, rgba(20,22,30,0.7) 100%);
}
.ss-login-premium:hover .ss-login-text {
  filter: brightness(1.3);
}
/* Active press */
.ss-login-premium:active {
  transform: translateY(0);
  transition-duration: 0.1s;
}
/* Signed in: auth.js adds this class to hide */
.ss-login-premium.ss-hidden { display: none; }

/* Nav CTA button (Sign In uses auth.js styles, this is for other CTAs) */
.ss-nav-cta {
  font-family: var(--ss-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 8px 18px; border-radius: var(--ss-radius-pill);
  border: 1px solid rgba(14,165,233,0.3); background: rgba(14,165,233,0.06);
  color: var(--ss-blue); transition: all 0.3s;
}
.ss-nav-cta:hover {
  background: rgba(14,165,233,0.12); border-color: rgba(14,165,233,0.5);
  box-shadow: 0 0 20px rgba(14,165,233,0.1);
}

/* Mobile nav */
@media (max-width: 1024px) {
  .ss-nav-links { gap: 28px; }
  .ss-nav-links a { font-size: 11px; }
}
@media (max-width: 768px) {
  .ss-nav-inner { padding: 0 var(--ss-pad-mobile); }
  .ss-nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(5,5,5,0.97); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--ss-border);
    padding: 12px 0;
  }
  .ss-nav-links.open { display: flex; }
  .ss-nav-links a {
    padding: 14px var(--ss-pad-mobile); font-size: 13px;
    border-bottom: 1px solid var(--ss-border);
  }
  .ss-nav-links a:last-child { border-bottom: none; }
  .ss-nav-links.open a { color: var(--ss-text-primary); }
  .ss-nav-links.open a:hover { color: var(--ss-blue); }
  .ss-nav-brand { font-size: 20px; letter-spacing: 0.28em; max-width: none; }
  .ss-nav-brand span { font-size: 16px; letter-spacing: 0.32em; }
  .ss-nav-social { display: none; }
  .ss-login-premium { padding: 7px 16px; font-size: 10px; }
}

@media (max-width: 480px) {
  .ss-nav-brand { font-size: 16px; letter-spacing: 0.20em; }
  .ss-nav-brand span { font-size: 12px; letter-spacing: 0.24em; }
}

/* Hamburger toggle */
.ss-nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 28px; height: 20px; position: relative; padding: 0;
}
.ss-nav-toggle span {
  display: block; position: absolute; left: 0; right: 0; height: 2px;
  background: var(--ss-text-secondary); border-radius: 1px;
  transition: all 0.3s var(--ss-ease);
}
.ss-nav-toggle span:nth-child(1) { top: 0; }
.ss-nav-toggle span:nth-child(2) { top: 9px; }
.ss-nav-toggle span:nth-child(3) { top: 18px; }
.ss-nav-toggle.open span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.ss-nav-toggle.open span:nth-child(2) { opacity: 0; }
.ss-nav-toggle.open span:nth-child(3) { top: 9px; transform: rotate(-45deg); }
@media (max-width: 768px) {
  .ss-nav-toggle { display: block; }
}

/* ═══ ONBOARDING TUNNEL ═══ */
/* Superseded by body[data-shell-mode="tunnel"] rules in SHELL MODES section.
   Logo click blocking is now in ss-shell.js via data-shell-mode check. */

/* ═══ FOOTER ═══ */
.ss-footer {
  background: var(--ss-blue-dark);
  padding: 14px 0;
  position: relative; z-index: 1;
}
.ss-footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 var(--ss-pad);
  /* NO max-width. Footer spans full viewport. */
}
.ss-footer-logo {
  font-family: var(--ss-display); font-size: 12px; font-weight: 600;
  letter-spacing: 0.35em; text-transform: uppercase;
  color: rgba(255,255,255,0.9);
}
.ss-footer-links {
  display: flex; gap: 28px; align-items: center;
}
.ss-footer-links a {
  font-family: var(--ss-mono); font-size: 11px;
  color: rgba(255,255,255,0.7); transition: color 0.3s;
  letter-spacing: 0.03em;
}
.ss-footer-links a:hover { color: rgba(255,255,255,1); }
.ss-footer-copy {
  font-family: var(--ss-mono); font-size: 10px;
  color: rgba(255,255,255,0.5); letter-spacing: 0.04em;
}
@media (max-width: 768px) {
  .ss-footer-inner { flex-direction: column; gap: 12px; padding: 0 var(--ss-pad-mobile); }
}

/* ═══ AUTH IN NAV (light context overrides) ═══ */
.ss-nav .ss-auth-signin {
  border-color: var(--ss-blue-mid);
  background: rgba(14,116,144,0.08);
  color: var(--ss-blue-dark);
}
.ss-nav .ss-auth-signin:hover {
  background: rgba(14,116,144,0.14);
  border-color: var(--ss-blue-dark);
  box-shadow: 0 0 16px rgba(14,116,144,0.1);
  color: var(--ss-blue-dark);
}
.ss-nav .ss-auth-signin svg path { fill: currentColor; }
.ss-nav .ss-auth-user-btn {
  border-color: var(--ss-border-light);
}
.ss-nav .ss-auth-user-btn:hover {
  border-color: var(--ss-border-light-hover);
  background: rgba(0,0,0,0.03);
}
.ss-nav .ss-auth-name {
  color: var(--ss-text-dark);
}
.ss-nav .ss-auth-chevron {
  color: var(--ss-text-dark-secondary);
}
.ss-nav .ss-auth-avatar {
  border-color: rgba(14,116,144,0.3);
}
.ss-nav .ss-auth-skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
}

/* ═══ SECTION ZONES ═══ */
.ss-section { width: 100%; position: relative; }
.ss-section-dark { background: var(--ss-void); color: var(--ss-text-primary); }
.ss-section-light { background: var(--ss-surface); color: var(--ss-text-dark); }
.ss-section-blue { background: var(--ss-blue-gradient); color: white; }
.ss-section-card {
  background: var(--ss-surface-card);
  border-radius: var(--ss-radius-lg);
  border: 1px solid var(--ss-border-light);
}

/* ═══ TYPOGRAPHY ═══ */
.ss-display {
  font-family: var(--ss-display); font-weight: 700; line-height: 1.1;
}
.ss-heading {
  font-family: var(--ss-statement); font-weight: 600; line-height: 1.2;
}
.ss-body-text {
  font-family: var(--ss-body); font-size: 20px; line-height: 1.6;
}
.ss-mono-text {
  font-family: var(--ss-mono); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.ss-eyebrow {
  font-family: var(--ss-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
}
.ss-gradient-text {
  background: var(--ss-gradient-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ═══ BUTTONS ═══ */
.ss-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ss-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 14px 32px; border-radius: var(--ss-radius);
  border: none; cursor: pointer; transition: all 0.3s var(--ss-ease);
}
.ss-btn-primary {
  background: var(--ss-blue-gradient); color: white;
  box-shadow: 0 4px 16px rgba(14,165,233,0.25);
}
.ss-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(14,165,233,0.35);
}
.ss-btn-outline {
  background: transparent; color: var(--ss-text-primary);
  border: 1px solid var(--ss-border);
}
.ss-btn-outline:hover { border-color: var(--ss-border-hover); background: rgba(255,255,255,0.03); }
.ss-btn-teal {
  background: var(--ss-blue); color: var(--ss-void);
}
.ss-btn-teal:hover {
  box-shadow: 0 4px 20px rgba(14,165,233,0.15);
  transform: translateY(-1px);
}

/* ═══ CARDS ═══ */
.ss-card {
  background: var(--ss-surface-card);
  border-radius: var(--ss-radius-lg);
  border: 1px solid var(--ss-border-light);
  padding: 40px;
  transition: transform 0.3s var(--ss-ease), box-shadow 0.3s;
}
.ss-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
/* Welcome sequence cards are transparent — atmosphere shows through */
.ss-sequence .ss-card {
  background: transparent;
}
.ss-card-dark {
  background: var(--ss-void-card);
  border: 1px solid var(--ss-border);
  color: var(--ss-text-primary);
}
.ss-card-dark:hover {
  border-color: var(--ss-border-hover);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* ═══ PILLS / TAGS ═══ */
.ss-pill {
  display: inline-flex; align-items: center;
  font-family: var(--ss-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 8px 20px; border-radius: var(--ss-radius-lg);
  border: 1px solid var(--ss-border); color: var(--ss-text-secondary);
  transition: all 0.3s;
}
.ss-pill:hover {
  border-color: var(--ss-border-hover); color: var(--ss-text-primary);
  background: rgba(255,255,255,0.03);
}

/* ═══ UTILITIES ═══ */
.ss-flex { display: flex; }
.ss-flex-center { display: flex; align-items: center; justify-content: center; }
.ss-flex-between { display: flex; align-items: center; justify-content: space-between; }
.ss-gap-sm { gap: 8px; }
.ss-gap-md { gap: 16px; }
.ss-gap-lg { gap: 32px; }
.ss-gap-xl { gap: 48px; }
.ss-mt-sm { margin-top: 16px; }
.ss-mt-md { margin-top: 32px; }
.ss-mt-lg { margin-top: 64px; }
.ss-mb-sm { margin-bottom: 16px; }
.ss-mb-md { margin-bottom: 32px; }
.ss-mb-lg { margin-bottom: 64px; }
.ss-text-center { text-align: center; }

/* ═══ SCROLL REVEAL ═══ */
.ss-reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s var(--ss-ease), transform 0.8s var(--ss-ease);
}
.ss-reveal.visible { opacity: 1; transform: translateY(0); }

/* ═══ SPACER (nav height offset) ═══ */
.ss-nav-spacer { height: 72px; }

/* ═══════════════════════════════════════════
   VIEW TRANSITIONS — Native OS-feel page transitions
   Chrome 111+, Safari 18+, Firefox 144+. Graceful fallback on others.
   ═══════════════════════════════════════════ */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: 200ms ease-out both vt-fade-slide-out;
}
::view-transition-new(root) {
  animation: 300ms ease-in both vt-fade-slide-in;
}

@keyframes vt-fade-slide-out {
  to { opacity: 0; transform: translateX(-30px); }
}
@keyframes vt-fade-slide-in {
  from { opacity: 0; transform: translateX(30px); }
}

/* Respect user preferences */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* ═══ AUTH PANEL OVERLAY — REMOVED ═══ */
/* Ghost CSS: .auth-panel at z-index 55000 had no DOM element.
   Removed to prevent stacking context pollution. */
/* Tab active state */
.hero-auth-tabs button.active {
  color: var(--ss-teal) !important;
  border-bottom-color: var(--ss-teal) !important;
}
/* View toggle — .active shows the view */
#heroLoginView.active,
#heroSignupView.active {
  display: block !important;
}
/* Input focus */
.hero-auth-card input:focus {
  border-color: rgba(14,245,194,0.4);
}
.hero-auth-card input::placeholder {
  color: var(--ss-text-dim);
}
/* Password strength pass state */
.hero-strength-rule.pass {
  color: var(--ss-teal);
}
/* Auth message states */
.hero-auth-message.show.error { color: #ef4444; }
.hero-auth-message.show.success { color: var(--ss-teal); }
/* Button loading state */
.hero-auth-card button.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* =============================================
   SCENE MANAGER — Layer Containers
   ============================================= */

/* Scene layer containers. #ss-layer-main starts hidden — the orchestrator
   shows it only when entering tunnel mode. This prevents it from eating
   viewport space in the flex column before the orchestrator runs. */
.ss-layer {
  position: relative;
  width: 100%;
}

#ss-layer-main {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
}
/* When the orchestrator shows #ss-layer-main (display:flex), the active scene
   must stretch to fill it so absolutely-positioned inactive scenes have a
   containing block with real dimensions. */
#ss-layer-main > .ss-scene--active {
  flex: 1;
}

/* =============================================
   FSA SECTION 2.2: STAGE ELEMENT LIFECYCLE
   The ONLY permitted transition pattern for
   content elements on the stage.
   ============================================= */

.ss-stage-element {
  position: absolute;
  top: 0; left: 0; right: 0;
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 350ms cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 350ms cubic-bezier(0.25, 0.1, 0.25, 1);
  pointer-events: none;
}

.ss-stage-element.ss-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.ss-stage-element.ss-exiting {
  opacity: 0;
  transform: translateX(-60px);
  pointer-events: none;
}

.ss-stage-element.ss-dormant {
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  position: absolute;
}

/* =============================================
   SCENE BASE — Every scene gets these
   ============================================= */

.ss-scene {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translateX(60px);
  transition: opacity 350ms cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 350ms cubic-bezier(0.25, 0.1, 0.25, 1),
              visibility 0ms 350ms;
}

/* ACTIVE scene — visible, centered */
.ss-scene--active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition: opacity 350ms cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 350ms cubic-bezier(0.25, 0.1, 0.25, 1),
              visibility 0ms 0ms;
}

/* =============================================
   SCENE TRANSITIONS — Direction-Aware
   ============================================= */

/* FORWARD: current exits LEFT, new enters from RIGHT */
.ss-scene--exit-forward {
  opacity: 0;
  transform: translateX(-60px);
  visibility: hidden;
  pointer-events: none;
}

.ss-scene--enter-forward {
  transform: translateX(60px);
  opacity: 0;
}

/* BACK: current exits RIGHT, new enters from LEFT */
.ss-scene--exit-back {
  opacity: 0;
  transform: translateX(60px);
  visibility: hidden;
  pointer-events: none;
}

.ss-scene--enter-back {
  transform: translateX(-60px);
  opacity: 0;
}

/* FADE: no directional movement */
.ss-scene--exit-fade {
  opacity: 0;
  transform: translateX(0);
  visibility: hidden;
  pointer-events: none;
}

.ss-scene--enter-fade {
  opacity: 0;
  transform: translateX(0);
}

/* =============================================
   SHELL MODES (replaces body.ss-onboarding)
   ============================================= */

/* Tunnel mode: strip everything except logo */
body[data-shell-mode="tunnel"] .ss-nav-links,
body[data-shell-mode="tunnel"] .ss-login-premium,
body[data-shell-mode="tunnel"] .ss-nav-social,
body[data-shell-mode="tunnel"] .ss-auth-container,
body[data-shell-mode="tunnel"] .ss-nav-toggle,
body[data-shell-mode="tunnel"] .ss-user-pill {
  display: none !important;
}

body[data-shell-mode="tunnel"] .ss-logo,
body[data-shell-mode="tunnel"] .ss-nav-brand {
  pointer-events: none;
  cursor: default;
}

/* Tunnel mode: hide legacy SPA mount (scene layer takes over the stage) */
body[data-shell-mode="tunnel"] #ss-page-content {
  display: none !important;
}
/* NEVER hide #ss-shell-footer — it is a persistent utility bar (like a taskbar).
   Header and footer are permanent chrome. Only the stage content changes. */

/* SHELL-MODE: When welcome sequence is active, lock stage overflow.
   Uses :has() instead of data-shell-mode because ANONYMOUS removes the attribute. */
body:has(.ss-sequence) #ss-page-content {
  overflow: hidden;
}

/* Sequence step indicator — hidden by default, shown in tunnel + public with active sequence */
.ss-sequence-label {
  display: none;
  font-family: var(--ss-mono, 'Space Mono', monospace);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  min-width: 160px; /* Reserve space for longest label to prevent nav reflow */
}
/* Show sequence label when welcome sequence is active (public mode) */
body:has(.ss-sequence) .ss-sequence-label {
  display: inline-flex;
}
/* Show sequence label in tunnel mode always */
body[data-shell-mode="tunnel"] .ss-sequence-label {
  display: inline-flex !important;
}

/* Public mode: standard marketing nav */
body[data-shell-mode="public"] .ss-user-pill {
  display: none !important;
}

/* Member mode: show member nav, hide login */
body[data-shell-mode="member"] .ss-login-premium {
  display: none !important;
}

/* =============================================
   WELCOME FLOW — Screen-Specific Styles
   ============================================= */

.welcome-content {
  text-align: center;
  max-width: 640px;
  width: 100%;
}

.welcome-advance-btn {
  display: block;
  margin: 40px auto 0;
  padding: 12px 32px;
  background: transparent;
  border: 1px solid var(--accent-teal, #5de4c7);
  border-radius: 6px;
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--accent-teal, #5de4c7);
  cursor: pointer;
  text-transform: uppercase;
  transition: background 200ms ease, color 200ms ease;
}

.welcome-advance-btn:hover {
  background: rgba(93, 228, 199, 0.08);
}

/* Scene layer hidden by default — orchestrator shows it for tunnel states */
#ss-layer-main { display: none; }
