/* ForgeStarter Tools - mobile-first, no libraries, Core Web Vitals friendly */

:root {
    --bg: #f6f4f1;
    --surface: #ffffff;
    --surface-2: #f0ece7;
    --ink: #1c1a17;
    --muted: #5f584f;
    --line: #e2dcd3;
    --line-strong: #cfc7ba;
    --brand: #c8471c;
    --brand-ink: #a5380f;
    --brand-soft: #fdeee6;
    --ok: #2f7d43;
    --ok-soft: #e7f4ea;
    --warn: #9a6a00;
    --warn-soft: #fdf1d8;
    --danger: #b3261e;
    --danger-soft: #fbe6e4;
    --ink-dark: #12100e;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(20, 16, 12, .06), 0 6px 20px rgba(20, 16, 12, .05);
    --maxw: 1080px;
    --content: 820px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.62;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }

h1, h2, h3 { line-height: 1.2; font-weight: 750; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.5rem); margin: .2em 0 .5em; }
h2 { font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.6rem); margin: 2em 0 .6em; }
h3 { font-size: 1.12rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 28px); }

.skip-link {
    position: absolute; left: -9999px; top: 0; background: var(--ink-dark); color: #fff;
    padding: .6rem 1rem; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header { background: var(--ink-dark); color: #f4efe9; position: sticky; top: 0; z-index: 40; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand:hover { color: #fff; }
.brand__mark { color: var(--brand); display: inline-flex; }
.brand__text { font-size: 1.12rem; }

.site-nav__list { list-style: none; display: flex; gap: .3rem; margin: 0; padding: 0; }
.site-nav__list a {
    display: inline-block; padding: .5rem .7rem; color: #d9d2c8; text-decoration: none; border-radius: 8px; font-weight: 600; font-size: .97rem;
}
.site-nav__list a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-nav__list a[aria-current="page"] { color: #fff; background: rgba(200,71,28,.25); }
.nav-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; padding: .45rem .7rem; border-radius: 8px; font-size: .95rem; cursor: pointer; }

@media (max-width: 720px) {
    .nav-toggle { display: inline-block; }
    .site-nav { position: relative; }
    .site-nav__list {
        display: none; position: absolute; right: 0; top: calc(100% + 10px); background: #1d1a16;
        flex-direction: column; padding: .4rem; border-radius: 10px; min-width: 190px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.08);
    }
    .site-nav__list.open { display: flex; }
    .site-nav__list a { padding: .6rem .8rem; }
}

/* ---------- Main layout ---------- */
main.wrap { padding-top: 1.6rem; padding-bottom: 2.5rem; max-width: 900px; }
main.has-sidebar { max-width: 1160px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.2rem; align-items: start; }
.content { max-width: var(--content); }
main.has-sidebar .content { max-width: none; }
.sidebar { position: sticky; top: 84px; }
@media (max-width: 900px) { main.has-sidebar { grid-template-columns: 1fr; } .sidebar { position: static; } }

article.page { min-width: 0; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .85rem; color: var(--muted); margin: 0 0 .4rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .3rem; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- Quick answer ---------- */
.quick-answer {
    background: var(--brand-soft); border: 1px solid #f3d6c6; border-left: 4px solid var(--brand);
    border-radius: var(--radius-sm); padding: 1rem 1.15rem; margin: 0 0 1.5rem;
}
.quick-answer__label { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 800; color: var(--brand-ink); margin: 0 0 .3rem; }
.quick-answer__body p:last-child { margin-bottom: 0; }

/* ---------- Callouts ---------- */
.callout { border-radius: var(--radius-sm); padding: .95rem 1.1rem; margin: 1.4rem 0; border: 1px solid var(--line); background: var(--surface-2); }
.callout__title { font-weight: 750; margin: 0 0 .35rem; }
.callout__body p:last-child, .callout__body ul:last-child { margin-bottom: 0; }
.callout ul { margin: .3rem 0; padding-left: 1.15rem; }
.callout li { margin: .2rem 0; }
.callout--note { background: var(--surface-2); border-color: var(--line-strong); }
.callout--warning { background: var(--warn-soft); border-color: #ecd396; }
.callout--warning .callout__title { color: var(--warn); }
.callout--danger { background: var(--danger-soft); border-color: #f0b7b2; }
.callout--danger .callout__title { color: var(--danger); }

/* ---------- Prose ---------- */
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }
.prose code, code { font-family: var(--mono); background: var(--surface-2); padding: .1em .35em; border-radius: 5px; font-size: .9em; }

/* ---------- Tool layout ---------- */
.tool-layout { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 1.4rem; margin: 1.5rem 0; align-items: start; }
@media (max-width: 680px) { .tool-layout { grid-template-columns: 1fr; } }

.tool-form, .tool-result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.2rem; box-shadow: var(--shadow); }
.tool-form__h, .tool-result__h { margin: 0 0 .9rem; font-size: 1.05rem; }
.tool-result { background: linear-gradient(180deg, #fff, #fbf8f4); }

.field { margin-bottom: 1rem; }
.field label, .label-text { display: block; font-weight: 650; font-size: .93rem; margin-bottom: .35rem; }
.field input[type="number"], .field input[type="search"], .field select, .search-row input {
    width: 100%; padding: .6rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.preset-select { margin-top: .5rem; }
.field-hint { display: block; font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.field-error { display: block; font-size: .82rem; color: var(--danger); margin-top: .3rem; font-weight: 600; }
.field--err input, .field--err select { border-color: var(--danger); }

.radio-row, .radio-col { display: flex; gap: .5rem .9rem; flex-wrap: wrap; margin-top: .1rem; }
.radio-col { flex-direction: column; gap: .35rem; }
.radio, .check { font-weight: 500; font-size: .95rem; display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.check { margin-top: .6rem; }

.btn {
    display: inline-flex; align-items: center; gap: .4rem; justify-content: center; font-family: inherit;
    font-weight: 700; font-size: 1rem; border-radius: var(--radius-sm); padding: .7rem 1.1rem; cursor: pointer;
    text-decoration: none; border: 1px solid transparent; transition: background .15s, transform .05s;
}
.btn--calc { background: var(--brand); color: #fff; width: 100%; margin-top: .3rem; }
.btn--calc:hover { background: var(--brand-ink); color: #fff; }
.btn--calc:active { transform: translateY(1px); }
.btn--tool { background: var(--ink-dark); color: #fff; }
.btn--tool:hover { background: #2a2620; color: #fff; }
.btn--buy { background: #fff; color: var(--brand-ink); border-color: var(--brand); font-size: .9rem; padding: .5rem .8rem; }
.btn--buy:hover { background: var(--brand-soft); }
.tool-cta { margin: 1.3rem 0; }

/* ---------- Result panel ---------- */
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.result-grid--two { grid-template-columns: repeat(2, 1fr); }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: .7rem .8rem; }
.stat__big { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--brand-ink); line-height: 1.15; }
.stat__small { display: block; font-size: .8rem; color: var(--muted); }
.result-note { font-size: .9rem; color: var(--muted); margin: .9rem 0 0; }
.result-empty { color: var(--muted); }

.verdict { margin-top: .9rem; padding: .8rem .9rem; border-radius: var(--radius-sm); font-size: .95rem; border: 1px solid var(--line); }
.verdict p { margin: 0; }
.verdict--ok { background: var(--ok-soft); border-color: #bfe0c6; }
.verdict--warn { background: var(--warn-soft); border-color: #ecd396; }
.verdict--note { background: var(--surface-2); }
.verdict--danger { background: var(--danger-soft); border-color: #f0b7b2; }

/* ---------- Visualisations ---------- */
.viz { margin: 1.6rem 0; }
.viz svg { width: 100%; height: auto; display: block; }
.viz figcaption, .table-caption { font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.viz-hist, .viz-sil { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }

.viz-bar { fill: #d9cfc2; }
.viz-bar--sel { fill: var(--brand); }
.viz-val { fill: var(--ink); font-size: 13px; font-weight: 700; font-family: var(--font); }
.viz-axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.viz-baseline { stroke: var(--line-strong); stroke-width: 1.5; }

.sil-person { fill: #c3b8a9; }
.sil-anvil { fill: #6f665b; }
.sil-anvil--sel { fill: var(--brand); }
.sil-label { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font); }
.sil-sub { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }

/* Labeled anvil diagram */
.viz-diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.diag-anvil { fill: #6f665b; }
.diag-hole { fill: var(--bg); stroke: var(--brand); stroke-width: 1.6; }
.diag-leader { stroke: var(--line-strong); stroke-width: 1; }
.diag-label { fill: var(--ink); font-size: 13px; font-weight: 700; font-family: var(--font); }

/* Vaporization scale */
.viz-vapor { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.1rem 1rem; }
.vapor-bar { position: relative; display: flex; height: 26px; border-radius: 6px; overflow: visible; margin-top: 1.4rem; }
.vapor-zone { height: 100%; }
.vapor-zone--ok { background: #3f9e57; border-radius: 6px 0 0 6px; }
.vapor-zone--warn { background: #e6b23a; }
.vapor-zone--bad { background: #cf4b3e; border-radius: 0 6px 6px 0; }
.vapor-marker { position: absolute; top: -6px; bottom: -6px; width: 3px; background: var(--ink-dark); transform: translateX(-50%); }
.vapor-marker::after { content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--ink-dark); }
.vapor-marker--over { background: var(--danger); }
.vapor-marker--over::after { border-top-color: var(--danger); }
.vapor-marker__flag { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .72rem; font-weight: 700; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); padding: .15rem .4rem; border-radius: 5px; text-align: center; line-height: 1.2; }
.vapor-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .5rem; }

/* Heat ribbon */
.viz-ribbon { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.4rem; }
.ribbon { position: relative; }
.ribbon-bar { position: relative; height: 34px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); }
.ribbon-band { position: absolute; top: -4px; bottom: -4px; border: 2.5px solid var(--ink-dark); border-radius: 5px; box-shadow: 0 0 0 2px rgba(255,255,255,.5) inset; }
.ribbon-ticks { position: relative; height: 1.4rem; margin-top: .3rem; }
.ribbon-tick { position: absolute; transform: translateX(-50%); font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
.table-heading { font-weight: 750; margin-bottom: .5rem; font-size: 1.05rem; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: none; }
tbody th { font-weight: 700; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: .4rem; vertical-align: -2px; border: 1px solid rgba(0,0,0,.15); }

/* ---------- Product cards ---------- */
.product-section { margin: 2rem 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.pcard__head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.pcard__icon { width: 38px; height: 38px; flex: none; color: var(--brand); }
.pcard__name { margin: 0; font-size: 1rem; line-height: 1.25; }
.pcard__dim { font-size: .82rem; color: var(--muted); margin: 0 0 .5rem; }
.pcard__specs { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .6rem; margin: 0 0 .6rem; font-size: .82rem; }
.pcard__specs div { display: flex; justify-content: space-between; gap: .4rem; border-bottom: 1px dotted var(--line); padding: .12rem 0; }
.pcard__specs dt { color: var(--muted); margin: 0; }
.pcard__specs dd { margin: 0; font-weight: 650; text-align: right; }
.pcard__notes { font-size: .85rem; color: var(--ink); margin: 0 0 .8rem; }
.pcard__foot { margin-top: auto; display: flex; flex-direction: column; gap: .5rem; }
.pcard__reviewed { font-size: .72rem; color: var(--muted); }

/* ---------- Card grids (tools / guides) ---------- */
.tool-grid, .guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin: 1.3rem 0; }
.tool-card, .guide-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .08s; }
.tool-card:hover, .guide-card:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--ink); }
.tool-card h3, .guide-card h3 { margin: 0 0 .35rem; font-size: 1.08rem; color: var(--brand-ink); }
.tool-card p, .guide-card p { margin: 0 0 .6rem; font-size: .9rem; color: var(--muted); }
.tool-card__go, .guide-card__go { font-size: .85rem; font-weight: 700; color: var(--brand); }

.home h1 { margin-top: .3rem; }
.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin: 1.5rem 0; }
@media (max-width: 620px) { .home-cols { grid-template-columns: 1fr; } }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list a { display: block; padding: .55rem 0; text-decoration: none; font-weight: 600; }
.section-lead { font-size: 1.05rem; color: var(--muted); margin-top: -.3rem; }

/* ---------- FAQ ---------- */
.faq { margin: 2rem 0; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .6rem; background: var(--surface); overflow: hidden; }
.faq-item summary { cursor: pointer; padding: .85rem 1rem; font-weight: 650; list-style: none; position: relative; padding-right: 2.4rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--brand); font-weight: 400; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-answer { padding: 0 1rem 1rem; }
.faq-answer p { margin: 0 0 .7rem; }
.faq-answer p:last-child { margin: 0; }

/* ---------- HowTo steps ---------- */
.howto { margin: 2rem 0; }
.howto-steps { counter-reset: step; list-style: none; padding: 0; margin: 1rem 0 0; }
.howto-steps li { counter-increment: step; position: relative; padding: .2rem 0 1rem 2.6rem; margin: 0; border-left: 2px solid var(--line); }
.howto-steps li:last-child { border-left-color: transparent; }
.howto-steps li::before { content: counter(step); position: absolute; left: -0.95rem; top: 0; width: 1.8rem; height: 1.8rem; background: var(--brand); color: #fff; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.howto-step__name { display: block; margin-bottom: .15rem; }

/* ---------- Related / verified ---------- */
.related { margin: 2rem 0 1rem; padding: 1.1rem 1.2rem; background: var(--surface-2); border-radius: var(--radius); }
.related h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.related__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.related__list a { font-weight: 650; text-decoration: none; }
.related__note { color: var(--muted); font-weight: 400; font-size: .85rem; }
.related--more { background: transparent; border: 1px solid var(--line); }
.related--more .related__list { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .related--more .related__list { grid-template-columns: 1fr; } }
.verified { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .9rem; margin-top: 2rem; }

/* ---------- Search ---------- */
.search-form { margin: 1.2rem 0 1.6rem; }
.search-row { display: flex; gap: .5rem; }
.search-row input { flex: 1; }
.search-row button { background: var(--brand); color: #fff; border: none; border-radius: var(--radius-sm); padding: 0 1.2rem; font-weight: 700; cursor: pointer; }
.search-count { color: var(--muted); }
.search-results { list-style: none; padding: 0; }
.search-results li { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.search-results a { font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.search-results p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- Ads ---------- */
.ad-slot { margin: 1.8rem 0; text-align: center; min-height: 0; }
.ad-label { display: block; font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; color: var(--line-strong); margin-bottom: .3rem; }
.sidebar .ad-slot { margin-top: 0; }

/* ---------- Doc pages ---------- */
.page--doc { max-width: 720px; }
.page--doc h2 { font-size: 1.3rem; }
.contact-email { font-size: 1.3rem; font-weight: 700; margin: 1rem 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-dark); color: #cabfb2; margin-top: 3rem; padding: 2.4rem 0 2rem; font-size: .92rem; }
.site-footer__cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1.6rem; }
@media (max-width: 720px) { .site-footer__cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .site-footer__cols { grid-template-columns: 1fr; } }
.site-footer__brand { font-weight: 800; color: #fff; font-size: 1.05rem; margin: 0 0 .2rem; }
.site-footer__tag { margin: 0; color: #9d9384; }
.site-footer__h { font-weight: 700; color: #fff; margin: 0 0 .5rem; font-size: .95rem; }
.site-footer__col ul { list-style: none; padding: 0; margin: 0; }
.site-footer__col li { margin: .3rem 0; }
.site-footer__col a { color: #cabfb2; text-decoration: none; }
.site-footer__col a:hover { color: #fff; }
.site-footer__legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 1.8rem; padding-top: 1.2rem; font-size: .82rem; color: #9d9384; }
.site-footer__legal a { color: #cabfb2; }
.site-footer__copy { margin-top: .8rem; }

/* ---------- Focus visibility ---------- */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

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