/* ============================================================
   BioProcess Tools — Global Stylesheet
   Version: 2.0 (V5 Design System)
   Last updated: 2026-03-28

   Design tokens, typography, navigation, cards, forms,
   blog article styles, and responsive breakpoints.

   All pages link to this file — change once, update everywhere.
   ============================================================ */


/* ============================================================
   1. CSS VARIABLES / COLOUR TOKENS
   ============================================================ */
:root {
    /* ---- V5 Navy palette ---- */
    --color-navy:        #020a17;
    --color-navy-68:     rgba(2, 10, 23, 0.68);
    --color-navy-trans:  rgba(2, 10, 23, 0);
    --color-sky-blue:    #6ECFF6;
    --color-mid-blue:    #28A9E1;
    --color-dark-teal:   #095280;
    --color-purple:      #672675;
    --color-text:        #FFFFFF;
    --color-text-muted:  rgba(255, 255, 255, 0.70);
    --color-accent-light:#D4EFFD;
    --color-label-blue:  #1197D5;
    --color-border:      #095280;

    /* ---- BioProcess accent spectrum ---- */
    --teal:       #4ecdc4;
    --blue:       #82aaff;
    --purple-bp:  #c792ea;
    --coral:      #ff6b6b;
    --gold:       #ffd93d;
    --green:      #22c55e;

    /* ---- Gradients ---- */
    --grad-hero:        linear-gradient(135deg, #4ecdc4 0%, #82aaff 50%, #c792ea 100%);
    --grad-teal-blue:   linear-gradient(135deg, #4ecdc4, #82aaff);
    --grad-blue-purple: linear-gradient(135deg, #82aaff, #c792ea);
    --grad-coral-gold:  linear-gradient(135deg, #ff6b6b, #ffd93d);
    --grad-shimmer:     linear-gradient(100deg, #28A9E1 0%, rgba(255, 255, 255, 0.8) 49%, #28A9E1 100%);

    /* ---- Legacy aliases (tool pages still reference these) ---- */
    --bg:               #020a17; /* darkened from #04152e (near-black navy) for deeper contrast */
    --bg-card:          #071120; /* darkened from #0f1d32 */
    --bg-card-hover:    #0c1a2c; /* darkened from #152a45 */
    --bg-input:         #050e1a; /* darkened from #0d1a2f */
    --border:           #1a3355;
    --border-alt:       #152a45;
    --border-focus:     #4ecdc4;
    --border-hover:     rgba(78, 205, 196, 0.35);
    --text:             #d0d8e8;
    --text-dim:         #a8b5ca; /* bumped from #8494ad -> #9aa8bf -> here: ~8:1 on cards (secondary text used site-wide) */
    --text-muted:       #8b99b0; /* bumped from #6b7a94 -> #7c8ba4 -> here: ~5.9:1 on cards (comfortably above WCAG AA) */
    --heading:          #f0f4fa;
    --accent:           #4ecdc4;
    --accent-soft:      rgba(78, 205, 196, 0.08);
    --accent-glow:      rgba(78, 205, 196, 0.12);
    --accent-glow-strong: rgba(78, 205, 196, 0.15);
    --amber:            #ffd93d;
    --purple:           #c792ea;

    /* ---- Chart text tokens (single source of truth for Chart.js) ----
       Canvas text can't be styled by CSS, so js/chart-theme.js reads these
       via getComputedStyle and applies them to Chart.defaults site-wide.
       Change a value here and every chart that inherits defaults updates.
       Contrast targets on --bg-card: ticks/titles ~7:1, legend ~11:1. */
    --chart-tick:       #9aa8bf; /* axis tick numbers + annotations (~7:1) */
    --chart-title:      #9aa8bf; /* axis titles (~7:1) */
    --chart-label:      #d0d8e8; /* legend + data labels (~11:1) */
    --chart-grid:       rgba(26, 37, 64, 0.4);
    --chart-tooltip-bg: #111b2e;
}


/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Global link color - prevents default blue on dark background */
a {
    color: var(--accent);
}

a:visited {
    color: var(--accent);
}


/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */

/* --- Heading family: Instrument Serif --- */
/* Metric-matched fallback: Instrument Serif's advance width is ~0.74x Georgia's,
   so size-adjust:74% makes the Georgia fallback wrap to the SAME line count. Without
   it, headings reflow when the (async) web font swaps in at widths near a wrap
   boundary — the dominant real-user desktop CLS source (lab uses one width and
   misses it). local('Georgia') resolves on Win/Mac where most desktop users are;
   elsewhere display:optional keeps the fallback (no swap), so no reflow either way. */
@font-face {
    font-family: 'Instrument Serif Fallback';
    src: local('Georgia'), local('Times New Roman');
    size-adjust: 74%;
    ascent-override: 92%;
    descent-override: 22%;
    line-gap-override: 0%;
}
h1, .h1 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-weight: 400;
    letter-spacing: 1px;
}

h2, .h2 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-weight: 400;
    letter-spacing: 0.8px;
}

h3, .h3 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-weight: 400;
    letter-spacing: 0.6px;
}

/* Instrument Serif ships a SINGLE 400 weight. Stray 500/600/700 overrides
   (e.g. blog-card / article h3) made the browser synthesize a faux-bold —
   smeared, fuzzy serifs, worst on fractional-DPR/Windows displays. Forbid
   synthesis so headings always render the true, crisp 400 glyphs. Real
   Instrument Serif italic exists, so italics are unaffected. */
h1, .h1, h2, .h2, h3, .h3 {
    font-synthesis: none;
}

h4, .h4 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
}

/* Gradient shimmer text effect (V5) */
.gradient-heading b,
.gradient-heading strong {
    background: var(--grad-shimmer);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 400;
    font-style: normal;
}

/* Mono helpers */
.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Screen-reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}


