/* ==========================================================================
   SeasonEngine website - design system
   Hand-written static site. No build step, no framework, no CDN.

   Conventions:
   - Root pages (index.html, 404.html) reference assets as  assets/...
   - Pages one folder deep (features/, docs/, roadmap/) use  ../assets/...
   - Every page is self-contained: copy the closest existing page and edit
     the <main> content. Header and footer markup is duplicated on purpose.
   ========================================================================== */

/* --- tokens --------------------------------------------------------------- */

:root {
    /* Keeps native scrollbars, form controls and the caret in step with the
       theme. Dark is the site default, so the dark block below overrides this. */
    color-scheme: light;

    --brand: #3e90ee;
    --brand-strong: #2f7cd6;
    --brand-soft: rgba(62, 144, 238, .12);

    --banner-bg: #e9f0f4;
    --page-bg: #eef3f6;
    --surface: #ffffff;
    --surface-2: #f5f8fa;
    --border: #e1e9ee;
    --text: #2f4f4f;
    --text-gray: #708090;
    --link: #1069c4;
    --code-bg: #f6f8fa;
    --code-text: #33475b;
    --shadow: 0 4px 12px rgba(0, 0, 0, .1);
    --shadow-lift: 0 10px 26px rgba(0, 0, 0, .14);
    --shell-overlay: linear-gradient(rgba(238, 243, 246, .82), rgba(238, 243, 246, .94));

    --ok: #2e9e5b;
    --warn: #c8871a;
    --off: #8a97a3;

    --radius: 10px;
    --radius-sm: 6px;
    --maxw: 1160px;

    --tok-comment: #8a99a6;
    --tok-string: #b1651a;
    --tok-keyword: #1f6feb;
    --tok-number: #8250df;
    --tok-type: #217a6b;
}

[data-theme="dark"] {
    color-scheme: dark;

    --banner-bg: #0b1116;
    --page-bg: #0f1720;
    --surface: #182229;
    --surface-2: #131c23;
    --border: #26333e;
    --text: #e6edf3;
    --text-gray: #9fb0bf;
    --link: #6fb2ff;
    --code-bg: #111a21;
    --code-text: #d7e2ea;
    --shadow: 0 4px 14px rgba(0, 0, 0, .45);
    --shadow-lift: 0 12px 30px rgba(0, 0, 0, .55);
    --shell-overlay: linear-gradient(rgba(15, 23, 32, .88), rgba(15, 23, 32, .96));

    --ok: #4fc47c;
    --warn: #e0a63c;
    --off: #7d8b98;

    --tok-comment: #7d8d9b;
    --tok-string: #e0a878;
    --tok-keyword: #79b8ff;
    --tok-number: #c4a2f5;
    --tok-type: #6fd3bd;
}

/* --- base ---------------------------------------------------------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 110px; }

body {
    margin: 0;
    background-color: var(--page-bg);
    color: var(--text);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.3; color: var(--text); }
h1 { font-size: 34px; margin: 0 0 14px; }
h2 { font-size: 25px; margin: 34px 0 12px; }
h3 { font-size: 19px; margin: 26px 0 8px; }

p { margin: 0 0 14px; }

hr.se-hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }

.se-container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.se-muted { color: var(--text-gray); }
.se-lede { font-size: 18px; color: var(--text-gray); max-width: 760px; }
.se-center { text-align: center; }
.se-nowrap { white-space: nowrap; }
.se-mt0 { margin-top: 0; }

/* --- top bar + navigation ------------------------------------------------ */

.se-topbar {
    background-color: var(--banner-bg);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.se-topbar .se-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    height: 36px;
}

.se-topbar a { color: var(--text-gray); }

.se-theme {
    width: 26px;
    height: 26px;
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 0;
}

.se-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .04);
}

.se-nav .se-container {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 62px;
}

.se-nav__brand { display: flex; align-items: center; gap: 10px; margin-right: 12px; }
.se-nav__brand img { width: 40px; height: 40px; }
.se-nav__brand span { font-weight: 700; font-size: 19px; color: var(--text); }
.se-nav__brand:hover { text-decoration: none; }

.se-nav__links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.se-nav__links a {
    display: inline-block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
}

.se-nav__links a:hover { background-color: var(--brand-soft); text-decoration: none; }
.se-nav__links a[aria-current="page"] { color: var(--brand); font-weight: 700; }

.se-nav__spacer { flex: 1 1 auto; }

.se-nav__toggle {
    display: none;
    margin-left: auto;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 18px;
    cursor: pointer;
}

/* --- page shell --------------------------------------------------------- */

.se-shell {
    background-image: var(--shell-overlay), url(../img/Background.jpg);
    background-repeat: no-repeat, repeat-y;
    background-position: center top, center top;
    background-size: cover, 100% auto;
    background-attachment: scroll;
    padding: 34px 0 54px;
    min-height: 70vh;
}

