@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --bg-main: #F2F4F7;
    --card: #F8FAFC;
    --header-footer: #0B192C;
    --cta: #0284C7;
    --badge: #059669;
    --text-primary: #111827;
    --text-secondary: #64748B;
    --border-col: #CBD5E1;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-col) transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.font-display {
    font-family: 'Source Serif 4', serif;
}

.font-mono {
    font-family: 'IBM Plex Mono', monospace;
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--cta);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Signature: pulse-line (ECG) system ---------- */
.pulse-path {
    fill: none;
    stroke: var(--cta);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.8s cubic-bezier(.4, 0, .2, 1);
}

.pulse-path.drawn {
    stroke-dashoffset: 0;
}

.pulse-dot {
    fill: var(--cta);
    opacity: 0;
    transition: opacity .6s ease 1.2s;
}

.pulse-dot.drawn {
    opacity: 1;
}

/* ---------- Scroll reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s cubic-bezier(.4, 0, .2, 1), transform .7s cubic-bezier(.4, 0, .2, 1);
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Evidence / research badges ---------- */
.evidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--badge);
    background: rgba(5, 150, 105, .08);
    border: 1px solid rgba(5, 150, 105, .25);
    padding: 4px 10px;
    border-radius: 999px;
}

/* ---------- Nav underline hover ---------- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--cta);
    transition: width .3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ---------- Mobile menu ---------- */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
}

#mobile-menu.open {
    max-height: 600px;
}

/* ---------- Back to top ---------- */
#back-to-top {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .3s ease, transform .3s ease;
}

#back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ---------- Reading progress bar (article page) ---------- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--cta);
    width: 0%;
    z-index: 60;
    transition: width .1s linear;
}

/* ---------- Toast / newsletter success popup ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--header-footer);
    color: #F8FAFC;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(11, 25, 44, .35);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .4s cubic-bezier(.4, 0, .2, 1), opacity .4s ease;
    z-index: 100;
    max-width: 340px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ---------- Modal overlay ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 25, 44, .55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 90;
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    transform: scale(.94) translateY(10px);
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

.modal-overlay.show .modal-box {
    transform: scale(1) translateY(0);
}

/* ---------- Card hover ---------- */
.insight-card {
    transition: transform .35s cubic-bezier(.4, 0, .2, 1), box-shadow .35s ease, border-color .35s ease;
}

.insight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px rgba(11, 25, 44, .25);
    border-color: var(--cta);
}

/* ---------- Bookmark button ---------- */
.bookmark-btn svg {
    transition: fill .25s ease, stroke .25s ease, transform .25s ease;
}

.bookmark-btn.saved svg {
    fill: var(--cta);
    stroke: var(--cta);
}

.bookmark-btn:active svg {
    transform: scale(1.2);
}

/* ---------- Utility: line clamp ---------- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Specialty pill rail ---------- */
.pill-rail {
    scrollbar-width: none;
}

.pill-rail::-webkit-scrollbar {
    display: none;
}

.specialty-pill {
    transition: background .25s ease, color .25s ease, border-color .25s ease;
    white-space: nowrap;
}

.specialty-pill.active {
    background: var(--header-footer);
    color: #fff;
    border-color: var(--header-footer);
}

/* ---------- Progress ring / bar (saved insights) ---------- */
.progress-track {
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    background: var(--cta);
    height: 100%;
    border-radius: 999px;
    transition: width .6s ease;
}

/* ---------- Skip link ---------- */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    background: var(--cta);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    z-index: 200;
}

.skip-link:focus {
    left: 16px;
    top: 16px;
}



/* Hide Scrollbar */

html,

body {

    overflow-x: hidden;

    scrollbar-width: none;

    -ms-overflow-style: none;

}



html::-webkit-scrollbar,

body::-webkit-scrollbar {

    display: none;

}

/* ---------- Article detail page ---------- */
.article-hero {
    background:
        radial-gradient(ellipse 70% 80% at 85% 20%, rgba(2, 132, 199, 0.22), transparent 55%),
        radial-gradient(ellipse 50% 60% at 10% 90%, rgba(5, 150, 105, 0.1), transparent 50%),
        var(--header-footer);
}

.article-hero-glow {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(248, 250, 252, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(248, 250, 252, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black 30%, transparent 95%);
    pointer-events: none;
}

.article-feature {
    box-shadow: 0 24px 48px -20px rgba(11, 25, 44, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.article-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-col);
    background: var(--card);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    transition: border-color .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease;
}

.article-action-btn:hover {
    border-color: var(--cta);
    color: var(--cta);
    box-shadow: 0 6px 16px -8px rgba(2, 132, 199, 0.35);
}

.article-section {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(203, 213, 225, 0.7);
}

.article-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cta);
    margin-bottom: 10px;
}

