/* Complexity Studio · Social Lab — brand system (geocomplexity style) */
:root {
  --brand-blue: #6CAED1;
  --brand-blue-hover: #5a9fc4;
  --brand-blue-light: #8ecae6;
  --brand-black: #000000;
  --brand-emerald: #10B981;
  --brand-violet: #8B5CF6;
  --brand-gold: #D4A853;
  --primary: 201 52% 62%;
  --success: 152 45% 48%;
  --warning: 42 70% 52%;
  --danger: 0 55% 58%;
  --radius: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.125rem;
  --font-display: "Montserrat", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --header-offset: 8.75rem;
}

html.dark {
  --background: 0 0% 4%;
  --foreground: 0 0% 96%;
  --card: 0 0% 7%;
  --surface: 0 0% 9%;
  --muted-foreground: 0 0% 58%;
  --border: 0 0% 16%;
  --border-subtle: 0 0% 10%;
  --header-shadow-rest: 0 4px 24px -8px rgba(0, 0, 0, 0.12);
  --header-shadow-scrolled: 0 8px 40px -12px rgba(0, 0, 0, 0.2);
  --panel-shadow: 0 0 0 1px hsl(var(--border-subtle)), 0 8px 32px hsl(0 0% 0% / 0.15);
  --grid-opacity: 0.35;
}

html.light {
  --background: 0 0% 99%;
  --foreground: 0 0% 7%;
  --card: 0 0% 100%;
  --surface: 210 25% 97%;
  --muted-foreground: 0 0% 42%;
  --border: 210 16% 88%;
  --border-subtle: 210 18% 92%;
  --header-shadow-rest: 0 4px 24px -8px rgba(0, 0, 0, 0.08);
  --header-shadow-scrolled: 0 8px 40px -12px rgba(0, 0, 0, 0.1);
  --panel-shadow: 0 2px 8px hsl(0 0% 0% / 0.06);
  --grid-opacity: 0.18;
}

@media (min-width: 1024px) {
  :root { --header-offset: 9.25rem; }
}

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

body {
  font-family: var(--font-body);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.ambient-bg {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, hsl(var(--primary) / 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, hsl(152 30% 8% / 0.4), transparent);
}

html.light .ambient-bg {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, hsl(var(--primary) / 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, hsl(201 40% 92% / 0.6), transparent);
}

.grid-subtle {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(hsl(var(--border-subtle)) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border-subtle)) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: var(--grid-opacity);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent);
}

.network-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.04;
}

