
/* ============================================================
   TOKENS — idénticos al sitio principal
   ============================================================ */
:root {
  --ocean-dark: #020b14;
  --ocean-deep: #040f1c;
  --ocean-mid:  #071a2e;
  --wave-blue:  #0d6efd;
  --wave-cyan:  #00d4ff;
  --wave-glow:  #38bdf8;
  --gold:       #f5c842;
  --gold-soft:  #e8b84b;
  --text-bright:#f0f4f8;
  --text-muted: #8ba3b8;
  --text-body:  #c5d5e4;
}

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

/* Scrollbar cyan */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(2,11,20,.5); }
::-webkit-scrollbar-thumb { background: rgba(0,212,255,.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,.5); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,212,255,.3) rgba(2,11,20,.5); }
body {
  background: var(--ocean-dark);
  color: var(--text-bright);
  font-family: 'Crimson Pro', Georgia, serif;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* ============================================================
   NAV — igual al del sitio
   ============================================================ */
nav {
  position: fixed; top:0; left:0; right:0; z-index:100;
  padding: 0 40px; height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(2,11,20,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(56,189,248,.08);
}
.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: .1em;
  color: var(--wave-cyan); text-decoration: none;
}
.nav-step {
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: .18em;
  color: var(--text-muted); text-transform: uppercase;
}
@media(max-width:600px){ nav { padding: 0 20px; } }

/* ============================================================
   FONDO — mismo hero-bg del sitio
   ============================================================ */
.hero-bg-fixed {
  position: fixed; inset:0; z-index:0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(13,110,253,.16) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 20%,  rgba(0,212,255,.07)  0%, transparent 60%),
    linear-gradient(180deg, #020b14 0%, #040f1c 40%, #071a2e 100%);
}
.particles-fixed {
  position: fixed; inset:0; z-index:1; overflow:hidden; pointer-events:none;
}
.particle {
  position: absolute; border-radius: 50%;
  background: var(--wave-cyan); opacity:0;
  animation: floatUp var(--dur,8s) var(--delay,0s) infinite ease-in;
}
@keyframes floatUp {
  0%   { transform: translateY(100vh) translateX(0); opacity:0; }
  10%  { opacity:.5; }
  90%  { opacity:.15; }
  100% { transform: translateY(-10vh) translateX(var(--drift,20px)); opacity:0; }
}

/* ============================================================
   PANTALLAS
   ============================================================ */
.screen {
  position: relative; z-index:10;
  height: 100vh;
  height: 100dvh;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: 68px 20px 20px;
  overflow-y: auto;
}
.screen.active { display: flex; }
/* Pantallas con mucho contenido: empezar desde arriba */
.screen.scroll-top { justify-content: flex-start; padding-top: 80px; }

/* ============================================================
   CARD — estilo stat-box / about-book del sitio
   ============================================================ */
.card {
  background: rgba(13,110,253,.06);
  border: 1px solid rgba(56,189,248,.12);
  padding: 40px 44px 36px;
  max-width: 620px; width:100%;
  position: relative;
  animation: fadeUp .55s cubic-bezier(.16,1,.3,1) both;
}
/* Línea superior cyan — igual que about-book::before */
.card::before {
  content:'';
  position:absolute; top:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, var(--wave-cyan), transparent);
}
/* Línea inferior sutil */
.card::after {
  content:'';
  position:absolute; bottom:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,.15), transparent);
}

@keyframes fadeUp {
  from { opacity:0; transform:translateY(28px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.section-tag {
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: .4em;
  color: var(--wave-cyan); text-transform: uppercase;
  margin-bottom: 16px; display: block;
}
h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px,8vw,80px);
  line-height: .95; letter-spacing: .02em;
  color: var(--text-bright);
  margin-bottom: 20px;
}
h1 .cyan { color: var(--wave-cyan); }
h1 .glow {
  color: var(--wave-glow);
  text-shadow: 0 0 40px rgba(56,189,248,.35);
}
h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px,6vw,60px);
  line-height: 1; letter-spacing: .03em;
  color: var(--text-bright); margin-bottom: 20px;
}
h2 .cyan { color: var(--wave-cyan); }
h2 .gold { color: var(--gold); }

.subtitle {
  font-family: 'Crimson Pro', serif;
  font-size: 18px; font-style: italic;
  color: var(--text-muted); line-height: 1.65;
  border-left: 2px solid var(--wave-cyan);
  padding-left: 16px;
  margin-bottom: 32px;
}
p {
  font-size: 18px; line-height: 1.75;
  color: var(--text-body); margin-bottom: 18px;
}
.highlight-block {
  border-left: 3px solid var(--gold);
  padding: 18px 22px;
  background: rgba(245,200,66,.05);
  margin: 24px 0;
}
.highlight-block p {
  font-size: 20px; font-style: italic;
  color: var(--gold-soft); margin:0; line-height: 1.5;
}

