/* =====================================================================
   iq-product.css: product marketing pages (features, FAQ, guides,
   comparisons) for Bank Reconciler, CodeIQ, LedgerIQ and PrepIQ.

   Load AFTER /css/iq-tools.css, which carries the IQ Books landing chrome
   (tokens, type, masthead, drawer, buttons, section heads, FAQ, final CTA,
   colophon, reveal). This file only adds:
     1. the product brand, from <body data-product="riq|ciq|liq|prepiq">
     2. the product wordmark in the masthead
     3. a small set of figures every product page draws from
   Each page keeps its own bespoke layout in a page-scoped <style>.
   ===================================================================== */

/* ---------- 1. Brand per product ---------- */
body[data-product="riq"]    { --brand: var(--riq);    --brand-ink: var(--riq-deep);    --brand-wash: var(--riq-wash); }
body[data-product="ciq"]    { --brand: var(--ciq);    --brand-ink: var(--ciq-deep);    --brand-wash: var(--ciq-wash); }
body[data-product="liq"]    { --brand: var(--liq);    --brand-ink: var(--liq-deep);    --brand-wash: var(--liq-wash); }
body[data-product="prepiq"] { --brand: var(--prepiq); --brand-ink: var(--prepiq-deep); --brand-wash: #f4ece0; }

/* ---------- 2. Masthead wordmark ---------- */
.masthead .mark { display: inline-flex; align-items: baseline; gap: 10px; }
.mark__word { font-family: var(--serif); font-weight: 500; font-size: 21px; letter-spacing: -0.025em; color: var(--ink); line-height: 1; }
.mark__word em { font-style: italic; font-weight: 400; color: var(--brand); }
.masthead .mark__by { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-3); }
.masthead .mark__by b { font-style: normal; font-weight: 500; color: var(--ink-2); }
.masthead .mark__by b em { font-style: italic; font-weight: 400; color: var(--riq); }
@media (max-width: 700px) { .masthead .mark__by { display: none; } }
.masthead__nav a[aria-current="page"] { color: var(--ink); }
.masthead__nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--brand); }
.drawer a[aria-current="page"] { font-style: italic; color: var(--brand-ink); }
@media (min-width: 1180px) and (max-width: 1320px) { .masthead__nav { gap: 14px; font-size: 13px; } }

/* ---------- 3. Shared figures ---------- */
.pp-section { padding: var(--space-8) 0; }
.pp-section--ivory { background: var(--ivory); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.pp-section--paper { background: var(--paper); }

/* Product hero: copy left, a drawn figure right */
.pp-hero { position: relative; padding: clamp(32px, 5vw, 72px) 0 var(--space-7); overflow: hidden; }
.pp-hero::before { content: ''; position: absolute; width: 720px; height: 720px; border-radius: 50%; right: -260px; top: -320px;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 16%, transparent), transparent); pointer-events: none; }
.pp-hero__grid { position: relative; display: grid; grid-template-columns: 1fr; gap: var(--space-6); align-items: center; }
@media (min-width: 1080px) { .pp-hero__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--space-7); } }
.pp-hero__eyebrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.pp-hero__eyebrow .eyebrow::before { content: ''; display: inline-block; width: 22px; height: 1px; background: var(--ink-3); vertical-align: middle; margin-right: 10px; }
.pp-hero h1 { font-size: clamp(44px, 6vw, 96px); line-height: 0.95; letter-spacing: -0.04em; }
.pp-hero h1 em { font-style: italic; font-weight: 300; color: var(--brand); }
.pp-hero .lede { margin-top: var(--space-4); max-width: 640px; font-size: clamp(18px, 1.7vw, 22px); }
.pp-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-5); }
.pp-hero__facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pp-hero__facts b { color: var(--ink); font-weight: 500; }
.chip--product { color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 40%, transparent); background: var(--brand-wash); }

/* Paper sheet with a strip of tape: the landing's "pinned" figure */
.sheet { position: relative; background: #fff; border: 1px solid var(--rule); border-radius: 3px;
    box-shadow: 0 1px 0 rgba(26,26,26,.03), 0 40px 80px -48px rgba(30,52,80,.5), 0 14px 28px -22px rgba(0,0,0,.22); }
