/* =========================================================
   HealthCare — Clinical Research Nexus
   Global design system
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,500&family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    /* Palette (fixed brief tokens) */
    --bg-main: #0B132B;
    --bg-hero: #1C2541;
    --bg-card: #1A2D42;
    --bg-header: #030816;
    --cta: #0284C7;
    --cta-hover: #0369A1;
    --mint: #34D399;
    --sky: #38BDF8;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --border: #334155;

    /* Derived */
    --border-soft: rgba(51, 65, 85, 0.6);
    --mint-soft: rgba(52, 211, 153, 0.12);
    --sky-soft: rgba(56, 189, 248, 0.12);
    --cta-soft: rgba(2, 132, 199, 0.14);
    --shadow-card: 0 1px 0 rgba(248, 250, 252, 0.02) inset, 0 12px 30px -18px rgba(0, 0, 0, 0.7);

    /* Type */
    --font-display: 'Newsreader', ui-serif, Georgia, serif;
    --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.font-display {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

.font-mono {
    font-family: var(--font-mono);
}

a {
    color: inherit;
}

::selection {
    background: var(--sky-soft);
    color: var(--text-primary);
}

:focus-visible {
    outline: 2px solid var(--sky);
    outline-offset: 3px;
    border-radius: 2px;
}

/* =========================================================
      Clinical grid texture — subtle chart-paper background
      ========================================================= */

.clinical-grid {
    background-image:
        linear-gradient(rgba(203, 213, 225, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(203, 213, 225, 0.05) 1px, transparent 1px);
    background-size: 34px 34px;
}

.clinical-grid-fade {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 0%, var(--bg-hero) 85%);
    pointer-events: none;
}

/* =========================================================
      Header
      ========================================================= */

.site-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: linear-gradient(155deg, var(--cta) 0%, var(--sky) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 8px 18px -8px rgba(2, 132, 199, 0.55);
    flex-shrink: 0;
}

.brand-mark i {
    color: #041022;
    font-size: 19px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--sky);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--sky);
    border-radius: 2px;
}

#mobile-menu {
    display: none;
}

#mobile-menu.open {
    display: block;
}

/* =========================================================
      Buttons
      ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-cta {
    background: var(--cta);
    color: #F8FAFC;
    box-shadow: 0 10px 24px -12px rgba(2, 132, 199, 0.65);
}

.btn-cta:hover {
    background: var(--cta-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--sky);
    color: var(--sky);
}

.btn-mint {
    background: var(--mint-soft);
    color: var(--mint);
    border-color: rgba(52, 211, 153, 0.35);
}

.btn-mint:hover {
    background: rgba(52, 211, 153, 0.2);
}

/* =========================================================
      Cards
      ========================================================= */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.card-hover:hover {
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-3px);
}

.card-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.icon-tile {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sky-soft);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: var(--sky);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.icon-tile.mint {
    background: var(--mint-soft);
    border-color: rgba(52, 211, 153, 0.28);
    color: var(--mint);
}

.icon-tile.cta {
    background: var(--cta-soft);
    border-color: rgba(2, 132, 199, 0.32);
    color: var(--sky);
}

/* =========================================================
      Evidence Ring — signature component
      Circular conic-gradient gauge showing evidence strength
      ========================================================= */

.evidence-ring {
    --ring-pct: 70;
    --ring-color: var(--mint);
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    flex-shrink: 0;
    background:
        radial-gradient(closest-side, var(--bg-card) 66%, transparent 67% 100%),
        conic-gradient(var(--ring-color) calc(var(--ring-pct) * 1%), var(--border) 0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.evidence-ring span {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.evidence-ring.sm {
    width: 40px;
    height: 40px;
}

.evidence-ring.sm span {
    font-size: 0.62rem;
}

.evidence-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    border: 1px solid;
}

.evidence-tag.strong {
    color: var(--mint);
    border-color: rgba(52, 211, 153, 0.35);
    background: var(--mint-soft);
}

.evidence-tag.moderate {
    color: var(--sky);
    border-color: rgba(56, 189, 248, 0.35);
    background: var(--sky-soft);
}

.evidence-tag.emerging {
    color: #FBBF24;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.1);
}

.evidence-tag i,
.evidence-tag .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* =========================================================
      Citation-trail divider — dotted rule with node markers
      ========================================================= */

.citation-trail {
    position: relative;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 12px);
    margin: 3rem 0;
}

.citation-trail .node {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 1.5px solid var(--sky);
}

/* =========================================================
      Eyebrow / section labels
      ========================================================= */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sky);
}

.eyebrow::before {
    content: "";
    width: 18px;
    height: 1px;
    background: var(--sky);
}

/* =========================================================
      Stat blocks
      ========================================================= */

.stat-value {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* =========================================================
      Timeline / care pathway stages
      ========================================================= */

.pathway-stage {
    position: relative;
    padding-left: 2.75rem;
    border-left: 1px solid var(--border);
}

.pathway-stage:last-child {
    border-left: 1px solid transparent;
}

.pathway-marker {
    position: absolute;
    left: -19px;
    top: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-hero);
    border: 1px solid var(--sky);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--sky);
}