/* Cyan line divider */
.cyan-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--wave-cyan), transparent);
  margin: 28px 0;
}

/* Tagline */
.tagline {
  font-family: 'Crimson Pro', serif;
  font-size: 20px; font-style: italic;
  color: var(--text-muted); text-align: center;
  margin: 28px 0 0; line-height: 1.7;
}
.tagline-author {
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(0,212,255,.3); text-align: center;
  margin: 14px 0 4px;
}

/* Easter egg letter */
.egg-letter {
  cursor: pointer;
  display: inline-block;
  transition: text-shadow .15s;
}
.egg-letter:hover {
  color: var(--gold) !important;
  -webkit-text-fill-color: var(--gold) !important;
  text-shadow: 0 0 22px rgba(245,200,66,.75);
}

/* ============================================================
   INPUTS — coherentes con estilo del sitio
   ============================================================ */
.field { margin-bottom: 18px; }
label {
  display:block;
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--wave-cyan); opacity:.6; margin-bottom: 9px;
}
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  background: rgba(13,110,253,.06);
  border: 1px solid rgba(56,189,248,.18);
  padding: 14px 16px;
  color: var(--text-bright);
  font-family: 'Inter', -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
}
input:focus, textarea:focus {
  border-color: rgba(0,212,255,.5);
  background: rgba(13,110,253,.1);
}
input::placeholder, textarea::placeholder { color: rgba(139,163,184,.4); }
textarea { resize:vertical; min-height:60px; line-height:1.5; }

/* Código compuesto — como la tarjeta del libro */
.code-row {
  display: flex; align-items: stretch;
  background: rgba(13,110,253,.06);
  border: 1px solid rgba(56,189,248,.18);
  margin-bottom: 22px;
}
.code-fixed, .code-suffix {
  padding: 14px 16px;
  font-family: 'Space Mono', monospace;
  font-size: 13px; letter-spacing:.06em;
  color: var(--wave-cyan); opacity:.5;
  white-space: nowrap;
  background: rgba(0,212,255,.04);
  display: flex; align-items: center;
}
.code-fixed  { border-right: 1px solid rgba(56,189,248,.14); }
.code-suffix { border-left:  1px solid rgba(56,189,248,.14); }
.code-sep, .code-sep2 {
  padding: 14px 10px;
  font-family: 'Space Mono', monospace;
  font-size: 13px; color: var(--wave-cyan); opacity:.2;
  display: flex; align-items: center;
  border-right: 1px solid rgba(56,189,248,.14);
}
.code-input-inner {
  flex:1; background:transparent !important;
  border:none !important;
  padding: 14px 16px !important;
  font-family: 'Space Mono', monospace !important;
  font-size: 13px !important;
  text-transform: uppercase; letter-spacing:.07em;
  color: var(--text-bright) !important;
  min-width: 0;
}
.code-input-inner:focus { outline:none; }

/* ============================================================
   BOTONES — clip-path idéntico al sitio
   ============================================================ */
.btn-primary {
  background: linear-gradient(135deg, var(--wave-blue), var(--wave-cyan));
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  padding: 16px 36px;
  border: none; cursor: pointer;
  text-decoration: none; display: inline-block;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: all .3s;
  position: relative; overflow: hidden;
  width: 100%; text-align:center; margin-top:8px;
}
.btn-primary::after {
  content:''; position:absolute; inset:0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
  opacity:0; transition:opacity .3s;
}
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 8px 30px rgba(0,212,255,.35); }
.btn-primary:hover::after { opacity:1; }

.btn-secondary {
  color: var(--wave-cyan);
  font-family: 'Space Mono', monospace;
  font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  padding: 16px 36px;
  border: 1px solid rgba(0,212,255,.3);
  text-decoration: none; display: inline-block;
  transition: all .3s; background:transparent; cursor:pointer;
  width:100%; text-align:center; margin-top:10px;
}
.btn-secondary:hover { border-color:var(--wave-cyan); background:rgba(0,212,255,.06); }

/* ============================================================
   LOADER
   ============================================================ */
.loader-phrase {
  font-family: 'Crimson Pro', serif;
  font-size: 1.4rem; font-style: italic;
  text-align: center; color: var(--text-body);
  min-height: 2rem; transition: opacity .35s;
}
.loader-track {
  width: 200px; height: 1px;
  background: rgba(0,212,255,.1);
  margin: 32px auto 0; position:relative; overflow:hidden;
}
.loader-track::after {
  content:''; position:absolute; top:0; left:-100%;
  width:100%; height:1px;
  background: linear-gradient(90deg, transparent, var(--wave-cyan), transparent);
  animation: scan 1.7s ease-in-out infinite;
}
@keyframes scan { 0%{left:-100%;} 100%{left:100%;} }

