/* ---------------------------------------------------------------------------
   Help / field guide.  The same cream paper and ink as the start page
   (css/home.css) and the 3D HUD (css/paper.css), set for long reading.
   --------------------------------------------------------------------------- */

:root {
    --paper: #FFFDF8;
    --canvas: #F5F1E8;
    --sand: #EDE8DC;
    --hairline: #E3DDD0;
    --ink: #12233F;
    --ink-soft: #3a4a63;
    --slate: #6B7280;
    --signal: #F2622E;
    --signal-dark: #C9491A;
    --green-800: #0b3d2c;
    --green-950: #04180f;
    --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --sans: "Be Vietnam Pro", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    background: var(--canvas);
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--signal-dark); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 4px; }

/* -- header ------------------------------------------------------------------ */
.help-top {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 64px;
    padding: 0 max(24px, calc((100vw - 1180px) / 2 + 24px));
    background: linear-gradient(160deg, var(--green-800), var(--green-950));
    color: #eaf5ef;
    box-shadow: 0 8px 24px -16px rgba(4, 24, 15, .7);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}
.brand-mark {
    display: inline-grid;
    grid-template-columns: repeat(3, 1fr);
    width: 24px;
    height: 18px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}
.brand-mark i { background: #008751; }
.brand-mark i:nth-child(2) { background: #fff; }
.brand-name { font-family: var(--serif); font-size: 22px; letter-spacing: -.02em; }
.help-top-title {
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, .2);
    color: rgba(234, 245, 239, .7);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.help-play {
    margin-left: auto;
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--signal);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.help-play:hover { background: #D9501F; }

/* -- layout ------------------------------------------------------------------- */
.help-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 24px 96px;
}
.help-toc {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow: auto;
}
.help-toc-head {
    margin: 0 0 10px;
    color: var(--slate);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.help-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--hairline);
}
.help-toc a {
    display: block;
    margin-left: -1px;
    padding: 5px 0 5px 14px;
    border-left: 2px solid transparent;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.35;
    text-decoration: none;
}
.help-toc a:hover { color: var(--ink); border-left-color: var(--hairline); }
.help-toc a.is-current {
    border-left-color: var(--signal);
    color: var(--ink);
    font-weight: 700;
}

/* -- the document -------------------------------------------------------------- */
article {
    min-width: 0;
    padding: 8px 56px 48px;
    border: 1px solid var(--hairline);
    border-radius: 20px;
    background: var(--paper);
    box-shadow: 0 1px 0 rgba(18, 35, 63, .04), 0 18px 40px -24px rgba(18, 35, 63, .3);
}
h1 {
    margin: 56px 0 14px;
    padding-top: 28px;
    border-top: 1px solid var(--hairline);
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.15;
}
article > h1:first-child {
    margin-top: 32px;
    padding-top: 0;
    border-top: 0;
    font-size: 40px;
}
h2 {
    margin: 32px 0 8px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
}
h1 + h2 { margin-top: 12px; }
p { margin: 0 0 14px; color: var(--ink-soft); max-width: 46em; }
ul { margin: 0 0 18px; padding-left: 22px; color: var(--ink-soft); }
li { margin: 4px 0; }
li::marker { color: var(--signal); }
strong { color: var(--ink); }
small { color: var(--slate); font-size: 13px; }

label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 10px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: var(--canvas);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
label:hover { border-color: var(--ink); }
input[type="checkbox"] { accent-color: var(--signal); margin: 0; }

.content { display: none; }

/* tables */
table {
    width: 100%;
    margin: 6px 0 22px;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    overflow: hidden;
    font-size: 14.5px;
    display: block;
    overflow-x: auto;
}
table > tbody { display: table; width: 100%; }
th, td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--hairline);
    text-align: left;
    vertical-align: top;
}
th {
    background: var(--sand);
    color: var(--slate);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tr:nth-child(even) td { background: #fbf8f1; }
td:first-child { color: var(--ink); font-weight: 600; }

.not-implemented,
tr.not-implemented td { color: #a3a9b3; }

/* -- small screens ---------------------------------------------------------------- */
@media (max-width: 900px) {
    .help-layout { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px 64px; }
    .help-toc { position: static; max-height: none; }
    .help-toc ol { display: flex; flex-wrap: wrap; gap: 6px; border: 0; }
    .help-toc a {
        margin: 0;
        padding: 4px 10px;
        border: 1px solid var(--hairline);
        border-radius: 999px;
        background: var(--paper);
        font-size: 13px;
    }
    .help-toc a.is-current { border-color: var(--signal); }
    article { padding: 4px 20px 28px; border-radius: 16px; }
    article > h1:first-child { font-size: 32px; }
    h1 { font-size: 26px; }
}
@media (max-width: 520px) {
    .help-top { padding: 0 16px; }
    .help-top-title { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
