@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ============================================================
   Hub Remodelación Costal — sistema de diseño
   Dirección: autoridad científica editorial (revista médica de prestigio
   + marca clínica refinada). Papel marfil · tinta · navy · acento brass.
   Fraunces (display) + Newsreader (lectura) + IBM Plex Mono (datos/DOI).
   ============================================================ */
:root {
  --paper:   #f5f1e7;   /* marfil cálido */
  --paper-2: #efe8d8;   /* panel */
  --paper-3: #e7dfca;   /* hairline cálido sutil */
  --ink:     #1a1c1a;   /* casi negro cálido */
  --navy:    #12314a;   /* autoridad */
  --navy-2:  #1d4a6e;
  --brass:   #9c6f24;   /* acento (autoría) */
  --brass-2: #c19a4c;
  --line:    #d9cfb8;   /* hairline sobre papel */
  --muted:   #6a6353;
  --measure: 66ch;

  --display: "Fraunces", Georgia, serif;
  --body:    "Newsreader", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.72;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* grano de papel muy sutil, fijo */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 26px; }

/* ---------- tipografía ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 500; color: var(--navy); letter-spacing: -0.01em; }
p { margin: 0 0 1.15rem; max-width: var(--measure); }
a { color: var(--navy-2); }

/* ---------- header ---------- */
header.site {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  position: sticky; top: 0; z-index: 10;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 26px; max-width: 1040px; }
.brand {
  font-family: var(--display); font-weight: 600; font-size: 1.28rem; color: var(--navy);
  text-decoration: none; letter-spacing: -0.02em; white-space: nowrap;
}
nav.site { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
nav.site a {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
nav.site a:hover { color: var(--navy); border-color: var(--brass); }
.lang { font-family: var(--mono); font-size: 0.72rem; color: var(--brass); }
.lang a { color: var(--brass); border: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
.hero .wrap { padding: 74px 26px 46px; position: relative; z-index: 1; }
.hero::after {           /* motivo de arcos costales, tenue */
  content: ""; position: absolute; right: -60px; top: -40px; width: 460px; height: 460px; z-index: 0;
  opacity: .10; pointer-events: none;
  background: no-repeat right top / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'%3E%3Cg fill='none' stroke='%2312314a' stroke-width='2'%3E%3Cpath d='M30 390 Q30 120 330 70'/%3E%3Cpath d='M30 360 Q40 150 300 100'/%3E%3Cpath d='M30 330 Q50 180 270 130'/%3E%3Cpath d='M30 300 Q60 205 240 158'/%3E%3Cpath d='M30 270 Q70 228 212 185'/%3E%3Cpath d='M30 240 Q80 248 186 210'/%3E%3C/g%3E%3C/svg%3E");
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.03; margin: 0 0 .5rem; font-weight: 500;
  animation: rise .7s cubic-bezier(.2,.7,.2,1) both;
}
.hero .sub {
  font-family: var(--body); font-style: italic; color: var(--muted);
  font-size: clamp(1.1rem, 2.4vw, 1.4rem); max-width: 40ch; margin: 0;
  animation: rise .7s .08s cubic-bezier(.2,.7,.2,1) both;
}

/* ---------- contenido ---------- */
main { padding: 8px 0 84px; }
main .wrap { counter-reset: sec; padding-top: 12px; }

h2 {
  font-size: clamp(1.55rem, 3.4vw, 2rem); margin: 3rem 0 .7rem; position: relative; line-height: 1.15;
}
h2::before {
  counter-increment: sec; content: counter(sec, decimal-leading-zero);
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; color: var(--brass);
  letter-spacing: 0.1em; display: block; margin-bottom: .5rem;
}
h3 { font-size: 1.22rem; font-weight: 600; margin: 1.6rem 0 .4rem; color: var(--navy); }

/* enlaces de cita: navy con subrayado brass */
a.cite { color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--brass-2); padding-bottom: 1px; transition: background .2s, border-color .2s; }
a.cite:hover { background: color-mix(in srgb, var(--brass-2) 16%, transparent); border-color: var(--brass); }

main ul { max-width: var(--measure); padding-left: 1.1rem; }
main li { margin: .35rem 0; }

/* ---------- answer-first (la firma: bloque tipo "abstract") ---------- */
.answer {
  position: relative; background: var(--paper-2);
  border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: 2px; padding: 26px 28px 24px; margin: 30px 0 8px;
  font-size: 1.16rem; line-height: 1.6; max-width: none;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.answer::before {
  content: "RESPUESTA"; display: block; font-family: var(--mono); font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.18em; color: var(--brass); margin-bottom: .7rem;
}
html[lang="en"] .answer::before { content: "ANSWER"; }
.answer strong { color: var(--navy); font-weight: 600; }

/* ---------- cards / evidencia ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: 1fr; margin: 22px 0; }
@media (min-width: 660px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 3px;
  padding: 22px 24px; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -18px rgba(18,49,74,.4); border-color: var(--paper-3); }
.card h3 { margin-top: 0; }
.card p { max-width: none; margin-bottom: .8rem; }
.doi {
  font-family: var(--mono); font-size: 0.76rem; color: var(--muted); word-break: break-word;
  border-top: 1px solid var(--line); padding-top: .7rem; margin: 0;
}
.doi a { color: var(--navy-2); text-decoration: none; border-bottom: 1px solid var(--brass-2); }

/* ---------- tabla comparativa ---------- */
table.compare { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 0.98rem; }
table.compare th, table.compare td { border: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: top; }
table.compare th { background: var(--navy); color: var(--paper); font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
table.compare tr:nth-child(even) td { background: var(--paper-2); }

/* ---------- FAQ ---------- */
.faq { margin: 14px 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  font-family: var(--display); font-weight: 500; font-size: 1.12rem; color: var(--navy);
  cursor: pointer; padding: 14px 34px 14px 0; position: relative; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); color: var(--brass); font-size: 1.3rem; transition: transform .2s;
}
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 16px; color: var(--ink); }

/* ---------- anotaciones ---------- */
.pending {
  font-family: var(--mono); font-size: 0.74rem; background: color-mix(in srgb, var(--brass-2) 14%, var(--paper));
  border: 1px dashed var(--brass); color: var(--brass); border-radius: 3px; padding: 1px 7px;
}

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--line); background: var(--paper-2); margin-top: 40px; }
footer.site .wrap { padding: 30px 26px; max-width: 1040px; }
footer.site p { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); max-width: none; margin: 0; line-height: 1.6; }
footer.site a { color: var(--navy-2); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
