/* =============================================================
   Dr Chris · Educación Médica — styles.css
   Arquetipo: Magazine multipágina, adaptado a paleta oscura clínica
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #07121F;
  --bg-2:      #0B1A2C;
  --bg-3:      #102540;
  --navy:      #13304B;
  --emerald:   #0E7C5D;
  --emerald-2: #19A87E;
  --emerald-3: #3FD3A3;
  --gold:      #D4A84E;
  --gold-2:    #E8C77F;
  --ink:       #EAF0F5;
  --ink-soft:  #BFD0DC;
  --mute:      #8199AE;
  --line:      rgba(191, 208, 220, 0.10);
  --line-2:    rgba(191, 208, 220, 0.18);
  --card:      rgba(16, 37, 64, 0.55);
  --danger:    #E2675B;

  --display: "Poppins", system-ui, sans-serif;
  --serif:   "Instrument Serif", Georgia, serif;
  --sans:    "Poppins", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --nav-h: 76px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --maxw: 1240px;
  --radius: 18px;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@property --spin {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  background: var(--bg);
  color-scheme: dark;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink);
  background: transparent; /* html lleva el fondo: así .page-bg y el ECG (z-index negativo) se ven */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; letter-spacing: -0.025em; font-weight: 600; }
strong { font-weight: 600; }
::selection { background: var(--gold); color: var(--bg); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--gold); color: var(--bg);
  border-radius: 8px; font-weight: 500;
}
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.gold { color: var(--gold); }
.emerald { color: var(--emerald-3); }
em, .serif-em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--gold);
}
.kicker {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--emerald-3);
  display: inline-flex; align-items: center; gap: .7rem;
}
.kicker::before {
  content: ""; width: 26px; height: 1px; background: currentColor; opacity: .7;
}
.mono { font-family: var(--mono); }

/* page background — monitor grid + vignette */
.page-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 85% 0%, rgba(14,124,93,.16), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(19,48,75,.55), transparent 70%),
    var(--bg);
}
.page-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(191,208,220,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(191,208,220,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(90% 70% at 50% 30%, #000 30%, transparent 85%);
}

/* =============================================================
   4. Typography
   ============================================================= */
.h-display { font-size: clamp(2.5rem, 6.4vw, 5.6rem); line-height: 1.02; letter-spacing: -0.035em; }
.h-section { font-size: clamp(1.9rem, 4vw, 3.2rem); }
.lede { font-size: clamp(1.02rem, 1.3vw, 1.18rem); color: var(--ink-soft); max-width: 60ch; }

/* =============================================================
   5. Components
   ============================================================= */

/* ---------- Buttons ---------- */
.btn {
  --b: var(--gold);
  position: relative;
  display: inline-flex; align-items: center; gap: .65rem;
  padding: .9rem 1.5rem;
  border-radius: 999px;
  font-size: .92rem; font-weight: 500; letter-spacing: .01em;
  transition: transform .4s var(--ease-out), background .3s, color .3s, box-shadow .4s var(--ease-out);
  isolation: isolate;
}
.btn svg { width: 16px; height: 16px; transition: transform .4s var(--ease-out); }
.btn:hover svg { transform: translateX(4px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, #B98B33);
  color: #0A1626;
  box-shadow: 0 10px 30px -10px rgba(212,168,78,.55), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px rgba(212,168,78,.7), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-ghost {
  border: 1px solid var(--line-2);
  color: var(--ink);
  background: rgba(255,255,255,.02);
}
.btn-ghost:hover { border-color: var(--emerald-2); background: rgba(14,124,93,.12); }
.link-arrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .9rem; font-weight: 500; color: var(--gold);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease-out);
  padding-bottom: 2px;
}
.link-arrow:hover { background-size: 100% 1px; }
.link-arrow svg { width: 14px; height: 14px; }

/* ---------- Brand mark ---------- */
.mark { width: 30px; height: 36px; flex: none; }
.mark path { fill: none; stroke: var(--gold); }
.mark .m-d { stroke-width: 9.3; }
.mark .m-c { stroke-width: 9.3; stroke-linecap: round; }
.brand { display: inline-flex; align-items: center; gap: .8rem; }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-word b { font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; }
.brand-word b span { color: var(--gold); }
.brand-word small {
  font-size: .52rem; letter-spacing: .42em; color: var(--ink-soft); margin-top: .35rem; font-weight: 400;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  transition: background .4s, border-color .4s, transform .5s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(7, 18, 31, 0.92);
  border-bottom-color: var(--line);
}
@supports (backdrop-filter: blur(16px)) {
  .nav.is-scrolled { background: rgba(7, 18, 31, 0.72); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); }
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.nav-links { display: none; align-items: center; gap: .3rem; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem .9rem; border-radius: 999px;
  font-size: .88rem; font-weight: 400; color: var(--ink-soft);
  transition: color .25s, background .25s;
}
.nav-link svg { width: 10px; height: 10px; transition: transform .35s var(--ease-out); opacity: .7; }
.nav-link:hover, .nav-item:hover > .nav-link, .nav-link[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,.04); }
.nav-link[aria-current="page"] { color: var(--gold); }
.nav-item:hover > .nav-link svg, .nav-item:focus-within > .nav-link svg { transform: rotate(180deg); }
.nav-cta { display: none; }

/* dropdown / mega */
.dropdown {
  position: absolute; top: calc(100% + 12px); left: 50%;
  translate: -50% 0;
  min-width: 280px;
  padding: .7rem;
  background: rgba(11, 26, 44, .97);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(212,168,78,.04);
  opacity: 0; visibility: hidden; transform: translateY(8px) scale(.98);
  transition: opacity .3s var(--ease-out), transform .4s var(--ease-out), visibility .3s;
}
.dropdown::before { content: ""; position: absolute; inset: -14px 0 auto 0; height: 14px; }
.nav-item:hover > .dropdown, .nav-item:focus-within > .dropdown { opacity: 1; visibility: visible; transform: none; }
.dd-link {
  display: flex; gap: .85rem; align-items: flex-start;
  padding: .7rem .8rem; border-radius: 12px;
  transition: background .25s;
}
.dd-link:hover { background: rgba(14,124,93,.14); }
.dd-link .ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(212,168,78,.08); border: 1px solid rgba(212,168,78,.18); }
.dd-link .ico svg { width: 18px; height: 18px; color: var(--gold); }
.dd-link b { display: block; font-size: .88rem; font-weight: 500; color: var(--ink); line-height: 1.3; }
.dd-link small { display: block; font-size: .76rem; color: var(--mute); line-height: 1.45; margin-top: .15rem; }