/* ============================================================
   4. NAVIGATION
   ============================================================ */

/* --- Sticky header bar --- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    /* Reserve height: the <nav> is empty in the HTML and filled by deferred
       nav.js, so without a floor it grows from 0 -> ~66px after first paint and
       shifts everything below (CLS on slow loads). 60px is below the smallest
       populated height, so it never causes a reverse-shift. */
    min-height: 60px;
    background: rgba(2, 10, 23, 0.88);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-bottom: 1px solid var(--border);
}

/* Optional fade shadow beneath nav (V5 header::after pattern) */
.nav::after {
    content: "";
    position: absolute;
    inset: 0 0 -40px 0;
    background: linear-gradient(180deg, var(--bg) 0%, var(--color-navy-68) 41%, var(--color-navy-trans) 100%);
    opacity: 0.35;
    pointer-events: none;
    z-index: -1;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

/* --- Brand --- */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--accent);
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 1px;
}

.nav-brand svg {
    width: 26px;
    height: 26px;
}

/* V5 brand variants */
.nav-brand-bp {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    background: var(--grad-shimmer);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.nav-brand-name {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 19px;
    letter-spacing: 1.2px;
    color: var(--color-text);
}

/* Full name on wide screens, abbreviated "BP Tools" on small screens,
   then just "BP" when there isn't room for the word. */
.nav-brand-abbr {
    display: none;
}
@media (max-width: 600px) {
    .nav-brand-full {
        display: none;
    }
    .nav-brand-abbr {
        display: inline;
        white-space: nowrap;
    }
    /* Keep the brand from being squeezed and guarantee a gutter to the menu */
    .nav-brand {
        flex-shrink: 0;
    }
    .nav-inner {
        gap: 16px;
    }
}
/* Not enough room for "BP Tools" -> drop the word, show just "BP" */
@media (max-width: 430px) {
    .nav-brand-abbr-word {
        display: none;
    }
}

/* Below ~640px the row (brand + 5 links + 2 social icons + CTA) is intrinsically wider than
   the viewport, so .nav-links used to push the document to ~464px and every page scrolled
   sideways. Wrapping the links onto their own row fixes it without a hamburger.

   Deliberately NOT `overflow-x: auto` on .nav-links: that creates a clipping context and the
   Tools mega-menu, which is absolutely positioned inside .nav-item, would be cut off. */
@media (max-width: 640px) {
    .nav-inner {
        flex-wrap: wrap;
        row-gap: 10px;
    }
    .nav-links {
        flex-wrap: wrap;
        width: 100%;
        row-gap: 10px;
        justify-content: flex-start;
    }
    /* The mega-menu is anchored to its .nav-item, which is now near the left edge on a
       wrapped row. The base rule centres it with `left: 50%` + `translateX(-50%)`, which on a
       345px panel pulls it ~172px off the left of the screen. Reset BOTH the offset and the
       X translation, in the closed and open states, or the transform silently undoes `left`. */
    .nav-item .nav-dropdown {
        left: 0;
        right: auto;
        max-width: calc(100vw - 32px);
        transform: translateY(8px);
    }
    .nav-item:hover .nav-dropdown {
        transform: translateY(0);
    }
    /* The little arrow points at the trigger, so it follows the panel to the left. */
    .nav-dropdown::before {
        left: 28px;
        transform: rotate(45deg);
    }
}

/* --- Back link (tool pages) --- */
.nav-back {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-back:hover {
    color: var(--accent);
}

/* --- Nav links row --- */
.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
    list-style: none;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Nav CTA button */
.nav-cta {
    padding: 7px 16px;
    background: var(--accent);
    color: var(--bg) !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.15s;
}

.nav-cta:hover {
    background: #3dbdb5;
    transform: translateY(-1px);
}

/* --- Nav item with dropdown (V5 mega menu) --- */
.nav-item {
    position: relative;
}

.nav-item > a,
.nav-item > .nav-trigger {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.nav-item > a:hover,
.nav-item > .nav-trigger:hover,
.nav-item:hover > .nav-trigger {
    color: var(--color-text);
}

/* Active indicator bar */
.nav-item.active > a,
.nav-item.active > .nav-trigger {
    color: var(--color-sky-blue);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background: linear-gradient(100deg, #6ECFF6 0%, rgba(125, 191, 237, 0) 100%);
}

/* Chevron rotation */
.nav-chevron {
    width: 10px;
    height: 10px;
    transition: transform 0.2s;
}

.nav-item:hover .nav-chevron {
    transform: rotate(180deg);
}

/* --- Mega dropdown panel --- */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(2, 10, 23, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(9, 82, 128, 0.3);
    border-radius: 16px;
    padding: 24px;
    min-width: 520px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 200;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.nav-item:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Arrow pointer */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(2, 10, 23, 0.95);
    border-top: 1px solid rgba(9, 82, 128, 0.3);
    border-left: 1px solid rgba(9, 82, 128, 0.3);
}

/* Dropdown items — selector is more specific than `.nav-links a` so the
   label renders full white instead of the muted --text-dim it would inherit */
.nav-dropdown .nav-drop-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    transition: background 0.15s, color 0.15s;
}

.nav-dropdown .nav-drop-item:hover {
    background: rgba(110, 207, 246, 0.12);
}

.nav-drop-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.nav-drop-label {
    /* Match the nav-bar links (DM Sans), not the serif used elsewhere */
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    letter-spacing: normal;
    font-weight: 500;
    margin-bottom: 2px;
}

.nav-drop-desc {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Category color dots in dropdown */
.cat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

/* "View All" link — pinned header at the top of the dropdown */
.nav-drop-full {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(9, 82, 128, 0.25);
}

.nav-drop-full a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-sky-blue);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.nav-drop-full a:hover {
    background: rgba(9, 82, 128, 0.15);
}

/* --- Tools mega-menu: category blocks --- */
.nav-drop-cat {
    margin-bottom: 10px;
}

.nav-drop-cat-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin-bottom: 6px;
}

/* --- Tools mega-menu: scrollable container ---
   The outer panel keeps the arrow pointer (::before) and the bottom fade
   (::after); an inner wrapper owns the grid and does the scrolling, so the
   arrow is never clipped by overflow. */
.nav-dropdown.nav-dropdown-tools {
    display: block;
    min-width: 600px;
    padding: 18px 16px;
}

.nav-dropdown-scroll {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 18px;
    align-content: start;
    max-height: max(340px, min(66vh, 540px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(110, 207, 246, 0.5) rgba(255, 255, 255, 0.06);
}

/* Always-visible themed scrollbar so the "more below" affordance is obvious */
.nav-dropdown-scroll::-webkit-scrollbar {
    width: 10px;
}
.nav-dropdown-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 2px 0;
}
.nav-dropdown-scroll::-webkit-scrollbar-thumb {
    background: rgba(110, 207, 246, 0.45);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.nav-dropdown-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(110, 207, 246, 0.7);
    background-clip: content-box;
}

/* Bottom fade — hints there is more to scroll; hidden once scrolled to the end */
.nav-dropdown-tools::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 18px;
    bottom: 18px;
    height: 34px;
    background: linear-gradient(to top, rgba(2, 10, 23, 0.97), rgba(2, 10, 23, 0));
    border-radius: 0 0 14px 14px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.25s ease;
}
.nav-dropdown-tools.is-bottom::after {
    opacity: 0;
}


/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--color-navy);
}

