/* =========================================================
   IdeaFlow — Cinematic Video Scroll Experience
   Dark, minimal, no gradients, no neons
   ========================================================= */

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #03030a;
  --text:      #f0ede8;
  --text-muted:#9896a0;
  --accent:    #d4a96a;
  --accent-dim:#8a6a3e;
  --glass-bg:  rgba(3, 3, 10, 0.72);
  --glass-border: rgba(240, 237, 232, 0.08);
  --font-display: 'Cabinet Grotesk', system-ui, sans-serif;
  --font-body:    'Satoshi', system-ui, sans-serif;
  --radius: 4px;
  --nav-h: 64px;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* overflow-x: hidden crea scroll container en Safari y rompe position:fixed.
     Usar overflow-x: clip que no crea scroll container (Safari 16+, Chrome 90+). */
  overflow-x: clip;
  scroll-behavior: auto; /* JS handles scrolling */
}

body {
  background: var(--bg);
  min-height: 100vh;
  /* Igual que html: clip en lugar de hidden para preservar position:fixed */
  overflow-x: clip;
}

/* ── Loader ────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.loader--done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.loader__bar {
  width: 200px;
  height: 2px;
  background: rgba(240, 237, 232, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.loader__fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.loader__status {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Navigation ────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-h);
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav--scrolled {
  background: rgba(3, 3, 10, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-color: var(--glass-border);
}

.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav__link:hover { color: var(--text); }

.nav__cta {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: var(--accent);
  color: #0a0804;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: var(--radius);
  transition: opacity 0.2s;
}
.nav__cta:hover { opacity: 0.85; }

/* Burger — hidden on desktop */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
}

/* ── Progress bar ──────────────────────────────────────── */
.progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 190;
  height: 2px;
  background: transparent;
}
.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.05s linear;
}

/* ── Scroll video — fixed fullscreen ──────────────────── */
.scroll-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  /* Ensure first frame shows while loading */
  background: var(--bg);
  /* Safari: promueve el video a su propia capa para mejor rendering */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: contents;
}

/* ── Vignette ──────────────────────────────────────────── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(3, 3, 10, 0.55) 100%
  );
}

/* ── Driver (scroll spacer) ────────────────────────────── */
.driver {
  position: relative;
  z-index: -1;
  width: 100%;
  /* Height set by JS */
}

/* ── Overlay (all panels) ──────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* ── Panels ────────────────────────────────────────────── */
.panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: none; /* opacity driven by JS RAF */
  padding: var(--nav-h) 32px 64px;
}

/* Positioning variants */
.panel__body--center  { margin: auto; text-align: center; }
.panel__body--left    { margin-right: auto; }
.panel__body--right   { margin-left: auto; }
.panel__body--bottom  { margin-top: auto; padding-bottom: 80px; }

.panel__body {
  max-width: 540px;
  width: 100%;
}
.panel__body--wide {
  max-width: 640px;
}

/* Glass card (non-hero panels) */
.panel__body--glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 40px 44px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

/* ── Typography ────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.h-hero {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
}
.h-hero em {
  font-style: normal;
  color: var(--accent);
}

.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 16px;
}
.h2--xl {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.0;
}

.sub {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 420px;
  margin: 0 auto 32px;
}

.body-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

/* ── Buttons ───────────────────────────────────────────── */
.btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.btn--gold {
  background: var(--accent);
  color: #0a0804;
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(240, 237, 232, 0.2);
}
.btn:hover { opacity: 0.82; }

/* ── Scroll cue ────────────────────────────────────────── */
.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cue-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(240,237,232,0.4), transparent);
  animation: cue-pulse 2s ease-in-out infinite;
}
@keyframes cue-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.15); }
}

/* ── Stats grid ────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.stat span {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Phase chip ────────────────────────────────────────── */
.phase-chip {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--c, var(--accent));
  color: var(--c, var(--accent));
  margin-bottom: 14px;
}

