/* Ancora — prototipo dinámico (ESADE BDP 2026)
   Sistema de diseño compartido. Sin build: CSS plano + tokens. */

:root {
  --bg: #FBFAF7;
  --bg-2: #F4F1EA;
  --ink: #13201A;
  --ink-soft: #2A3A32;
  --muted: #5C6B62;
  --line: #E8E4DA;
  --accent: #1E5547;
  --accent-2: #2E7A65;
  --accent-soft: #E7F0EC;
  --warn-bg: #FFF7E6;
  --warn-line: #F1E1B4;
  --warn-ink: #6F5A14;
  --danger: #B5483B;
  --shadow-card: 0 1px 2px rgba(19,32,26,.05), 0 18px 40px -24px rgba(19,32,26,.35);
  --shadow-soft: 0 1px 2px rgba(19,32,26,.04), 0 8px 24px -16px rgba(19,32,26,.20);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.font-display {
  font-family: Fraunces, "Times New Roman", Georgia, serif;
  font-feature-settings: "ss01" on;
  letter-spacing: -.02em;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.eyebrow::before {
  content: ""; width: 1.75rem; height: 1px; background: currentColor; opacity: .55;
}

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--accent); background: var(--accent-soft);
  padding: 6px 13px; border-radius: 999px; font-weight: 600;
}
.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--accent-2); }
.badge .dot.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(46,122,101,.5);} 50% { box-shadow: 0 0 0 6px rgba(46,122,101,0);} }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,247,.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: Fraunces, serif; font-weight: 600; font-size: 22px; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 34px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a.navlink { color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.nav-links a.navlink.active { color: var(--accent); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; transition: .25s; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 12px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; transition: transform .15s, background .2s, box-shadow .2s;
  text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #0a1610; box-shadow: var(--shadow-soft); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); box-shadow: var(--shadow-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: #fff; }
.btn-sm { padding: 9px 15px; font-size: 14px; }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-sand { background: var(--bg-2); }
.section-ink { background: var(--ink); color: #F4F1EA; }
.section-ink .muted, .section-ink p { color: #C4CFC8; }
.section-ink .section-title, .section-ink h2, .section-ink h3 { color: #fff; }
.section-title { font-family: Fraunces, serif; font-weight: 600; font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.02em; margin: 14px 0 16px; line-height: 1.12; }
.section-intro { color: var(--muted); font-size: 18px; max-width: 640px; margin: 0 0 40px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center .section-intro { margin-left: auto; margin-right: auto; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 64px; position: relative; overflow: hidden; }
.hero h1 { font-family: Fraunces, serif; font-weight: 600; font-size: clamp(38px, 5.4vw, 62px); line-height: 1.05; letter-spacing: -.025em; margin: 22px 0 22px; max-width: 16ch; }
.hero .lead { font-size: clamp(17px, 2vw, 21px); color: var(--muted); max-width: 56ch; margin: 0 0 34px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero-note { color: var(--muted); font-size: 14px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-soft);
}
.card h3 { font-family: Fraunces, serif; font-weight: 600; font-size: 20px; margin: 0 0 8px; letter-spacing: -.01em; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.ico {
  width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 16px;
}

/* ---------- Steps (journey) ---------- */
.steps { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); counter-reset: step; }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-soft); }
.step .num {
  width: 30px; height: 30px; border-radius: 999px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
  font-family: Fraunces, serif; margin-bottom: 14px;
}
.step h3 { font-family: Fraunces, serif; font-weight: 600; font-size: 18px; margin: 0 0 6px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- CTA banner ---------- */
.cta-banner { background: var(--accent); color: #fff; border-radius: 22px; padding: 48px; text-align: center; }
.cta-banner h2 { font-family: Fraunces, serif; font-weight: 600; font-size: clamp(24px, 3vw, 34px); margin: 0 0 12px; color: #fff; }
.cta-banner p { color: #DCEAE3; max-width: 52ch; margin: 0 auto 26px; font-size: 17px; }

/* ---------- Device / demo console ---------- */
.device {
  background: #0F1B16; border-radius: 28px; padding: 14px; box-shadow: 0 30px 60px -30px rgba(19,32,26,.6);
  border: 1px solid #1f3329;
}
.device-screen { background: var(--bg); border-radius: 18px; overflow: hidden; }
.device-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.device-bar .d { width: 10px; height: 10px; border-radius: 999px; background: #E2DDD2; }
.device-bar .title { margin-left: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Demo specifics ---------- */
.demo-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-soft); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { font-family: Fraunces, serif; font-size: 17px; margin: 0; font-weight: 600; }
.panel-tag { font-size: 12px; color: var(--muted); background: var(--bg-2); padding: 3px 9px; border-radius: 999px; }

.waveform { display: flex; align-items: flex-end; gap: 3px; height: 46px; margin: 8px 0 16px; }
.waveform i { flex: 1; background: var(--accent-2); border-radius: 2px; height: 20%; opacity: .35; }
.waveform.live i { animation: wave 1s ease-in-out infinite; }
.waveform.live i:nth-child(odd) { animation-delay: .15s; }
.waveform.live i:nth-child(3n) { animation-delay: .3s; }
@keyframes wave { 0%,100% { height: 18%; opacity:.35;} 50% { height: 92%; opacity: 1;} }

.transcript { font-size: 14px; min-height: 180px; }
.t-line { margin: 0 0 10px; opacity: 0; transform: translateY(4px); transition: .3s; }
.t-line.show { opacity: 1; transform: none; }
.t-line .who { font-weight: 600; color: var(--accent); }
.t-line .who.pac { color: var(--ink-soft); }
.cursor::after { content: "▍"; color: var(--accent-2); animation: blink 1s steps(2) infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }

.out-block { opacity: 0; transform: translateY(8px); transition: .5s; }
.out-block.show { opacity: 1; transform: none; }
.scale-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.scale-row:last-child { border-bottom: 0; }
.scale-name { font-weight: 600; }
.scale-score { font-family: Fraunces, serif; font-weight: 600; font-size: 18px; }
.scale-tag { font-size: 12px; color: var(--muted); }
.note-sec { margin: 0 0 14px; }
.note-sec h4 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
.note-sec p { font-size: 14px; color: var(--ink-soft); margin: 0; }
.provenance { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { background: var(--bg-2); padding: 3px 9px; border-radius: 999px; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 999px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 12px 0; }

/* consent toggle */
.consent { display: flex; align-items: flex-start; gap: 12px; background: var(--accent-soft); border: 1px solid #CFE2D9; border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 18px; }
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.consent label { font-size: 14px; color: var(--ink-soft); }

/* ---------- Chart (longitudinal) ---------- */
.chart-card { background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-soft); }
.chart { display: flex; align-items: flex-end; gap: 18px; height: 240px; padding-top: 14px; border-bottom: 1px solid var(--line); }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: flex-end; height: 100%; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 100%; width: 100%; justify-content: center; }
.bar { width: 26px; border-radius: 6px 6px 0 0; height: 0; transition: height 1s cubic-bezier(.2,.7,.3,1); position: relative; }
.bar.mmse { background: var(--accent); }
.bar.moca { background: var(--coral, #D98B6F); }
.bar .val { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.bar-label { font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 18px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }

.alert-flag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--danger); background: #FBEAE7; border: 1px solid #F0CFC9; padding: 7px 12px; border-radius: 999px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 22px 28px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content:""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 999px; background: var(--accent); border: 2px solid var(--bg); }
.timeline .date { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.timeline .ev { font-weight: 600; font-size: 15px; margin: 2px 0; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; }
.stat .n { font-family: Fraunces, serif; font-weight: 600; font-size: clamp(30px,4vw,44px); letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 14px; }

/* ---------- Form ---------- */
.form-card { background:#fff; border:1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-card); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: 15px; background: var(--bg); color: var(--ink); transition: border .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff;
}
.field textarea { resize: vertical; min-height: 96px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-success { display: none; text-align: center; padding: 20px 0; }
.form-success.show { display: block; }
.form-success .ok { width: 56px; height: 56px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 14px; }
.hp { position: absolute; left: -9999px; opacity: 0; }
.consent-line { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Disclaimer / footer ---------- */
.disclaimer { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); color: var(--warn-ink); font-size: 13px; padding: 16px 18px; line-height: 1.5; }
.site-footer { border-top: 1px solid var(--line); padding: 44px 0 56px; color: var(--muted); font-size: 14px; background: var(--bg); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
.footer-links a { color: var(--muted); display: block; margin: 6px 0; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Pills / lists ---------- */
.pill-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px 28px; list-style: none; padding: 0; margin: 0; }
.pill-list li { display: flex; gap: 10px; font-size: 15px; color: var(--ink-soft); }
.pill-list li::before { content: "✓"; color: var(--accent); font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .demo-stage { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  section { padding: 52px 0; }
  .hero { padding: 56px 0 44px; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .site-header.open .nav-links {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 24px 20px;
  }
  .site-header.open .nav-links a.navlink { padding: 8px 0; width: 100%; }
  .grid-3, .grid-2, .steps, .stats, .pill-list, .field-row { grid-template-columns: 1fr; }
  .cta-banner { padding: 32px 22px; }
  .form-card { padding: 22px; }
  .chart { gap: 8px; }
  .bar { width: 18px; }
}
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
}