.btn-primary:hover {
    background: #3dbdb5;
    transform: translateY(-1px);
}

/* V5 gradient primary */
.btn-primary.grad {
    background: var(--grad-teal-blue);
    color: var(--color-navy);
    box-shadow: 0 4px 24px rgba(78, 205, 196, 0.2);
}

.btn-primary.grad:hover {
    box-shadow: 0 8px 36px rgba(78, 205, 196, 0.35);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-glow);
}

/* V5 outline variant */
.btn-outline.v5 {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-outline.v5:hover {
    border-color: var(--color-sky-blue);
    color: var(--color-sky-blue);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Row of buttons */
.btn-row {
    display: flex;
    gap: 16px;
}

/* Copy button */
.copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 6px;
    transition: all 0.15s;
}

.copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.copy-btn.copied {
    border-color: var(--green);
    color: var(--green);
}


/* ============================================================
   6. TOOL CARDS
   ============================================================ */
.tool-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: all 0.25s;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Top-edge gradient accent */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--card-gradient, var(--grad-teal-blue));
    opacity: 0.5;
    transition: opacity 0.25s;
}

.tool-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 30px var(--accent-glow);
}

.tool-card:hover::before {
    opacity: 1;
}

/* Status badge */
.tool-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--green);
    margin-bottom: 14px;
}

.tool-card-status::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--green);
    border-radius: 50%;
}

/* Absolute-positioned status (legacy) */
.tool-card-status.abs {
    position: absolute;
    top: 16px;
    right: 16px;
    margin-bottom: 0;
}

.status-live {
    color: var(--accent);
}

.status-soon {
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(58, 74, 100, 0.3);
}

.tool-card.coming-soon {
    opacity: 0.55;
    pointer-events: none;
}

/* Icon container */
.tool-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
    background: var(--accent-soft);
}

/* Card title */
.tool-card h3 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.8px;
    color: var(--heading);
    margin-bottom: 8px;
}

/* Card description */
.tool-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.65;
    margin-bottom: 16px;
}

/* Tag pills */
.tool-tags,
.tool-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tool-tag {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid;
}

.tag-teal,
.tool-tag {
    color: var(--teal);
    border-color: rgba(78, 205, 196, 0.2);
    background: rgba(78, 205, 196, 0.06);
}