/* --- cards -------------------------------------------------------------- */

.se-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 26px;
}

.se-card--tight { padding: 22px; }
.se-card--plain { box-shadow: none; }

.se-card__title { margin: 0 0 6px; font-size: 22px; font-weight: 700; }

/* --- hero --------------------------------------------------------------- */

.se-hero { display: flex; flex-wrap: wrap; gap: 30px; align-items: center; }
.se-hero__text { flex: 1 1 420px; min-width: 300px; }
.se-hero__art { flex: 0 1 320px; min-width: 240px; text-align: center; }

.se-hero__title { font-size: 34px; font-weight: 700; margin: 0 0 4px; }
.se-hero__title-cn { font-size: 26px; font-weight: 700; color: var(--brand); margin: 0 0 12px; }

.se-btnrow { display: flex; flex-wrap: wrap; gap: 14px; margin: 22px 0 8px; }

.se-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 16px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.se-btn img { width: 24px; height: 24px; }
.se-btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.se-btn--primary { background-color: var(--brand); color: #fff; }
.se-btn--primary:hover { background-color: var(--brand-strong); color: #fff; }
.se-btn--ghost { background-color: var(--surface-2); color: var(--text); border-color: var(--border); }

/* --- store badges ------------------------------------------------------- */

.se-store { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 16px; }
.se-store__item { text-align: center; color: var(--text-gray); font-size: 14px; width: 92px; }
.se-store__item img { height: 62px; width: auto; display: block; margin: 0 auto 4px; }
.se-store__item--muted { opacity: .45; }

/* --- grids and feature tiles -------------------------------------------- */

.se-grid { display: grid; gap: 26px; }
.se-grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.se-grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.se-grid--4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.se-feature__icon { height: 72px; margin-bottom: 12px; }
.se-feature__icon--svg {
    width: 150px;
    height: 72px;
    margin-bottom: 12px;
    background-repeat: no-repeat;
    background-position: left center;
    background-size: contain;
}
.se-feature h3 { margin: 0 0 6px; font-size: 20px; }
.se-feature p { color: var(--text-gray); font-size: 15px; margin: 0; }

.se-linkcard {
    display: block;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    color: var(--text);
    transition: transform .2s ease, box-shadow .2s ease;
}
.se-linkcard:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.se-linkcard h3 { margin: 0 0 6px; font-size: 18px; color: var(--brand); }
.se-linkcard p { margin: 0; color: var(--text-gray); font-size: 15px; }
.se-linkcard__meta { display: block; margin-top: 10px; font-size: 13px; color: var(--text-gray); }

/* --- badges and pills --------------------------------------------------- */

.se-badge {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.se-badge--shipped { color: var(--ok); border-color: var(--ok); background: rgba(46, 158, 91, .1); }
.se-badge--partial { color: var(--warn); border-color: var(--warn); background: rgba(200, 135, 26, .12); }
.se-badge--absent { color: var(--off); border-color: var(--off); background: rgba(138, 151, 163, .12); }

.se-pill {
    display: inline-block;
    padding: 3px 11px;
    margin: 0 6px 6px 0;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 600;
}

/* --- pipeline strip ----------------------------------------------------- */

.se-pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; }

.se-pipeline__step {
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    font-family: Consolas, "SF Mono", Menlo, monospace;
}

.se-pipeline__step--accent { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.se-pipeline__arrow { color: var(--text-gray); font-weight: 700; }

/* --- logo strips -------------------------------------------------------- */

.se-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 14px; }
.se-strip img { height: 62px; width: auto; }
.se-strip--sm img { height: 46px; }

/* --- code --------------------------------------------------------------- */

.se-code {
    position: relative;
    background-color: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin: 0 0 16px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
}

.se-code code {
    font-family: Consolas, "SF Mono", Menlo, "Courier New", monospace;
    color: var(--code-text);
    white-space: pre;
}

code.se-inline {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: Consolas, "SF Mono", Menlo, monospace;
    font-size: .92em;
    color: var(--code-text);
}

.se-code__copy {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-gray);
    border-radius: 4px;
    font-size: 12px;
    padding: 2px 9px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease;
}

.se-code:hover .se-code__copy, .se-code__copy:focus { opacity: 1; }

.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-string { color: var(--tok-string); }
.tok-keyword { color: var(--tok-keyword); }
.tok-number { color: var(--tok-number); }
.tok-type { color: var(--tok-type); }

/* --- code + result pair ------------------------------------------------- */

.se-codepair { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); align-items: start; }
.se-codepair .se-code { margin-bottom: 0; }

/* --- screenshots -------------------------------------------------------- */

