/* ==========================================================================
   TraceHunt — public stylesheet
   Hand-written, single-file, system-font stack for fast Core Web Vitals.
   ========================================================================== */

:root {
    /* Light sky-blue theme */
    --bg: #f2f8ff;
    --bg-2: #e6f2fd;
    --surface: #ffffff;
    --surface-2: #eef6ff;
    --border: #d3e5f7;
    --text: #0f2a43;
    --muted: #4c6580;
    --muted-2: #7089a3;
    --brand: #1d9bf0;
    --brand-2: #0b7fd4;
    --accent: #38bdf8;
    --danger: #e5484d;
    --warn: #e8890c;
    --good: #16a34a;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 12px 34px rgba(13, 71, 120, 0.12);
    --maxw: 1140px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
h3 { font-size: 1.28rem; }
p { margin: 0 0 1rem; }
::selection { background: var(--brand); color: #ffffff; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 1.18rem; color: var(--muted); max-width: 60ch; }
.eyebrow {
    display: inline-block; text-transform: uppercase; letter-spacing: .14em;
    font-size: .74rem; font-weight: 700; color: var(--brand);
    background: rgba(29, 155, 240, .1); padding: 6px 12px; border-radius: 100px;
    margin-bottom: 18px; border: 1px solid rgba(29, 155, 240, .2);
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 999; background: var(--brand); color: #ffffff; padding: 10px 16px; border-radius: 8px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: .55em; cursor: pointer;
    font-weight: 700; font-size: 1rem; padding: 13px 24px; border-radius: 100px;
    border: 1px solid transparent; transition: transform .12s, background .15s, box-shadow .15s;
    text-align: center; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #ffffff; box-shadow: 0 8px 24px rgba(29, 155, 240, .28); }
.btn--primary:hover { color: #ffffff; box-shadow: 0 10px 30px rgba(29, 155, 240, .42); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--lg { padding: 16px 30px; font-size: 1.06rem; }
.btn--block { width: 100%; justify-content: center; }
.btn--danger { background: var(--danger); color: #fff; }

/* ---- Header ---- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .85); backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.18rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand svg { flex: none; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: .96rem; }
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text); width: 42px; height: 40px; cursor: pointer; }
.nav-toggle svg { margin: auto; }

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .nav-links, .nav-cta .btn--ghost { display: none; }
    .nav-menu { position: fixed; inset: 68px 0 auto 0; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 16px 20px; flex-direction: column; align-items: stretch; gap: 6px; box-shadow: var(--shadow); }
    .nav-menu.open { display: flex; }
    .nav-menu:not(.open) { display: none; }
    .nav-menu a { padding: 12px 14px; }
}
@media (min-width: 901px) { .nav-menu { display: flex !important; } }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; padding: 84px 0 64px; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(60% 55% at 78% 8%, rgba(56, 189, 248, .18), transparent 60%),
        radial-gradient(55% 60% at 12% 4%, rgba(29, 155, 240, .18), transparent 55%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 34px; } }
.hero h1 span { background: linear-gradient(120deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 30px; color: var(--muted-2); font-size: .9rem; }
.trust-row span { display: inline-flex; align-items: center; gap: 7px; }

/* ---- Checker widget ---- */
.checker-card {
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px; box-shadow: var(--shadow);
}
.checker-card h2 { font-size: 1.3rem; }
.checker-form { display: flex; gap: 10px; margin-top: 14px; }
@media (max-width: 520px) { .checker-form { flex-direction: column; } }
.input, .textarea, .select {
    width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
    padding: 14px 16px; border-radius: var(--radius-sm); font-size: 1rem; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 155, 240, .16); }
.textarea { resize: vertical; min-height: 120px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; font-size: .95rem; }
.field .hint { font-size: .84rem; color: var(--muted-2); margin-top: 5px; }
.field-error { color: var(--danger); font-size: .86rem; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; color: var(--muted); }
.checkbox input { margin-top: 4px; }

/* ---- Cards & grids ---- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .cards, .cards--4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .cards, .cards--2, .cards--4 { grid-template-columns: 1fr; } }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px; transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); border-color: rgba(29, 155, 240, .4); }
.card .icon {
    width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(29, 155, 240, .12); color: var(--brand); margin-bottom: 16px;
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); margin: 0; font-size: .98rem; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.stat .num { font-size: 2.1rem; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }
.stat .label { color: var(--muted); font-size: .92rem; margin-top: 4px; }

/* ---- Steps ---- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #ffffff; font-weight: 800; display: grid; place-items: center; margin-bottom: 14px; }
.step h3 { font-size: 1.08rem; }
.step p { color: var(--muted); font-size: .94rem; margin: 0; }

/* ---- Risk result ---- */
.result { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; margin-top: 24px; background: var(--surface); }
.result-head { padding: 26px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.gauge { --p: 0; width: 116px; height: 116px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative;
    background: conic-gradient(var(--gauge-color) calc(var(--p) * 1%), var(--surface-2) 0); }
.gauge::after { content: ""; position: absolute; inset: 10px; background: var(--surface); border-radius: 50%; }
.gauge .g-val { position: relative; z-index: 1; text-align: center; }
.gauge .g-num { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.gauge .g-cap { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.verdict-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 100px; font-weight: 800; font-size: .95rem; text-transform: capitalize; }
.v-safe { background: rgba(29, 155, 240, .16); color: var(--good); }
.v-caution { background: rgba(255, 176, 32, .16); color: var(--warn); }
.v-high-risk { background: rgba(255, 92, 108, .14); color: var(--danger); }
.v-dangerous { background: rgba(255, 92, 108, .22); color: #ff8892; }
.v-unknown { background: var(--surface-2); color: var(--muted); }
.signals { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.signals li { display: flex; gap: 14px; padding: 16px 26px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.signals li:last-child { border-bottom: 0; }
.sig-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; flex: none; }
.sig-bad .sig-dot { background: var(--danger); }
.sig-warn .sig-dot { background: var(--warn); }
.sig-good .sig-dot { background: var(--good); }
.sig-neutral .sig-dot { background: var(--muted-2); }
.sig-body strong { display: block; font-size: 1rem; }
.sig-body span { color: var(--muted); font-size: .92rem; }
.sig-weight { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted-2); font-size: .85rem; font-weight: 700; }

/* ---- Alert / notice ---- */
.notice { border-radius: var(--radius); padding: 16px 20px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 20px; display: flex; gap: 12px; }
.notice--success { border-color: rgba(29, 155, 240, .4); background: rgba(29, 155, 240, .08); }
.notice--warn { border-color: rgba(255, 176, 32, .4); background: rgba(255, 176, 32, .07); }
.notice--danger { border-color: rgba(255, 92, 108, .4); background: rgba(255, 92, 108, .08); }
.notice strong { color: var(--text); }

/* ---- Section header ---- */
.sec-head { max-width: 640px; margin: 0 auto 42px; text-align: center; }
.sec-head p { color: var(--muted); font-size: 1.08rem; }

/* ---- Split feature ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.split--reverse .split-media { order: 2; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split--reverse .split-media { order: 0; } }
.check-list { list-style: none; margin: 20px 0 0; padding: 0; }
.check-list li { padding: 9px 0 9px 32px; position: relative; color: var(--muted); }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 9px; color: var(--brand); font-weight: 800; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }

/* ---- FAQ ---- */
.faq { max-width: 800px; margin: 0 auto; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--surface); overflow: hidden; }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.5rem; font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { color: var(--brand); }
.faq .faq-body { padding: 0 22px 20px; color: var(--muted); }

/* ---- CTA band ---- */
.cta-band { background: linear-gradient(135deg, var(--surface), var(--surface-2)); border: 1px solid var(--border); border-radius: 20px; padding: 48px; text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 120% at 50% 0%, rgba(29, 155, 240, .16), transparent 60%); z-index: 0; }
.cta-band > * { position: relative; z-index: 1; }

/* ---- Blog ---- */
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .15s, border-color .15s; }
.post-card:hover { transform: translateY(-3px); border-color: rgba(29, 155, 240, .4); }
.post-card .thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); display: grid; place-items: center; color: var(--muted-2); font-weight: 700; }
.post-card .p-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.post-card .p-cat { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); font-weight: 700; }
.post-card h3 { margin: 8px 0; font-size: 1.15rem; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--brand); }
.post-card .p-meta { margin-top: auto; padding-top: 14px; color: var(--muted-2); font-size: .84rem; display: flex; gap: 14px; }
.tag { display: inline-block; padding: 5px 12px; border-radius: 100px; background: var(--surface-2); color: var(--muted); font-size: .82rem; font-weight: 600; border: 1px solid var(--border); }
.tag:hover { color: var(--brand); border-color: var(--brand); }