.tag-gold,
.tool-tag.amber {
    color: var(--gold);
    border-color: rgba(255, 217, 61, 0.2);
    background: rgba(255, 217, 61, 0.06);
}

.tag-coral,
.tool-tag.coral {
    color: var(--coral);
    border-color: rgba(255, 107, 107, 0.2);
    background: rgba(255, 107, 107, 0.06);
}

.tag-purple,
.tool-tag.purple {
    color: var(--purple-bp);
    border-color: rgba(199, 146, 234, 0.2);
    background: rgba(199, 146, 234, 0.06);
}

.tag-green,
.tool-tag.green {
    color: var(--green);
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.06);
}

.tool-tag.blue {
    color: var(--blue);
    background: rgba(130, 170, 255, 0.06);
    border-color: rgba(130, 170, 255, 0.12);
}


/* ============================================================
   7. CARD OVERLAY VARIANTS (V5)
   ============================================================ */
.card-overlay {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    padding: 36px;
    border: 1px solid rgba(9, 82, 128, 0.3);
    text-decoration: none;
    color: var(--color-text);
    display: block;
    transition: all 0.3s;
}

.card-overlay:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
}

.card-overlay > * {
    position: relative;
    z-index: 1;
}

.card-overlay-blue::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 0 200px 0 0;
    background: linear-gradient(90deg, #095280 0%, rgba(9, 82, 128, 0.40) 100%);
    z-index: 0;
}

.card-overlay-purple::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 0 200px 0 0;
    background: linear-gradient(90deg, #672675 0%, rgba(103, 38, 117, 0.39) 100%);
    z-index: 0;
}

.card-overlay-lightblue::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 0 200px 0 0;
    background: linear-gradient(91deg, #28A9E1 0%, rgba(40, 169, 225, 0.24) 100%);
    z-index: 0;
}

.card-overlay h3 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.card-overlay p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.65;
}

.card-overlay .card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    color: var(--color-sky-blue);
}

.overlay-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}


/* ============================================================
   8. CALCULATOR / TOOL PAGE
   ============================================================ */

/* --- Calc page layout --- */
.calc-section {
    padding: 60px 40px;
}

.calc-inner {
    max-width: 900px;
    margin: 0 auto;
}

.calc-header {
    margin-bottom: 32px;
}

.calc-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 20px;
}

.calc-header .back-link:hover {
    color: var(--color-sky-blue);
}

.calc-header h1 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 36px;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--heading);
    margin-bottom: 8px;
}

.calc-header .subtitle {
    font-size: 15px;
    color: var(--color-text-muted);
}

/* --- Calc card (input/output panels) --- */
.calc-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 20px;
}

