/* BiCalc Phase 1 global design system */
:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface-soft: #eef5ff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe6f3;
    --primary: #0ea5e9;
    --primary-dark: #0369a1;
    --accent: #22c55e;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
    --radius: 24px;
    --radius-sm: 16px;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 32rem),
        radial-gradient(circle at top right, rgba(34, 197, 94, 0.10), transparent 30rem),
        var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(247, 249, 252, 0.82);
    border-bottom: 1px solid rgba(219, 230, 243, 0.7);
}

.nav-shell {
    max-width: var(--max);
    margin: 0 auto;
    min-height: 74px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 850;
    letter-spacing: -0.04em;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    color: white;
    background: linear-gradient(135deg, var(--primary), #2563eb 55%, #7c3aed);
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.24);
}

.brand-text {
    font-size: 1.35rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.94rem;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--primary-dark);
    background: rgba(14, 165, 233, 0.10);
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 1.1rem;
}

.hero,
.page-hero,
.section,
.site-footer {
    max-width: var(--max);
    margin: 0 auto;
    padding-left: 22px;
    padding-right: 22px;
}

.hero {
    min-height: 600px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    align-items: center;
    gap: 38px;
    padding-top: 72px;
    padding-bottom: 72px;
}

.hero-content h1,
.page-hero h1 {
    margin: 0;
    font-size: clamp(2.7rem, 6vw, 5.9rem);
    line-height: 0.96;
    letter-spacing: -0.08em;
}

.hero-subtitle,
.page-hero p,
.section-heading p,
.prose p {
    color: var(--muted);
    font-size: 1.08rem;
}

.eyebrow {
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 850;
    font-size: 0.78rem;
    margin: 0 0 14px;
}

.hero-search,
.directory-toolbar {
    display: flex;
    gap: 10px;
    margin: 30px 0 18px;
}

.hero-search input,
.directory-toolbar input,
.directory-toolbar select {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 16px 18px;
    font: inherit;
    box-shadow: var(--shadow-soft);
    outline: none;
}

.hero-search input:focus,
.directory-toolbar input:focus,
.directory-toolbar select:focus {
    border-color: rgba(14, 165, 233, 0.7);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.hero-search button,
.button {
    border: 0;
    border-radius: 18px;
    padding: 15px 20px;
    font-weight: 850;
    font-size: 0.98rem;
    cursor: pointer;
    white-space: nowrap;
}

.hero-search button,
.button-primary {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    box-shadow: 0 14px 30px rgba(14, 165, 233, 0.25);
}

.button-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.centered {
    justify-content: center;
}

.hero-panel {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(219, 230, 243, 0.9);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
}

.metric {
    padding: 22px;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f3f8ff);
    border: 1px solid var(--border);
}

.metric strong {
    display: block;
    font-size: 2.4rem;
    line-height: 1;
    letter-spacing: -0.06em;
}

.metric span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-top: 8px;
}

.section {
    padding-top: 74px;
    padding-bottom: 74px;
}

.section-muted {
    background: rgba(255, 255, 255, 0.52);
    border-radius: 36px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 28px;
}

.section-heading h2,
.two-column h2,
.prose h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.calculator-grid,
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.calculator-card,
.category-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 210px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.calculator-card:hover,
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(14, 165, 233, 0.45);
}

.card-tag,
.category-count {
    width: fit-content;
    color: var(--primary-dark);
    background: rgba(14, 165, 233, 0.10);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 850;
}

.calculator-card h3,
.category-card h3 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.calculator-card p,
.category-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.96rem;
}

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.try-link {
    color: var(--primary-dark);
    font-weight: 850;
}

.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 99px;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 28px;
    align-items: start;
}

.feature-list {
    display: grid;
    gap: 14px;
}

.feature-list div,
.notice-box {
    border: 1px solid var(--border);
    background: white;
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.feature-list strong,
.notice-box strong {
    display: block;
    letter-spacing: -0.03em;
}

.feature-list span,
.notice-box span {
    color: var(--muted);
}

.page-hero {
    padding-top: 74px;
    padding-bottom: 30px;
}

.page-hero.compact {
    max-width: 920px;
    text-align: left;
}

.page-hero.center {
    text-align: center;
}

.directory-toolbar {
    margin-top: 0;
    align-items: center;
}

.directory-toolbar select {
    max-width: 260px;
}

.result-count {
    color: var(--muted);
    font-weight: 700;
    margin: 0 0 18px;
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
}

.pagination button {
    border: 1px solid var(--border);
    background: white;
    border-radius: 12px;
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 800;
}

.pagination button.is-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.prose {
    max-width: 840px;
}

.prose ul {
    color: var(--muted);
}

.site-footer {
    padding-top: 54px;
    padding-bottom: 28px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr .7fr .7fr;
    gap: 22px;
    padding: 28px;
    background: #0f172a;
    color: white;
    border-radius: 32px;
}

.footer-grid p {
    color: #cbd5e1;
    max-width: 520px;
}

.footer-grid h3 {
    margin: 0 0 12px;
}

.footer-grid a {
    display: block;
    color: #dbeafe;
    margin: 8px 0;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 16px 4px 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

@media (max-width: 880px) {
    .menu-toggle { display: inline-flex; }
    .nav-links {
        display: none;
        position: absolute;
        left: 22px;
        right: 22px;
        top: 70px;
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        background: white;
        border: 1px solid var(--border);
        border-radius: 20px;
        box-shadow: var(--shadow);
    }
    .nav-links.is-open { display: flex; }
    .hero,
    .two-column,
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .hero { min-height: auto; }
    .calculator-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hero-search,
    .directory-toolbar {
        flex-direction: column;
    }
    .directory-toolbar select { max-width: none; }
}

@media (max-width: 560px) {
    .calculator-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }
    .hero,
    .section,
    .page-hero {
        padding-left: 16px;
        padding-right: 16px;
    }
    .hero-content h1 { font-size: 3rem; }
    .footer-bottom { flex-direction: column; }
}


/* Phase 3 clean URL routing additions */
.breadcrumb { margin: 0 0 18px; font-size: 0.92rem; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumb li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.breadcrumb li:not(:last-child)::after { content: "/"; color: var(--muted-light); }
.breadcrumb a { color: var(--primary-dark); font-weight: 700; }
.route-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; color: var(--muted); }
.route-meta span { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 12px; font-size: 0.9rem; }
.status-pill { font-weight: 800; }
.status-needs-review { color: #075985; background: rgba(14, 165, 233, 0.12) !important; }
.status-published { color: #166534; background: rgba(34, 197, 94, 0.12) !important; }
.status-draft { color: #92400e; background: rgba(245, 158, 11, 0.14) !important; }
.status-unsafe { color: #991b1b; background: rgba(239, 68, 68, 0.12) !important; }
.route-status { color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.align-left { text-align: left; max-width: 780px; margin-left: 0; }
.calculator-shell-section { padding-top: 28px; }
.calculator-frame { width: 100%; min-height: 680px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.small-note { color: var(--muted); font-size: 0.92rem; margin-top: 12px; }
.two-column-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 24px; box-shadow: var(--shadow-sm); }
.info-card h2 { margin-top: 0; }
.formula-box { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 16px; padding: 14px; overflow-wrap: anywhere; }
.notice-box.warning { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.08); }
.route-card .card-footer { gap: 10px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
@media (max-width: 780px) { .two-column-info { grid-template-columns: 1fr; } .calculator-frame { min-height: 560px; } }
