/* ==========================================================================
   LINEAR DESIGN SYSTEM · UNIVERSAL SYSTEM (DARK & LIGHT DUAL THEME)
   Inspirado directamente en Linear.app (102 MB de tokens oficiales)
   Base monocromática en escala de grises refinada + toques de color muy contenidos.
   ========================================================================== */

:root,
[data-theme="dark"] {
  /* Fondo y Superficies en Grises Neutros (Zero Saturation) */
  --bg: #08090A;
  --bg-canvas: #08090A;
  --bg-subtle: #0D0E11;
  --bg-card: rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --bg-elevated: #131418;
  --bg-input: #0E0F12;
  --bg-nav: rgba(8, 9, 10, 0.82);

  /* Bordes Hairline */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-active: rgba(255, 255, 255, 0.28);

  /* Escala Tipográfica de Grises */
  --text-0: #F7F8F8; /* Títulos / Énfasis principal */
  --text-1: #8A8F98; /* Párrafos / Descripciones */
  --text-2: #62666D; /* Subtextos / Etiquetas */
  --text-muted: #4B4F56; /* Bordes apagados / Micro-detalles */

  /* Colores de Acento (Uso estrictamente limitado) */
  --brand-raccord: #5E6AD2; /* Linear Indigo (RaccordOS) */
  --brand-raccord-dim: rgba(94, 106, 210, 0.12);
  --brand-cinetix: #F43F5E; /* Linear Ruby (CineTixOS) */
  --brand-cinetix-dim: rgba(244, 63, 94, 0.12);

  --color-success: #27A644;
  --color-amber: #F59E0B;

  /* Resplandores y Sombras Neutros (Sin saturación de color en el fondo) */
  --ambient-glow: radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255, 255, 255, 0.04), transparent 70%);
  --grid-line: rgba(255, 255, 255, 0.02);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 20px 48px rgba(0, 0, 0, 0.6);
  --shadow-card-hover: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 28px 60px rgba(0, 0, 0, 0.8);
  --shadow-dropdown: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);

  /* Identificador de Modo */
  --theme-name: "dark";
  color-scheme: dark;
}

[data-theme="light"] {
  /* Fondo y Superficies en Modo Claro — canvas tonalmente distinto a las tarjetas */
  --bg: #E8EBF2;
  --bg-canvas: #E8EBF2;
  --bg-subtle: #F4F5F9;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F3F5FA;
  --bg-elevated: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-nav: rgba(232, 235, 242, 0.90);

  /* Bordes Hairline (más definidos en claro) */
  --border: rgba(14, 17, 27, 0.12);
  --border-hover: rgba(14, 17, 27, 0.22);
  --border-active: rgba(14, 17, 27, 0.34);

  /* Escala Tipográfica de Grises (más contraste) */
  --text-0: #0A0B0F; /* Títulos / Énfasis principal */
  --text-1: #3A3E49; /* Párrafos / Descripciones */
  --text-2: #5E636E; /* Subtextos / Etiquetas */
  --text-muted: #9AA0AB; /* Bordes apagados / Micro-detalles */

  /* Colores de Acento (Uso estrictamente limitado) */
  --brand-raccord: #4F5BC7;
  --brand-raccord-dim: rgba(79, 91, 199, 0.08);
  --brand-cinetix: #E11D48;
  --brand-cinetix-dim: rgba(225, 29, 72, 0.08);

  --color-success: #1E8734;
  --color-amber: #D97706;

  /* Resplandores y Sombras Neutros */
  --ambient-glow: radial-gradient(ellipse 80% 40% at 50% -10%, rgba(16, 18, 28, 0.03), transparent 70%);
  --grid-line: rgba(14, 17, 27, 0.03);
  --shadow-card: 0 1px 2px rgba(16, 18, 28, 0.06), 0 14px 30px -12px rgba(16, 18, 28, 0.16);
  --shadow-card-hover: 0 2px 6px rgba(16, 18, 28, 0.08), 0 24px 48px -14px rgba(16, 18, 28, 0.24);
  --shadow-dropdown: 0 18px 44px rgba(16, 18, 28, 0.18), 0 0 0 1px rgba(14, 17, 27, 0.08);

  /* Identificador de Modo */
  --theme-name: "light";
  color-scheme: light;
}

