/* ==========================================================================
   MedicalPulse — shared stylesheet
   Canvas #0A1120 · Hero #1E1222 · Cards #182032 · Header/Footer #030712
   CTA #E11D48 · Rose #F43F5E · Cyan #38BDF8
   ========================================================================== */

:root {
    --canvas: #0A1120;
    --hero: #1E1222;
    --card: #182032;
    --chrome: #030712;
    --cta: #E11D48;
    --rose: #F43F5E;
    --cyan: #38BDF8;
    --text-primary: #F8FAFC;
    --text-secondary: #E2E8F0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--canvas);
    color: var(--text-primary);
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.font-display {
    font-family: 'Fraunces', ui-serif, Georgia, serif;
}

.font-mono {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ------------------------------------------------------------------ */
/* Signature element: the vitals line — an animated EKG/pulse tracing */
/* used as a recurring divider that literalizes the "pulse" in brand  */
/* ------------------------------------------------------------------ */
.vitals-line {
    width: 100%;
    height: 44px;
    overflow: hidden;
    display: block;
}

.vitals-line path {
    fill: none;
    stroke: var(--rose);
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    animation: vitals-draw 3.6s ease-in-out infinite;
    opacity: 0.85;
}

@keyframes vitals-draw {
    0% {
        stroke-dashoffset: 620;
    }

    45% {
        stroke-dashoffset: 0;
    }

    85% {
        stroke-dashoffset: 0;
        opacity: 0.85;
    }

    100% {
        stroke-dashoffset: -620;
        opacity: 0.85;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vitals-line path {
        animation: none;
        stroke-dashoffset: 0;
    }
}

/* Glow accents */
.glow-rose {
    box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.15), 0 24px 60px -24px rgba(244, 63, 94, 0.35);
}

.glow-cyan {
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15), 0 24px 60px -24px rgba(56, 189, 248, 0.35);
}

.bg-grid {
    background-image:
        linear-gradient(rgba(226, 232, 240, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(226, 232, 240, 0.045) 1px, transparent 1px);
    background-size: 34px 34px;
}

.text-balance {
    text-wrap: balance;
}

/* Card hover lift */
.pulse-card {
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.pulse-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.4);
}

/* Marquee for latest briefs ticker */
.brief-track {
    animation: brief-scroll 32s linear infinite;
}

.brief-track:hover {
    animation-play-state: paused;
}

@keyframes brief-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .brief-track {
        animation: none;
    }
}

/* Bookmark button state */
.bookmark-btn[data-active="true"] .bm-icon {
    color: var(--rose);
    fill: var(--rose);
}

/* Read badge */
.read-badge {
    display: none;
}

[data-read="true"] .read-badge {
    display: inline-flex;
}

/* Category chip active state */
.chip[aria-pressed="true"] {
    background-color: var(--cta);
    border-color: var(--cta);
    color: var(--text-primary);
}

/* Accordion caret rotation */
.accordion-trigger[aria-expanded="true"] .caret {
    transform: rotate(180deg);
}

.caret {
    transition: transform 200ms ease;
}

/* Scrollbar (webkit) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--chrome);
}

::-webkit-scrollbar-thumb {
    background: #1f2a44;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2a3a5c;
}

/* Fade-in on scroll */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile nav panel */
#mobile-nav {
    transition: max-height 300ms ease, opacity 250ms ease;
}


/* Hide Scrollbar */
html,
body {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

.subscribe-popup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.subscribe-popup.is-open { display: flex; }
.subscribe-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(6px);
}
.subscribe-popup-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 2rem 1.6rem 1.6rem;
  text-align: center;
  color: var(--text-primary);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
}
.subscribe-popup-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  background: rgba(225, 29, 72, 0.15);
  color: var(--rose);
}
.subscribe-popup-title {
  margin: 0;
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
}
.subscribe-popup-body {
  margin: 0.65rem 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.subscribe-popup-btn {
  margin-top: 1.4rem;
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--cta);
  color: #fff;
}
.subscribe-popup-btn:hover { background: #be123c; }