/* ── Agent tags ────────────────────────────────────────── */
.agents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.agent {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: rgba(240, 237, 232, 0.07);
  border: 1px solid rgba(240, 237, 232, 0.15);
  border-radius: var(--radius);
  color: rgba(240, 237, 232, 0.70);
  letter-spacing: 0.02em;
}

/* ── Outputs list ──────────────────────────────────────── */
.outs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text);
}
.outs div::before { margin-right: 4px; }

/* ── Phase label (bottom center) ──────────────────────── */
.phase-label {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* ── CTA Form ──────────────────────────────────────────── */
.form {
  margin-bottom: 28px;
}
.form__wrap {
  display: flex;
  gap: 0;
  border: 1px solid rgba(240, 237, 232, 0.18);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(240, 237, 232, 0.04);
}
.form__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  min-width: 0;
}
.form__input::placeholder { color: var(--text-muted); }
.form__btn {
  background: var(--accent);
  color: #0a0804;
  border: none;
  padding: 0 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.form__btn:hover { opacity: 0.85; }
.form__hint {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Trust bar ─────────────────────────────────────────── */
.trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.trust__item {
  text-align: center;
}
.trust__item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.trust__item span {
  font-size: 0.75rem;
  color: rgba(240,237,232,0.65);
}
.trust__sep {
  color: var(--glass-border);
  font-size: 1.25rem;
}

/* ── Metric row (sistema panel) ────────────────────── */
.metric-row {
  display: flex;
  gap: 28px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}
.metric b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 2px;
}
.metric span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Phase timeline (lateral derecha) ──────────────── */
.timeline {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.timeline.timeline--visible {
  opacity: 1;
  pointer-events: auto;
}
.timeline__label {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: right;
}
.timeline__items {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.timeline__items::before {
  content: '';
  position: absolute;
  right: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: rgba(240,237,232,0.1);
}
.timeline__item {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 6px 0;
  cursor: pointer;
  position: relative;
}
.timeline__item::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(240,237,232,0.2);
  border: 1px solid rgba(240,237,232,0.15);
  flex-shrink: 0;
  transition: background 0.3s, transform 0.3s;
  position: relative;
  z-index: 1;
}
.timeline__item span {
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.2s, transform 0.2s, color 0.2s;
  white-space: nowrap;
}
.timeline__item:hover span,
.timeline__item.timeline__item--active span {
  opacity: 1;
  transform: translateX(0);
}
.timeline__item.timeline__item--active::after {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.4);
}
.timeline__item.timeline__item--active span {
  color: var(--accent);
}
.timeline__item.timeline__item--done::after {
  background: rgba(212,169,106,0.35);
  border-color: rgba(212,169,106,0.35);
}

/* ── Transition cut flash ─────────────────────────────── */
.cut-flash {
  position: fixed;
  inset: 0;
  z-index: 5; /* above video+vignette, below panels */
  background: #000;
  opacity: 0;
  pointer-events: none;
  /* No CSS transition — JS drives opacity directly for frame-accurate sync */
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .timeline { display: none; }
  .nav__inner { padding: 0 20px; }
  .nav__links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(3, 3, 10, 0.96);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 24px 20px 32px;
    gap: 24px;
    border-bottom: 1px solid var(--glass-border);
    z-index: 199;
  }
  .nav__links--open { display: flex; }
  .nav__burger { display: flex; }
  .nav__link, .nav__cta { width: 100%; text-align: center; justify-content: center; }

  .panel { padding: 80px 16px 60px; align-items: flex-end; }
  .panel__body--center { text-align: left; margin: 0 0 0 0; }
  .panel__body--bottom { padding-bottom: 40px; }
  .panel__body--glass { padding: 24px; }
  .panel__body--right, .panel__body--left { margin: 0; }

  .h-hero { font-size: clamp(2rem, 8vw, 3rem); }
  .h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
  .h2--xl { font-size: clamp(2rem, 7vw, 2.75rem); }

  .sub { text-align: left; }
  .btns { justify-content: flex-start; }

  .stats { grid-template-columns: 1fr; gap: 12px; }
  .stat b { font-size: 1.5rem; }

  .trust { gap: 12px; }
  .trust__sep { display: none; }

  .form__btn { padding: 0 16px; font-size: 0.75rem; }

  .phase-label { font-size: 0.625rem; bottom: 20px; }
}

