/* Qvasir marketing site — layout & components. Consumes assets/tokens.css. */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ── Header / nav ─────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border-subtle);
}
.nav-bar {
    display: flex; align-items: center; gap: 28px;
    height: 64px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 1.25rem; letter-spacing: 0.02em;
    color: var(--text-primary);
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 28px; height: 28px; border-radius: 6px;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-500));
    display: inline-flex; align-items: center; justify-content: center;
}
/* The mark is a CSS mask, not an <img>, so its colour is set by background —
   swap --brand-mark-color (or the background below) to recolour it anywhere. */
.brand-mark::before {
    content: ""; width: 19px; height: 19px;
    background: var(--brand-mark-color, var(--gold));
    -webkit-mask: url(brand/qvasir-mark.svg) center / contain no-repeat;
            mask: url(brand/qvasir-mark.svg) center / contain no-repeat;
}
/* The wordmark is the outlined "QVASIR" lettering cut from brand/qvasir-logo.svg,
   rendered as a mask so it takes currentColor (theme-aware) like the mark. */
.brand-word {
    display: inline-block; width: 82px; height: 16px;
    background: currentColor;
    -webkit-mask: url(brand/qvasir-wordmark.svg) center / contain no-repeat;
            mask: url(brand/qvasir-wordmark.svg) center / contain no-repeat;
}
.nav-links { display: flex; gap: 22px; align-items: center; margin-left: auto; }
.nav-links a { color: var(--text-secondary); font-weight: 600; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text-primary); text-decoration: none; }
.nav-links a.nav-cta {
    background: var(--cta-bg); color: var(--cta-text);
    padding: 8px 16px; border-radius: 8px;
}
.theme-toggle {
    border: 1px solid var(--border-strong); background: transparent;
    color: var(--text-secondary); border-radius: 8px;
    padding: 6px 10px; cursor: pointer; font-size: 0.85rem;
}
.nav-menu-btn { display: none; }

/* Dropdown */
.nav-drop { position: relative; }
.nav-drop > a::after { content: " ▾"; font-size: 0.7em; }
.nav-drop-menu {
    display: none; position: absolute; top: 100%; left: -12px; padding: 8px 0;
    background: var(--bg-raised); border: 1px solid var(--border-subtle);
    border-radius: 10px; box-shadow: var(--shadow-card); min-width: 240px;
}
.nav-drop:hover .nav-drop-menu, .nav-drop:focus-within .nav-drop-menu { display: block; }
.nav-drop-menu a { display: block; padding: 8px 16px; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(160deg, var(--hero-grad-a) 0%, var(--hero-grad-b) 100%);
    color: var(--text-on-navy);
    padding: 88px 0 72px;
    position: relative;
    overflow: hidden;
}
.hero .container { position: relative; }
.hero h1 { color: #FFFFFF; max-width: 17em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lede {
    font-size: 1.2rem; color: var(--text-on-navy-secondary);
    max-width: 40em; margin-bottom: 1.8em;
}
.hero-grid-bg {
    position: absolute; inset: 0; opacity: 0.35; pointer-events: none;
}
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
    display: inline-block; padding: 12px 22px; border-radius: 10px;
    font-weight: 700; font-size: 1rem;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-primary { background: var(--cta-bg); color: var(--cta-text); }
.btn-ghost {
    color: #FFFFFF; border: 1px solid rgba(255, 255, 255, 0.4);
}
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 34px; }
.hero-badges span {
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.03em;
    color: var(--text-on-navy-secondary);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 99px; padding: 5px 12px;
}

/* ── Funnel stat band (homepage, under hero) ──────────────── */
.funnel-band {
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border-subtle);
    padding: 44px 0;
}
.funnel {
    list-style: none; padding: 0; margin: 18px 0 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px;
}
.funnel li {
    position: relative; padding: 18px 16px; border-radius: 12px;
    background: var(--bg-raised); border: 1px solid var(--border-subtle);
}
.funnel li:not(:last-child)::after {
    content: "→"; position: absolute; right: -16px; top: 50%;
    transform: translateY(-50%); width: 12px; text-align: center;
    color: var(--text-muted); font-size: 1rem; line-height: 1;
}
.fn-num {
    display: block; font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 800;
    letter-spacing: -0.02em; color: var(--text-primary);
}
.fn-label { display: block; margin-top: 4px; font-size: 0.82rem; color: var(--text-muted); }
.funnel .fn-final { border-color: var(--accent-interactive); box-shadow: var(--shadow-card); }
.funnel .fn-final .fn-num { color: var(--accent-interactive); }
.funnel-note {
    margin: 18px 0 0; max-width: 62em;
    font-size: 0.9rem; color: var(--text-secondary);
}

