/* Public resource pages: Learn articles, encoder guides, glossary and tools.
   Shares the dashboard's theme variables so a visitor who has chosen light
   mode anywhere on the site keeps it here. */

.res { min-height: 100vh; background: var(--dash-bg); color: var(--dash-text); overflow-x: hidden; }
.res-nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--dash-bg) 90%, transparent);
    backdrop-filter: blur(14px); border-bottom: 1px solid var(--dash-border); }
.res-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.res-main { padding-top: 3rem; padding-bottom: 5rem; }
.res-breadcrumb { margin: 0 0 2.5rem; color: var(--dash-text-secondary); font-size: .875rem; }
.res-breadcrumb a:hover { color: #ef4444; }
.res-card { background: var(--dash-surface); border: 1px solid var(--dash-border); border-radius: 14px; }
.res-card:hover { border-color: rgba(239,68,68,.5); }
.res-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #ef4444; }

/* ---- section index ---- */
.res-hero { max-width: 46rem; margin: 0 0 3.5rem; }
.res-hero h1 { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 2.6rem;
    line-height: 1.05; margin: 1rem 0 1.15rem; }
.res-hero p { font-size: 1.1rem; color: var(--dash-text-secondary); line-height: 1.65; }
.res-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(1, minmax(0,1fr)); }
@media (min-width: 640px) { .res-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .res-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.res-grid a { display: block; padding: 1.35rem; transition: transform .15s, border-color .15s; }
.res-grid a:hover { transform: translateY(-2px); }
.res-grid h3 { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 600; font-size: 1.05rem;
    margin: .5rem 0 .5rem; }
.res-grid p { font-size: .875rem; color: var(--dash-text-secondary); line-height: 1.6; }

/* ---- article ---- */
.res-article { display: grid; grid-template-columns: minmax(0,1fr) 190px; gap: 40px; }
.res-article > article { min-width: 0; }
.article-head { margin: 0 0 2.5rem; }
.article-head h1 { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 2.5rem;
    line-height: 1.06; margin: 1rem 0 1.25rem; }
.article-head-desc { font-size: 1.125rem; color: var(--dash-text-secondary); line-height: 1.6; margin: 0; }
.article-head-meta { margin-top: 1.15rem; font-size: .8125rem; color: var(--dash-text-muted); }
.res-prose { max-width: 74ch; }
/* The guided-tour band, in the article column and under a hub grid. Full
   column width, so it lines up with the trial pitch that follows it. */
.article-tour { margin: 3.5rem 0 0; }
.index-tour { margin: 3.5rem 0 0; }
.res-prose h2 { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.55rem; font-weight: 700;
    margin: 3rem 0 1.1rem; scroll-margin-top: 5rem; }
.res-prose h3 { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.1rem; font-weight: 700;
    margin: 2rem 0 .7rem; scroll-margin-top: 5rem; }
.res-prose p, .res-prose li { color: var(--dash-text-secondary); line-height: 1.78; }
.res-prose p, .res-prose ul, .res-prose ol { margin-bottom: 1.15rem; }
.res-prose ul, .res-prose ol { padding-left: 1.4rem; }
.res-prose ul li { list-style: disc; }
.res-prose ol li { list-style: decimal; }
.res-prose li { margin-bottom: .35rem; }
.res-prose strong { color: var(--dash-text); font-weight: 600; }
.res-prose a { color: #ef4444; text-decoration: underline; text-underline-offset: 2px; }
.res-prose code { background: var(--dash-surface-light); padding: .12rem .35rem; border-radius: 6px;
    font-size: .9em; word-break: break-word; }
.res-prose blockquote { border-left: 3px solid #ef4444; background: var(--dash-surface);
    border-radius: 0 10px 10px 0; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }

.table-scroll { overflow-x: auto; margin: 0 0 1.6rem; border: 1px solid var(--dash-border); border-radius: 12px; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table-scroll th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
    font-weight: 700; color: var(--dash-text-muted); padding: 11px 14px; background: var(--dash-surface);
    border-bottom: 1px solid var(--dash-border); white-space: nowrap; }
.table-scroll td { padding: 11px 14px; border-bottom: 1px solid var(--dash-border);
    color: var(--dash-text-secondary); vertical-align: top; line-height: 1.55; }
.table-scroll tr:last-child td { border-bottom: 0; }
.table-scroll td:first-child { color: var(--dash-text); }

.res-toc { font-size: .8125rem; }
.res-toc h4 { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
    color: var(--dash-text-muted); margin: 0 0 .85rem; }
.res-toc a { display: block; border-left: 2px solid var(--dash-border); padding: 5px 0 5px 11px;
    color: var(--dash-text-secondary); }
.res-toc a:hover, .res-toc a.active { color: #ef4444; border-left-color: #ef4444; }

.res-cta { margin: 3.5rem 0 0; padding: 1.75rem; border-radius: 14px; border: 1px solid rgba(239,68,68,.35);
    background: linear-gradient(135deg, rgba(239,68,68,.10), rgba(239,68,68,.02)); }
.res-cta h2 { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.2rem; font-weight: 700; margin: 0 0 .5rem; }
.res-cta p { color: var(--dash-text-secondary); font-size: .925rem; margin: 0 0 1.1rem; line-height: 1.6; }
.res-btn { display: inline-block; background: linear-gradient(90deg, #ef4444, #dc2626); color: #fff;
    border-radius: 10px; padding: .65rem 1.15rem; font-size: .875rem; font-weight: 600; }
.res-btn:hover { filter: brightness(1.07); }

.res-related { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--dash-border); }
.res-related h2 { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.2rem; font-weight: 700; margin: 0 0 1.25rem; }
.res-related-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .res-related-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---- glossary ---- */
.gloss-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 3rem; }
.gloss-jump a { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
    padding: 0 8px; border: 1px solid var(--dash-border); border-radius: 9px; font-size: .8125rem;
    font-weight: 600; color: var(--dash-text-secondary); }
.gloss-jump a:hover { border-color: #ef4444; color: #ef4444; }
.gloss-letter { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.9rem; font-weight: 700;
    color: #ef4444; margin: 2.75rem 0 1.1rem; scroll-margin-top: 5rem; }
.gloss-list { display: grid; gap: 1.1rem; }
.gloss-term { border-bottom: 1px solid var(--dash-border); padding-bottom: 1.1rem; scroll-margin-top: 5rem; }
.gloss-term dt { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 1rem;
    color: var(--dash-text); margin-bottom: .35rem; }
.gloss-term dd { color: var(--dash-text-secondary); line-height: 1.7; font-size: .9375rem; margin: 0; }

/* ---- tools ---- */
.tool-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; align-items: start;
    margin: 0 0 3rem; }
@media (max-width: 860px) { .tool-panel { grid-template-columns: 1fr; } }
.tool-inputs { display: grid; gap: 1.1rem; padding: 1.6rem; }
.tool-inputs label { display: grid; gap: .4rem; font-size: .8125rem; font-weight: 600; color: var(--dash-text); }
.tool-inputs small { font-weight: 400; color: var(--dash-text-muted); font-size: .75rem; line-height: 1.5; }
.tool-inputs input, .tool-inputs select { border: 1px solid var(--dash-border); border-radius: 10px;
    background: var(--dash-bg); color: var(--dash-text); padding: .6rem .75rem; font-size: .9375rem; width: 100%; }
.tool-inputs input:focus, .tool-inputs select:focus { outline: 2px solid rgba(239,68,68,.45); outline-offset: 1px; }
.tool-out { padding: 1.6rem; position: sticky; top: 5.5rem; }
.tool-out h2 { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: .72rem; text-transform: uppercase;
    letter-spacing: .09em; color: var(--dash-text-muted); margin: 0 0 1.25rem; font-weight: 700; }
.tool-headline { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 700; font-size: 2.4rem;
    line-height: 1.05; color: var(--dash-text); }
.tool-headline span { font-size: 1.1rem; color: var(--dash-text-secondary); font-weight: 500; }
.tool-sub { color: var(--dash-text-secondary); font-size: .9375rem; margin-top: .6rem; line-height: 1.6; }
.tool-rows { margin-top: 1.5rem; display: grid; gap: .7rem; border-top: 1px solid var(--dash-border); padding-top: 1.25rem; }
.tool-row { display: flex; justify-content: space-between; gap: 14px; font-size: .875rem; }
.tool-row span { color: var(--dash-text-secondary); }
.tool-row b { color: var(--dash-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tool-note { margin-top: 1.25rem; padding: .85rem 1rem; border-radius: 10px; font-size: .8125rem; line-height: 1.55;
    border: 1px solid var(--dash-border); color: var(--dash-text-secondary); }
.tool-note.ok { border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.08); }
.tool-note.warn { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.08); }

@media (max-width: 1050px) { .res-article { display: block; } .res-toc { display: none; } }
@media (max-width: 640px) {
    .res-wrap { padding: 0 16px; }
    .res-hero h1, .article-head h1 { font-size: 2rem; line-height: 1.12; }
    .res-main { padding-top: 2rem; }
    .tool-headline { font-size: 2rem; }
    .tool-out { position: static; }
}