@media (max-width: 480px) {
  .form__wrap { flex-direction: column; }
  .form__btn { padding: 14px; width: 100%; }
}

/* ── Word reveal (SplitText) ───────────────────────────── */
.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.1;
  /* small padding so descenders aren't clipped */
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}
.word__inner {
  display: inline-block;
  transform: translateY(105%);
  opacity: 0;
  will-change: transform, opacity;
}

/* ── Hero title — video clip effect ───────────────────── */
.h-hero--clip {
  background: linear-gradient(
    135deg,
    #f0ede8 0%,
    #d4a96a 40%,
    #f0ede8 70%,
    #a07840 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  background-size: 200% 200%;
  animation: shimmer 6s ease-in-out infinite;
}
.h-hero--clip em {
  -webkit-text-fill-color: transparent;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Custom cursor ─────────────────────────────────────── */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  border: 1px solid rgba(212, 169, 106, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  will-change: transform;
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
  mix-blend-mode: difference;
}
.cursor__dot {
  position: fixed;
  top: 0; left: 0;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}
.cursor--hover {
  width: 56px; height: 56px;
  border-color: rgba(212, 169, 106, 0.9);
}
.cursor--out {
  opacity: 0;
}

/* ── Magnetic button base ──────────────────────────────── */
.btn, .nav__cta {
  will-change: transform;
}

/* ── Panel glass — accent left border per phase ──────────── */
.panel--cards .panel__body--glass {
  border-left: 2px solid rgba(212, 169, 106, 0.25);
}


/* ── Scroll cue pulse enhancement ──────────────────────── */
.scroll-cue span {
  animation: cue-text-fade 3s ease-in-out infinite;
}
@keyframes cue-text-fade {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.9; }
}

/* =========================================================
   NUEVAS SECCIONES — Carrusel, CTA inmersivo, i18n
   ========================================================= */

/* ── Carrusel post-vídeo ───────────────────────────────── */
.carousel-section {
  position: relative;
  z-index: 20;
  background: var(--bg);
  padding: 100px 0 80px;
  border-top: 1px solid var(--glass-border);
}
.carousel-header {
  text-align: center;
  padding: 0 32px;
  margin-bottom: 48px;
}
.carousel-track-wrap {
  position: relative;
  overflow: hidden;
  padding: 0 60px;
}
.carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
  cursor: grab;
  user-select: none;
}
.carousel-track:active { cursor: grabbing; }

/* Cards */
.card {
  min-width: calc(33.333% - 14px);
  background: rgba(8, 8, 20, 0.85);
  border: 1px solid rgba(240, 237, 232, 0.12);
  border-radius: 10px;
  padding: 32px 28px;
  flex-shrink: 0;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.card:hover {
  border-color: rgba(212,169,106,0.35);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.50), 0 0 0 1px rgba(212,169,106,0.08);
}
.card__icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 0 12px var(--ic, #d4a96a));
}
.card__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 10px;
}
.card__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Carousel nav buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(240,237,232,0.06);
  border: 1px solid var(--glass-border);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  z-index: 10;
}
.carousel-btn:hover { background: rgba(212,169,106,0.15); border-color: rgba(212,169,106,0.4); }
.carousel-btn--prev { left: 8px; }
.carousel-btn--next { right: 8px; }

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.carousel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(240,237,232,0.2);
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}
.carousel-dot--active {
  background: var(--accent);
  transform: scale(1.4);
}

/* Carousel final CTA */
.carousel-cta {
  text-align: center;
  padding: 80px 32px 40px;
  border-top: 1px solid var(--glass-border);
  margin-top: 60px;
}