@media (max-width: 900px) {
    .funnel { grid-template-columns: repeat(2, 1fr); }
    .funnel li:not(:last-child)::after { display: none; }
    .funnel .fn-final { grid-column: 1 / -1; }
}

/* ── Code blocks (FDL rule listings) ──────────────────────── */
.code-wrap {
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
}
.code-wrap > figcaption {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.code-wrap pre {
    margin: 0; padding: 18px 16px;
    overflow-x: auto;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.78rem; line-height: 1.6;
    color: var(--text-primary);
    tab-size: 2;
}
.code-wrap pre b { font-weight: 700; color: var(--accent-interactive); }
.code-wrap pre i { font-style: normal; color: var(--text-muted); }
.code-note {
    display: block; margin-top: 10px;
    font-size: 0.86rem; color: var(--text-muted);
}
/* Inline annotation list beside a listing */
.annotated { display: grid; grid-template-columns: 1.45fr 1fr; gap: 32px; margin-top: 40px; align-items: start; }
.annotated ul { padding-left: 20px; color: var(--text-secondary); margin: 0; }
.annotated li { margin-bottom: 12px; }
.annotated code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.86em; color: var(--accent-interactive);
}
@media (max-width: 900px) {
    .annotated { grid-template-columns: 1fr; gap: 24px; }
}

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-sunken); }
.section.navy {
    background: var(--bg-navy-panel); color: var(--text-on-navy);
}
.section.navy h2, .section.navy h3 { color: #FFFFFF; }
.section.navy p { color: var(--text-on-navy-secondary); }
/* In dark, --bg-sunken and --bg-navy-panel both resolve to navy-950, so an `alt`
   section followed by a `navy` one reads as one undifferentiated block. Light mode
   already has ample contrast at that boundary and needs no seam. */
:root[data-theme="dark"] .section.alt + .section.navy {
    border-top: 1px solid var(--border-subtle);
}
.kicker {
    text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem;
    font-weight: 700; color: var(--accent-interactive); margin-bottom: 10px;
}
.section.navy .kicker { color: var(--teal); }
.section-intro { max-width: 46em; font-size: 1.08rem; color: var(--text-secondary); }
.section.navy .section-intro { color: var(--text-on-navy-secondary); }

/* Cards */
.card-grid { display: grid; gap: 20px; margin-top: 36px; }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
    background: var(--bg-raised); border: 1px solid var(--border-subtle);
    border-radius: 14px; padding: 24px; box-shadow: var(--shadow-card);
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p { color: var(--text-secondary); font-size: 0.97rem; margin-bottom: 0; }
.card p + p { margin-top: 0.9em; }
.card .more { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 0.92rem; }
.card-icon {
    width: 34px; height: 34px; flex: none; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--navy-800); color: var(--teal); font-size: 1rem;
}

/* Cards inside navy sections keep a dark surface in BOTH themes —
   the section forces light text, so a light card would be unreadable. */
.section.navy .card {
    background: var(--navy-800);
    border-color: var(--navy-600);
}
.section.navy .card h3 { color: #FFFFFF; }
.section.navy .card p { color: var(--text-on-navy-secondary); }
.section.navy .card-icon { background: var(--navy-700); }

/* Numbered steps (how it works) */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 36px; }
.steps.cols-3 { grid-template-columns: repeat(3, 1fr); }
.steps.cols-5 { grid-template-columns: repeat(5, 1fr); gap: 14px; }
.steps.cols-5 .step { padding: 18px 16px; }
.steps.cols-5 .step h3 { font-size: 1rem; }
.steps.cols-5 .step p { font-size: 0.88rem; }
.step { position: relative; padding: 22px; border-radius: 14px; background: var(--bg-raised);
        border: 1px solid var(--border-subtle); box-shadow: var(--shadow-card); }
.step .num {
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em;
    color: var(--accent-interactive); text-transform: uppercase;
}
.step h3 { margin: 6px 0 8px; font-size: 1.05rem; }
.step p { font-size: 0.92rem; color: var(--text-secondary); margin: 0; }
.step .more { display: inline-block; margin-top: 10px; font-size: 0.88rem; font-weight: 600; }

/* Feature rows w/ screenshot */
.feature-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 44px;
    align-items: center; margin-top: 48px;
}
.feature-row.flip .feature-copy { order: 2; }
.feature-copy h3 { font-size: 1.35rem; }
.feature-copy ul { padding-left: 20px; color: var(--text-secondary); }
.feature-copy li { margin-bottom: 6px; }

/* Screenshot frames */
.shot {
    border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-card);
    background: var(--navy-900);
}
.shot img { display: block; width: 100%; }
.shot-placeholder {
    aspect-ratio: 16 / 9.6; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
    color: var(--text-on-navy-secondary); font-size: 0.9rem;
    background:
        linear-gradient(0deg, rgba(85, 170, 178, 0.06), rgba(85, 170, 178, 0.06)),
        var(--navy-900);
    border: 1px dashed var(--navy-500); border-radius: 12px;
}
.shot-placeholder strong { color: #F0F0F0; }
figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }
figure { margin: 0; }

