/* =============================================================
   palmeiromed.com · Variante 1 — Editorial clínico
   Papel cálido, tinta profunda, serif de revista médica.
   ============================================================= */

/* ---------- tokens ---------- */
:root {
  --paper:     #faf7f2;
  --paper-2:   #f2eee6;
  --card:      #fffdf9;
  --ink:       #15191b;
  --ink-2:     #434b4d;
  --ink-3:     #747c7e;
  --rule:      #e4ddd2;
  --rule-2:    #d2c9ba;
  --accent:    #0d6158;
  --accent-2:  #0a4a43;
  --accent-soft: rgba(13, 97, 88, 0.075);
  --gold:      #94642c;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --shell: 1120px;
  --gut: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(.22, .78, .3, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:   #0f1214;
    --paper-2: #14181b;
    --card:    #13171a;
    --ink:     #edeff0;
    --ink-2:   #b6bdbf;
    --ink-3:   #868e90;
    --rule:    #262c30;
    --rule-2:  #343c41;
    --accent:  #58c6b5;
    --accent-2:#7ad7c7;
    --accent-soft: rgba(88, 198, 181, 0.11);
    --gold:    #cfa05c;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:   #0f1214;
  --paper-2: #14181b;
  --card:    #13171a;
  --ink:     #edeff0;
  --ink-2:   #b6bdbf;
  --ink-3:   #868e90;
  --rule:    #262c30;
  --rule-2:  #343c41;
  --accent:  #58c6b5;
  --accent-2:#7ad7c7;
  --accent-soft: rgba(88, 198, 181, 0.11);
  --gold:    #cfa05c;
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }

img { max-width: 100%; }
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--accent); color: var(--paper); }

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gut);
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 4px 0;
}
.skip:focus { left: 0; }

/* ---------- tipografía ---------- */
.display {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0;
}
.display em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

h1.display { font-size: clamp(2.3rem, 6.2vw, 4.3rem); }
h2.display { font-size: clamp(1.6rem, 3.4vw, 2.35rem); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 22px;
}
.eyebrow-rule {
  width: 34px; height: 1px;
  background: currentColor;
  flex: 0 0 auto;
  opacity: .55;
}

.lede {
  font-size: clamp(1.03rem, 1.5vw, 1.19rem);
  line-height: 1.68;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0;
}
.lede-sm { font-size: 1rem; max-width: 46ch; }