/* ── CTA Fullscreen Inmersivo ───────────────────────────── */
.cta-immersive {
  position: absolute;
  inset: 0;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  padding: 80px 24px 40px;
  text-align: center;
  pointer-events: auto;
  overflow: visible;
  isolation: isolate;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
/* Overlay oscuro sobre el vídeo — mejora legibilidad de TODOS los textos del CTA */
.cta-immersive::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Degradado radial: más oscuro en el centro donde está el contenido */
  background:
    radial-gradient(ellipse 80% 90% at 50% 55%,
      rgba(3,3,10,0.78) 0%,
      rgba(3,3,10,0.55) 55%,
      rgba(3,3,10,0.20) 100%);
  pointer-events: none;
  z-index: 0;
}
/* Todo el contenido directo del CTA debe estar SOBRE el overlay */
.cta-immersive > * {
  position: relative;
  z-index: 1;
}
.cta-title {
  margin-bottom: 12px;
}
.cta-sub {
  font-size: 1rem;
  /* Más legible sobre el vídeo con el nuevo overlay */
  color: rgba(240,237,232,0.80);
  margin-bottom: 36px;
  max-width: 40ch;
  text-shadow: 0 1px 8px rgba(3,3,10,0.6);
}

/* Idea input */
.idea-input-wrap {
  width: 100%;
  max-width: 640px;
  margin-bottom: 32px;
  pointer-events: auto;
}
.idea-input-inner {
  position: relative;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(240,237,232,0.20);
  border-radius: 8px;
  padding: 20px 20px 40px;
  transition: border-color 0.3s, box-shadow 0.3s;
  margin-bottom: 12px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  /* Sombra interior sutil para dar profundidad al campo */
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.25);
}
.idea-input-inner:focus-within {
  border-color: rgba(212,169,106,0.55);
  background: rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.20), 0 0 0 3px rgba(212,169,106,0.09);
}

.idea-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  resize: none;
  font-family: var(--font-body), -apple-system, sans-serif;
  font-size: 1.0625rem;
  color: #f0ede8;
  -webkit-text-fill-color: #f0ede8;
  line-height: 1.65;
  min-height: 80px;
  pointer-events: auto;
  /* Safari: eliminar TODOS los estilos nativos */
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  /* Safari: display y dimensiones */
  display: block;
  max-width: 100%;
  /* Safari: quitar sombra interna nativa */
  -webkit-box-shadow: none;
  box-shadow: none;
}
.idea-textarea:focus {
  outline: none !important;
  -webkit-box-shadow: none;
  box-shadow: none;
}
.idea-textarea::placeholder {
  color: rgba(240,237,232,0.4);
  -webkit-text-fill-color: rgba(240,237,232,0.4);
  opacity: 1;
}
.idea-input-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 0 0 8px 8px;
  transform: scaleX(0);
  transition: transform 0.4s ease;
}
.idea-input-inner:focus-within .idea-input-bar { transform: scaleX(1); }
.idea-char-count {
  position: absolute;
  bottom: 10px; right: 14px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.idea-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #0a0804;
  -webkit-text-fill-color: #0a0804;
  border: none;
  border-radius: 6px;
  padding: 16px 32px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.2s, transform 0.2s;
  width: 100%;
  justify-content: center;
  pointer-events: auto;
}
.idea-submit-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.idea-submit-btn:active { transform: translateY(0); }
.idea-submit-icon { display: flex; align-items: center; }