.pathway-stage[data-active="true"] .pathway-marker {
    background: var(--sky);
    color: var(--bg-header);
    box-shadow: 0 0 0 5px var(--sky-soft);
}

.pathway-stage[data-active="true"] {
    border-left-color: var(--sky);
}

/* =========================================================
      Forms
      ========================================================= */

.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.field-input,
.field-select,
.field-textarea {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    transition: border-color 0.15s ease;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
    border-color: var(--sky);
    outline: none;
}

.field-input::placeholder,
.field-textarea::placeholder {
    color: #64748B;
}

/* =========================================================
      Disclaimer banner
      ========================================================= */

.disclaimer {
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 12px;
    color: var(--text-secondary);
}

.disclaimer i {
    color: #FBBF24;
}

/* =========================================================
      Footer
      ========================================================= */

.site-footer {
    background: var(--bg-header);
    border-top: 1px solid var(--border-soft);
}

.footer-link {
    color: var(--text-secondary);
    font-size: 0.88rem;
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: var(--sky);
}

/* =========================================================
      Scroll reveal
      ========================================================= */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
      Search / filter controls
      ========================================================= */

.filter-chip {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--bg-hero);
    transition: all 0.15s ease;
    cursor: pointer;
}

.filter-chip:hover {
    border-color: var(--sky);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--cta);
    border-color: var(--cta);
    color: #F8FAFC;
}

/* =========================================================
      Bookmark toggle
      ========================================================= */

.bookmark-btn {
    color: var(--text-secondary);
    transition: color 0.15s ease, transform 0.15s ease;
}

.bookmark-btn:hover {
    color: var(--sky);
}

.bookmark-btn.saved {
    color: var(--mint);
}

.bookmark-btn.saved i {
    transform: scale(1.05);
}

/* =========================================================
      Utility
      ========================================================= */

.hero-half {
    min-height: 52vh;
    display: flex;
    align-items: center;
}

@media (max-width: 767px) {
    .hero-half {
        min-height: 46vh;
    }
}

.text-balance {
    text-wrap: balance;
}

.glow-sky {
    box-shadow: 0 0 60px -20px rgba(56, 189, 248, 0.35);
}

.glow-mint {
    box-shadow: 0 0 60px -20px rgba(52, 211, 153, 0.3);
}

hr.rule {
    border: none;
    border-top: 1px solid var(--border-soft);
}

.badge-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}


/* Hide Scrollbar */
html,
body {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}


/* Add to style.css if not already present */
.evidence-grid {
    background-image: radial-gradient(rgba(148,163,184,0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle at 70% 50%, black, transparent 75%);
}

.citation-dot-trail {
    background-image: radial-gradient(circle, rgba(56,189,248,0.5) 1px, transparent 1.5px);
    background-size: 6px 1px;
    background-repeat: repeat-x;
}

.citation-trail {
    border-top: 1px dashed rgba(148, 163, 184, 0.25);
}

/* base ring, reused for mobile compact badge */
.evidence-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(#38bdf8 var(--grade), rgba(255,255,255,0.1) var(--grade));
    flex-shrink: 0;
}

.evidence-ring-label {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #06131d;
    color: #34d399;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.evidence-ring--lg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(#38bdf8 var(--grade), rgba(255,255,255,0.06) var(--grade));
    padding: 10px;
}

.evidence-ring-core {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #06131d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid rgba(255,255,255,0.08);
}

.evidence-ring-grade {
    font-family: 'Newsreader', serif;
    font-size: 48px;
    color: #34d399;
    line-height: 1;
}

.evidence-ring-pct {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.orbit-node {
    background: rgba(6,19,29,0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    backdrop-filter: blur(6px);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.orbit-node:hover {
    border-color: rgba(56,189,248,0.4);
    transform: translateY(-2px);
}

.orbit-node-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
}

.orbit-node-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #64748b;
}

.orbit-node--sm {
    padding: 8px 10px;
}

.orbit-ring {
    transform-origin: 210px 210px;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.orbit-ring--slow {
    animation-name: orbit-spin;
    animation-duration: 60s;
}

.orbit-ring--rev {
    animation-name: orbit-spin-rev;
    animation-duration: 40s;
}

@keyframes orbit-spin {
    to { transform: rotate(360deg); }
}

@keyframes orbit-spin-rev {
    to { transform: rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .orbit-ring { animation: none; }
}

@keyframes ring-draw-in {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.evidence-ring--animate {
    animation: ring-draw-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.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, 8, 22, 0.72);
    backdrop-filter: blur(6px);
}
.subscribe-popup-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.6rem 1.6rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
}
.subscribe-popup-icon {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: var(--sky-soft);
    color: var(--sky);
}
.subscribe-popup-title {
    margin: 0;
    font-family: var(--font-display);
    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: #F8FAFC;
}
.subscribe-popup-btn:hover { background: var(--cta-hover); }

form[data-newsletter-form] .field-input {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}