/* ---------- reveal ---------- */
[data-reveal].pending {
  opacity: 0;
  transform: translateY(18px);
}
[data-reveal] {
  transition: opacity .75s var(--ease), transform .75s var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.masthead.is-stuck { border-bottom-color: var(--rule); }

.masthead-in {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 70px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-right: auto;
}
.wordmark-mark {
  color: var(--accent);
  display: flex;
  align-self: center;
}
.wordmark-text {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.wordmark-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-left: 10px;
  border-left: 1px solid var(--rule-2);
}

.nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav a {
  display: block;
  padding: 7px 13px;
  font-size: 14.2px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 3px;
  position: relative;
  transition: color .22s var(--ease), background .22s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 13px; right: 13px; bottom: 2px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a.is-active { color: var(--accent); }
.nav a.is-active::after { transform: scaleX(1); }

.masthead-actions { display: flex; gap: 6px; align-items: center; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* iconos sol/luna dibujados en CSS para no depender del JS */
.t-sun, .t-moon { width: 16px; height: 16px; display: block; position: relative; }
.t-sun {
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.t-sun::before {
  content: "";
  position: absolute; inset: -5px;
  background:
    linear-gradient(currentColor, currentColor) center/1.5px 4px no-repeat,
    linear-gradient(currentColor, currentColor) center/4px 1.5px no-repeat;
  background-position: top center, left center;
}
.t-sun::after {
  content: "";
  position: absolute; inset: -5px;
  background:
    linear-gradient(currentColor, currentColor) bottom center/1.5px 4px no-repeat,
    linear-gradient(currentColor, currentColor) right center/4px 1.5px no-repeat;
}
.t-moon {
  border-radius: 50%;
  box-shadow: inset -4px 0 0 0 currentColor;
  transform: rotate(-28deg);
}
.t-moon { display: none; }
:root[data-theme="dark"] .t-sun { display: none; }
:root[data-theme="dark"] .t-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t-sun { display: none; }
  :root:not([data-theme="light"]) .t-moon { display: block; }
  :root[data-theme="dark"] .t-sun { display: none; }
}

.nav-burger { display: none; flex-direction: column; gap: 4px; }
.nav-burger span {
  width: 16px; height: 1.5px; background: currentColor;
  transition: transform .25s var(--ease);
}
.nav-burger[aria-expanded="true"] span:first-child { transform: translateY(2.75px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:last-child { transform: translateY(-2.75px) rotate(-45deg); }

.nav-panel {
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.nav-panel ul { list-style: none; margin: 0; padding: 8px var(--gut) 20px; }
.nav-panel a {
  display: block;
  padding: 13px 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  border-bottom: 1px solid var(--rule);
}
.nav-panel a:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero { position: relative; padding-top: clamp(48px, 9vh, 96px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.hero-main h1.display { margin-bottom: 28px; max-width: 19ch; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  font-size: 14.5px;
  font-weight: 500;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: background .22s var(--ease), color .22s var(--ease),
              border-color .22s var(--ease), transform .22s var(--ease);
}
.btn-solid { background: var(--accent); color: #fdfdfc; }
.btn-solid:hover { background: var(--accent-2); transform: translateY(-1px); }
:root[data-theme="dark"] .btn-solid { color: #0c1012; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-solid { color: #0c1012; }
}
.btn-ghost { border-color: var(--rule-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ficha lateral, como la cabecera de datos de un artículo */
.ficha {
  border-top: 2px solid var(--ink);
  padding-top: 18px;
  font-size: 13.5px;
}
.ficha-name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.26;
  margin: 0 0 18px;
}
.ficha dl { margin: 0; }
.ficha dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 13px;
}
.ficha dd {
  margin: 2px 0 0;
  color: var(--ink-2);
  line-height: 1.45;
}
.ficha-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
  animation: beat 2.6s var(--ease) infinite;
}
@keyframes beat {
  0%, 100% { transform: scale(1); opacity: 1; }
  14% { transform: scale(1.55); opacity: .72; }
  28% { transform: scale(1); opacity: 1; }
  41% { transform: scale(1.3); opacity: .82; }
  55% { transform: scale(1); opacity: 1; }
}

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(48px, 8vh, 86px);
  border-top: 1px solid var(--rule);
}
.stat {
  padding: 22px 20px 26px 0;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: 0; }
.stat + .stat { padding-left: 20px; }
.stat-num {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: block;
}
.stat-label {
  display: block;
  margin-top: 9px;
  font-size: 12.8px;
  line-height: 1.4;
  color: var(--ink-3);
  max-width: 17ch;
}

/* ---------- ecg: monitor vivo ---------- */
.ecg {
  position: relative;
  margin-top: clamp(26px, 4vh, 40px);
  border-top: 1px solid var(--rule);

  /* el motor del trazo (shared/ecg.js) lee estas tres variables */
  --ecg-stroke: var(--accent);
  --ecg-baseline: rgba(13, 97, 88, .13);
  --ecg-glow: 0;
}

.ecg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 11px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ecg-bpm { color: var(--accent); display: inline-flex; align-items: baseline; gap: 5px; }
.ecg-bpm strong {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ecg canvas {
  display: block;
  width: 100%;
  height: 118px;   /* la altura fija la velocidad del barrido — ver shared/ecg.js */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

/* en oscuro el trazo se permite un halo tenue, como en un monitor real */
:root[data-theme="dark"] .ecg {
  --ecg-baseline: rgba(88, 198, 181, .16);
  --ecg-glow: 7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ecg {
    --ecg-baseline: rgba(88, 198, 181, .16);
    --ecg-glow: 7;
  }
}

/* ---------- secciones ---------- */
.section { padding: clamp(68px, 11vh, 128px) 0; }
.section + .section { border-top: 1px solid var(--rule); }

.section-head { margin-bottom: clamp(38px, 6vh, 60px); }
.section-head h2 { max-width: 26ch; }

/* ---------- el porqué ---------- */
.porque-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.porque-lede {
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  font-weight: 400;
  line-height: 1.26;
  max-width: 24ch;
}
.porque-body p {
  margin: 0;
  color: var(--ink-2);
  font-size: 1.01rem;
  line-height: 1.72;
}
.porque-body p + p { margin-top: 17px; }
.porque-body p:first-child::first-letter {
  font-family: var(--serif);
  font-size: 3.3em;
  line-height: .82;
  float: left;
  padding: 4px 10px 0 0;
  color: var(--accent);
  font-weight: 600;
}

.pullquote {
  margin: clamp(44px, 7vh, 76px) 0 0;
  padding: 30px 0 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.pullquote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.38;
  max-width: 34ch;
  text-wrap: balance;
}
.pullquote figcaption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  margin: clamp(44px, 7vh, 72px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule-2);
}
.timeline li {
  padding: 20px 18px 4px 0;
  position: relative;
}
.timeline li + li { padding-left: 18px; border-left: 1px solid var(--rule); }
.timeline li::before {
  content: "";
  position: absolute;
  top: -4px; left: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.timeline li + li::before { left: 18px; transform: translateX(-50%); }
.tl-when {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.tl-what {
  display: block;
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 1.07rem;
  font-weight: 600;
}
.tl-detail {
  display: block;
  margin-top: 6px;
  font-size: 13.2px;
  line-height: 1.52;
  color: var(--ink-3);
}

/* ---------- worklist de proyectos ---------- */
.worklist { border-top: 1px solid var(--rule-2); }

.study {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 232px;
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
  padding: clamp(26px, 4vh, 40px) 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  transition: background .3s var(--ease);
}
.study::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.study:hover::after, .study:focus-within::after { transform: scaleX(1); }

.study-index {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: .9;
  color: var(--rule-2);
  font-variant-numeric: tabular-nums;
  transition: color .3s var(--ease);
}
.study:hover .study-index { color: var(--accent); }

.study-kind {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 9px;
}
.study-chip {
  padding: 3px 7px;
  border: 1px solid var(--rule-2);
  border-radius: 2px;
  color: var(--accent);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.study:hover .study-chip { border-color: var(--accent); background: var(--accent-soft); }

.study-name {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0;
}
.study-name a { display: inline-flex; align-items: center; gap: 11px; }
.study-name a::after {
  content: "";
  width: 0; height: 1.5px;
  background: currentColor;
  transition: width .35s var(--ease);
}
.study:hover .study-name { color: var(--accent); }
.study:hover .study-name a::after { width: 26px; }

.study-tagline {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.04rem;
  color: var(--ink-3);
}
.study-desc {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 0.97rem;
  line-height: 1.68;
  max-width: 52ch;
}
.study-long {
  margin: 11px 0 0;
  color: var(--ink-3);
  font-size: 0.9rem;
  line-height: 1.62;
  max-width: 54ch;
}
.study-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.study-tags li {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 2px;
  background: var(--paper-2);
  color: var(--ink-3);
}

.study-aside { font-size: 13px; }
.study-specs { margin: 0; }
.study-specs > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}
.study-specs > div:first-child { border-top: 1px solid var(--rule-2); }
.study-specs dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: 0 0 auto;
}
.study-specs dd {
  margin: 0;
  text-align: right;
  font-size: 12.6px;
  color: var(--ink);
  font-weight: 500;
}
.study-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.study-open svg { transition: transform .3s var(--ease); }
.study:hover .study-open svg { transform: translateX(5px); }
.study-host {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  word-break: break-all;
}

/* ---------- principios ---------- */
.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.principle {
  background: var(--paper);
  padding: clamp(24px, 3.4vw, 38px);
  transition: background .3s var(--ease);
}
.principle:hover { background: var(--card); }
.principle .ico {
  color: var(--accent);
  margin-bottom: 18px;
  display: block;
}
.principle h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 9px;
  letter-spacing: -0.01em;
}
.principle p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.94rem;
  line-height: 1.66;
}

/* ---------- contacto ---------- */
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(30px, 5vw, 56px);
}
.contact-card h2 { max-width: 24ch; margin-bottom: 18px; }

.contact-rows { margin: 0; border-top: 1px solid var(--rule-2); }
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 0;
  border-bottom: 1px solid var(--rule);
  transition: padding-left .25s var(--ease);
}
.contact-item:hover { padding-left: 7px; }
.contact-item .ico { color: var(--accent); flex: 0 0 auto; }
.contact-item dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  width: 72px;
  flex: 0 0 auto;
}
.contact-item dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  transition: color .22s var(--ease);
  word-break: break-word;
}
.contact-item:hover dd { color: var(--accent); }

/* ---------- pie ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding: 44px 0 56px;
  background: var(--paper-2);
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 48px;
  align-items: baseline;
  justify-content: space-between;
}
.foot-disclaimer {
  margin: 0;
  max-width: 62ch;
  font-size: 12.4px;
  line-height: 1.62;
  color: var(--ink-3);
}
.foot-line {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  white-space: nowrap;
}

/* =============================================================
   responsive
   ============================================================= */
@media (max-width: 1000px) {
  .study { grid-template-columns: 58px minmax(0, 1fr); }
  .study-aside { grid-column: 2; margin-top: 20px; }
  .study-desc, .study-long { max-width: 60ch; }
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .ficha {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 32px;
    border-top-width: 1px;
  }
  .ficha-name { grid-column: 1 / -1; }
  .ficha dl { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; }
  .ficha-status { grid-column: 1 / -1; }
  .porque-grid { grid-template-columns: 1fr; }
  .porque-lede { max-width: 30ch; }
  .contact-card { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(2, 1fr); border-top: 0; }
  .timeline li { border-top: 1px solid var(--rule-2); padding-top: 24px; }
  .timeline li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .timeline li:nth-child(odd)::before { left: 0; transform: none; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .nav-burger { display: flex; }
  .wordmark-sub { display: none; }
  .ecg canvas { height: 84px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--rule); }
  .stat:nth-child(even) { border-right: 0; padding-left: 20px; }
  .stat:nth-child(odd) { padding-left: 0; }
  .principles { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .study { grid-template-columns: 1fr; gap: 0; }
  .study-index { font-size: 1.5rem; margin-bottom: 12px; }
  .study-aside { grid-column: 1; }
  .timeline { grid-template-columns: 1fr; }
  .timeline li:nth-child(n) { padding-left: 0; border-left: 0; }
  .timeline li:nth-child(n)::before { left: 0; transform: none; }
  .ficha dl { grid-template-columns: 1fr; }
  .ficha { grid-template-columns: 1fr; }
  .porque-body p:first-child::first-letter { font-size: 2.8em; }
}