/* Agents grid */
.agents-grid {
  display: -webkit-grid; /* Safari fallback */
  display: grid;
  -webkit-grid-template-columns: repeat(6, 1fr); /* Safari fallback */
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 640px;
  width: 100%;
  margin-bottom: 24px;
  box-sizing: border-box;
  /* Safari: isolation crea stacking context propio para que el grid no
     quede colapsado por la opacidad animada del panel padre */
  isolation: isolate;
  /* Safari: forzar compositing propio para que grid no sea aplastado */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  position: relative;
  z-index: 1;
}
.agent-node {
  /* Safari: usar flex para centrar contenido — grid item + flex container
     evita el bug de renderizado de texto en grid anidado */
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  background: rgba(240,237,232,0.04);
  border: 1px solid rgba(240,237,232,0.08);
  border-radius: 6px;
  padding: 8px 4px;
  text-align: center;
  font-size: 0.6875rem;
  color: rgba(240,237,232,0.45);
  letter-spacing: 0.03em;
  transition: background 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
  cursor: default;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  /* Safari: forzar que cada nodo no colapsa */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.agent-node span { display: block; }
.agent-node--active {
  background: rgba(212,169,106,0.1);
  border-color: rgba(212,169,106,0.4);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(212,169,106,0.15);
}
.agent-node--pulse {
  animation: agent-pulse 1s ease-in-out infinite;
}
@keyframes agent-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(212,169,106,0.2); }
  50%       { box-shadow: 0 0 20px rgba(212,169,106,0.5); }
}

/* ── Language selector ─────────────────────────────────── */
.lang-selector {
  position: relative;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(240, 237, 232, 0.06);
  border: 1px solid rgba(240, 237, 232, 0.18);
  border-radius: 6px;
  color: rgba(240, 237, 232, 0.75);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 7px 12px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
.lang-btn svg {
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.lang-btn:hover {
  background: rgba(212, 169, 106, 0.10);
  border-color: rgba(212, 169, 106, 0.45);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(212, 169, 106, 0.08);
}
.lang-btn:hover svg { opacity: 1; }
.lang-btn--open {
  background: rgba(212, 169, 106, 0.10);
  border-color: rgba(212, 169, 106, 0.50);
  color: var(--text);
}
.lang-btn--open svg { opacity: 1; -webkit-transform: rotate(180deg); transform: rotate(180deg); }

.lang-dropdown {
  position: fixed;
  top: 72px;   /* fallback: JS sobreescribe con getBoundingClientRect */
  right: 24px; /* fallback */
  background: #0d0d1a;
  border: 1px solid rgba(212, 169, 106, 0.20);
  border-radius: 8px;
  overflow: hidden;
  min-width: 176px;
  opacity: 0;
  visibility: hidden;
  -webkit-transform: translateY(-6px) scale(0.98);
  transform: translateY(-6px) scale(0.98);
  -webkit-transform-origin: top right;
  transform-origin: top right;
  transition: opacity 0.18s cubic-bezier(0.16,1,0.3,1), -webkit-transform 0.18s cubic-bezier(0.16,1,0.3,1), transform 0.18s cubic-bezier(0.16,1,0.3,1), visibility 0.18s ease;
  z-index: 99999;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.3),
    0 20px 60px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.04),
    inset 0 1px 0 rgba(255,255,255,0.04);
}
.lang-dropdown--open {
  opacity: 1;
  visibility: visible;
  -webkit-transform: translateY(0) scale(1);
  transform: translateY(0) scale(1);
}
.lang-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 11px 16px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(240, 237, 232, 0.65);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  border-bottom: 1px solid rgba(240, 237, 232, 0.05);
  position: relative;
}
.lang-opt:last-child { border-bottom: none; }
.lang-opt:hover {
  background: rgba(212, 169, 106, 0.08);
  color: var(--text);
}
.lang-opt--active {
  color: var(--accent);
  background: rgba(212, 169, 106, 0.06);
}
.lang-opt--active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

/* ── Mobile updates ────────────────────────────────────── */
@media (max-width: 768px) {
  .card { min-width: calc(85vw); }
  .carousel-track-wrap { padding: 0 20px; }
  .agents-grid { grid-template-columns: repeat(4, 1fr); }
  .cta-immersive { padding: 80px 16px 40px; justify-content: flex-end; padding-bottom: 60px; }
  .carousel-section { padding: 60px 0 40px; }
}
@media (max-width: 480px) {
  .agents-grid { grid-template-columns: repeat(3, 1fr); }
  .idea-submit-btn { padding: 14px 20px; }
}