/* Modo claro: texto algo más grueso para asegurar legibilidad */
[data-theme="light"] body { font-weight: 500; }
[data-theme="light"] p,
[data-theme="light"] .pillar-desc,
[data-theme="light"] .film-poster-title,
[data-theme="light"] .linear-nav-link { font-weight: 500; }

/* ==========================================================================
   TIPOGRAFÍA Y RESET GLOBAL
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text-0);
  transition: background-color 0.25s ease, color 0.25s ease;
}

body {
  background-color: var(--bg);
  color: var(--text-0);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   RESPLANDOR Y RETÍCULA DE FONDO
   ========================================================================== */
.linear-ambient-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 680px;
  background: var(--ambient-glow);
  pointer-events: none;
  z-index: 0;
}

.linear-grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 900px;
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 10%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 10%, black 20%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   HEADER & NAVBAR LINEAR
   ========================================================================== */
.linear-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.linear-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.linear-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.linear-brand-logo svg {
  width: 20px;
  height: 20px;
}

.linear-brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-0);
  display: flex;
  align-items: center;
  gap: 4px;
}

.linear-brand-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.06em;
  margin-left: 4px;
}

.linear-nav-center {
  display: flex;
  align-items: center;
  gap: 20px;
}

.linear-nav-link,
.linear-nav-dropdown-trigger {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  padding: 5px 9px;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
}

.linear-nav-link:hover,
.linear-nav-dropdown-trigger:hover,
.linear-nav-dropdown:hover .linear-nav-dropdown-trigger {
  color: var(--text-0);
  background-color: var(--bg-card-hover);
}

.linear-nav-link.active {
  color: var(--text-0);
  font-weight: 600;
}

/* Dropdown */
.linear-nav-dropdown {
  position: relative;
}

/* Puente invisible: mantiene el hover al bajar del botón al menú */
.linear-nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -12px;
  right: -12px;
  height: 16px;
}

.linear-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 280px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-dropdown);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 300;
}

.linear-nav-dropdown:hover .linear-dropdown-menu,
.linear-nav-dropdown.open .linear-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.linear-menu-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-0);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s;
}

.linear-menu-item:hover {
  background-color: var(--bg-card-hover);
}

.linear-menu-item small {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-1);
}

.linear-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

/* Nav Actions Right */
.linear-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-1);
  transition: all 0.15s;
}

.btn-theme-toggle:hover {
  color: var(--text-0);
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}

.btn-linear-pill-outline {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-1);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: 9999px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-linear-pill-outline:hover {
  color: var(--text-0);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.btn-linear-primary {
  font-size: 12.5px;
  font-weight: 600;
  color: #FFFFFF;
  background: #111215;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 7px 16px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

[data-theme="light"] .btn-linear-primary {
  background: #08090A;
  color: #FFFFFF;
}

[data-theme="dark"] .btn-linear-primary {
  background: #1A1C23;
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-linear-primary:hover {
  transform: translateY(-1px);
  background: #252834;
}

/* ==========================================================================
   BENTO CARDS & SECCIONES EN TONOS DE GRISES
   ========================================================================== */
.bento-card-clean {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.bento-card-clean:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.kicker-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
  display: block;
}

.heading-h2 {
  font-size: clamp(24px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-0);
  margin-bottom: 12px;
}

.lead-p {
  font-size: 15px;
  color: var(--text-1);
  line-height: 1.65;
}

/* ==========================================================================
   FOOTER UNIVERSAL LINEAR
   ========================================================================== */
.linear-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 48px 32px 36px;
  margin-top: auto;
}

.footer-inner-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
}

.footer-links-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links-row a {
  font-size: 13px;
  color: var(--text-1);
  transition: color 0.15s;
}

.footer-links-row a:hover {
  color: var(--text-0);
}

.footer-bottom-row {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-2);
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   COMMAND PALETTE LINEAR (⌘K / Ctrl+K)
   ========================================================================== */
.linear-cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

.linear-cmd-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.linear-cmd-dialog {
  width: 100%;
  max-width: 580px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  border-radius: 14px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.linear-cmd-backdrop.active .linear-cmd-dialog {
  transform: translateY(0) scale(1);
}

.linear-cmd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.linear-cmd-icon {
  color: var(--text-2);
  display: flex;
  align-items: center;
}

.linear-cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-0);
}