.mega { width: min(920px, 92vw); padding: 1.4rem; display: grid; grid-template-columns: 1.15fr 1fr .95fr; gap: 1.2rem; }
.mega-col h6 {
  font-family: var(--mono); font-size: .66rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--mute); padding: 0 .8rem .6rem;
}
.mega-col .dd-link { padding: .55rem .8rem; }
.mega-feature {
  border-radius: 16px; padding: 1.3rem; position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(14,124,93,.35), rgba(19,48,75,.6));
  border: 1px solid rgba(63,211,163,.2);
  display: flex; flex-direction: column; justify-content: flex-end; min-height: 260px;
}
.mega-feature svg.bg-art { position: absolute; right: -30px; top: -20px; width: 220px; opacity: .22; }
.mega-feature .kicker { margin-bottom: .6rem; }
.mega-feature b { font-size: 1.05rem; line-height: 1.3; font-weight: 600; }
.mega-feature p { font-size: .8rem; color: var(--ink-soft); margin: .4rem 0 .9rem; line-height: 1.5; }

/* burger + mobile panel */
.burger {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; position: relative;
}
.burger span { position: absolute; width: 18px; height: 1.5px; background: var(--ink); transition: transform .4s var(--ease-out), opacity .3s; }
.burger span:nth-child(1) { transform: translateY(-4px); }
.burger span:nth-child(2) { transform: translateY(4px); }
.nav.is-open .burger span:nth-child(1) { transform: rotate(45deg); }
.nav.is-open .burger span:nth-child(2) { transform: rotate(-45deg); }

.mobile-panel {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99;
  background: rgba(7,18,31,.98);
  padding: 1.2rem var(--gutter) 3rem;
  overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-10px);
  transition: opacity .35s var(--ease-out), transform .45s var(--ease-out), visibility .35s;
}
.nav.is-open + .mobile-panel { opacity: 1; visibility: visible; transform: none; }
.mobile-panel details { border-bottom: 1px solid var(--line); }
.mobile-panel summary, .mobile-panel > a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 0; font-size: 1.25rem; font-weight: 500; list-style: none; cursor: pointer;
}
.mobile-panel > a { border-bottom: 1px solid var(--line); }
.mobile-panel summary::-webkit-details-marker { display: none; }
.mobile-panel summary svg { width: 14px; height: 14px; transition: transform .3s; }
.mobile-panel details[open] summary svg { transform: rotate(180deg); }
.mobile-panel details div { display: grid; gap: .1rem; padding-bottom: 1rem; }
.mobile-panel details a { padding: .45rem 0; color: var(--ink-soft); font-size: .98rem; }
.mobile-panel .btn { margin-top: 1.6rem; width: 100%; justify-content: center; }

/* ---------- Spotlight card ---------- */
.spot {
  position: relative;
  background: linear-gradient(180deg, rgba(16,37,64,.65), rgba(11,26,44,.55));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .5s var(--ease-out), border-color .4s;
  isolation: isolate;
}
.spot::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1;
  background: radial-gradient(260px circle at var(--x, 50%) var(--y, 50%), rgba(212,168,78,.75), rgba(63,211,163,.35) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .4s;
}
.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--x, 50%) var(--y, 50%), rgba(63,211,163,.07), transparent 60%);
  opacity: 0; transition: opacity .4s;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }
.spot:hover { transform: translateY(-4px); }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .32rem .6rem; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-soft);
}
.tag-gold { border-color: rgba(212,168,78,.35); color: var(--gold); background: rgba(212,168,78,.06); }
.tag-em { border-color: rgba(63,211,163,.3); color: var(--emerald-3); background: rgba(14,124,93,.1); }

/* ---------- Content card ---------- */
.c-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.c-card .thumb {
  aspect-ratio: 16 / 10; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 80% 0%, rgba(14,124,93,.35), transparent 60%), linear-gradient(160deg, #102540, #0A1828);
  border-bottom: 1px solid var(--line);
}
.c-card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(191,208,220,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(191,208,220,.05) 1px, transparent 1px);
  background-size: 22px 22px;
}
.c-card .thumb svg.art {
  position: absolute; inset: 0; margin: auto; width: 46%; height: 70%; z-index: 1;
  color: var(--gold); transition: transform .8s var(--ease-out);
}
.c-card:hover .thumb svg.art { transform: scale(1.08) rotate(-2deg); }
.c-card .thumb .tag { position: absolute; top: .9rem; left: .9rem; z-index: 2; background: rgba(7,18,31,.7); }
.c-card .body { padding: 1.3rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.c-card .meta { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--mute); text-transform: uppercase; display: flex; gap: .8rem; flex-wrap: wrap; }
.c-card h3 { font-size: 1.12rem; font-weight: 500; letter-spacing: -.015em; line-height: 1.3; }
.c-card p { font-size: .88rem; color: var(--ink-soft); line-height: 1.6; }
.c-card .foot { margin-top: auto; padding-top: .6rem; display: flex; justify-content: space-between; align-items: center; }
.c-card .foot span { font-size: .78rem; color: var(--mute); }
.c-card .go {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; transition: background .3s, border-color .3s, transform .4s var(--ease-out);
}
.c-card .go svg { width: 14px; height: 14px; }
.c-card:hover .go { background: var(--gold); border-color: var(--gold); color: var(--bg); transform: rotate(-45deg); }

/* ---------- Section head ---------- */
.section { position: relative; padding-block: clamp(5rem, 11vw, 9rem); }
.section-head { display: grid; gap: 1.2rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; }
.section-num { font-family: var(--mono); font-size: .72rem; color: var(--gold); letter-spacing: .2em; }
.divider-ecg { height: 40px; width: 100%; color: rgba(63,211,163,.35); }