/* =========================================================
   PIPELINE INTEGRADO — sección inline post-carousel
   ========================================================= */

/* ── Sección contenedor ─────────────────────────────────── */
.pipeline-section {
  position: relative;
  z-index: 20;
  background: var(--bg);
  border-top: 1px solid rgba(212, 169, 106, 0.15);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Entrada animada */
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.pipeline-section--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Header del pipeline ────────────────────────────────── */
.pl-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px;
  height: 60px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(240, 237, 232, 0.07);
  background: rgba(3, 3, 10, 0.85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  position: sticky;
  top: var(--nav-h); /* debajo de la nav de la landing */
  z-index: 30;
}
.pl-header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pl-header__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.pl-header__idea {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
  padding: 0 20px;
  border-left: 1px solid rgba(240, 237, 232, 0.08);
}
.pl-header__idea em {
  color: var(--text);
  font-style: normal;
  font-weight: 500;
}
.pl-header__progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.pl-progress-bar {
  width: 110px;
  height: 2px;
  background: rgba(240, 237, 232, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.pl-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.6s ease;
}
.pl-progress-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pl-header__reset {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(240, 237, 232, 0.05);
  border: 1px solid rgba(240, 237, 232, 0.12);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.pl-header__reset:hover {
  background: rgba(212, 169, 106, 0.08);
  border-color: rgba(212, 169, 106, 0.30);
  color: var(--text);
}

/* ── Body: sidebar + detail ─────────────────────────────── */
.pl-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  height: calc(100vh - var(--nav-h) - 60px);
  position: sticky;
  top: calc(var(--nav-h) + 60px);
}

/* ── Sidebar ────────────────────────────────────────────── */
.pl-sidebar {
  width: 268px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(240, 237, 232, 0.07);
  background: rgba(3, 3, 10, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 20px 12px;
}
.pl-sidebar__label {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 6px;
  margin-bottom: 12px;
  font-weight: 600;
}

/* ── Agent button ───────────────────────────────────────── */
.pl-agent-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.18s, border-color 0.18s;
  margin-bottom: 3px;
}
.pl-agent-btn:hover { background: rgba(240,237,232,0.04); }
.pl-agent-btn.is-selected {
  background: rgba(212, 169, 106, 0.08);
  border-color: rgba(212, 169, 106, 0.28);
}
.pl-agent-btn.is-running {
  border-color: rgba(212, 169, 106, 0.22);
}
.pl-agent-btn.is-done {
  border-color: rgba(240,237,232,0.05);
}
.pl-agent-btn__icon { font-size: 1.1rem; flex-shrink: 0; }
.pl-agent-btn__info { flex: 1; min-width: 0; }
.pl-agent-btn__phase {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pl-agent-btn__name {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-agent-btn__preview {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.pl-agent-btn__dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.pl-agent-btn__dot.idle  { background: rgba(240,237,232,0.15); }
.pl-agent-btn__dot.running { background: var(--accent); animation: pl-pulse 1.4s ease-in-out infinite; }
.pl-agent-btn__dot.done  { background: #4ade80; }
.pl-agent-btn__dot.error { background: #f87171; }
@keyframes pl-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.65)} }

/* ── Detail panel ───────────────────────────────────────── */
.pl-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(3, 3, 10, 0.35);
}
.pl-detail__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 36px;
  border-bottom: 1px solid rgba(240, 237, 232, 0.06);
  flex-shrink: 0;
  background: rgba(3, 3, 10, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pl-detail__icon { font-size: 1.75rem; }
.pl-detail__titles { flex: 1; min-width: 0; }
.pl-detail__phase {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.pl-detail__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.pl-detail__badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}
.pl-detail__badge.idle    { color: var(--text-muted); border-color: rgba(240,237,232,0.1); background: transparent; }
.pl-detail__badge.running { color: var(--accent); border-color: rgba(212,169,106,0.35); background: rgba(212,169,106,0.08); }
.pl-detail__badge.done    { color: #4ade80; border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.07); }
.pl-detail__badge.error   { color: #f87171; border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.07); }

.pl-detail__body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  scroll-behavior: smooth;
}

/* Scrollbar del detalle */
.pl-detail__body::-webkit-scrollbar { width: 4px; }
.pl-detail__body::-webkit-scrollbar-track { background: transparent; }
.pl-detail__body::-webkit-scrollbar-thumb { background: rgba(212,169,106,0.22); border-radius: 4px; }

/* ── Estado vacío ───────────────────────────────────────── */
.pl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 320px;
  text-align: center;
}
.pl-empty__icon {
  font-size: 2.5rem;
  opacity: 0.3;
  animation: pl-pulse 2s ease-in-out infinite;
}
.pl-empty__text {
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ── Skeleton loader ────────────────────────────────────── */
.pl-skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: pl-shimmer 1.4s infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}
@keyframes pl-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Prose (markdown renderizado) ──────────────────────── */
.pl-prose {
  line-height: 1.8;
  font-size: 0.9375rem;
  color: rgba(240, 237, 232, 0.88);
}
.pl-prose h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent);
  margin: 1.5rem 0 0.5rem;
  letter-spacing: -0.01em;
}
.pl-prose h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.1rem 0 0.35rem;
}
.pl-prose strong { color: var(--text); font-weight: 700; }
.pl-prose p { margin: 0.5rem 0; }
.pl-prose ul, .pl-prose ol { padding-left: 1.4rem; margin: 0.45rem 0; }
.pl-prose li { margin: 0.3rem 0; }
.pl-prose code {
  background: rgba(212,169,106,0.12);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent);
}
/* Typing cursor */
.pl-prose.typing::after {
  content: '▋';
  animation: pl-blink 0.9s step-end infinite;
  color: var(--accent);
  font-size: 0.85em;
  margin-left: 2px;
}
@keyframes pl-blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Media section (RRSS) ───────────────────────────────── */
.pl-media-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(240, 237, 232, 0.07);
}
.pl-media-section__title {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}
.pl-media-section__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.pl-media-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.pl-media-card {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(240,237,232,0.08);
  position: relative;
  aspect-ratio: 16/9;
  background: rgba(255,255,255,0.03);
}
.pl-media-card img { width:100%; height:100%; object-fit:cover; display:block; }
.pl-media-card__label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 8px; font-size: 0.6875rem; font-weight: 600;
  color: #fff; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}