.calc-card h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    font-weight: 500;
    color: var(--heading);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.calc-card h2 .num {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(9, 82, 128, 0.3);
    border: 1px solid rgba(9, 82, 128, 0.5);
    color: var(--color-sky-blue);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* --- Form inputs --- */
.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
    cursor: pointer;
    appearance: none;
    font-family: 'DM Sans', sans-serif;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7a94' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.form-group {
    margin-bottom: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

/* V5 calc-page form styling (larger inputs) */
.calc-card .form-input,
.calc-card .form-select {
    padding: 12px 16px;
    background: rgba(9, 82, 128, 0.2);
    border: 1px solid rgba(9, 82, 128, 0.4);
    border-radius: 10px;
    font-size: 14px;
}

.calc-card .form-input {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

.calc-card .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236ECFF6' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-position: right 14px center;
}

.calc-card .form-input:focus,
.calc-card .form-select:focus {
    border-color: var(--color-sky-blue);
    box-shadow: 0 0 0 3px rgba(110, 207, 246, 0.1);
}

.calc-card .form-group label {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.calc-card .form-row {
    gap: 16px;
    margin-bottom: 16px;
}

/* --- Result cards --- */
.result-hero {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
}

/* Hero result number. The tool template emits `.result-hero > .big-val + .big-unit
   + .big-label` for a single headline figure, but those classes had no global
   styling and .result-hero above is a 3-column card grid, so such heroes rendered
   as scattered, unstyled cells. When a .result-hero actually contains a .big-val it
   is a hero figure (not the card grid), so render it as one centered number. Tools
   that scope their own #heroResult/.big-val rules still win on specificity. */
.result-hero:has(> .big-val) { display: block; grid-template-columns: none; text-align: center; }
.big-val { font-family: 'Outfit', sans-serif; font-size: 60px; font-weight: 700; line-height: 1.05; color: var(--heading); display: inline; }
.big-unit { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 600; color: var(--text-dim); display: inline; margin-left: 6px; }
.big-label { font-size: 13px; color: var(--text-dim); margin-top: 10px; text-transform: uppercase; letter-spacing: 0.6px; display: block; }

.result-card {
    background: rgba(9, 82, 128, 0.12);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(9, 82, 128, 0.3);
}

.result-card.primary {
    border-color: rgba(110, 207, 246, 0.25);
    background: linear-gradient(160deg, rgba(9, 82, 128, 0.25), rgba(40, 169, 225, 0.08));
}

.result-val {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 600;
    line-height: 1;
}

.result-val.shimmer {
    background: var(--grad-shimmer);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-val.grad-bp {
    background: var(--grad-blue-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-val.grad-cg {
    background: var(--grad-coral-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-unit {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 6px;
}

.result-label {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* --- Panel layout (existing tool pages) --- */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent);
    margin-bottom: 16px;
}


.panel-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-item {
    background: var(--bg-input);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.result-item .val {
    font-size: 18px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.result-item .lbl {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.results-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

/* App layout (existing tool pages) */
.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Most tools turn .app into a grid and use a bare `1fr` column on phones. A grid item's
   automatic minimum is its min-content width, so one wide table or chart widened the column
   past the screen and Chrome zoomed the whole page out (18 tools on 2026-10-05). With
   min-width:0 the column shrinks to the screen and wide content scrolls in its own box. */
.app > * {
    min-width: 0;
}


/* ============================================================
   9. BLOG ARTICLE STYLES
   ============================================================ */

/* --- Breadcrumbs --- */
.breadcrumbs {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 20px 24px 0;
    font-size: 13px;
}

.breadcrumbs a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumbs span {
    color: var(--text-muted);
    margin: 0 8px;
}

.breadcrumbs .current {
    color: var(--text-dim);
}

/* --- Article header --- */
.article-header {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 24px 0;
}

.article-header h1 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 400;
    line-height: 1.15;
    color: var(--heading);
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-dim);
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--accent-soft);
    border: 1px solid rgba(78, 205, 196, 0.12);
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
}

.meta-sep {
    color: var(--text-muted);
}

/* --- Table of Contents --- */
.toc {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 24px;
}

.toc-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 28px;
}

.toc-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.toc-list {
    list-style: none;
    counter-reset: toc;
}

.toc-list li {
    counter-increment: toc;
    margin-bottom: 8px;
}

.toc-list li a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.toc-list li a::before {
    content: counter(toc, decimal-leading-zero);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    min-width: 18px;
}

.toc-list li a:hover {
    color: var(--accent);
}

/* TOC links (alternate structure used in blog articles) */
.toc-box ol li a,
.toc-box ul li a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s;
}

.toc-box ol li a:hover,
.toc-box ul li a:hover {
    color: var(--accent);
}

/* Key takeaways links */
.key-takeaways a {
    color: var(--accent);
    text-decoration: none;
}

.key-takeaways a:hover {
    text-decoration: underline;
}

/* --- Article body --- */
.article {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.article h2 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 400;
    color: var(--heading);
    letter-spacing: -0.5px;
    margin: 48px 0 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.article h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

.article h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--heading);
    margin: 32px 0 14px;
}

.article h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--heading);
    margin: 24px 0 10px;
}

.article p {
    margin-bottom: 18px;
    font-size: 16px;
    line-height: 1.75;
}

.article ul,
.article ol {
    margin-bottom: 18px;
    padding-left: 24px;
}

.article li {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.7;
}

.article strong {
    color: var(--heading);
    font-weight: 600;
}

.article blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 24px 0;
    background: var(--bg-card);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-dim);
}

/* Article links (excludes all button-style elements) */
/* Inline article links.
   ⚠ THE ESCAPE HATCH IS `data-btn`. This selector sits at specificity (0,8,1)
   and forces color:var(--accent) — the same cyan several buttons use as their
   BACKGROUND, so a button-styled link that lands inside .article renders
   cyan-on-cyan and disappears. That has now bitten twice.

   Put `data-btn` on ANY link that is styled as a button and it is exempt here,
   whatever its class is called. That is preferable to the old workaround of
   `color: … !important` on every new component, because it cannot be forgotten
   silently: forget it and the link looks like a normal underlined article link,
   which is obvious, rather than invisible, which is not.

   The class list is kept for the components that already rely on it. */
.article a:not(.cta-btn):not(.share-btn):not(.btn):not(.btn-primary):not(.btn-outline):not(.btn-ghost):not([data-btn]) {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(78, 205, 196, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s;
}

.article a:not(.cta-btn):not(.share-btn):not(.btn):not(.btn-primary):not(.btn-outline):not(.btn-ghost):not([data-btn]):hover {
    text-decoration-color: var(--accent);
}

/* Ensure all button-style links inside articles have correct text color */
.article .btn,
.article .btn-primary,
.article .cta-btn {
    color: var(--color-navy) !important;
    text-decoration: none !important;
}

/* --- Article code / pre --- */
.article code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

.article pre {
    background: rgba(12, 18, 32, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text);
    overflow-x: auto;
    line-height: 1.7;
}

.article pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* --- Article tables --- */
.article table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}