.linear-cmd-input::placeholder {
  color: var(--text-2);
}

.linear-cmd-esc {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
}

.linear-cmd-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  list-style: none;
}

.linear-cmd-group-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 8px 12px 4px;
}

.linear-cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-1);
  transition: background-color 0.12s, color 0.12s;
  text-decoration: none;
}

.linear-cmd-item:hover,
.linear-cmd-item.selected {
  background: var(--bg-card-hover);
  color: var(--text-0);
}

.linear-cmd-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
}

.linear-cmd-item-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--text-2);
}

.linear-cmd-footer {
  padding: 8px 16px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-2);
}

/* ==========================================================================
   A/B COMPARE SLIDER (CONTINUIDAD SET)
   ========================================================================== */
.ab-slider-wrap {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 32px auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  user-select: none;
  background: var(--bg-card);
}

.ab-image-layer {
  width: 100%;
  display: block;
}

.ab-image-layer img,
.ab-image-layer svg {
  width: 100%;
  height: auto;
  display: block;
}

.ab-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid var(--brand-raccord);
}

.ab-overlay-layer .ab-inner-content {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.ab-handle-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--brand-raccord);
  transform: translateX(-50%);
  cursor: ew-resize;
  pointer-events: none;
}

.ab-handle-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--brand-raccord);
  color: var(--text-0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.ab-label-pill {
  position: absolute;
  bottom: 16px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10;
}
.ab-label-left { left: 16px; }
.ab-label-right { right: 16px; }

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* ---------- Red de seguridad: todo se adapta al ancho de pantalla ---------- */
img, video, iframe, canvas, table { max-width: 100%; height: auto; }
svg { max-width: 100%; }

@media (max-width: 1024px) {
  .bento-card-clean { padding: 24px; }
}

@media (max-width: 860px) {
  .linear-nav {
    padding: 8px 16px !important;
    height: auto !important;
    min-height: 56px;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .linear-nav-center { display: none; }
  .linear-nav-right { gap: 8px; flex-wrap: wrap; margin-left: auto; }
  .linear-nav-right .linear-kbd, .linear-nav-right kbd { display: none; }
  .linear-brand-tag { display: none; }
  .page-container, .linear-container { padding-left: 18px !important; padding-right: 18px !important; }
  .framexis-main, .raccord-hero, .cinetix-hero, .agenda-hero,
  .comunidad-hero, .incubadora-hero, .hero-section {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
  .apps-dual-grid, .framexis-apps-grid, .cards-grid,
  .matrix-row, .bento-grid { grid-template-columns: 1fr !important; }
  h1, h2, .framexis-main-title, .heading-h2 { word-break: break-word; overflow-wrap: anywhere; }
}

@media (max-width: 520px) {
  .linear-nav { padding: 8px 12px !important; }
  .linear-brand-title { font-size: 14px; }
  .linear-brand-logo { width: 28px; height: 28px; }
  .linear-brand-logo svg { width: 18px; height: 18px; }
}


/* ==========================================================================
   BARRA RÁPIDA SUPERIOR (GarciFilms · Atrás · Tema) — presente en toda pantalla
   ========================================================================== */
.gf-quickbar { display: inline-flex; align-items: center; gap: 8px; }
.gf-quickbar-fixed { position: fixed; top: 14px; right: 16px; z-index: 600; }
.gf-quick-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-0);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: transform .12s cubic-bezier(.23,1,.32,1), background-color .2s ease,
              border-color .2s ease, color .2s ease;
}
.gf-quick-btn:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.gf-quick-btn:active { transform: scale(.96); }
.gf-quick-btn:focus-visible { outline: 2px solid var(--brand-raccord); outline-offset: 2px; }
.gf-quick-btn svg { width: 15px; height: 15px; display: block; }
.gf-quick-btn--icon { width: 36px; padding: 0; }
.gf-quickbar-fixed .gf-quick-btn { background: var(--bg-nav); box-shadow: var(--shadow-card); }
@media (max-width: 640px) {
  .gf-quickbar .gf-quick-label { display: none; }
  .gf-quick-btn { padding: 0 11px; }
}