.sheet--tape::before { content: ''; position: absolute; top: -12px; left: 50%; width: 112px; height: 26px; translate: -50% 0; rotate: -2deg;
    background: color-mix(in srgb, var(--brand-wash) 88%, transparent); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.sheet__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--rule); }
.sheet__title { font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.sheet__title em { font-style: italic; font-weight: 400; color: var(--brand-ink); }
.sheet__meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.sheet__body { padding: 6px 20px 18px; }
.sheet__foot { padding: 12px 20px; border-top: 1px solid var(--rule); background: var(--ivory); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Ledger table: mono figures, ruled rows, double rule under the total */
.ledger { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ledger th { text-align: left; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); padding: 10px 8px 8px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.ledger td { padding: 9px 8px; border-bottom: 1px dashed var(--rule); color: var(--ink-2); vertical-align: middle; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger .num, .ledger th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.ledger .neg { color: var(--ciq-deep); }
.ledger tr.total td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 600; color: var(--ink); }
.ledger tr.total .num span { border-bottom: 4px double var(--ink); padding-bottom: 2px; }
.ledger .desc { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--ink); }

/* Status marks */
.tick { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--liq-wash); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--liq) 40%, transparent); flex-shrink: 0; }
.tick::after { content: ''; width: 7px; height: 4px; border-left: 1.5px solid var(--liq-deep); border-bottom: 1.5px solid var(--liq-deep); transform: translateY(-1px) rotate(-45deg); }
.tick--warn { background: #f6ead3; box-shadow: inset 0 0 0 1px #e2c48c; }
.tick--warn::after { width: 2px; height: 8px; border: 0; background: #8a5a12; transform: none; border-radius: 1px; }
.conf { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.conf b { color: var(--ink); font-weight: 500; }
.tag { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--brand-wash); color: var(--brand-ink); white-space: nowrap; }
.tag--ok { background: var(--liq-wash); color: var(--liq-deep); }
.tag--warn { background: #f6ead3; color: #8a5a12; }
.tag--muted { background: var(--ivory); color: var(--ink-3); }

/* Chapter rail: a long page's contents, sticky on wide screens */
.pp-body { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
@media (min-width: 1100px) { .pp-body { grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-7); } }
.pp-rail { display: none; }
@media (min-width: 1100px) {
    .pp-rail { display: block; position: sticky; top: 96px; align-self: start; }
    .pp-rail ol { list-style: none; counter-reset: rail; border-left: 1px solid var(--rule); }
    .pp-rail li { counter-increment: rail; }
    .pp-rail a { display: grid; grid-template-columns: 28px 1fr; gap: 6px; padding: 8px 0 8px 16px; margin-left: -1px; border-left: 1px solid transparent;
        font-size: 13.5px; line-height: 1.35; color: var(--ink-3); transition: color 180ms ease, border-color 180ms ease; }
    .pp-rail a::before { content: counter(rail, decimal-leading-zero); font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; padding-top: 2px; }
    .pp-rail a:hover { color: var(--ink); }
    .pp-rail a.is-on { color: var(--ink); border-left-color: var(--brand); }
    .pp-rail__label { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
}

/* Chapter: numbered section inside the rail layout */
.chapter { padding: var(--space-7) 0; border-top: 1px solid var(--rule-strong); scroll-margin-top: 80px; }
.chapter:first-child { border-top: 0; padding-top: 0; }
.chapter__num { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); display: flex; gap: 12px; align-items: center; margin-bottom: var(--space-3); }
.chapter__num::after { content: ''; width: 48px; height: 1px; background: var(--rule-strong); }
.chapter h2 { font-size: clamp(36px, 4.4vw, 68px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 500; max-width: 15ch; }
.chapter h2 em { font-style: italic; font-weight: 300; color: var(--brand); }
.chapter__lede { margin-top: var(--space-4); font-family: var(--serif); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 680px; }
.chapter__lede strong { font-weight: 500; color: var(--ink); }
.chapter__split { display: grid; grid-template-columns: 1fr; gap: var(--space-6); margin-top: var(--space-6); align-items: start; }
@media (min-width: 960px) { .chapter__split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.chapter h3 { font-size: clamp(22px, 2vw, 28px); font-weight: 500; letter-spacing: -0.02em; }
.chapter h3 em { font-style: italic; font-weight: 400; color: var(--brand-ink); }
.chapter p { font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.chapter p + p { margin-top: 12px; }
.chapter a:not(.btn) { color: var(--brand-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Plain-line list (practitioner ledger motif): no cards, ruled lines */
.lines { list-style: none; border-top: 1px solid var(--rule-strong); }
.lines li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 6px 24px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.lines li > b { font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.lines li > span { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
@media (max-width: 640px) { .lines li { grid-template-columns: 1fr; } }

/* Stat row */
.pp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); }
@media (min-width: 900px) { .pp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pp-stat { padding: var(--space-5) var(--space-4); border-right: 1px solid var(--rule); }
.pp-stat:last-child { border-right: 0; }
@media (max-width: 899px) { .pp-stat:nth-child(2n) { border-right: 0; } .pp-stat:nth-child(-n+2) { border-bottom: 1px solid var(--rule); } }
.pp-stat b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.6vw, 64px); letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.pp-stat b em { font-style: italic; color: var(--brand); }
.pp-stat span { display: block; margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }

/* Note in the margin */
.marginal { border-left: 2px solid var(--brand); padding: 4px 0 4px 18px; font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.marginal strong { font-style: normal; font-weight: 500; color: var(--ink); }

/* The rest of the suite */
.xsell { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--rule-strong); }
@media (min-width: 900px) { .xsell { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.xsell a { display: flex; flex-direction: column; gap: 10px; padding: var(--space-5) var(--space-4) var(--space-5) 0; border-bottom: 1px solid var(--rule); transition: background 200ms ease; }
@media (min-width: 900px) { .xsell a { border-bottom: 0; border-right: 1px solid var(--rule); padding-left: var(--space-4); } .xsell a:first-child { padding-left: 0; } .xsell a:last-child { border-right: 0; } }
.xsell .xsell__name { font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: -0.025em; color: var(--ink); }
.xsell .xsell__name em { font-style: italic; font-weight: 400; }
.xsell p { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.xsell .xsell__go { margin-top: auto; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); transition: color 180ms ease; }
.xsell a:hover .xsell__go { color: var(--ink); }
.xsell [data-p="riq"] em { color: var(--riq); } .xsell [data-p="ciq"] em { color: var(--ciq); }
.xsell [data-p="liq"] em { color: var(--liq); } .xsell [data-p="prepiq"] em { color: var(--prepiq); }
.xsell [data-p="iqb"] em { color: var(--iqbooks); }

/* FAQ pages: question index + grouped lists */
.faq-index { display: flex; flex-wrap: wrap; gap: 8px; }
.faq-index a { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; padding: 9px 14px; border: 1px solid var(--rule-strong); border-radius: 999px; color: var(--ink-2); background: var(--cream); transition: all 180ms ease; }
.faq-index a:hover { border-color: var(--ink); color: var(--ink); }
.faq-index a span { color: var(--ink-3); margin-left: 6px; }
.faq-group { display: grid; grid-template-columns: 1fr; gap: var(--space-5); padding: var(--space-7) 0; border-top: 1px solid var(--rule-strong); scroll-margin-top: 80px; }
@media (min-width: 1024px) { .faq-group { grid-template-columns: 1fr 2fr; gap: var(--space-7); } .faq-group__head { position: sticky; top: 96px; align-self: start; } }
.faq-group__head h2 { font-size: clamp(32px, 3.6vw, 52px); line-height: 1; letter-spacing: -0.03em; font-weight: 500; }
.faq-group__head h2 em { font-style: italic; font-weight: 300; color: var(--brand); }
.faq-group__head p { margin-top: var(--space-3); font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--ink-2); max-width: 340px; }
.faq-group details .answer p + p { margin-top: 10px; }
.faq-group details .answer ul, .faq-group details .answer ol { margin: 8px 0 0 20px; display: grid; gap: 6px; }
.faq-group details .answer a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.faq-search { display: flex; align-items: center; gap: 10px; max-width: 560px; border-bottom: 1px solid var(--ink); padding: 8px 0; margin-top: var(--space-5); }
.faq-search svg { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; }
.faq-search input { flex: 1; font: inherit; font-family: var(--serif); font-size: 20px; border: 0; background: transparent; color: var(--ink); outline: none; min-width: 0; }
.faq-search input::placeholder { color: var(--ink-3); font-style: italic; }
.faq-empty { display: none; padding: var(--space-5) 0; font-family: var(--serif); font-style: italic; color: var(--ink-3); }

/* Guide steps: numbered, ruled, with a figure beside each */
.steps { list-style: none; counter-reset: step; }
.step { counter-increment: step; display: grid; grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-6) 0; border-top: 1px solid var(--rule-strong); scroll-margin-top: 80px; }
@media (min-width: 960px) { .step { grid-template-columns: 72px minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-5); } }
.step__n { font-family: var(--serif); font-size: 56px; font-weight: 300; font-style: italic; line-height: .9; color: var(--brand); }
.step__n::before { content: counter(step, decimal-leading-zero); }
.step h3 { font-size: clamp(24px, 2.4vw, 34px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; }
.step h3 em { font-style: italic; font-weight: 400; color: var(--brand-ink); }
.step p, .step li { font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.step p { margin-top: 10px; }
.step ul, .step ol { margin: 10px 0 0 20px; display: grid; gap: 6px; }
.step a:not(.btn) { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }

/* Comparison table (vs pages) */
.vs { width: 100%; border-collapse: collapse; font-size: 15px; }
.vs th, .vs td { padding: 14px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.vs thead th { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--ink); }
.vs thead th.is-us { color: var(--brand-ink); }
.vs tbody th { font-family: var(--serif); font-weight: 500; font-size: 16px; color: var(--ink); width: 28%; }
.vs td { color: var(--ink-2); line-height: 1.5; }
.vs td.is-us { background: color-mix(in srgb, var(--brand-wash) 55%, transparent); color: var(--ink); }
@media (max-width: 720px) { .vs-wrap { overflow-x: auto; } .vs { min-width: 640px; } }

@media print { .masthead, .drawer, .colophon, .final, .pp-rail { display: none !important; } }

/* Grid children never force the page wider than the screen */
.pp-hero__grid > *, .chapter__split > *, .pp-body > *, .faq-group > *, .step > * { min-width: 0; }
.sheet { max-width: 100%; }
@media (max-width: 560px) {
    .ledger { font-size: 12.5px; }
    .ledger th, .ledger td { padding-left: 4px; padding-right: 4px; }
    .ledger .desc { font-size: 11px; letter-spacing: 0; word-break: break-word; }
    .sheet__head, .sheet__body, .sheet__foot { padding-left: 14px; padding-right: 14px; }
    .conf { font-size: 10px; }
}
.section-head + .xsell { border-top: 0; }
@media (max-width: 480px) { .chapter__num::after { display: none; } }
@media (max-width: 520px) { .masthead #language-selector { display: none; } }
/* The masthead's backdrop-filter makes it the containing block for the language selector's
   position:fixed dropdown. Closed, it had no right offset and sat past the page edge; anchor it
   to the right (the script sets top/right inline when it opens). */
.masthead #language-selector .lang-dropdown { right: 0; }
/* Laptop widths: the full product nav and the wordmark collide. Drop the "by ReconcileIQ" tag and the
   suite link (both stay in the drawer and footer) and tighten the gaps. */
@media (min-width: 1180px) and (max-width: 1535px) {
    .masthead .mark__by { display: none; }
    .masthead__nav a[href="/suite"] { display: none; }
    .masthead__nav { gap: 16px; font-size: 13px; }
}
/* JetBrains Mono is loaded at 400 and 500 only: a 600 total would be synthetic bold and smear. */
.ledger tr.total .num { font-weight: 500; }
