/* ==========================================================================
   Korelabs — Landing v3
   Dirección: paleta cohesiva de UN solo color (familia cobalto) sobre base
   clara, con "aurora" de luces difusas animadas por detrás. Sin bloques
   negros: todo respira en el mismo tono, con profundidad por la luz.
   ========================================================================== */

:root {
  --bg: #F6F7FB;          /* casi blanco, ligero tinte frío para unificar con el cobalto */
  --surface: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.66);
  --ink: #15172A;         /* azul-noche suave, evita el negro puro */
  --muted: #5C6173;
  --muted-2: #9096A8;
  --line: #E6E8F1;

  --accent: #1B45E0;
  --accent-2: #4E7BFF;
  --accent-3: #86A9FF;
  --accent-hover: #1638BC;
  --accent-soft: rgba(27, 69, 224, 0.09);
  --on-accent: #FFFFFF;

  --nav-bg: rgba(246, 247, 251, 0.72);
  --app-bg: #FFFFFF;
  --app-bar: #FBFBFE;
  --app-side: #FBFBFE;
  --app-track: #EDEFF6;
  --app-dot: #D9DCE8;
  --app-win: #C7CBDA;

  --maxw: 1120px;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

/* ===================== Modo oscuro ===================== */
:root[data-theme="dark"] {
  --bg: #0B0D15;
  --surface: #141726;
  --glass: rgba(22, 26, 42, 0.55);
  --ink: #ECEEF5;
  --muted: #9CA2B4;
  --muted-2: #6C7284;
  --line: rgba(255, 255, 255, 0.10);

  --accent: #5B7BFF;
  --accent-2: #7C97FF;
  --accent-3: #3A5CE0;
  --accent-hover: #6E88FF;
  --accent-soft: rgba(91, 123, 255, 0.14);

  --nav-bg: rgba(11, 13, 21, 0.72);
  --app-bg: #141726;
  --app-bar: #191D2E;
  --app-side: #10131F;
  --app-track: rgba(255, 255, 255, 0.09);
  --app-dot: rgba(255, 255, 255, 0.18);
  --app-win: rgba(255, 255, 255, 0.30);

  color-scheme: dark;
}
/* CTA atenuado en modo oscuro (no choca con el fondo) */
:root[data-theme="dark"] .cta__inner {
  background: linear-gradient(135deg, #161B33 0%, #202A54 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] .cta__inner::before {
  opacity: 0.22;
  background: radial-gradient(circle, rgba(91, 123, 255, 0.55), transparent 60%);
}
:root[data-theme="dark"] .cta__text { color: rgba(255, 255, 255, 0.72); }
:root[data-theme="dark"] .cta .btn--primary { background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(91, 123, 255, 0.3); }
:root[data-theme="dark"] .cta .btn--primary:hover { background: var(--accent-hover); }
:root[data-theme="dark"] .cta .btn--primary .btn__k { filter: brightness(0) invert(1); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
a { color: inherit; text-decoration: none; }

/* ===================== Aurora: luces difusas animadas ===================== */
.matrix { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
/* Velo translúcido que suaviza el fondo para poder leer el texto */
.veil { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: rgba(246, 247, 251, 0.5); }
:root[data-theme="dark"] .veil { background: rgba(11, 13, 21, 0.55); }
/* El contenido va por encima del fondo animado */
main, .footer { position: relative; z-index: 1; }
@keyframes drift2 { from { transform: translate(0,0) scale(1.05); } to { transform: translate(-22vmax, 18vmax) scale(0.85); } }

/* ===================== Reveal on scroll ===================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease) var(--d, 0ms), transform 0.7s var(--ease) var(--d, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ===================== Botones ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: 15px; padding: 12px 22px;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.05s ease, box-shadow 0.25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--sm { padding: 9px 16px; font-size: 14px; }
.btn--lg { padding: 15px 28px; font-size: 16px; }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 26px rgba(27, 69, 224, 0.22); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: 0 16px 36px rgba(27, 69, 224, 0.3); }

.btn__k {
  display: block; height: 1.1em; width: auto; aspect-ratio: 698 / 849;
  transform: rotate(-90deg); transition: transform 0.25s var(--ease);
}
.btn--primary .btn__k { filter: brightness(0) invert(1); }
.btn:hover .btn__k { transform: rotate(-90deg) translateX(2px); }
.cta .btn--primary .btn__k { filter: none; }

.link-arrow { position: relative; font-weight: 600; font-size: 15px; color: var(--ink); padding-bottom: 3px; }
.link-arrow::after { content: "→"; display: inline-block; margin-left: 6px; transition: transform 0.25s var(--ease); }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ===================== Kickers ===================== */
.eyebrow, .kicker {
  display: inline-block; font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.eyebrow { color: var(--accent); margin-bottom: 24px; }
.kicker, .kicker--light { color: var(--muted-2); margin-bottom: 14px; }

/* ===================== Nav ===================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { display: block; height: 26px; width: auto; aspect-ratio: 698 / 849; }
.brand__name { font-weight: 700; font-size: 18px; letter-spacing: -0.2px; }
.nav__links { display: flex; gap: 34px; }
.nav__links a { position: relative; color: var(--muted); font-size: 15px; font-weight: 500; transition: color 0.2s ease; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: var(--accent); transition: width 0.25s var(--ease); }
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

/* ===================== Hero ===================== */
.hero { position: relative; padding: 118px 0 84px; }
.hero__title {
  font-family: 'Fraunces', Georgia, serif; font-weight: 500;
  font-size: clamp(2.7rem, 7.5vw, 5.4rem); line-height: 1.02;
  letter-spacing: -0.025em; max-width: 16ch;
}
.hero__accent { color: var(--accent); font-style: italic; }
.hero__row { margin-top: 40px; display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.hero__sub { max-width: 46ch; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.18rem); }
.hero__cta { display: flex; align-items: center; gap: 24px; }

.scroll-cue {
  position: absolute; right: 28px; bottom: 34px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted-2); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  writing-mode: vertical-rl;
}
.scroll-cue__line { width: 1px; height: 46px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue__line::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--accent); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { top: -50%; } 100% { top: 100%; } }

/* ===================== Marquee ===================== */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 18px 0; background: var(--glass); backdrop-filter: blur(6px); }
.marquee__track { display: inline-flex; align-items: center; gap: 26px; white-space: nowrap; animation: marquee 30s linear infinite; font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; color: var(--ink); }
.marquee__track .dot { color: var(--accent); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===================== Showcase (claro, sobre la aurora) ===================== */
.showcase { padding: 96px 0; position: relative; }
.showcase__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 48px; }
.showcase__title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: clamp(2.4rem, 6vw, 3.6rem); letter-spacing: -0.02em; margin-top: 6px; }
.showcase__lead { color: var(--muted); font-size: 1.15rem; margin-top: 6px; }
.showcase__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }

/* App mock (tema claro) */
.app {
  border-radius: 16px;
  background: var(--app-bg);
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(27, 69, 224, 0.14), 0 6px 20px rgba(21, 23, 42, 0.06);
  overflow: hidden;
}
.app__bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--app-bar); }
.app__dots { display: flex; gap: 7px; }
.app__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--app-dot); }
.app__name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.app__logo { height: 15px; width: auto; aspect-ratio: 698 / 849; }
.app__win { display: flex; gap: 14px; }
.app__win i { width: 11px; height: 2px; background: var(--app-win); }

.app__body { display: grid; grid-template-columns: 140px 1fr; min-height: 300px; }
.app__side { padding: 16px 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; background: var(--app-side); }
.app__navitem { font-size: 13px; color: var(--muted); padding: 8px 12px; border-radius: 8px; transition: background 0.2s ease, color 0.2s ease; }
.app__navitem.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.app__navitem--accent { color: var(--accent-2); }

.app__main { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.app__stats { display: flex; flex-direction: column; gap: 14px; }
.stat__top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.stat__top b { color: var(--ink); }
.bar { height: 8px; border-radius: 999px; background: var(--app-track); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.app__cta { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(27, 69, 224, 0.2); }
.app__cta-label { font-size: 13px; color: var(--muted); }
.app__cta-btn { font-size: 13px; font-weight: 600; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }

.app__list { list-style: none; display: flex; flex-direction: column; }
.app__list li { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); padding: 8px 4px; border-bottom: 1px solid var(--line); }
.app__list li:last-child { border-bottom: 0; }
.app__list li b { color: var(--ink); font-weight: 500; }

/* Showcase info */
.showcase__text { color: var(--muted); font-size: 1.08rem; }
.feature-list { list-style: none; margin: 26px 0; display: flex; flex-direction: column; }
.feature-list li { padding: 16px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.feature-list li:last-child { border-bottom: 1px solid var(--line); }
.feature-list b { font-size: 1rem; color: var(--ink); }
.feature-list span { color: var(--muted); font-size: 0.95rem; }
.showcase__actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 26px; }
.showcase__meta { color: var(--muted-2); font-size: 14px; }

.pill { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.pill--live { background: var(--accent-soft); color: var(--accent); border-color: rgba(27, 69, 224, 0.22); }

/* Próximos */
.soon-grid { margin-top: 56px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.soon { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--glass); backdrop-filter: blur(6px); transition: border-color 0.25s ease, transform 0.25s var(--ease); }
.soon:hover { transform: translateY(-3px); border-color: var(--accent-3); }
.soon__title { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: 1.3rem; margin-top: 14px; color: var(--ink); }
.soon__text { color: var(--muted); margin-top: 8px; font-size: 0.95rem; }

/* ===================== Secciones ===================== */
.section { padding: 96px 0; position: relative; }
.section__head { margin-bottom: 52px; }
.section__title { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; }

/* Principios */
.principles { list-style: none; border-top: 1px solid var(--line); }
.principle { display: grid; grid-template-columns: 88px 1fr; gap: 24px; align-items: start; padding: 30px 12px; border-bottom: 1px solid var(--line); transition: background 0.25s ease, padding-left 0.25s var(--ease); border-radius: 12px; }
.principle:hover { background: var(--glass); padding-left: 22px; }
.principle__num { font-family: 'Fraunces', Georgia, serif; font-size: 1.6rem; color: var(--accent); font-weight: 500; }
.principle h3 { font-size: 1.22rem; font-weight: 600; }
.principle p { color: var(--muted); margin-top: 6px; max-width: 60ch; }

/* Nosotros */
.section--about { background: var(--glass); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; }
.about__title { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; }
.about__lead { font-size: 1.25rem; color: var(--ink); }
.about__text { color: var(--muted); margin-top: 18px; }
.about__signature { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; }
.about__name { font-family: 'Dancing Script', cursive; font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--accent); }
.about__role { color: var(--muted-2); font-size: 0.92rem; margin-top: 8px; }

/* ===================== CTA (degradado del mismo color) ===================== */
.cta { padding: 100px 0; }
.cta__inner {
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(135deg, #1B45E0 0%, #3A63F0 45%, #5B84FF 100%);
  color: #fff; border-radius: 28px; padding: 84px 28px;
  box-shadow: 0 30px 70px rgba(27, 69, 224, 0.32);
}
.cta__inner::before {
  content: ""; position: absolute; width: 40vmax; height: 40vmax; border-radius: 50%;
  top: -20vmax; right: -10vmax; background: radial-gradient(circle, rgba(255,255,255,0.35), transparent 60%);
  animation: drift2 24s var(--ease) infinite alternate;
}
.cta__title, .cta__text, .cta .btn { position: relative; z-index: 1; }
.cta__title { font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.02em; }
.cta__text { color: rgba(255,255,255,0.85); margin: 12px 0 32px; }
.cta .btn--primary { background: #fff; color: var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,0.14); }
.cta .btn--primary:hover { background: #eef1ff; }

/* ===================== Footer ===================== */
.footer { border-top: 1px solid var(--line); padding: 64px 0 32px; background: var(--glass); backdrop-filter: blur(8px); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer__col { display: flex; flex-direction: column; gap: 12px; }
.footer__col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); font-weight: 600; margin-bottom: 4px; }
.footer__col a { color: var(--muted); font-size: 15px; transition: color 0.2s ease; }
.footer__col a:hover { color: var(--accent); }
.footer__col--brand .brand__name { font-size: 18px; }
.footer__tag { color: var(--muted); font-size: 15px; max-width: 30ch; }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 14px; }

/* ===================== Responsive ===================== */
@media (max-width: 900px) {
  .showcase__grid { grid-template-columns: 1fr; gap: 36px; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .nav__links { display: none; }
  .hero { padding: 80px 0 60px; }
  .hero__row { flex-direction: column; align-items: flex-start; gap: 28px; }
  .scroll-cue { display: none; }
  .section, .showcase, .cta { padding: 64px 0; }
  .soon-grid { grid-template-columns: 1fr; }
  .principle { grid-template-columns: 54px 1fr; gap: 14px; padding: 24px 4px; }
  .principle:hover { padding-left: 4px; }
  .cta__inner { padding: 56px 22px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .app__body { grid-template-columns: 1fr; }
  .app__side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .footer__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