.se-shot { margin: 0; position: relative; }
.se-shot img { display: block; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.se-shot figcaption { margin-top: 8px; font-size: 14px; color: var(--text-gray); }

.se-shot__tag {
    position: absolute;
    left: 10px;
    bottom: 44px;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 4px;
    letter-spacing: .02em;
}

/* --- tables ------------------------------------------------------------- */

.se-table-wrap { overflow-x: auto; margin-bottom: 18px; }

.se-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.se-table th, .se-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.se-table th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.se-table tbody tr:hover { background: var(--brand-soft); }
.se-table code { font-family: Consolas, "SF Mono", Menlo, monospace; font-size: .9em; }
.se-table--center td:not(:first-child), .se-table--center th:not(:first-child) { text-align: center; }

.se-yes { color: var(--ok); font-weight: 700; }
.se-no { color: var(--off); font-weight: 700; }

/* --- callouts ----------------------------------------------------------- */

.se-callout {
    border-left: 4px solid var(--brand);
    background: var(--surface-2);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 18px;
    margin: 0 0 18px;
    font-size: 15px;
}

.se-callout p:last-child { margin-bottom: 0; }
.se-callout__title { font-weight: 700; display: block; margin-bottom: 4px; }
.se-callout--warn { border-left-color: var(--warn); }
.se-callout--contract { border-left-color: var(--ok); }

/* --- lists -------------------------------------------------------------- */

.se-list { padding-left: 22px; margin: 0 0 16px; }
.se-list li { margin-bottom: 7px; }
.se-list--plain { list-style: none; padding-left: 0; }

/* --- doc layout --------------------------------------------------------- */

.se-doc { display: grid; grid-template-columns: 232px minmax(0, 1fr) 210px; gap: 30px; align-items: start; }

/* Two columns: body plus a right-hand table of contents, no left sidebar. */
.se-doc--wide { grid-template-columns: minmax(0, 1fr) 210px; }

.se-sidebar, .se-toc {
    position: sticky;
    top: 82px;
    font-size: 14.5px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.se-sidebar__group { margin-bottom: 20px; }
.se-sidebar__group h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-gray); }
.se-sidebar ul { list-style: none; margin: 0; padding: 0; }
.se-sidebar li { margin-bottom: 2px; }

.se-sidebar a {
    display: block;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    border-left: 2px solid transparent;
}

.se-sidebar a:hover { background: var(--brand-soft); text-decoration: none; }
.se-sidebar a[aria-current="page"] { color: var(--brand); font-weight: 700; border-left-color: var(--brand); background: var(--brand-soft); }
.se-sidebar a.is-todo { color: var(--text-gray); cursor: default; }
.se-sidebar a.is-todo:hover { background: none; }

.se-toc h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-gray); }
.se-toc ul { list-style: none; margin: 0; padding: 0; }
.se-toc a { display: block; padding: 3px 0 3px 10px; border-left: 2px solid var(--border); color: var(--text-gray); }
.se-toc a:hover { color: var(--text); text-decoration: none; }
.se-toc a.is-active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.se-toc li.is-h3 a { padding-left: 22px; font-size: 13.5px; }

.se-doc__main { min-width: 0; }
.se-doc__main > .se-card { margin-bottom: 26px; }

.se-crumbs { font-size: 14px; color: var(--text-gray); margin-bottom: 14px; }
.se-crumbs a { color: var(--text-gray); }

.se-pagenav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.se-pagenav a { font-weight: 600; }

/* --- footer ------------------------------------------------------------- */

.se-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 32px 0 26px;
    color: var(--text-gray);
    font-size: 15px;
}

.se-footer__cols { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 22px; }
.se-footer h4 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
.se-footer ul { list-style: none; margin: 0; padding: 0; }
.se-footer li { margin-bottom: 5px; }
.se-footer a { color: var(--text-gray); }
.se-footer a:hover { color: var(--brand); }
.se-footer__bottom { border-top: 1px solid var(--border); padding-top: 16px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

/* --- responsive --------------------------------------------------------- */

@media (max-width: 1080px) {
    .se-doc { grid-template-columns: 210px minmax(0, 1fr); }
    .se-doc--wide { grid-template-columns: minmax(0, 1fr); }
    .se-toc { display: none; }
}

@media (max-width: 860px) {
    h1, .se-hero__title { font-size: 28px; }
    h2 { font-size: 22px; }

    .se-nav__toggle { display: inline-block; }

    .se-nav__links {
        display: none;
        order: 3;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-bottom: 12px;
    }

    .se-nav__links.is-open { display: flex; }
    .se-nav__links a { padding: 10px 12px; border-radius: 0; border-bottom: 1px solid var(--border); }
    .se-nav__spacer { display: none; }

    .se-doc { grid-template-columns: minmax(0, 1fr); }

    .se-sidebar {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 12px;
    }

    .se-card { padding: 22px; }
    .se-shell { padding-top: 24px; }
    .se-hero__art { display: none; }
}
