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

:root {
  --color-left-bg:     #1a0f0a;
  --color-left-accent: #c9955c;
  --color-left-muted:  #7a5030;
  --color-left-text:   #f5ede3;

  --color-right-bg:     #060d18;
  --color-right-accent: #4fc0e8;
  --color-right-muted:  #1e4060;
  --color-right-text:   #d8eaf5;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Barlow', sans-serif;
  --font-mono:    'Barlow Condensed', monospace;

  --ease-slide:     cubic-bezier(0.77, 0, 0.175, 1);
  --duration-hover: 700ms;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: #000;
}

/* ── Split Screen Container ───────────────────────────────── */
.split-screen {
  display: flex;
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ── Panel (compartido) ───────────────────────────────────── */
.split-screen__panel {
  position: relative;
  flex: 0 0 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
}

/* ── Background ───────────────────────────────────────────── */
.split-screen__panel .split-screen__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: transform 0ms, opacity var(--duration-hover) var(--ease-slide);
}

.split-screen__panel--left .split-screen__bg {
  background:
    radial-gradient(ellipse 80% 80% at 20% 40%, #5c2e0e55 0%, transparent 60%),
    radial-gradient(ellipse 60% 90% at 80% 80%, #8a420022 0%, transparent 55%),
    linear-gradient(160deg, #2b1406 0%, #1a0f0a 50%, #0e0705 100%);
}

.split-screen__panel--right .split-screen__bg {
  background:
    radial-gradient(ellipse 80% 80% at 80% 30%, #0a3a5e55 0%, transparent 60%),
    radial-gradient(ellipse 60% 90% at 20% 80%, #0a2a4422 0%, transparent 55%),
    linear-gradient(200deg, #060d18 0%, #0b1f36 50%, #030810 100%);
}

.split-screen__panel:hover .split-screen__bg {
  transform: scale(1.04);
}

/* ── Noise overlay ────────────────────────────────────────── */
.split-screen__panel .split-screen__noise {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}

/* ── Numbers background (izquierdo) ───────────────────────── */
.split-screen__panel .split-screen__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
}

.split-screen__panel .split-screen__grid pre {
  font-family: 'Courier New', monospace;
  font-size: clamp(0.6rem, 1.3vw, 0.9rem);
  line-height: 2;
  color: rgba(201, 149, 92, 0.09);
  white-space: pre;
  text-align: left;
  user-select: none;
  animation: code-scroll 30s linear infinite;
}

/* ── Code background (derecho) ────────────────────────────── */
.split-screen__panel .split-screen__code {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 2rem;
}

.split-screen__panel .split-screen__code pre {
  font-family: 'Courier New', monospace;
  font-size: clamp(0.55rem, 1.2vw, 0.8rem);
  line-height: 1.8;
  color: rgba(79, 192, 232, 0.07);
  white-space: pre;
  text-align: left;
  user-select: none;
  animation: code-scroll 25s linear infinite;
}

/* ── Content wrapper ──────────────────────────────────────── */
.split-screen__panel .split-screen__content {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
}

/* ── Label ────────────────────────────────────────────────── */
.split-screen__panel .split-screen__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.55;
}

.split-screen__panel--left .split-screen__label {
  color: var(--color-left-accent);
}

.split-screen__panel--right .split-screen__label {
  color: var(--color-right-accent);
}

/* ── Title ────────────────────────────────────────────────── */
.split-screen__panel .split-screen__title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  overflow: hidden;
}

.split-screen__panel--left .split-screen__title {
  color: var(--color-left-text);
}

.split-screen__panel--right .split-screen__title {
  color: var(--color-right-text);
}

.split-screen__panel .split-screen__title-first {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  font-style: italic;
  display: block;
}

.split-screen__panel .split-screen__title-last {
  font-size: clamp(2.8rem, 6.5vw, 5rem);
  font-weight: 900;
  display: block;
}

/* ── Tagline ──────────────────────────────────────────────── */
.split-screen__panel .split-screen__tagline {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.split-screen__panel--left .split-screen__tagline {
  color: var(--color-left-text);
}

.split-screen__panel--right .split-screen__tagline {
  color: var(--color-right-text);
}

.split-screen__panel:hover .split-screen__tagline {
  opacity: 0.6;
  transform: translateY(0);
}

/* ── Button ───────────────────────────────────────────────── */
.split-screen__panel .split-screen__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid currentColor;
  padding: 0.7em 1.6em;
  margin-top: 0.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease 0.3s,
              transform 0.4s ease 0.3s,
              background 0.2s ease,
              color 0.2s ease;
}

.split-screen__panel:hover .split-screen__btn {
  opacity: 1;
  transform: translateY(0);
}

.split-screen__panel--left .split-screen__btn {
  color: var(--color-left-accent);
  border-color: var(--color-left-accent);
}

.split-screen__panel--left .split-screen__btn:hover {
  background: var(--color-left-accent);
  color: var(--color-left-bg);
}

.split-screen__panel--right .split-screen__btn {
  color: var(--color-right-accent);
  border-color: var(--color-right-accent);
}

.split-screen__panel--right .split-screen__btn:hover {
  background: var(--color-right-accent);
  color: var(--color-right-bg);
}

.split-screen__panel .split-screen__btn svg {
  transition: transform 0.25s ease;
}

.split-screen__panel .split-screen__btn:hover svg {
  transform: translateX(4px);
}

/* ── Decorative floating symbols ──────────────────────────── */
.split-screen__panel .split-screen__deco {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.split-screen__panel .split-screen__deco span {
  position: absolute;
  font-family: var(--font-display);
  opacity: 0.04;
  user-select: none;
  animation: float-deco 20s infinite linear;
}

.split-screen__panel .split-screen__deco span:nth-child(1) { top:  8%; left: 10%; animation-delay:   0s; font-size: 3rem;   }
.split-screen__panel .split-screen__deco span:nth-child(2) { top: 25%; left: 75%; animation-delay:  -4s; font-size: 1.5rem; }
.split-screen__panel .split-screen__deco span:nth-child(3) { top: 60%; left: 20%; animation-delay:  -8s; font-size: 2.5rem; }
.split-screen__panel .split-screen__deco span:nth-child(4) { top: 80%; left: 65%; animation-delay:  -2s; font-size: 1.8rem; }
.split-screen__panel .split-screen__deco span:nth-child(5) { top: 15%; left: 55%; animation-delay:  -6s; font-size: 1.2rem; }
.split-screen__panel .split-screen__deco span:nth-child(6) { top: 45%; left:  5%; animation-delay: -10s; font-size: 2.8rem; }
.split-screen__panel .split-screen__deco span:nth-child(7) { top: 70%; left: 85%; animation-delay: -14s; font-size: 1.4rem; }
.split-screen__panel .split-screen__deco span:nth-child(8) { top: 90%; left: 40%; animation-delay:  -3s; font-size: 2rem;   }

/* ── Borde derecho panel izquierdo ────────────────────────── */
.split-screen__panel--left::after {
  content: '';
  position: absolute;
  right: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--color-left-muted), transparent);
  z-index: 20;
  opacity: 0.4;
}

/* ── Divider central ──────────────────────────────────────── */
.split-screen__divider {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 0;
  z-index: 30;
  pointer-events: none;
  transform: translateX(-50%);
}

.split-screen__divider .split-screen__divider-line {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 20%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.15) 80%,
    transparent 100%
  );
  transform: translateX(-50%);
}