/* ── Header flotante (paridad Series Lab) ── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10200;
  pointer-events: none;
}

.site-header a,
.site-header button {
  pointer-events: auto;
}

.live-status-bar {
  pointer-events: auto;
  border-bottom: 1px solid hsl(var(--border) / 0.3);
  background: hsl(var(--background) / 0.9);
  backdrop-filter: blur(12px);
}

.live-status-bar__inner {
  max-width: 80rem;
  margin: 0 auto;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
}

.live-pulse {
  position: relative;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
}

.live-pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: hsl(var(--success));
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0.4;
}

.live-pulse::after {
  content: "";
  position: relative;
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--success));
}

.live-status-label {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: hsl(var(--primary));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1024px) {
  .live-status-label { font-size: 10px; }
}

.live-metrics {
  display: none;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .live-metrics { display: flex; }
}

@media (min-width: 1024px) {
  .live-metrics { gap: 2rem; }
}

.live-metric-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}

.live-metric-value {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
}

.header-float-wrap {
  pointer-events: none;
  display: flex;
  justify-content: center;
  padding: 0.5rem 1rem 0.75rem;
}

.header-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 64rem;
  height: 3.5rem;
  padding: 0 0.75rem;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border) / 0.3);
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(12px);
  box-shadow: var(--header-shadow-rest);
  transition: all 0.3s ease;
  gap: 8px;
}

.header-pill.is-scrolled {
  border-color: hsl(var(--border) / 0.5);
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(24px);
  box-shadow: var(--header-shadow-scrolled);
}

@media (min-width: 1024px) {
  .header-pill {
    height: 3.75rem;
    padding: 0 1.5rem;
  }
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

@media (min-width: 1024px) {
  .header-brand { gap: 0.75rem; }
}

.logo-white-bg {
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-white-bg img {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.logo-box {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.header-product-name {
  display: none;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .header-product-name { display: inline; }
}

@media (min-width: 1024px) {
  .header-product-name {
    font-size: 12px;
    letter-spacing: 0.2em;
  }
}

.text-gradient-brand {
  background: linear-gradient(90deg, #6CAED1, #8ecae6, #5a9fc4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.live-badge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid hsl(var(--success) / 0.3);
  background: hsl(var(--success) / 0.05);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .live-badge { display: inline-flex; }
}

.live-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--success));
  animation: pulse 2s ease-in-out infinite;
}

.live-badge-text {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--success));
}

.header-nav {
  display: none;
  align-items: center;
  gap: 2px;
}

@media (min-width: 1024px) {
  .header-nav { display: flex; }
}

.header-nav a {
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

@media (min-width: 1024px) {
  .header-nav a { font-size: 13px; }
}

.header-nav a:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--surface) / 0.5);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .header-actions { gap: 6px; }
}

.mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid hsl(var(--border) / 0.4);
  border-radius: 8px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}

@media (min-width: 1024px) {
  .mobile-toggle { display: none; }
}

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-offset);
  left: 0;
  right: 0;
  z-index: 10190;
  padding: 1rem;
  background: hsl(var(--background) / 0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid hsl(var(--border));
  flex-direction: column;
  gap: 4px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}

.mobile-nav a:hover {
  background: hsl(var(--surface));
  color: hsl(var(--foreground));
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid hsl(var(--border) / 0.4);
  border-radius: 8px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--surface) / 0.5);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

html.dark .theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: block; }
html.light .theme-toggle .icon-sun { display: none; }
html.light .theme-toggle .icon-moon { display: block; }

.hidden-md {
  display: none !important;
}

@media (min-width: 768px) {
  .hidden-md {
    display: inline-flex !important;
  }
}

@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 14px;
}

.btn-primary {
  height: 48px;
  padding: 0 32px;
  border-radius: var(--radius-xl);
  background: var(--brand-blue);
  color: var(--brand-black);
  font-weight: 600;
  box-shadow: 0 0 20px rgba(108, 174, 209, 0.2);
}

.btn-primary:hover {
  background: var(--brand-blue-hover);
  box-shadow: 0 0 24px rgba(108, 174, 209, 0.35);
}

.btn-gold {
  height: 48px;
  padding: 0 32px;
  border-radius: var(--radius-xl);
  background: var(--brand-blue);
  color: var(--brand-black);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(108, 174, 209, 0.2);
}

.btn-gold.btn-sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
}

.btn-gold:hover {
  background: var(--brand-blue-hover);
  box-shadow: 0 0 24px rgba(108, 174, 209, 0.35);
}

.btn-outline {
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-xl);
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border) / 0.6);
}

.btn-outline:hover {
  border-color: hsl(var(--primary) / 0.5);
  background: hsl(var(--primary) / 0.05);
}

.btn-outline.btn-sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.btn-ghost:hover {
  background: hsl(var(--surface));
  color: hsl(var(--foreground));
}

.page-content { position: relative; z-index: 1; padding-top: var(--header-offset); }

.container { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 980px; margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.text-gradient-brand-lg {
  background: linear-gradient(90deg, #6CAED1, #8ecae6, #10B981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid hsl(var(--primary) / 0.25);
  background: hsl(var(--primary) / 0.05);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand-blue);
}

.panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid hsl(var(--border) / 0.6);
  background: hsl(var(--card) / 0.8);
  backdrop-filter: blur(8px);
  box-shadow: var(--panel-shadow);
  padding: 22px 24px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.panel > * { position: relative; z-index: 1; }

.panel-premium {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid hsl(var(--border) / 0.6);
  background: hsl(var(--card) / 0.8);
  backdrop-filter: blur(8px);
  box-shadow: var(--panel-shadow);
}

.panel-premium::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.btn-pro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  margin-top: 0;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(168, 120, 16, 0.55);
  background: linear-gradient(145deg, #fff0b3 0%, #f5c842 22%, #d4a017 58%, #f7e08a 100%);
  color: #2a1e05;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    0 2px 16px rgba(212, 160, 23, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-pro::before {
  content: "👑";
  font-size: 1.05em;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

.btn-pro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.38) 50%, transparent 62%);
  pointer-events: none;
}

.btn-pro:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    0 6px 24px rgba(212, 160, 23, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-pro:active {
  transform: translateY(0);
}

html.dark .btn-pro {
  border-color: rgba(245, 200, 66, 0.45);
  box-shadow:
    0 2px 18px rgba(212, 160, 23, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-sm.btn-pro {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 38px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag-plus { background: hsl(var(--primary) / 0.15); color: var(--brand-blue); }
.tag-pro { background: hsl(270 60% 50% / 0.15); color: var(--brand-violet); }
.tag-demo { background: hsl(var(--success) / 0.15); color: var(--brand-emerald); }

.demo-banner {
  position: sticky;
  top: var(--header-offset);
  z-index: 40;
  background: hsl(var(--warning) / 0.12);
  border-bottom: 1px solid hsl(var(--warning) / 0.3);
  padding: 10px 1rem;
  text-align: center;
  font-size: 13px;
  color: hsl(var(--foreground));
}

.demo-banner a { color: var(--brand-blue); font-weight: 600; }

.app-banner {
  position: sticky;
  top: var(--header-offset);
  z-index: 40;
  background: hsl(var(--success) / 0.1);
  border-bottom: 1px solid hsl(var(--success) / 0.25);
  padding: 10px 1rem;
  text-align: center;
  font-size: 13px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
