/* ¿Cuál es Mi BioTipo? — landing dinámica
   Roberto Ocampo · Ocampo Lab · 2026
   Light/dark via prefers-color-scheme + manual toggle.
*/

:root {
  --bg: #fafaf7;
  --bg-card: #ffffff;
  --bg-soft: #f3f1ec;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --border: #e5e3dd;
  --accent: #b85c3a;
  --accent-soft: #e8c9b8;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --radius: 10px;
  --max: 880px;
  --font-serif: 'Crimson Text', 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #0e0e10;
  --bg-card: #18181b;
  --bg-soft: #1e1e22;
  --text: #f0eee9;
  --text-muted: #9b9b9b;
  --border: #2a2a30;
  --accent: #d97757;
  --accent-soft: #3a2620;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10;
    --bg-card: #18181b;
    --bg-soft: #1e1e22;
    --text: #f0eee9;
    --text-muted: #9b9b9b;
    --border: #2a2a30;
    --accent: #d97757;
    --accent-soft: #3a2620;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .25s ease, color .25s ease;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, .85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .topbar { background: rgba(14, 14, 16, .8); }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -.01em;
}
.brand-mark {
  width: 18px; height: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border-radius: 50%;
}
.brand-text { font-family: var(--font-serif); font-size: 1.05rem; }
.controls { display: flex; gap: .35rem; }
.ctrl-btn {
  background: var(--bg-soft);
  border: 1px solid var(--text-muted);
  color: var(--text);
  padding: .35rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  transition: all .15s ease;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.5rem; height: 2.1rem;
}
.ctrl-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  color: var(--accent);
}
.ctrl-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.lang-icon { font-size: 1.05rem; line-height: 1; }
.lang-label { font-size: .85rem; font-weight: 600; margin-left: .35rem; letter-spacing: .02em; }
.theme-icon-sun, .theme-icon-moon { font-size: 1.05rem; line-height: 1; color: var(--text); }
:root:not([data-theme="dark"]) .theme-icon-moon,
:root[data-theme="light"] .theme-icon-moon { display: inline; }
:root[data-theme="dark"] .theme-icon-sun { display: inline; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
:root:not([data-theme="dark"]) .theme-icon-sun,
:root[data-theme="light"] .theme-icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-icon-sun { display: inline; }
}

/* ===== PRÓLOGO + INVITACIÓN ===== */
.prologo {
  padding: 2.5rem 0 4rem;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.prologo-container { max-width: 720px; }
.prologo-block {
  margin-bottom: 3.5rem;
  font-family: var(--font-serif);
}
.prologo-block:last-child { margin-bottom: 0; }
.prologo-block h2 {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 1.5rem;
  color: var(--text);
}
.prologo-block.invitacion h2 {
  text-align: center;
  font-style: italic;
  color: var(--accent);
}
.prologo-block h3 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 .8rem;
  color: var(--text);
}
.prologo-block p {
  font-size: 1.02rem;
  line-height: 1.75;
  margin: 0 0 1.05rem;
  color: var(--text);
}
.prologo-block.invitacion p {
  font-size: 1.08rem;
  text-align: center;
}
.prologo-emph {
  text-align: center;
  font-style: italic;
  font-size: 1.2rem !important;
  margin: 1.8rem 0 !important;
  color: var(--accent) !important;
}
.prologo-closing {
  text-align: center;
  font-style: italic;
  margin-top: 1.5rem !important;
  color: var(--text-muted) !important;
}
.prologo-signature {
  text-align: right;
  font-style: italic;
  margin-top: 1.8rem !important;
  color: var(--text-muted) !important;
}
.prologo strong { font-weight: 600; color: var(--text); }
.prologo em { color: var(--accent); font-style: italic; }
@media (max-width: 600px) {
  .prologo { padding: 2rem 0 3rem; }
  .prologo-block { margin-bottom: 2.5rem; }
  .prologo-block h2 { font-size: 1.4rem; }
  .prologo-block.invitacion p { font-size: 1.02rem; }
  .prologo-emph { font-size: 1.1rem !important; }
}

/* ===== HERO ===== */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}
.kicker {
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-weight: 500;
}
h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 1.2rem;
  font-weight: 600;
}
.lead {
  font-size: 1.15rem;
  max-width: 38rem;
  margin: 0 auto 2.2rem;
  color: var(--text-muted);
}
.cta-row {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: .95rem;
  transition: all .15s ease;
  font-family: inherit;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--text); }

/* ===== SECTIONS ===== */
section { padding: 4.5rem 0; }
section h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0 0 .7rem;
  letter-spacing: -.01em;
  font-weight: 600;
}
.sec-lead {
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  font-size: 1.05rem;
  max-width: 38rem;
}