/* =============================================================
   6. Sections
   ============================================================= */

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 9000;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .7s var(--ease-out), visibility .7s;
  animation: splashSafety .01s 4.5s forwards;
}
.splash.is-out { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes splashSafety { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.splash-inner { display: grid; justify-items: center; gap: 1.4rem; }
.splash .mark { width: 74px; height: 90px; }
.splash .mark path { stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw 1.4s var(--ease-out) forwards; }
.splash .mark .m-c { stroke-dasharray: 120; stroke-dashoffset: 120; animation-delay: .45s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.splash-line { width: 160px; height: 1px; background: var(--line-2); overflow: hidden; position: relative; }
.splash-line::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--emerald-3), transparent); animation: scan 1.2s ease-in-out infinite; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.splash small { font-family: var(--mono); font-size: .62rem; letter-spacing: .4em; color: var(--ink-soft); }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 3rem) 0 4rem;
  overflow: clip;
}
.hero-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px circle at var(--mx, 70%) var(--my, 40%), rgba(14,124,93,.22), transparent 60%),
    radial-gradient(380px circle at calc(var(--mx, 70%) + 12%) calc(var(--my, 40%) + 18%), rgba(212,168,78,.10), transparent 60%);
  transition: background .2s linear;
}
.hero-ecg { position: absolute; left: 0; right: 0; bottom: 18%; height: 120px; z-index: -1; opacity: .9; width: 100%; }
.hero-grid { display: grid; gap: 3.5rem; align-items: center; }
.hero-copy .kicker { margin-bottom: 1.6rem; }
.hero-title { max-width: 14ch; }
.hero-title em { padding-right: .06em; }
.hero-sub { margin: 1.6rem 0 2.2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-meta { margin-top: 2.8rem; display: flex; flex-wrap: wrap; gap: 1.6rem 2.4rem; }
.hero-meta div { display: grid; gap: .2rem; }
.hero-meta b { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; }
.hero-meta span { font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }

/* vitals monitor */
.monitor {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(16,37,64,.85), rgba(7,18,31,.92));
  box-shadow: 0 60px 120px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05);
  padding: 1.2rem;
  overflow: hidden;
}
.monitor::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
}
.monitor-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; color: var(--mute); text-transform: uppercase; padding: .2rem .3rem .9rem; border-bottom: 1px solid var(--line); }
.live { display: inline-flex; align-items: center; gap: .5rem; color: var(--emerald-3); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-3); box-shadow: 0 0 0 0 rgba(63,211,163,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63,211,163,.6); } 70% { box-shadow: 0 0 0 10px rgba(63,211,163,0); } 100% { box-shadow: 0 0 0 0 rgba(63,211,163,0); } }
.monitor-trace { height: 110px; margin: .8rem 0; position: relative; }
.monitor-trace canvas { width: 100%; height: 100%; }
.monitor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.vital { border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; background: rgba(7,18,31,.5); }
.vital small { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .6rem; letter-spacing: .14em; color: var(--mute); text-transform: uppercase; }
.vital b { display: block; font-family: var(--mono); font-weight: 500; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.vital span.u { font-size: .7rem; color: var(--mute); margin-left: .25rem; font-family: var(--mono); }
.vital.hr b { color: var(--emerald-3); }
.vital.bp b { color: var(--ink); }
.vital.spo b { color: #7FC8F8; }
.vital.tmp b { color: var(--gold); }
.monitor-foot { margin-top: .8rem; font-family: var(--mono); font-size: .62rem; color: var(--mute); letter-spacing: .08em; display: flex; justify-content: space-between; }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); padding: 1.1rem 0; overflow: hidden; background: rgba(11,26,44,.5); }
.marquee-track { display: flex; gap: 3rem; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { display: inline-flex; align-items: center; gap: 3rem; font-size: clamp(1rem, 1.6vw, 1.3rem); color: var(--ink-soft); white-space: nowrap; font-weight: 300; }
.marquee span::after { content: "✚"; color: var(--gold); font-size: .7em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Specialties ---------- */
.spec-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.spec { padding: 1.6rem; display: flex; flex-direction: column; gap: 1rem; min-height: 230px; }
.spec .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(14,124,93,.12); border: 1px solid rgba(63,211,163,.22); }
.spec .ico svg { width: 26px; height: 26px; color: var(--emerald-3); }
.spec h3 { font-size: 1.2rem; font-weight: 500; }
.spec p { font-size: .86rem; color: var(--ink-soft); line-height: 1.6; }
.spec .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; color: var(--mute); text-transform: uppercase; }
.spec .foot svg { width: 16px; height: 16px; color: var(--gold); transition: transform .4s var(--ease-out); }
.spec:hover .foot svg { transform: translateX(5px); }
.spec.is-feature { background: linear-gradient(160deg, rgba(14,124,93,.32), rgba(16,37,64,.7)); border-color: rgba(63,211,163,.25); }
.spec.is-feature .ico { background: rgba(212,168,78,.12); border-color: rgba(212,168,78,.3); }
.spec.is-feature .ico svg { color: var(--gold); }

/* ---------- Formats ---------- */
.formats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.format { background: var(--bg-2); padding: 1.6rem 1.3rem; display: grid; gap: .7rem; transition: background .4s; position: relative; }
.format:hover { background: var(--bg-3); }
.format svg { width: 28px; height: 28px; color: var(--gold); }
.format b { font-weight: 500; font-size: 1rem; }
.format small { font-size: .8rem; color: var(--mute); line-height: 1.5; }
.format .n { position: absolute; top: 1.2rem; right: 1.2rem; font-family: var(--mono); font-size: .62rem; color: var(--mute); }