.article thead th {
    background: var(--bg-card);
    color: var(--heading);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.article tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.article tbody tr:hover {
    background: rgba(78, 205, 196, 0.03);
}

/* Phones: a table whose columns cannot shrink below their longest word used
   to widen the whole page, so the browser zoomed the article out and every
   line of text became small (170 of 306 articles, found from feedback 271).
   Wide tables now scroll sideways inside their own box instead. The reference tables
   in a tool page's .seo-footer are the same kind of prose table (2026-10-05). */
@media (max-width: 600px) {
    .article table,
    .seo-footer table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .article p code,
    .article li code,
    .article td code {
        overflow-wrap: anywhere;
    }
}

.article tbody td:first-child {
    color: var(--heading);
    font-weight: 500;
}

/* --- Figures & charts --- */
.article figure {
    margin: 32px 0;
    padding: 0;
}

.article figure canvas {
    width: 100% !important;
    max-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.article figcaption {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-top: 12px;
    padding: 0 4px;
}

.article figure svg {
    display: block;
    margin: 0 auto;
}

.chart-figure {
    position: relative;
    width: 100%;
    margin: 24px 0;
}

.chart-figure canvas {
    width: 100% !important;
    max-width: 100%;
}

/* --- Equation / formula blocks --- */
.equation {
    display: block;
    background: rgba(12, 18, 32, 0.8);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    color: var(--heading);
    overflow-x: auto;
    line-height: 1.8;
}

.equation .var {
    color: var(--accent);
}

.equation .comment {
    color: var(--text-dim);
    font-size: 13px;
}

.equation .unit {
    color: var(--text-muted);
    font-size: 13px;
}

/* --- Code blocks (standalone) --- */
.code-block {
    background: rgba(12, 18, 32, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text);
    overflow-x: auto;
    line-height: 1.7;
}

.code-block .step {
    color: var(--accent);
    font-weight: 500;
}

.code-block .val {
    color: var(--amber);
}

.code-block .result {
    color: #4ecdc4;
    font-weight: 500;
}

/* --- Info / Tip / Warning boxes --- */
.info-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--blue);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0;
}

.info-box.warning,
.warning-box {
    border-left-color: var(--coral);
}

.info-box.tip {
    border-left-color: var(--accent);
}

.info-box-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.info-box.warning .info-box-title {
    color: var(--coral);
}

.info-box.tip .info-box-title {
    color: var(--accent);
}

.info-box p {
    font-size: 14px !important;
    margin-bottom: 8px !important;
}

.info-box p:last-child {
    margin-bottom: 0 !important;
}

/* --- CTA inline boxes --- */
.cta-inline {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.06), rgba(130, 170, 255, 0.06));
    border: 1px solid rgba(78, 205, 196, 0.15);
    border-radius: 12px;
    padding: 28px;
    margin: 32px 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cta-inline-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.cta-inline-content {
    flex: 1;
}

.cta-inline h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 6px;
}

.cta-inline p {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 12px !important;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    background: var(--accent);
    color: var(--color-navy) !important;
    border-radius: 7px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.15s;
}

.cta-btn:hover {
    background: #3dbdb5;
    transform: translateY(-1px);
}

/* --- Share bar --- */
.share-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.share-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #6b7a94;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}

.share-btn:hover {
    border-color: var(--border-hover);
    color: var(--accent);
}

/* --- References --- */
.references {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.references h2 {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.references ol {
    list-style-position: outside;
    padding-left: 24px;
}

.references li {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 12px;
    line-height: 1.6;
}

.references a {
    color: var(--accent);
    font-size: 13px;
}

/* --- Resources section --- */
.resources-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.resources-section h2 {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.resources-section ul {
    list-style: none;
    padding-left: 0;
}

.resources-section li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

.resources-section li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

/* --- FAQ section (article variant) --- */
.faq-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.faq-section h2 {
    font-size: 18px;
    color: var(--heading);
    margin-bottom: 16px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.faq-q {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    transition: all 0.15s;
}

.faq-q:hover {
    color: var(--accent);
}

.faq-a {
    padding: 0 18px 14px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.7;
    display: none;
    background: var(--bg-card);
}

.faq-item.open .faq-a {
    display: block;
}

.faq-arrow {
    transition: transform 0.2s;
    color: var(--text-muted);
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg);
}

/* Variant B: standalone questions */
.faq-q .arrow {
    transition: transform 0.2s;
    font-size: 12px;
    color: var(--text-muted);
}

.faq-q.open .arrow {
    transform: rotate(180deg);
}

.faq-a.open {
    display: block;
}

/* --- Related articles --- */
.related-articles {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.related-title {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 24px;
    color: var(--heading);
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.related-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.related-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.related-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 6px;
    line-height: 1.4;
}

.related-card p {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
}


/* ============================================================
   10. BLOG LISTING
   ============================================================ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 20px;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    display: block;
}

.blog-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.blog-card h3 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 19px;
    font-weight: 400;
    letter-spacing: 0.8px;
    color: var(--heading);
    margin-bottom: 8px;
    line-height: 1.35;
}

.blog-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 12px;
}

.blog-card .meta {
    font-size: 12px;
    color: var(--text-muted);
}


/* ============================================================
   11. SLIDER / CAROUSEL
   ============================================================ */
.slider-section {
    padding: 60px 0 60px 40px;
    position: relative;
}

.slider-header {
    max-width: 1200px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 40px;
}

.slider-header h2 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 34px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--heading);
}

.slider-nav {
    display: flex;
    gap: 8px;
}

.slider-nav button {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.slider-nav button:hover {
    border-color: var(--color-sky-blue);
    color: var(--color-sky-blue);
}

.slider-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.slider-wrapper::-webkit-scrollbar {
    display: none;
}

.slider-track {
    display: flex;
    gap: 20px;
    padding-bottom: 8px;
}

/* Right-edge fade (desktop only) */
@media (min-width: 768px) {
    .slider-wrapper::before {
        content: "";
        position: absolute;
        top: -10px;
        bottom: -10px;
        right: 0;
        left: unset;
        width: 300px;
        z-index: 2;
        background: linear-gradient(91deg, rgba(2, 10, 23, 0) 0%, var(--bg) 61%, var(--bg) 100%);
        pointer-events: none;
    }
}

.slider-card {
    min-width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    flex-shrink: 0;
}

.slider-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
}

.slider-card h3 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 19px;
    font-weight: 400;
    letter-spacing: 0.8px;
    line-height: 1.35;
    color: var(--heading);
    margin-bottom: 8px;
}

.slider-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}