.split-screen__divider .split-screen__divider-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
  animation: pulse-dot 3s ease-in-out infinite;
}

/* ── Keyframes ────────────────────────────────────────────── */
@keyframes float-deco {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-12px) rotate(3deg); }
  66%       { transform: translateY(8px) rotate(-2deg); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 0.9; transform: translate(-50%, -50%) scale(1.4); }
}

@keyframes code-scroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-30px); }
}

/* ══════════════════════════════════════════════════════════
   MOBILE — Slider divisor draggable
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  html, body { overflow: hidden; height: 100%; }

  .split-screen {
    height: 100vh;
    overflow: hidden;
    position: relative;
    /* neutralizar el flex row del desktop */
    display: block !important;
  }

  /* Ambos paneles absolutamente posicionados, JS controla top y height */
  .split-screen__panel {
    position: absolute !important;
    left: 0;
    width: 100%;
    overflow: hidden;
    /* sin flex, sin bottom */
    flex: none !important;
  }

  .split-screen__panel--left::after { display: none; }

  .split-screen__panel .split-screen__content {
    justify-content: center;
    padding: 1.5rem;
    gap: 0.5rem;
  }

  /* Tagline y btn ocultos por defecto */
  .split-screen__panel .split-screen__tagline {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .split-screen__panel .split-screen__btn {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s,
                background 0.2s, color 0.2s;
  }

  /* Clase .reveal-extra → mostrar tagline + btn */
  .split-screen__panel.reveal-extra .split-screen__tagline {
    opacity: 0.7;
    transform: translateY(0);
  }
  .split-screen__panel.reveal-extra .split-screen__btn {
    opacity: 1;
    transform: translateY(0);
  }

  .split-screen__panel .split-screen__code { justify-content: center; }

  /* ── Divisor ─────────────────────────────────────────── */
  /* El JS setea divider.style.top = pct + 'vh'
     El divider no tiene transform, la línea vive adentro centrada */
  .split-screen__divider {
    position: absolute !important;
    left: 0 !important;
    width: 100% !important;
    height: 0 !important;       /* altura 0, la línea sale negativa */
    transform: none !important;
    z-index: 100 !important;
    pointer-events: all !important;
    cursor: ns-resize;
    touch-action: none;
  }

  /* Línea: centrada verticalmente sobre top del divider */
  .split-screen__divider .split-screen__divider-line {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 1.5px !important;
    transform: translateY(-50%) !important;
    background: linear-gradient(
      to right,
      transparent 0%,
      rgba(255,255,255,0.15) 8%,
      rgba(255,255,255,0.6)  35%,
      rgba(255,255,255,0.9)  50%,
      rgba(255,255,255,0.6)  65%,
      rgba(255,255,255,0.15) 92%,
      transparent 100%
    ) !important;
    pointer-events: none;
  }

  /* Punto: centrado sobre la línea */
  .split-screen__divider .split-screen__divider-dot {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    width: 28px !important;
    height: 28px !important;
    transform: translate(-50%, -50%) !important;
    background: rgba(255,255,255,0.65) !important;
    border-radius: 50% !important;
    animation: none !important;
    box-shadow: 0 0 0 5px rgba(255,255,255,0.1), 0 2px 10px rgba(0,0,0,0.4) !important;
    transition: background 0.15s !important;
    cursor: ns-resize;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .split-screen__divider.is-dragging .split-screen__divider-dot {
    background: rgba(255,255,255,0.9) !important;
    box-shadow: 0 0 0 8px rgba(255,255,255,0.12), 0 4px 16px rgba(0,0,0,0.5) !important;
  }

  /* Hint */
  .drag-hint {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, 16px);
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    pointer-events: none;
    transition: opacity 0.5s ease;
  }
  .drag-hint.hidden { opacity: 0; }
}