/* ============================================================
   PROGRESS BAR preguntas
   ============================================================ */
.progress-bar { display:flex; gap:4px; margin-bottom:36px; }
.progress-seg {
  flex:1; height:2px;
  background: rgba(56,189,248,.1);
  transition: background .35s;
}
.progress-seg.done   { background: rgba(0,212,255,.35); }
.progress-seg.active { background: var(--wave-cyan); }

/* ============================================================
   OPCIONES — estilo chapter-item del sitio
   ============================================================ */
.question-num {
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--wave-cyan); opacity:.5; margin-bottom: 10px;
}
.question-text {
  font-family: 'Crimson Pro', serif;
  font-size: 1.35rem; font-style: italic;
  color: var(--text-body); margin-bottom: 22px;
  line-height: 1.5;
}
.options { display:flex; flex-direction:column; gap:2px; }
.opt {
  padding: 18px 20px 18px 48px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.04);
  cursor:pointer;
  font-family: 'Crimson Pro', serif;
  font-size: 17px; color: var(--text-muted);
  transition: all .2s; position:relative;
  line-height: 1.4;
  /* Barra inferior al hover — igual que chapter-item */
}
.opt::before {
  content:'';
  position:absolute; bottom:0; left:0; right:0; height:2px;
  background: linear-gradient(90deg, var(--wave-cyan), var(--wave-blue));
  transform:scaleX(0); transform-origin:left;
  transition:transform .25s;
}
.opt::after {
  content:'';
  position:absolute; left:18px; top:50%; transform:translateY(-50%);
  width:9px; height:9px;
  border:1px solid rgba(0,212,255,.3); border-radius:50%;
  transition:all .2s;
}
.opt:hover {
  background: rgba(13,110,253,.07);
  border-color: rgba(56,189,248,.15);
  color: var(--text-bright);
}
.opt:hover::before { transform:scaleX(1); }
.opt.selected {
  background: rgba(13,110,253,.1);
  border-color: rgba(0,212,255,.35);
  color: var(--text-bright);
}
.opt.selected::before { transform:scaleX(1); background: var(--wave-cyan); }
.opt.selected::after  { background:var(--wave-cyan); border-color:var(--wave-cyan); box-shadow:0 0 8px rgba(0,212,255,.5); }

/* ============================================================
   ARQUETIPO — stat-box style del sitio
   ============================================================ */
.arch-box {
  background: rgba(13,110,253,.08);
  border: 1px solid rgba(56,189,248,.15);
  padding: 28px; text-align:center;
  margin-bottom: 28px; position:relative;
  transition: all .3s;
}
.arch-box:hover {
  background: rgba(13,110,253,.13);
  border-color: rgba(56,189,248,.28);
}
.arch-box::before {
  content:''; position:absolute; bottom:0; left:0; right:0; height:2px;
  background: linear-gradient(90deg, var(--wave-cyan), var(--wave-blue));
}
.arch-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing:.28em; text-transform:uppercase;
  color: var(--text-muted); margin-bottom: 10px; display:block;
}
.arch-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(32px,5vw,52px); letter-spacing:.03em;
  color: var(--wave-cyan); line-height: 1;
  display:block; margin-bottom:6px;
}
.arch-sub {
  font-family: 'Crimson Pro', serif;
  font-size: 16px; font-style:italic;
  color: var(--text-muted);
}
.arch-desc {
  font-size: 17px; color: var(--text-body);
  line-height: 1.75; margin-bottom:22px;
}

/* ============================================================
   CÓDIGO FINAL — ai-stat style
   ============================================================ */
.legacy-box {
  background: rgba(245,200,66,.05);
  border: 1px solid rgba(245,200,66,.15);
  padding: 24px; text-align:center;
  margin: 24px 0; transition:all .3s;
}
.legacy-box:hover {
  background: rgba(245,200,66,.09);
  border-color: rgba(245,200,66,.3);
}
.legacy-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing:.22em; text-transform:uppercase;
  color: var(--text-muted); margin-bottom:12px; display:block;
}
.legacy-code {
  font-family: 'Space Mono', monospace;
  font-size: clamp(16px,3.5vw,26px); letter-spacing:.08em;
  color: var(--gold); font-weight:700;
  word-break:break-all;
  text-shadow: 0 0 30px rgba(245,200,66,.3);
}

/* Final wave mark */
.final-wave {
  text-align:center; margin-bottom:24px;
}
.final-wave svg { width:64px; opacity:.12; }

/* ============================================================
   DECLARACIÓN
   ============================================================ */