/* Standards strip */
.standards { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.standards span {
    border: 1px solid var(--border-strong); border-radius: 10px;
    padding: 10px 18px; font-weight: 700; font-size: 0.95rem;
    color: var(--text-secondary); background: var(--bg-raised);
}

/* Comparison table */
.compare-wrap { overflow-x: auto; margin-top: 36px; }
table.compare {
    width: 100%; border-collapse: collapse; font-size: 0.95rem;
    background: var(--bg-raised); border-radius: 14px; overflow: hidden;
    box-shadow: var(--shadow-card);
}
.compare th, .compare td {
    padding: 14px 16px; text-align: left; vertical-align: top;
    border-bottom: 1px solid var(--border-subtle);
}
.compare thead th {
    background: var(--navy-900); color: #F0F0F0; font-size: 0.9rem;
}
.compare thead th:first-child { width: 22%; }
.compare tbody th { font-weight: 700; color: var(--text-primary); }
.compare td { color: var(--text-secondary); }
.compare td.q { color: var(--text-primary); font-weight: 600; }
.compare .yes { color: var(--ok-green); font-weight: 700; }

/* Roadmap badge */
.badge-roadmap {
    display: inline-block; font-size: 0.72rem; font-weight: 800;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--navy-900); background: var(--sev-medium);
    padding: 3px 9px; border-radius: 99px; vertical-align: middle;
}

/* Footer */
.site-footer {
    background: var(--navy-950); color: var(--text-on-navy-secondary);
    padding: 48px 0 40px; font-size: 0.88rem;
}
.site-footer a { color: var(--text-on-navy-secondary); text-decoration: underline; }
.site-footer a.brand { text-decoration: none; color: #F0F0F0; }
/* Footer carries the full stacked logo (mark over wordmark) from brand/qvasir-logo-white.svg —
   the one place with the vertical room for it. */
.site-footer a.brand-stacked { display: inline-block; line-height: 0; }
.site-footer a.brand-stacked img { display: block; width: 96px; height: auto; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
.footer-cols h4 { color: #F0F0F0; font-size: 0.95rem; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: 6px; }
.legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--navy-700);
         font-size: 0.78rem; line-height: 1.7; color: #8899AA; }

/* ── Responsive ───────────────────────────────────────────── */
/* The full nav needs ~960px before links stop wrapping onto two
   lines, so the hamburger takes over well above the grid breaks. */
@media (max-width: 959px) {
    .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0;
                 flex-direction: column; align-items: stretch; gap: 0;
                 background: var(--bg-raised); border-bottom: 1px solid var(--border-subtle);
                 padding: 8px 0; }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 24px; }
    .nav-links .theme-toggle { margin: 8px 24px; align-self: flex-start; }
    .nav-drop-menu { position: static; display: block; border: 0; box-shadow: none; padding-left: 16px; }
    .nav-menu-btn { display: block; margin-left: auto; border: 1px solid var(--border-strong);
                    background: transparent; color: var(--text-primary); border-radius: 8px;
                    padding: 6px 12px; font-size: 1rem; cursor: pointer; }
}
@media (max-width: 900px) {
    .card-grid.cols-3, .steps, .steps.cols-3, .steps.cols-5 { grid-template-columns: 1fr 1fr; }
    .feature-row { grid-template-columns: 1fr; gap: 24px; }
    .feature-row.flip .feature-copy { order: 0; }
    .footer-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .card-grid.cols-3, .card-grid.cols-2, .steps, .steps.cols-3, .steps.cols-5 { grid-template-columns: 1fr; }
}

/* ---- Utilities ----------------------------------------------------------
   These replaced the site's inline style="" attributes so the Content-Security-Policy
   can be `style-src 'self'` (no 'unsafe-inline'). Do not reintroduce style="" or
   <style> blocks: the header set at the edge blocks them silently. */
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-28 { margin-top: 28px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mt-44 { margin-top: 44px; }
.mx-auto { margin: 0 auto; }
.mx-auto-24 { margin: 0 auto 24px; }
.text-center { text-align: center; }
.text-teal { color: var(--teal); }
.justify-center { justify-content: center; }
.hero-compact { padding: 64px 0 52px; }
.hero-tall { padding: 96px 0; }
.hero .lede-centered { margin: 0 auto 1.8em; }
.h1-compact { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.footnote { margin-top: 18px; font-size: 0.9rem; color: var(--text-muted); }
.footnote-sm { margin-top: 16px; font-size: 0.85rem; color: var(--text-muted); }
