/* askan.ai — single stylesheet, no build step.
   System font stack, fluid sizing, automatic dark mode, WCAG-AA contrast. */

:root {
    /* Brand: petrol/deep-cyan primary (breaks from the overused AI-indigo), amber = "checked".
       The brand dot is always the accent colour. See docs/brand.md. */
    --bg: #ffffff;
    --bg-soft: #f5f7fa;
    --text: #0b1b2b;
    --text-soft: #51607a;
    --accent: #0e7490;          /* petrol — 5.36:1 on white (AA text) */
    --accent-strong: #0b5a6e;   /* hover */
    --accent-contrast: #ffffff;
    --border: #e2e8f0;
    --danger-bg: #fdecec;
    --danger-text: #8f1d1d;
    --notice-bg: #ecfbfe;
    --focus: #0e7490;
    --brand-dot: var(--accent);
    --amber: #f59e0b;           /* graphic-only accent */
    --amber-text: #92400e;      /* AA on white/amber-tint */
    --amber-bg: #fef3c7;
    --radius: 12px;
    --max-width: 46rem;

    /* Spacing scale (4px base) — use these instead of ad-hoc rem values. */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;

    /* Type scale */
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.05rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1220;
        --bg-soft: #111c2e;
        --text: #e7ecf2;
        --text-soft: #a7b0c0;
        --accent: #22d3ee;          /* bright cyan — 10.4:1 on dark */
        --accent-strong: #67e8f9;
        --accent-contrast: #06232b; /* dark ink on cyan buttons */
        --border: #1e2a3d;
        --danger-bg: #3a1d1d;
        --danger-text: #f3b8b8;
        --notice-bg: #10222e;
        --focus: #22d3ee;
        --amber: #f59e0b;
        --amber-text: #fbbf24;
        --amber-bg: #2a2410;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
}

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}
main:focus { outline: none; } /* programmatic focus target (skip link), no visible ring */

a { color: var(--accent); }
a:hover { color: var(--accent-strong); }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: var(--accent-contrast);
    padding: .5rem 1rem;
    z-index: 10;
}
.skip-link:focus { left: 0; }

/* Header / footer */
.site-header nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.site-header ul { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; }
.site-header a { text-decoration: none; font-weight: 500; }
.brand { font-size: 1.3rem; }

/* --- Wordmark --- */
.wm-lockup { display: inline-flex; align-items: center; gap: .5rem; vertical-align: middle; }
.wm-mark { flex: 0 0 auto; border-radius: 7px; display: block; }
.wm {
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
    line-height: 1;
    white-space: nowrap;
}
.wm .wm-an { font-weight: 700; }              /* uniform by default; hero bumps it (see .hero-wm) */
.wm-dot {
    display: inline-block;
    width: .2em;
    height: .2em;
    border-radius: 50%;
    background: var(--brand-dot);
    margin: 0 .05em 0 .04em;
    vertical-align: baseline;
}
.footer-brand .wm { font-size: 1rem; color: var(--text-soft); }
.footer-brand .wm-dot { background: var(--accent); }

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding: 1.5rem 1rem 2.5rem;
    max-width: var(--max-width);
    margin-inline: auto;
    color: var(--text-soft);
    font-size: .875rem;
}
.site-footer ul { list-style: none; display: flex; gap: 1.25rem; padding: 0; }

/* Hero + form */
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.2; margin: 1rem 0 .5rem; }
.accent { color: var(--accent); }
.lede { color: var(--text-soft); font-size: 1.05rem; margin-bottom: 1.5rem; }

.ask-form { margin-top: 1rem; }
.ask-label { display: block; font-weight: 600; margin-bottom: .4rem; }

textarea#question {
    width: 100%;
    padding: .85rem 1rem;
    font: inherit;
    color: var(--text);
    background: var(--bg-soft);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 6rem;
}
textarea#question:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .6rem;
    flex-wrap: wrap;
}
.form-row small { color: var(--text-soft); }

.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-contrast);
    border: none;
    font: inherit;
    font-weight: 600;
    padding: .7rem 1.6rem;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); color: var(--accent-contrast); }
.btn-primary:disabled { opacity: .6; cursor: progress; }

/* Honeypot — visually removed, still in DOM for bots */
.hp-wrap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* Status / answers */
.ask-status:empty { display: none; }
.ask-status { margin-top: 1rem; color: var(--text-soft); }
.ask-status.error { background: var(--danger-bg); color: var(--danger-text); padding: .8rem 1rem; border-radius: var(--radius); }

.answer-card {
    margin-top: 1.5rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.answer-body { overflow-wrap: break-word; }
.answer-body pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .8rem 1rem;
    overflow-x: auto;
}
.answer-body table { border-collapse: collapse; display: block; overflow-x: auto; }
.answer-body th, .answer-body td { border: 1px solid var(--border); padding: .4rem .7rem; }