.pl-media-card.loading { animation: pl-shimmer 1.4s infinite; }

/* Generador personalizado */
.pl-media-gen {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(240,237,232,0.08);
  background: rgba(8,8,18,0.6);
}
.pl-media-gen__label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; }
.pl-media-gen__row { display: flex; gap: 8px; }
.pl-media-gen__input {
  flex: 1;
  background: rgba(240,237,232,0.04);
  border: 1px solid rgba(240,237,232,0.1);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.pl-media-gen__input::placeholder { color: var(--text-muted); }
.pl-media-gen__input:focus { border-color: rgba(212,169,106,0.45); }
.pl-media-gen__btn {
  padding: 9px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: #0a0804;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8125rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.pl-media-gen__btn:hover { opacity: 0.85; }
.pl-media-gen__btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Chat section ───────────────────────────────────────── */
.pl-chat-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(240, 237, 232, 0.07);
}
.pl-chat-section__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 16px;
}
.pl-chat-msgs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pl-chat-msg { display: flex; }
.pl-chat-msg.user { justify-content: flex-end; }
.pl-chat-msg__bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.6;
}
.pl-chat-msg.user .pl-chat-msg__bubble {
  background: var(--accent);
  color: #0a0804;
  font-weight: 500;
  border-radius: 10px 10px 2px 10px;
}
.pl-chat-msg.assistant .pl-chat-msg__bubble {
  background: rgba(240,237,232,0.05);
  border: 1px solid rgba(240,237,232,0.08);
  border-radius: 10px 10px 10px 2px;
}
.pl-chat-input-row { display: flex; gap: 8px; }
.pl-chat-input {
  flex: 1;
  background: rgba(240,237,232,0.04);
  border: 1px solid rgba(240,237,232,0.10);
  border-radius: 10px;
  padding: 11px 16px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.pl-chat-input::placeholder { color: var(--text-muted); }
.pl-chat-input:focus { border-color: rgba(212,169,106,0.45); }
.pl-chat-send {
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #0a0804;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.pl-chat-send:hover { opacity: 0.85; }
.pl-chat-send:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Fade in items ──────────────────────────────────────── */
@keyframes pl-fade-up {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}
.pl-fade-in { animation: pl-fade-up 0.4s cubic-bezier(0.16,1,0.3,1) forwards; }

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pl-header { padding: 0 16px; gap: 12px; }
  .pl-header__idea { display: none; }
  .pl-body { flex-direction: column; height: auto; position: static; }
  .pl-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid rgba(240,237,232,0.07); max-height: 220px; }
  .pl-detail__body { padding: 20px 16px; }
  .pl-detail__header { padding: 14px 16px; }
  .pl-media-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Watermark Footer ────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 5;
  width: 100%;
  text-align: center;
  padding: 14px 24px;
  background: rgba(3,3,10,0.85);
  border-top: 1px solid rgba(240,237,232,0.06);
}
.site-footer__text {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(240,237,232,0.30);
  margin: 0;
}
.site-footer__text strong {
  font-weight: 600;
  color: rgba(240,237,232,0.45);
  letter-spacing: 0.08em;
}