.slider-card .meta {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}


/* ============================================================
   12. HERO SECTION
   ============================================================ */
.hero-section {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 120px 80px 100px;
    overflow: hidden;
}

/* Bottom gradient fade */
.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(7, 30, 63, 0) 50%, var(--bg) 100%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 2;
}

/* Atmospheric orbs */
.hero-atmosphere {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 700px 500px at 15% 25%, rgba(9, 82, 128, 0.25) 0%, transparent 70%),
        radial-gradient(ellipse 600px 400px at 75% 20%, rgba(40, 169, 225, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 50% 70%, rgba(103, 38, 117, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 800px 300px at 85% 80%, rgba(9, 82, 128, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.hero-inner {
    position: relative;
    z-index: 3;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
}

/* Text column horizontal fade (V5) */
.hero-text-column {
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 20%, rgba(255, 255, 255, 0) 100%);
    background-color: transparent;
    padding: 56px 72px 56px 56px;
    border-radius: 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: rgba(110, 207, 246, 0.08);
    border: 1px solid rgba(110, 207, 246, 0.2);
    border-radius: 100px;
    font-size: 13px;
    color: var(--color-sky-blue);
    margin-bottom: 28px;
    font-weight: 500;
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero-text-column h1 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: clamp(38px, 6vw, 68px);
    font-weight: 400;
    line-height: 1.05;
    margin-bottom: 24px;
    color: var(--color-text);
}

.hero-text-column h1 em {
    font-style: italic;
    background: var(--grad-teal-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text-column p {
    font-size: 17px;
    color: var(--color-text-muted);
    max-width: 480px;
    line-height: 1.75;
    margin-bottom: 36px;
}

/* Hero stats row (hub hero) */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
}

.hero-stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 36px;
    font-weight: 600;
    color: var(--heading);
    line-height: 1;
}

.hero-stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Hero right column — capability cards */
.hero-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.hero-cap-card {
    background: rgba(9, 82, 128, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(9, 82, 128, 0.25);
    border-radius: 14px;
    padding: 18px;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--color-text);
}

.hero-cap-card:hover {
    background: rgba(9, 82, 128, 0.22);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.hero-cap-icon {
    font-size: 20px;
    margin-bottom: 10px;
}

.hero-cap-title {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.8px;
    color: var(--color-text);
    margin-bottom: 4px;
}

.hero-cap-desc {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.hero-cap-card.wide {
    grid-column: span 2;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    background: rgba(110, 207, 246, 0.05);
    border-color: rgba(110, 207, 246, 0.12);
}

.hero-cap-card.wide .hero-cap-icon {
    font-size: 28px;
    margin-bottom: 0;
}

.hero-cap-card.wide .hero-cap-title {
    font-size: 14px;
    margin-bottom: 2px;
}


/* ============================================================
   13. FOOTER
   ============================================================ */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 13px;
}

.footer-brand a {
    color: var(--accent);
    text-decoration: none;
}

/* V5 centered footer variant */
.footer-brand.v5 {
    font-family: 'Instrument Serif', 'Instrument Serif Fallback', Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.5px;
    background: var(--grad-shimmer);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent);
}


/* ============================================================
   14. RESPONSIVE
   ============================================================ */

/* --- Tablet (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links .hide-mobile {
        display: none;
    }

    .nav-links {
        gap: 14px;
    }

    .nav-dropdown {
        min-width: 300px;
        grid-template-columns: 1fr;
    }

    .nav-dropdown.nav-dropdown-tools {
        min-width: min(92vw, 360px);
    }

    /* Higher specificity than the base `.nav-dropdown-scroll` 3-col rule so it
       wins outright, not via source order */
    .nav-dropdown-tools .nav-dropdown-scroll {
        grid-template-columns: 1fr;
    }

    /* Hero */
    .hero-section {
        padding: 80px 24px 60px;
        min-height: auto;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-text-column {
        padding: 32px 24px;
    }

    .hero-text-column h1 {
        font-size: clamp(32px, 8vw, 48px);
    }

    .hero-stats {
        gap: 28px;
    }

    .hero-stat-val {
        font-size: 28px;
    }

    .hero-cards-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Blog article */
    .article-header {
        padding: 28px 20px 0;
    }

    .article {
        padding: 0 20px 40px;
    }

    .breadcrumbs {
        padding: 16px 20px 0;
    }

    .toc {
        padding: 24px 20px;
    }

    .cta-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .share-bar {
        flex-wrap: wrap;
    }

    .article table {
        font-size: 13px;
    }

    .article thead th,
    .article tbody td {
        padding: 8px 10px;
    }

    /* Tool cards */
    .tools-grid {
        grid-template-columns: 1fr;
    }

    /* Overlay grid */
    .overlay-grid {
        grid-template-columns: 1fr;
    }

    /* Result hero */
    .result-hero {
        grid-template-columns: 1fr;
    }

    /* Calc section */
    .calc-section {
        padding: 40px 20px;
    }

    /* Hub forms */
    .cta-form {
        flex-direction: column;
    }

    /* Slider */
    .slider-section {
        padding-left: 20px;
    }

    .slider-header {
        padding-right: 20px;
    }

    .slider-header h2 {
        font-size: 26px;
    }

    /* Blog grid */
    .blog-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --- Mobile (max-width: 480px) --- */
@media (max-width: 480px) {
    .hero-text-column {
        padding: 20px 16px;
    }

    .hero-text-column h1 {
        font-size: 32px;
    }

    .hero-cards-grid {
        grid-template-columns: 1fr;
    }

    .hero-cap-card.wide {
        grid-column: span 1;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .btn-row {
        flex-direction: column;
    }

    .nav-inner {
        padding: 12px 16px;
    }

    .slider-card {
        min-width: 260px;
    }

    .overlay-grid {
        gap: 12px;
    }

    .calc-card {
        padding: 20px;
    }
}


/* ============================================================
   15. UTILITIES
   ============================================================ */

/* Ambient background (blog & hub pages) */
body.ambient::before {
    content: '';
    position: fixed;
    top: -40%;
    left: -20%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body.ambient::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -15%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(130, 170, 255, 0.03) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* Fade-in animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Category label colours */
.category-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-label::before {
    content: '';
    width: 24px;
    height: 2px;
    border-radius: 1px;
}

.cat-upstream {
    color: var(--teal);
}

.cat-upstream::before {
    background: var(--grad-teal-blue);
}

.cat-downstream {
    color: var(--gold);
}

.cat-downstream::before {
    background: var(--grad-coral-gold);
}

.cat-qc {
    color: var(--coral);
}

.cat-qc::before {
    background: linear-gradient(135deg, #ff6b6b, #ff9f43);
}

.cat-emerging {
    color: var(--purple-bp);
}

.cat-emerging::before {
    background: var(--grad-blue-purple);
}

/* Section label (V5 demo label, also reused) */
.section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Unit helpers */
.unit {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 3px;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* Info tooltips */
.info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
}

.info:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    z-index: 10;
    max-width: 300px;
    white-space: normal;
    width: max-content;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Tables (.vtable — tool pages) */
.vtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.vtable th {
    text-align: left;
    padding: 8px 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.vtable td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(26, 37, 64, 0.5);
    color: var(--text);
}

.vtable tr:hover td {
    background: rgba(78, 205, 196, 0.03);
}

.vtable .mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.vtable .highlight-row td {
    background: rgba(78, 205, 196, 0.08);
    border-left: 3px solid var(--accent);
}

/* Pass/fail/warn tags (tool pages) */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.tag-pass {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green);
}

.tag-fail {
    background: rgba(255, 107, 107, 0.12);
    color: var(--coral);
}

.tag-warn {
    background: rgba(255, 217, 61, 0.12);
    color: var(--amber);
}

/* Preset chips / tag selectors */
.preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.preset-chip {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.12s;
}

.preset-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.preset-chip.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* Tools grid (hub page) */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

/* SEO footer (tool pages) */
.seo-footer {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px 40px;
}

.seo-footer h2 {
    font-size: 18px;
    color: var(--heading);
    margin-bottom: 12px;
}

.seo-footer p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 10px;
}

.seo-footer li {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 10px;
}

/* CTA / Subscribe section (hub page) */
.cta-section {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 24px;
    text-align: center;
}

.cta-box {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.06), rgba(130, 170, 255, 0.06));
    border: 1px solid rgba(78, 205, 196, 0.15);
    border-radius: 16px;
    padding: 48px 40px;
}

.cta-box h2 {
    font-family: 'Instrument Serif', serif;
    font-size: 28px;
    color: var(--heading);
    margin-bottom: 12px;
}

.cta-box p {
    color: var(--text-dim);
    font-size: 15px;
    margin-bottom: 24px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.cta-form {
    display: flex;
    gap: 8px;
    max-width: 420px;
    margin: 0 auto;
}

.cta-form input {
    flex: 1;
    padding: 11px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.cta-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.cta-form button {
    padding: 11px 24px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.15s;
}

.cta-form button:hover {
    background: #3dbdb5;
}

.cta-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}


/* MicroBioVision — Suppress all CSV and dataset download buttons */
[data-csv-download],
button[onclick*="exportCSV"],
button[onclick*="downloadCSV"],
button[onclick*="downloadTemplate"],
button[onclick*="downloadExampleRun"],
button[onclick*="exportProcessedCSV"],
.ph-download-simple,
.ph-download {
  display: none !important;
}