.ai-notice {
    margin-top: 1.25rem;
    background: var(--notice-bg);
    border-radius: var(--radius);
    padding: .8rem 1rem;
    font-size: .85rem;
    color: var(--text-soft);
}

.alert {
    background: var(--danger-bg);
    color: var(--danger-text);
    padding: .9rem 1.1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.asked-question {
    margin: .5rem 0 1rem;
    padding: .8rem 1.1rem;
    border-left: 4px solid var(--accent);
    background: var(--bg-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}

/* Article page */
.qa-article h1 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); line-height: 1.25; }
.breadcrumb { font-size: .85rem; color: var(--text-soft); margin-top: .5rem; }
.article-meta { color: var(--text-soft); font-size: .875rem; }
.related ul { padding-left: 1.2rem; }
.cta-box {
    margin-top: 2.5rem;
    text-align: center;
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.cta-box h2 { margin-top: 0; }

/* Lists */
.article-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.article-list li {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    background: var(--bg-soft);
}
.article-list a { font-weight: 600; text-decoration: none; font-size: 1.05rem; }
.article-list p { margin: .4rem 0 0; color: var(--text-soft); font-size: .9rem; }
.more-link { font-weight: 600; }

.pagination { display: flex; gap: 1.5rem; justify-content: center; margin-top: 2rem; }

.legal h1 { font-size: 1.7rem; }
.legal h2 { font-size: 1.15rem; margin-top: 1.75rem; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* --- Example chips + how-it-works (home) --- */
.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    margin-top: var(--space-4);
}
.chips-label { color: var(--text-soft); font-size: var(--text-sm); }
.chip {
    font: inherit;
    font-size: var(--text-sm);
    color: var(--text);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    min-height: 40px;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s ease, background .15s ease;
}
.chip:hover { border-color: var(--accent); background: var(--notice-bg); }

.how-it-works { margin-top: var(--space-8); }
.steps { padding-left: 1.2rem; display: grid; gap: var(--space-2); }
.steps li { color: var(--text-soft); }
.steps strong { color: var(--text); }

/* --- Search --- */
.search-form { margin: var(--space-4) 0 var(--space-5); }
.search-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.search-row input[type="search"] {
    flex: 1 1 14rem;
    padding: 0.7rem 1rem;
    font: inherit;
    color: var(--text);
    background: var(--bg-soft);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
}
.search-row input[type="search"]:focus { border-color: var(--accent); outline: none; }
.empty { color: var(--text-soft); }

/* --- Accessible field error --- */
.field-error {
    color: var(--danger-text);
    background: var(--danger-bg);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    margin: var(--space-2) 0 0;
    font-size: var(--text-sm);
}
textarea[aria-invalid="true"] { border-color: var(--danger-text); }

/* --- Nav wrap + touch targets (small screens / WCAG 2.5.8) --- */
.site-header nav { flex-wrap: wrap; }
.site-header ul { flex-wrap: wrap; }
.site-header a, .site-footer a { display: inline-block; padding: 4px 0; min-height: 24px; }

/* --- Article typography --- */
.answer-body > :first-child { margin-top: 0; }
.answer-body h2 { font-size: 1.3rem; margin-top: var(--space-5); }
.answer-body h3 { font-size: 1.1rem; margin-top: var(--space-4); }
.answer-body p { margin: var(--space-3) 0; }
.answer-body ul, .answer-body ol { padding-left: 1.4rem; }
.answer-body li { margin: var(--space-1) 0; }
.answer-body blockquote {
    margin: var(--space-4) 0;
    padding: var(--space-2) var(--space-4);
    border-left: 4px solid var(--accent);
    background: var(--bg-soft);
    color: var(--text-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.answer-body code {
    background: var(--bg-soft);
    padding: 0.1em 0.35em;
    border-radius: 5px;
    font-size: 0.9em;
}
.answer-body pre code { background: none; padding: 0; }
.answer-body a { text-decoration: underline; }

/* --- Brand: verified/checked seal (reinforces the quality-gated USP) --- */
.verified-seal {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--amber-text);
    background: var(--amber-bg);
    border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
    padding: .3rem .7rem;
    border-radius: 999px;
    line-height: 1;
}
.verified-seal svg { flex: 0 0 auto; }
.article-meta .verified-seal { vertical-align: middle; }

/* Hero wordmark option: reveal the "ask · an · ai" wordplay with a subtle weight bump */
.hero-wm .wm-an { font-weight: 800; }

/* Imprint/privacy address rendered as an image (anti-crawl) */
.imprint-address { display: block; max-width: 100%; height: auto; margin: var(--space-2) 0; }