/* ── Password Gate Modal ────────────────────────────────── */
.pw-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(3,3,10,0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 1;
  transition: opacity 0.4s ease;
}
.pw-gate.pw-gate--hidden {
  opacity: 0;
  pointer-events: none;
}
.pw-gate__box {
  background: rgba(20,20,32,0.95);
  border: 1px solid rgba(212,169,106,0.18);
  border-radius: 16px;
  padding: 48px 40px 36px;
  max-width: 400px;
  width: calc(100% - 48px);
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}
.pw-gate__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.pw-gate__brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.pw-gate__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 8px;
}
.pw-gate__sub {
  font-size: 0.9rem;
  color: rgba(240,237,232,0.5);
  margin-bottom: 28px;
  line-height: 1.5;
}
.pw-gate__field {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.pw-gate__input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(240,237,232,0.15);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  -webkit-text-fill-color: var(--text);
}
.pw-gate__input:focus {
  border-color: rgba(212,169,106,0.5);
  box-shadow: 0 0 0 3px rgba(212,169,106,0.08);
}
.pw-gate__btn {
  background: var(--accent);
  color: #03030a;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.15s;
}
.pw-gate__btn:hover { opacity: 0.88; transform: translateY(-1px); }
.pw-gate__btn:active { transform: translateY(0); }
.pw-gate__error {
  font-size: 0.8125rem;
  color: #e57373;
  min-height: 18px;
  margin-bottom: 4px;
}
.pw-gate__footer {
  font-size: 0.7rem;
  color: rgba(240,237,232,0.22);
  margin-top: 24px;
  letter-spacing: 0.04em;
}
.pw-gate__footer strong { color: rgba(240,237,232,0.32); }

/* ── Export PDF button ──────────────────────────────────── */
.pl-header__export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212,169,106,0.12);
  border: 1px solid rgba(212,169,106,0.35);
  border-radius: 7px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.pl-header__export:hover {
  background: rgba(212,169,106,0.20);
  border-color: rgba(212,169,106,0.55);
  transform: translateY(-1px);
}
.pl-header__export:active { transform: translateY(0); }
.pl-header__export--loading { opacity: 0.6; pointer-events: none; }

/* ── Password gate shake animation ─────────────────────── */
@keyframes pw-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-10px); }
  40%       { transform: translateX(10px); }
  60%       { transform: translateX(-8px); }
  80%       { transform: translateX(8px); }
}