/* ---- Article ---- */
.article { max-width: 760px; margin: 0 auto; }
.article-body { font-size: 1.08rem; }
.article-body h2 { margin-top: 1.8em; }
.article-body h3 { margin-top: 1.4em; }
.article-body ul, .article-body ol { padding-left: 1.4em; color: var(--muted); }
.article-body li { margin-bottom: .5em; }
.article-body blockquote { border-left: 3px solid var(--brand); margin: 1.5em 0; padding: .4em 1.2em; color: var(--muted); background: var(--surface); border-radius: 0 8px 8px 0; }
.article-body a { text-decoration: underline; }
.article-body code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: .9em; }
.article-body img { border-radius: var(--radius); margin: 1.5em 0; }

/* ---- Breadcrumbs ---- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted-2); font-size: .88rem; margin-bottom: 22px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; min-width: 560px; }
table.data th, table.data td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: .94rem; }
table.data th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface); }

/* ---- Pagination ---- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; list-style: none; padding: 0; margin: 40px 0 0; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); font-weight: 600; }
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .active span { background: var(--brand); color: #ffffff; border-color: var(--brand); }
.pagination .disabled span { opacity: .4; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: var(--muted); font-size: .95rem; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 40px; padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted-2); font-size: .86rem; }
.footer-disclaimer { color: var(--muted-2); font-size: .84rem; margin-top: 14px; max-width: 42ch; }

/* ---- Misc ---- */
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mt-3 { margin-top: 36px; }
.mb-0 { margin-bottom: 0; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.text-danger { color: var(--danger); } .text-good { color: var(--good); } .text-warn { color: var(--warn); }