/* ===== COMPENDIO BIOTIPOS GRID ===== */
.biotipos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.bcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.3rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.bcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.bcard-symbol {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .8rem;
}
.bcard-symbol object {
  width: 100%; height: 100%;
  filter: invert(0);
}
[data-theme="dark"] .bcard-symbol object { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bcard-symbol object { filter: invert(1); }
}
.bcard h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 0 0 .2rem;
  font-weight: 600;
}
.bt-elem {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin: 0 0 .8rem;
  font-weight: 500;
}
.bcard p:not(.bt-elem) {
  font-size: .92rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

/* ===== QUIZ ===== */
.quiz {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.quiz-section { margin-bottom: 2.5rem; }
.quiz-section-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2.5rem 0 .3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.quiz-section-title:first-child { padding-top: 0; border-top: 0; margin-top: 0; }
.quiz-section-lead {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: .92rem;
}
.q-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
  margin-bottom: 1rem;
}
.q-title {
  font-weight: 600;
  margin: 0 0 .3rem;
  font-size: 1.02rem;
}
.q-context {
  font-size: .87rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}
.q-options { display: flex; flex-direction: column; gap: .4rem; }
.q-option {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .7rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s ease;
  font-size: .9rem;
  background: var(--bg);
}
.q-option:hover { border-color: var(--text-muted); }
.q-option input { margin-top: .2rem; cursor: pointer; }
.q-option input:checked + span { font-weight: 500; }
.q-option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}
[data-theme="dark"] .q-option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.quiz-actions {
  text-align: center;
  margin-top: 2rem;
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== RESULT ===== */
.result {
  background: var(--bg);
}
.hidden { display: none !important; }
#result-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.result-formula {
  text-align: center;
  margin-bottom: 1.5rem;
}
.result-formula-label {
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--text-muted);
}
.result-formula-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  margin-top: .3rem;
  color: var(--accent);
  letter-spacing: -.01em;
}
.result-section { margin: 1.5rem 0; }
.result-section h4 {
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin: 0 0 .5rem;
  font-weight: 500;
}
.result-section ul { padding-left: 1.2rem; margin: 0; }
.result-section li { margin: .35rem 0; font-size: .95rem; }
.result-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .5rem;
  margin: 1.5rem 0;
}
.result-score {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: .9rem;
  text-align: center;
}
.result-score-name {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.result-score-val {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  margin-top: .2rem;
}

/* ===== EXTENDED COMPENDIO ===== */
.extended { background: var(--bg-soft); border-top: 1px solid var(--border); }
.extended details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  margin-bottom: .8rem;
}
.extended summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  font-family: var(--font-serif);
  padding: .35rem 0;
  list-style: none;
  outline: none;
}
.extended summary::-webkit-details-marker { display: none; }
.extended summary::after {
  content: '+';
  float: right;
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 300;
}
.extended details[open] summary::after { content: '−'; }
.extended details p {
  margin: 1rem 0 .3rem;
  color: var(--text-muted);
  font-size: .96rem;
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 3rem 0 4rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.foot-text { color: var(--text-muted); margin: .5rem 0; }
.foot-text.small { font-size: .85rem; }
.foot-text a { color: var(--accent); text-decoration: none; }
.foot-text a:hover { text-decoration: underline; }

/* ===== MODAL ===== */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 14px;
  padding: 2rem;
  max-width: 32rem;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute; top: .8rem; right: 1rem;
  background: transparent; border: 0;
  font-size: 1.6rem; line-height: 1; cursor: pointer;
  color: var(--text-muted);
  width: 2rem; height: 2rem;
  border-radius: 999px;
}
.modal-close:hover { background: var(--bg-soft); color: var(--text); }
.modal-card h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 0 0 .3rem;
  letter-spacing: -.01em;
}
.modal-lead { color: var(--text-muted); margin: 0 0 1.5rem; }
.dl-options { display: flex; flex-direction: column; gap: .55rem; }
.dl-opt {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  transition: all .12s ease;
}
.dl-opt:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.dl-opt-flag { font-size: 1.5rem; flex-shrink: 0; }
.dl-opt-text { flex: 1; }
.dl-opt-text strong { display: block; font-weight: 600; font-size: .98rem; margin-bottom: .15rem; }
.dl-opt-text small { display: block; color: var(--text-muted); font-size: .82rem; }
.dl-print {
  background: linear-gradient(135deg, var(--accent), #c4795a);
  color: #fff;
  border-color: var(--accent);
}
.dl-print:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(184,92,58,.25); }
.dl-print .dl-opt-text strong, .dl-print .dl-opt-text small { color: #fff; }

.venmo-handle {
  text-align: center;
  margin: 1.2rem 0;
}
.venmo-handle a {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: .8rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .12s ease;
}
.venmo-handle a:hover { transform: scale(1.05); }
.modal-card p { font-size: .96rem; line-height: 1.6; }
.modal-card a { color: var(--accent); }
.vn-small { font-size: .85rem; color: var(--text-muted); margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .hero { padding: 3.5rem 0 3rem; }
  section { padding: 3rem 0; }
  h1 { font-size: 2.4rem; }
  .lead { font-size: 1.05rem; }
  .modal-card { padding: 1.5rem; }
  .biotipos-grid { grid-template-columns: 1fr; }
}
