/* ============================================================
   sanación.org — sistema visual
   Dirección: boticario editorial. Papel cálido, tinta verde,
   latón para los grados. Nada de tarjetas flotantes.
   ============================================================ */

:root {
  --paper: #f2ece0;
  --paper-deep: #e8dfcb;
  --card: #fbf7ef;
  --card-2: #f7f2e6;
  --ink: #1c2721;
  --ink-2: #4b5a50;
  --ink-3: #7c897f;
  --line: rgba(28, 39, 33, .14);
  --line-strong: rgba(28, 39, 33, .28);
  --green: #2b4c40;
  --green-2: #3d6b59;
  --green-wash: #dfe7dc;
  --brass: #a97b2e;
  --brass-wash: #f1e4c9;
  --oxblood: #8b3432;
  --oxblood-wash: #f3e0dd;
  --serif: "Constantia", "Sitka Banner", "Palatino Linotype", Georgia, serif;
  --sans: "Corbel", "Candara", "Segoe UI", sans-serif;
  --mono: "Consolas", "Cascadia Mono", ui-monospace, monospace;
  --r: 3px;
  --shadow: 0 1px 0 rgba(28, 39, 33, .04), 0 12px 32px -24px rgba(28, 39, 33, .55);
  --header-h: 66px;
}

[data-theme="dark"] {
  --paper: #151b17;
  --paper-deep: #101512;
  --card: #1c241f;
  --card-2: #212b25;
  --ink: #ece6d8;
  --ink-2: #b9c2b6;
  --ink-3: #8b968c;
  --line: rgba(236, 230, 216, .13);
  --line-strong: rgba(236, 230, 216, .26);
  --green: #7fb49c;
  --green-2: #9ccab5;
  --green-wash: #23342c;
  --brass: #d3a459;
  --brass-wash: #3a2f1c;
  --oxblood: #d98b86;
  --oxblood-wash: #3a2321;
  --shadow: 0 12px 32px -20px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "kern" 1;
  position: relative;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.16'/></svg>");
  mix-blend-mode: multiply;
}

[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: .22; }

#app-root, .page { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0 0 .8em; }

a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: var(--brass-wash); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

/* ---------- cabecera ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(20px, 4vw, 44px);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand__mark {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  color: var(--green);
  letter-spacing: -.04em;
}
.brand__mark em { font-style: italic; color: var(--brass); }
.brand__name {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .01em;
}
.brand__sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  margin-left: 4px;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}

.nav a {
  padding: 8px 12px;
  font-size: 13.5px;
  letter-spacing: .02em;
  color: var(--ink-2);
  border-radius: var(--r);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}
.nav a:hover { color: var(--ink); background: var(--card-2); text-decoration: none; }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 1px;
  height: 2px;
  background: var(--brass);
}

.badge-study {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brass);
  border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent);
  background: var(--brass-wash);
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-study::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brass);
}

.icon-btn {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: var(--r);
}
.icon-btn:hover { background: var(--card-2); color: var(--ink); }

/* ---------- utilidades ---------- */

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  padding: 9px 14px;
  border-radius: var(--r);
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover { background: var(--card-2); text-decoration: none; }
.btn--solid {
  background: var(--green);
  border-color: var(--green);
  color: #f7f2e6;
}
.btn--solid:hover { background: var(--green-2); border-color: var(--green-2); }
.btn--quiet { border-color: transparent; color: var(--ink-2); }
.btn--quiet:hover { border-color: var(--line); }
.btn--danger { color: var(--oxblood); border-color: color-mix(in srgb, var(--oxblood) 40%, transparent); }
.btn--danger:hover { background: var(--oxblood-wash); }
.btn--sm { padding: 5px 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.btn svg, .icon-btn svg { width: 16px; height: 16px; flex: none; }
.btn--sm svg { width: 14px; height: 14px; }
.rem-chip svg { width: 11px; height: 11px; }

.field { display: grid; gap: 5px; }
.field > label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.input, .select, .textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 11px;
  font-size: 14.5px;
  color: var(--ink);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-2) 14%, transparent);
}
.textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--ink-3) 80%, transparent); }

/* ---------- pie ---------- */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 28px 0 40px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.footer__grid {
  display: flex; flex-wrap: wrap; gap: 18px 40px;
  justify-content: space-between; align-items: flex-start;
}
.footer a { color: var(--ink-2); }

/* ---------- adaptación de la cabecera ---------- */

@media (max-width: 900px) {
  .topbar {
    height: auto; flex-wrap: wrap; row-gap: 4px;
    padding: 10px 16px 8px; gap: 10px;
  }
  .brand { order: 1; }
  .badge-study { order: 2; margin-left: auto; }
  .topbar > .icon-btn { order: 2; }
  .nav {
    order: 3; width: 100%; display: flex; gap: 2px;
    overflow-x: auto; margin-left: 0; padding-top: 6px;
    border-top: 1px solid var(--line);
    scrollbar-width: none;
  }
  .nav a { padding: 6px 8px; font-size: 12.5px; white-space: nowrap; }
  .nav a.is-active::after { left: 8px; right: 8px; bottom: 0; }
}

@media (max-width: 620px) {
  .topbar { gap: 10px; }
  .brand { gap: 7px; }
  .brand__name { font-size: 17px; }
  .brand__sub { display: none; }
  .badge-study { display: none; }
}