/* ---------- Featured ---------- */
.featured { display: grid; overflow: hidden; }
.featured-art { position: relative; min-height: 320px; background: radial-gradient(90% 80% at 30% 20%, rgba(14,124,93,.4), transparent 60%), linear-gradient(160deg, #102540, #081525); border-bottom: 1px solid var(--line); overflow: hidden; }
.featured-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.featured-body { padding: clamp(1.6rem, 4vw, 3rem); display: flex; flex-direction: column; gap: 1.1rem; justify-content: center; }
.featured-body h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.12; }
.featured-body p { color: var(--ink-soft); }
.featured-body .meta { display: flex; gap: .6rem; flex-wrap: wrap; }

/* dialysis circuit svg animation */
.flow { stroke-dasharray: 6 10; animation: flow 1.6s linear infinite; }
.flow.rev { animation-direction: reverse; }
@keyframes flow { to { stroke-dashoffset: -32; } }

/* ---------- Grid of cards ---------- */
.cards { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }

/* ---------- Scheme (interactive diagram) ---------- */
.scheme { display: grid; gap: 2rem; align-items: center; }
.scheme-figure { position: relative; padding: clamp(1rem, 3vw, 2rem); }
.scheme-figure svg { width: 100%; height: auto; }
.scheme-figure .hot { cursor: pointer; }
.scheme-figure .hot circle.ring { transition: r .3s var(--ease-out), opacity .3s; }
.scheme-figure .hot:hover circle.ring, .scheme-figure .hot.is-active circle.ring { r: 15; opacity: 1; }
.scheme-list { display: grid; gap: .6rem; }
.scheme-item { padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .3s, background .3s; display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; }
.scheme-item .n { grid-row: span 2; font-family: var(--mono); font-size: .72rem; color: var(--gold); width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(212,168,78,.4); display: grid; place-items: center; }
.scheme-item b { font-weight: 500; font-size: .95rem; }
.scheme-item small { font-size: .82rem; color: var(--ink-soft); line-height: 1.55; }
.scheme-item:hover, .scheme-item.is-active { border-color: rgba(63,211,163,.4); background: rgba(14,124,93,.1); }

/* ---------- About teaser ---------- */
.about { display: grid; gap: 3rem; align-items: center; }
.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden;
  background: radial-gradient(80% 60% at 50% 30%, rgba(14,124,93,.35), transparent 70%), linear-gradient(170deg, var(--navy), #081525);
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
}
.portrait::before {
  content: ""; position: absolute; inset: -40%;
  background: conic-gradient(from var(--spin), transparent 0deg, rgba(212,168,78,.35) 40deg, transparent 90deg, transparent 360deg);
  animation: spin 9s linear infinite;
  opacity: .5;
}
.portrait::after { content: ""; position: absolute; inset: 1px; border-radius: 27px; background: radial-gradient(80% 60% at 50% 30%, rgba(14,124,93,.3), transparent 70%), linear-gradient(170deg, #12304B, #081525); }
@keyframes spin { to { --spin: 360deg; } }
.portrait .mark { position: relative; z-index: 1; width: 38%; height: auto; }
.portrait .mark path { stroke-width: 7; }
.portrait figcaption { position: absolute; z-index: 1; bottom: 1.2rem; left: 1.2rem; right: 1.2rem; display: flex; justify-content: space-between; font-family: var(--mono); font-size: .64rem; letter-spacing: .16em; color: var(--ink-soft); text-transform: uppercase; }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.highlights { display: grid; gap: .1rem; margin: 2rem 0; border-top: 1px solid var(--line); }
.highlights li { display: grid; grid-template-columns: 44px 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.highlights li svg { width: 22px; height: 22px; color: var(--gold); margin-top: .2rem; }
.highlights b { display: block; font-weight: 500; }
.highlights span { font-size: .88rem; color: var(--ink-soft); }

/* ---------- Tools teaser ---------- */
.tools { display: grid; gap: 1rem; }
.tool { padding: 1.5rem; display: grid; gap: .8rem; }
.tool .formula { font-family: var(--mono); font-size: .74rem; color: var(--emerald-3); background: rgba(14,124,93,.08); border: 1px dashed rgba(63,211,163,.25); border-radius: 10px; padding: .6rem .8rem; overflow-x: auto; white-space: nowrap; }
.tool h3 { font-size: 1.1rem; font-weight: 500; }
.tool p { font-size: .86rem; color: var(--ink-soft); }

/* ---------- Newsletter ---------- */
.newsletter {
  position: relative; border-radius: 32px; overflow: hidden;
  padding: clamp(2.2rem, 6vw, 5rem);
  background: radial-gradient(70% 90% at 100% 0%, rgba(212,168,78,.18), transparent 60%), radial-gradient(70% 90% at 0% 100%, rgba(14,124,93,.35), transparent 60%), linear-gradient(160deg, #12304B, #0A1828);
  border: 1px solid var(--line-2);
  display: grid; gap: 2rem; align-items: center;
}
.newsletter .bg-mark { position: absolute; right: -4%; top: -10%; width: 340px; height: auto; opacity: .07; }
.newsletter .bg-mark path { stroke: var(--ink); }
.nl-form { display: flex; flex-direction: column; gap: .7rem; position: relative; }
.nl-form input {
  flex: 1; min-width: 0;
  padding: 1rem 1.3rem; border-radius: 999px;
  background: rgba(7,18,31,.6); border: 1px solid var(--line-2); color: var(--ink);
  outline: none; transition: border-color .3s;
}
.nl-form input:focus { border-color: var(--gold); }
.nl-form input::placeholder { color: var(--mute); }
.nl-note { font-size: .76rem; color: var(--mute); margin-top: .4rem; }
.nl-ok { display: none; color: var(--emerald-3); font-size: .9rem; }
.nl-form.is-sent .nl-ok { display: block; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 4.5rem 0 2rem; margin-top: clamp(4rem, 8vw, 6rem); background: linear-gradient(180deg, transparent, rgba(11,26,44,.7)); }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; display: grid; gap: 1rem; max-width: 34ch; }
.footer-brand p { font-size: .86rem; color: var(--ink-soft); }
.footer h6 { font-family: var(--mono); font-size: .66rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.footer ul { display: grid; gap: .55rem; }
.footer ul a { font-size: .88rem; color: var(--ink-soft); transition: color .25s; }
.footer ul a:hover { color: var(--ink); }
.footer-bottom { margin-top: 3.5rem; padding-top: 1.6rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .76rem; color: var(--mute); }
.disclaimer { max-width: 70ch; }
.footer-ecg { width: 100%; height: 60px; color: rgba(212,168,78,.35); margin-bottom: 2rem; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: calc(var(--nav-h) + clamp(3rem, 8vw, 6rem)) 0 clamp(2.5rem, 6vw, 4rem); position: relative; }
.crumbs { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); display: flex; gap: .6rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.crumbs a:hover { color: var(--gold); }
.page-hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.6rem); max-width: 18ch; letter-spacing: -.035em; }
.page-hero .lede { margin-top: 1.3rem; }

/* ---------- Library ---------- */
.lib-bar {
  position: sticky; top: calc(var(--nav-h) + 8px); z-index: 20;
  display: grid; gap: .9rem;
  padding: 1rem; border-radius: 20px;
  background: rgba(11,26,44,.94); border: 1px solid var(--line-2);
  margin-bottom: 2rem;
}
@supports (backdrop-filter: blur(14px)) { .lib-bar { background: rgba(11,26,44,.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); } }
.lib-search { position: relative; }
.lib-search svg { position: absolute; left: 1rem; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--mute); }
.lib-search input { width: 100%; padding: .85rem 1rem .85rem 2.7rem; border-radius: 12px; background: rgba(7,18,31,.7); border: 1px solid var(--line); outline: none; color: var(--ink); }
.lib-search input:focus { border-color: var(--gold); }
.chips { display: flex; gap: .45rem; overflow-x: auto; overflow-y: visible; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: .5rem .95rem; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: .8rem; color: var(--ink-soft); transition: all .25s; white-space: nowrap;
}
.chip:hover { border-color: var(--emerald-2); color: var(--ink); }
.chip.is-on { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 500; }
.lib-row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.lib-select { padding: .55rem 2rem .55rem .9rem; border-radius: 999px; background: rgba(7,18,31,.7); border: 1px solid var(--line-2); font-size: .8rem; color: var(--ink); }
.lib-count { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; color: var(--mute); text-transform: uppercase; }
.lib-empty { display: none; text-align: center; padding: 4rem 1rem; color: var(--mute); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.lib-empty.is-on { display: block; }
.c-item.is-hidden { display: none; }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--emerald-2), var(--gold)); }
.art-hero { padding: calc(var(--nav-h) + clamp(3rem, 7vw, 5rem)) 0 2.5rem; }
.art-hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); max-width: 20ch; margin: 1.2rem 0; }
.art-hero .byline { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; font-size: .85rem; color: var(--ink-soft); margin-top: 1.6rem; }
.art-hero .byline .who { display: inline-flex; align-items: center; gap: .6rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); border: 1px solid rgba(212,168,78,.4); }
.avatar .mark { width: 14px; height: 17px; }
.art-cover { border-radius: 24px; overflow: hidden; border: 1px solid var(--line-2); background: radial-gradient(80% 80% at 20% 0%, rgba(14,124,93,.35), transparent 60%), linear-gradient(160deg, #102540, #081525); }
.art-cover svg { width: 100%; height: auto; }
.art-layout { display: grid; gap: 3rem; margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.toc { display: none; }
.toc h6 { font-family: var(--mono); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); margin-bottom: 1rem; font-weight: 500; }
.toc ol { list-style: none; display: grid; gap: .2rem; border-left: 1px solid var(--line-2); }
.toc a { display: block; padding: .4rem 0 .4rem 1rem; font-size: .84rem; color: var(--mute); border-left: 2px solid transparent; margin-left: -1px; transition: color .25s, border-color .25s; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--gold); border-left-color: var(--gold); }
.prose { max-width: 70ch; font-size: 1.04rem; color: var(--ink-soft); }
.prose > * + * { margin-top: 1.3rem; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); color: var(--ink); margin-top: 3.2rem; scroll-margin-top: calc(var(--nav-h) + 20px); }
.prose h3 { font-size: 1.2rem; color: var(--ink); margin-top: 2rem; font-weight: 500; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.2rem; display: grid; gap: .5rem; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul li { padding-left: 1.4rem; position: relative; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .72em; width: 7px; height: 7px; border-radius: 2px; background: var(--emerald-2); transform: rotate(45deg); }
.prose ol { list-style: decimal; }
.prose ol li::marker { color: var(--gold); font-family: var(--mono); font-size: .85em; }
.prose a { color: var(--gold); border-bottom: 1px solid rgba(212,168,78,.35); }
.dropcap::first-letter {
  float: left; font-family: var(--serif); font-style: italic; font-size: 5.2em; line-height: .82;
  padding: .06em .12em 0 0; color: var(--gold);
}
.callout { border: 1px solid rgba(63,211,163,.28); background: rgba(14,124,93,.09); border-radius: 18px; padding: 1.4rem 1.5rem; }
.callout h4 { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--emerald-3); margin-bottom: .8rem; display: flex; gap: .5rem; align-items: center; }
.callout h4 svg { width: 16px; height: 16px; }
.callout.warn { border-color: rgba(212,168,78,.35); background: rgba(212,168,78,.06); }
.callout.warn h4 { color: var(--gold); }
.pull {
  margin: 3rem 0 !important; padding: 0 0 0 1.6rem; border-left: 2px solid var(--gold);
  font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.25; color: var(--ink);
}
.pull cite { display: block; margin-top: .8rem; font-family: var(--mono); font-style: normal; font-size: .7rem; letter-spacing: .14em; color: var(--mute); text-transform: uppercase; }
.figure { border: 1px solid var(--line-2); border-radius: 20px; overflow: hidden; background: var(--bg-2); }
.figure svg { width: 100%; height: auto; }
.figure figcaption { padding: .9rem 1.2rem; font-size: .8rem; color: var(--mute); border-top: 1px solid var(--line); font-style: italic; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 16px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 520px; }
.table-wrap th { text-align: left; font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 500; padding: .9rem 1rem; background: rgba(212,168,78,.05); border-bottom: 1px solid var(--line-2); }
.table-wrap td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap tr:last-child td { border-bottom: 0; }
.refs { font-size: .84rem; }
.refs li { color: var(--mute); }
.author-box { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; padding: 1.6rem; margin-top: 3.5rem !important; }
.author-box .avatar { width: 64px; height: 64px; }
.author-box .avatar .mark { width: 24px; height: 29px; }
.author-box b { color: var(--ink); font-weight: 600; }
.author-box p { font-size: .88rem; margin-top: .2rem; }