.decl-item { margin-bottom:20px; }
.decl-item:last-child { margin-bottom:0; }
.decl-lbl {
  font-family: 'Space Mono', monospace;
  font-size:9px; letter-spacing:.2em; text-transform:uppercase;
  color:var(--wave-cyan); opacity:.5; margin-bottom:6px; display:block;
}
.decl-txt {
  font-size:17px; color:var(--text-body); line-height:1.7;
  border-left:2px solid rgba(0,212,255,.2); padding-left:14px;
}

/* ============================================================
   COMPARTIR (share row)
   ============================================================ */
.share-row { display:flex; gap:2px; flex-wrap:wrap; margin-top:10px; }
.share-btn {
  flex:1; min-width:130px;
  color: var(--wave-cyan);
  font-family: 'Space Mono', monospace;
  font-size:9px; letter-spacing:.15em; text-transform:uppercase;
  padding: 13px 10px;
  border: 1px solid rgba(0,212,255,.2);
  text-decoration:none; text-align:center;
  transition:all .25s; background:transparent; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.share-btn:hover { border-color:var(--wave-cyan); background:rgba(0,212,255,.06); color:#fff; }

/* ============================================================
   ERROR
   ============================================================ */
.msg-error {
  background:rgba(180,40,40,.1);
  border:1px solid rgba(220,60,60,.2);
  color:#e07070; font-size:15px; font-style:italic;
  padding:12px 16px; margin-top:14px; display:none; line-height:1.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media(max-width:640px){
  .screen { padding: 60px 14px 16px; }
  .card { padding: 26px 18px; }
  h1 { font-size: clamp(34px,9vw,52px); margin-bottom: 12px; }
  h2 { font-size: clamp(24px,7vw,40px); margin-bottom: 12px; }
  .subtitle { font-size: 15px; margin-bottom: 18px; }
  .field { margin-bottom: 14px; }
  .tagline { font-size: 16px; margin-top: 16px; }
  .tagline-author { margin-top: 6px; font-size: 10px; }
  p { font-size: 15px; margin-bottom: 12px; }
  .section-tag { font-size: 9px; letter-spacing: .2em; margin-bottom: 10px; }
  /* Touch targets mínimo 44px */
  .opt { font-size: 15px; padding: 16px 14px 16px 42px; min-height: 44px; }
  .question-text { font-size: 1.1rem; margin-bottom: 16px; }
  .share-row { flex-direction: column; gap: 6px; }
  .share-btn { min-width: unset; padding: 16px 12px; min-height: 44px; }
  .btn-primary, .btn-secondary { padding: 16px 24px; font-size: 11px; min-height: 44px; }
  .highlight-block { padding: 14px 16px; margin: 18px 0; }
  .highlight-block p { font-size: 16px; }
  .arch-box { padding: 22px 16px; }
  .arch-desc { font-size: 15px; margin-bottom: 14px; }
  .decl-txt { font-size: 15px; }
  .legacy-box { padding: 18px; }
  .legacy-code { font-size: clamp(14px,4vw,22px); }
  /* Code row responsive */
  .code-row { flex-wrap: wrap; }
  .code-fixed, .code-suffix { font-size: 11px; padding: 12px; }
  .code-sep, .code-sep2 { padding: 12px 6px; font-size: 11px; }
  .code-input-inner { font-size: 12px !important; padding: 12px !important; }
  /* Book y nav */
  #s1-book { width: 80px !important; margin: 0 0 10px 14px !important; }
  nav { height: 52px; padding: 0 14px; }
  .nav-logo { font-size: 18px; }
  .nav-step { font-size: 8px; letter-spacing: .12em; }
  /* Textareas */
  textarea { min-height: 50px; }
  /* Cyan line */
  .cyan-line { margin: 18px 0; }
}

@media(max-width:380px){
  .card { padding: 22px 14px; }
  h1 { font-size: clamp(28px,9vw,42px); }
  h2 { font-size: clamp(22px,7vw,34px); }
  #s1-book { display: none !important; }
  .code-fixed { font-size: 10px; padding: 10px 8px; }
  .code-suffix { font-size: 10px; padding: 10px 8px; }
  .code-sep, .code-sep2 { padding: 10px 4px; }
}

@media(max-height:700px){
  .screen { padding: 54px 14px 10px; }
  .card { padding: 22px 18px; }
  h1 { font-size: clamp(30px,8vw,44px); margin-bottom: 8px; }
  .subtitle { margin-bottom: 14px; font-size: 14px; }
  .tagline { font-size: 15px; margin-top: 12px; }
  .field { margin-bottom: 12px; }
  #s1-book { width: 70px !important; }
  .highlight-block { padding: 12px 14px; margin: 14px 0; }
}