.article-lead {
    background: var(--card);
    border: 1px solid var(--border-col);
    border-left: 3px solid var(--cta);
    border-radius: 0 14px 14px 0;
    padding: 1.35rem 1.5rem;
}

.article-lead p {
    color: rgba(17, 24, 39, 0.9);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.findings-grid {
    display: grid;
    gap: 12px;
}

@media (min-width: 640px) {
    .findings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.finding-item {
    background: var(--card);
    border: 1px solid var(--border-col);
    border-radius: 14px;
    padding: 1.15rem 1.2rem;
    transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.finding-item:hover {
    border-color: rgba(2, 132, 199, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -18px rgba(11, 25, 44, 0.3);
}

.finding-num {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--cta);
    margin-bottom: 8px;
}

.finding-item p {
    font-size: 14.5px;
    line-height: 1.55;
    color: rgba(17, 24, 39, 0.9);
    margin: 0;
}

.symptom-grid {
    display: grid;
    gap: 10px;
}

@media (min-width: 640px) {
    .symptom-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.symptom-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border-col);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(17, 24, 39, 0.9);
    transition: border-color .25s ease, background .25s ease;
}

.symptom-card svg {
    flex-shrink: 0;
    color: var(--cta);
    margin-top: 1px;
}

.symptom-card:hover {
    border-color: rgba(2, 132, 199, 0.4);
    background: #F0F7FC;
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

@media (min-width: 640px) {
    .check-list {
        grid-template-columns: 1fr 1fr;
    }
}

.check-list li {
    position: relative;
    padding: 12px 14px 12px 40px;
    background: var(--card);
    border: 1px solid var(--border-col);
    border-radius: 10px;
    font-size: 14.5px;
    line-height: 1.45;
    color: rgba(17, 24, 39, 0.9);
}

.check-list li::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    background: rgba(5, 150, 105, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.35);
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    background-size: 10px 10px;
    background-repeat: no-repeat;
    background-position: center;
}

.article-pullquote {
    margin: 1.75rem 0 0;
    padding: 1.4rem 1.5rem 1.4rem 1.6rem;
    border-left: 3px solid var(--badge);
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.06), rgba(2, 132, 199, 0.05));
    border-radius: 0 14px 14px 0;
}

.article-pullquote p {
    font-family: 'Source Serif 4', serif;
    font-size: 1.15rem;
    line-height: 1.55;
    color: var(--text-primary);
    margin: 0;
}

.ref-list {
    list-style: none;
    counter-reset: refs;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ref-list li {
    counter-increment: refs;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    background: var(--card);
    border: 1px solid var(--border-col);
    border-radius: 10px;
    padding: 12px 14px;
}

.ref-list li::before {
    content: counter(refs, decimal-leading-zero);
    font-weight: 600;
    color: var(--cta);
    flex-shrink: 0;
}

.article-cta {
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 100% at 100% 0%, rgba(2, 132, 199, 0.35), transparent 55%),
        var(--header-footer);
}

.article-cta-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 1.75rem;
}

@media (min-width: 640px) {
    .article-cta-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 2.25rem 2rem;
    }
}

.article-toc {
    background: var(--card);
    border: 1px solid var(--border-col);
    border-radius: 16px;
    padding: 1.35rem 1.25rem;
    box-shadow: 0 10px 30px -22px rgba(11, 25, 44, 0.35);
}

.toc-nav {
    gap: 2px;
}

.toc-link {
    position: relative;
    display: block;
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--text-secondary);
    padding: 8px 10px 8px 14px;
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.toc-link:hover {
    color: var(--cta);
    background: rgba(2, 132, 199, 0.05);
}

.toc-link.is-active {
    color: var(--cta);
    font-weight: 600;
    background: rgba(2, 132, 199, 0.07);
    border-left-color: var(--cta);
}

.related-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.related-card img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-col);
}

.related-card span {
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--text-primary);
}

@media print {
    #site-header,
    #mobile-menu,
    #back-to-top,
    #reading-progress,
    .article-actions,
    .article-toc,
    .article-cta,
    footer {
        display: none !important;
    }

    main {
        padding-top: 0 !important;
    }

    .article-feature {
        box-shadow: none;
        margin-top: 0 !important;
    }
}