/* ---------- About page ---------- */
.about-hero { display: grid; gap: 3rem; align-items: end; }
.roles { display: grid; gap: 1rem; }
.role { padding: 1.8rem; display: grid; gap: .9rem; align-content: start; }
.role .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(212,168,78,.1); border: 1px solid rgba(212,168,78,.28); }
.role .ico svg { width: 24px; height: 24px; color: var(--gold); }
.role h3 { font-size: 1.25rem; font-weight: 500; }
.role p { font-size: .9rem; color: var(--ink-soft); }
.role ul { display: grid; gap: .4rem; margin-top: .3rem; }
.role li { font-size: .84rem; color: var(--ink-soft); padding-left: 1.1rem; position: relative; }
.role li::before { content: ""; position: absolute; left: 0; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: var(--emerald-3); }
.skills { display: flex; flex-wrap: wrap; gap: .6rem; }
.skill { padding: .7rem 1.1rem; border-radius: 999px; border: 1px solid var(--line-2); font-size: .9rem; color: var(--ink-soft); transition: all .3s var(--ease-out); background: rgba(11,26,44,.5); }
.skill:hover { border-color: var(--gold); color: var(--ink); transform: translateY(-2px); }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--gold), var(--emerald-2) 50%, rgba(63,211,163,.1)); }
.t-item { position: relative; padding: 0 0 2.6rem 3rem; }
.t-item::before { content: ""; position: absolute; left: 4px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); }
.t-item.future::before { border-color: var(--emerald-3); border-style: dashed; }
.t-item .when { font-family: var(--mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.t-item.future .when { color: var(--emerald-3); }
.t-item h3 { font-size: 1.25rem; font-weight: 500; margin: .4rem 0; }
.t-item p { font-size: .92rem; color: var(--ink-soft); max-width: 60ch; }

/* ---------- Projects ---------- */
.project { display: grid; gap: 2.5rem; padding: clamp(1.6rem, 4vw, 3rem); }
.project + .project { margin-top: 1.4rem; }
.project h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.steps { display: grid; gap: .7rem; counter-reset: s; }
.step { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,18,31,.4); }
.step::before { counter-increment: s; content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: .72rem; color: var(--gold); }
.step b { font-weight: 500; font-size: .95rem; display: block; }
.step small { font-size: .8rem; color: var(--mute); display: block; line-height: 1.45; }
.state { font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; padding: .3rem .55rem; border-radius: 999px; white-space: nowrap; }
.state.done { color: var(--emerald-3); background: rgba(14,124,93,.14); }
.state.now { color: var(--gold); background: rgba(212,168,78,.12); }
.state.next { color: var(--mute); border: 1px solid var(--line-2); }
.bar { height: 6px; border-radius: 999px; background: rgba(191,208,220,.08); overflow: hidden; margin-top: .6rem; }
.bar i { display: block; height: 100%; width: var(--w, 0%); background: linear-gradient(90deg, var(--emerald-2), var(--gold)); border-radius: inherit; transition: width 1.6s var(--ease-out); }
.pillars { display: grid; gap: .8rem; grid-template-columns: 1fr; }
.pillar { padding: 1.3rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(7,18,31,.4); }
.pillar svg { width: 24px; height: 24px; color: var(--emerald-3); margin-bottom: .7rem; }
.pillar b { display: block; font-weight: 500; margin-bottom: .2rem; }
.pillar small { color: var(--ink-soft); font-size: .84rem; line-height: 1.5; display: block; }

/* ---------- Calculators ---------- */
.calc-grid { display: grid; gap: 1.2rem; }
.calc { padding: clamp(1.4rem, 3vw, 2rem); display: grid; gap: 1.2rem; align-content: start; }
.calc header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.calc h2 { font-size: 1.35rem; font-weight: 500; }
.calc header p { font-size: .84rem; color: var(--ink-soft); margin-top: .3rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.field { display: grid; gap: .35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.field input, .field select {
  width: 100%; padding: .8rem .9rem; border-radius: 12px;
  background: rgba(7,18,31,.7); border: 1px solid var(--line-2); color: var(--ink);
  outline: none; transition: border-color .25s; font-variant-numeric: tabular-nums;
}
.field input:focus, .field select:focus { border-color: var(--gold); }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.seg label { flex: 1; text-align: center; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .78rem .5rem; font-size: .84rem; color: var(--ink-soft); transition: background .25s, color .25s; font-family: var(--sans); letter-spacing: 0; text-transform: none; }
.seg input:checked + span { background: rgba(212,168,78,.16); color: var(--gold); }
.result {
  border-radius: 16px; padding: 1.2rem 1.3rem;
  background: linear-gradient(160deg, rgba(14,124,93,.2), rgba(7,18,31,.6));
  border: 1px solid rgba(63,211,163,.25);
  display: grid; gap: .3rem;
}
.result small { font-family: var(--mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.result b { font-family: var(--mono); font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 500; color: var(--emerald-3); line-height: 1.1; font-variant-numeric: tabular-nums; }
.result b .u { font-size: .8rem; color: var(--mute); margin-left: .3rem; }
.result p { font-size: .84rem; color: var(--ink-soft); }
.result .sub { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.calc .note { font-size: .74rem; color: var(--mute); line-height: 1.5; }

/* =============================================================
   7. Effects
   ============================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; } .reveal-d2 { transition-delay: .16s; } .reveal-d3 { transition-delay: .24s; } .reveal-d4 { transition-delay: .32s; }

.split-word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split-word > i { display: inline-block; font-style: inherit; transform: translateY(105%); transition: transform 1.1s var(--ease-out); }
.is-split-in .split-word > i { transform: none; }

.ecg-path { stroke-dasharray: 1600; stroke-dashoffset: 1600; }
.is-visible .ecg-path, .ecg-path.is-visible { animation: ecgDraw 2.6s var(--ease-soft) forwards; }
@keyframes ecgDraw { to { stroke-dashoffset: 0; } }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .nl-form { flex-direction: row; }
  .formats { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .spec-grid { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr); }
  .footer-brand { grid-column: auto; }
  .tools { grid-template-columns: repeat(3, 1fr); }
  .roles { grid-template-columns: repeat(3, 1fr); }
  .calc-grid { grid-template-columns: repeat(2, 1fr); }
  .lib-bar { grid-template-columns: 1fr; }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; padding: .7rem 1.2rem; }
  .burger, .mobile-panel { display: none; }
  .hero-grid { grid-template-columns: 1.2fr .9fr; gap: 4rem; }
  .spec-grid { grid-template-columns: repeat(4, 1fr); }
  .spec.is-feature { grid-column: span 2; }
  .formats { grid-template-columns: repeat(6, 1fr); }
  .featured { grid-template-columns: 1.1fr 1fr; }
  .featured-art { border-bottom: 0; border-right: 1px solid var(--line); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .scheme { grid-template-columns: 1.3fr 1fr; gap: 3rem; }
  .about { grid-template-columns: .85fr 1.15fr; gap: 5rem; }
  .newsletter { grid-template-columns: 1.1fr 1fr; gap: 3rem; }
  .art-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 4rem; }
  .toc { display: block; position: sticky; top: calc(var(--nav-h) + 30px); align-self: start; }
  .about-hero { grid-template-columns: 1.3fr .8fr; gap: 5rem; }
  .project { grid-template-columns: 1fr 1.1fr; gap: 4rem; }
  .lib-bar { grid-template-columns: minmax(240px, 340px) 1fr; align-items: center; }
  .lib-bar .lib-row { grid-column: 1 / -1; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px) {
  .calc-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================================
   9. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation-duration: 120s; }
  .portrait::before { animation: none; }
}

/* =============================================================
   10. Additions — icons, mega positioning, JS-gated reveals
   ============================================================= */
svg.i { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.c-card .thumb svg.art { stroke-width: .9; }
.nav-inner { position: relative; }
.nav-item.has-mega { position: static; }
.nav-item.has-mega > .dropdown { left: 50%; }
.js .reveal { opacity: 0; transform: translateY(28px); }
.reveal { opacity: 1; transform: none; }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal[data-split] { opacity: 1; transform: none; }
.pump-rotor { transform-box: view-box; transform-origin: 230px 110px; animation: rotor 1.4s linear infinite; }
@keyframes rotor { to { transform: rotate(360deg); } }
.scheme-figure .hot circle.ring { animation: hotPulse 2.4s ease-in-out infinite; }
@keyframes hotPulse { 50% { opacity: .15; } }
.result .sub > div { display: grid; gap: .2rem; }
