/* KoL Combat Item Catalog project hub
   Layout: sticky top bar, hero with status card, then stacked sections.
   Palette is the original cream and green, now tokenized with a dark variant. */

:root {
    color-scheme: light dark;

    --bg: #f5f2eb;
    --paper: #fffdf8;
    --topbar: #f9f7f0;
    --sunk: #f0efe6;
    --ink: #282b28;
    --body: #4a5148;
    --muted: #5f665c;
    --line: #deded2;
    --rule: #e9e8df;

    --green: #355e48;
    --green-hover: #1f3f2d;
    --on-green: #ffffff;
    --sage: #e5eee4;
    --rust: #a95f46;

    --warn-bg: #f6ead5;
    --warn-ink: #805522;
    --ok-bg: #dcebdd;
    --ok-ink: #28583b;
    --callout-bg: #e9eee4;
    --callout-ink: #3f5143;

    --bar-crit: #355e48;
    --bar-slack: #a9c1ae;
    --bar-slack-ink: #1f3a2b;
    --buffer-line: #d9c9a3;
    --buffer-bg: #f6efdd;
    --gridline: #e9e8df;

    --shadow: 0 8px 28px #26382a0b;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #171b18;
        --paper: #1e2420;
        --topbar: #1a1f1b;
        --sunk: #262d28;
        --ink: #e9ece6;
        --body: #c3cac0;
        --muted: #98a295;
        --line: #333b35;
        --rule: #2b332d;

        --green: #8cc3a0;
        --green-hover: #b4dcc4;
        --on-green: #12201a;
        --sage: #26342a;
        --rust: #e29c82;

        --warn-bg: #3a2f1a;
        --warn-ink: #e6bd82;
        --ok-bg: #243a2b;
        --ok-ink: #a9dbb9;
        --callout-bg: #222c25;
        --callout-ink: #b9cabc;

        --bar-crit: #8cc3a0;
        --bar-slack: #44584a;
        --bar-slack-ink: #dbe9de;
        --buffer-line: #5b4e2e;
        --buffer-bg: #2a261a;
        --gridline: #2b332d;

        --shadow: 0 8px 28px #00000040;
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
    color: var(--green);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--green-hover);
}

:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 3px;
    border-radius: 4px;
}

h1,
h2,
h3 {
    text-wrap: balance;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 30;
    background: var(--green);
    color: var(--on-green);
    padding: 9px 14px;
    border-radius: 9px;
    font-weight: 650;
    text-decoration: none;
}

.skip-link:focus {
    top: 10px;
    color: var(--on-green);
}

.bold {
    font-weight: 700;
    color: var(--ink);
}

.shell {
    max-width: 1180px;
    margin: auto;
    padding: 0 26px;
}

/* Top bar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: var(--topbar);
}

.topinner {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    font-weight: 750;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.brand-sub {
    color: var(--muted);
    font-weight: 500;
}

.mark {
    width: 30px;
    height: 30px;
    background: var(--green);
    color: var(--on-green);
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 17px;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    text-decoration: none;
    font-size: 13px;
    color: var(--muted);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}

.nav a:hover {
    color: var(--ink);
    border-bottom-color: var(--green);
}

/* Hero */

.hero {
    padding: 56px 0 34px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
    gap: 38px;
    align-items: center;
}

.eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--green);
    font-weight: 800;
}

.hero h1 {
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.06;
    letter-spacing: -0.055em;
    margin: 12px 0 18px;
    max-width: 720px;
}

.hero p {
    font-size: 16px;
    color: var(--muted);
    max-width: 66ch;
    margin: 0 0 24px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    padding: 10px 15px;
    border-radius: 9px;
    border: 1px solid var(--green);
    text-decoration: none;
    font-weight: 650;
    font-size: 13px;
}

.btn.primary {
    background: var(--green);
    color: var(--on-green);
}

.btn.primary:hover {
    background: var(--green-hover);
    color: var(--on-green);
}

.btn.secondary {
    color: var(--green);
    background: transparent;
}

.btn.secondary:hover {
    background: var(--sage);
}

.status-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.status-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.pill {
    font-size: 11px;
    background: var(--warn-bg);
    color: var(--warn-ink);
    padding: 4px 9px;
    border-radius: 30px;
    font-weight: 750;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat {
    background: var(--sunk);
    border-radius: 11px;
    padding: 13px;
}

.stat strong {
    font-size: 25px;
    display: block;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.stat span {
    font-size: 12px;
    color: var(--muted);
}

.small-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 12px;
}

.deadline {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    font-size: 13px;
    color: var(--body);
}

.deadline strong {
    color: var(--ink);
}

.progressline {
    height: 6px;
    background: var(--sunk);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

.progressline span {
    display: block;
    height: 100%;
    width: 7%;
    background: var(--green);
}

/* Sections */

.section {
    padding: 30px 0 18px;
    scroll-margin-top: 78px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 17px;
}

.section-title h2 {
    font-size: 24px;
    letter-spacing: -0.04em;
    margin: 3px 0;
}

.section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    max-width: 44ch;
    text-align: right;
}

.grid2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grid3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 21px;
    box-shadow: var(--shadow);
}

.panel h3 {
    margin: 0 0 9px;
    font-size: 16px;
    letter-spacing: -0.02em;
}

.panel p {
    margin: 0;
    color: var(--body);
}

.panel p + p {
    margin-top: 10px;
}

.panel ul {
    margin: 0;
    padding-left: 18px;
    color: var(--body);
}

.panel li + li {
    margin-top: 6px;
}

.tag {
    display: inline-block;
    background: var(--sage);
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 11px;
}

.callout {
    background: var(--callout-bg);
    border-left: 3px solid var(--green);
    padding: 13px 15px;
    border-radius: 0 9px 9px 0;
    font-size: 13px;
    color: var(--callout-ink);
    margin-top: 14px;
}

/* Milestones */

.milestones {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
}

.mile {
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: 12px;
    padding: 15px;
    min-height: 126px;
}

.mile .num {
    color: var(--rust);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.1em;
}

.mile time {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin: 4px 0 8px;
    font-variant-numeric: tabular-nums;
}

.mile strong {
    font-size: 13px;
    line-height: 1.35;
    display: block;
}

.mile.is-done {
    background: var(--ok-bg);
    border-color: transparent;
}

.mile.is-done .num {
    color: var(--ok-ink);
}

.mile.is-done .num::after {
    content: " \00b7  DONE";
}

.mile.is-next {
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green);
}

.mile.is-next .num::after {
    content: " \00b7  NEXT UP";
}

/* Deliverable and planning cards */

.deliverables {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.doc {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    background: var(--paper);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.doc.disabled {
    background: transparent;
    border-style: dashed;
}

.docicon {
    flex: 0 0 34px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--sage);
    color: var(--green);
    font-weight: 800;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.docbody {
    min-width: 0;
    display: grid;
    gap: 7px;
    justify-items: start;
}

.doc h3 {
    font-size: 14px;
    line-height: 1.35;
    margin: 0;
}

.doc p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

.doclink {
    font-size: 12px;
    font-weight: 700;
}

.doclink.off {
    color: var(--muted);
    font-weight: 500;
}

/* Status pills */

.state {
    display: inline-block;
    border-radius: 20px;
    padding: 3px 9px;
    background: var(--sunk);
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.state.done {
    background: var(--ok-bg);
    color: var(--ok-ink);
}

.state.next {
    background: var(--warn-bg);
    color: var(--warn-ink);
}

/* Figures */

.figure {
    margin: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.figure a {
    display: block;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.figure img {
    display: block;
    width: 100%;
    height: auto;
}

.figure figcaption {
    padding: 14px 17px 16px;
    font-size: 13px;
    color: var(--body);
}

.figure figcaption strong {
    display: block;
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 2px;
}

/* Gantt chart */

.gantt-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--paper);
    margin-bottom: 16px;
}

.gantt {
    --label: 218px;
    --cols: 19;
    min-width: 780px;
    font-size: 12px;
}

.g-row {
    display: grid;
    grid-template-columns: var(--label) minmax(0, 1fr);
}

.g-label {
    padding: 6px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-self: center;
    color: var(--body);
}

.g-label b {
    display: inline-block;
    width: 18px;
    font-weight: 800;
    color: var(--green);
}

.g-track {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    align-items: center;
}

.g-months span {
    padding: 8px 0 3px 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.g-days {
    border-bottom: 1px solid var(--line);
}

.g-days span {
    text-align: center;
    padding-bottom: 6px;
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.g-days span.buf,
.g-months span.buf {
    color: var(--warn-ink);
}

.g-body {
    position: relative;
}

.g-body .g-track {
    height: 34px;
    background-image: repeating-linear-gradient(
        to right,
        transparent 0,
        transparent calc(100% / var(--cols) - 1px),
        var(--gridline) calc(100% / var(--cols) - 1px),
        var(--gridline) calc(100% / var(--cols))
    );
}

.g-body .g-row + .g-row {
    border-top: 1px solid var(--rule);
}

.bar {
    grid-column: var(--s) / calc(var(--e) + 1);
    grid-row: 1;
    height: 20px;
    margin: 0 1px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
    background: var(--bar-crit);
    color: var(--on-green);
    position: relative;
    z-index: 1;
}

.bar.slack {
    background: var(--bar-slack);
    color: var(--bar-slack-ink);
}

.bar.done {
    background: var(--paper);
    border: 2px solid var(--bar-crit);
    color: var(--green);
}

.g-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--label);
    right: 0;
    pointer-events: none;
}

.g-buffer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(16 / var(--cols) * 100%);
    right: 0;
    background: repeating-linear-gradient(135deg, var(--buffer-bg) 0 6px, transparent 6px 12px);
    border-left: 1px dashed var(--buffer-line);
}

.g-today {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--rust);
}

.g-today[hidden] {
    display: none;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend i {
    display: inline-block;
    width: 18px;
    height: 10px;
    border-radius: 3px;
    background: var(--bar-crit);
}

.legend i.slack {
    background: var(--bar-slack);
}

.legend i.done {
    background: transparent;
    border: 2px solid var(--bar-crit);
}

.legend i.buf {
    background: repeating-linear-gradient(135deg, var(--buffer-line) 0 2px, transparent 2px 5px);
}

.legend i.today {
    width: 2px;
    height: 14px;
    border-radius: 0;
    background: var(--rust);
}

/* Schedule table */

.schedule-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--paper);
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 850px;
    font-size: 13px;
}

th,
td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

th {
    background: var(--sunk);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

td:nth-child(3),
td:nth-child(4) {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.taskid {
    font-weight: 800;
    color: var(--green);
}

/* Checklist */

.checklist {
    display: grid;
}

.checkrow {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 12px;
    border-bottom: 1px solid var(--rule);
}

.checkrow:last-child {
    border: 0;
}

.checkrow input {
    accent-color: var(--green);
    margin-top: 4px;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.checkrow label {
    flex: 1;
    cursor: pointer;
}

.checkrow input:checked + label strong {
    text-decoration: line-through;
    text-decoration-color: var(--muted);
    color: var(--muted);
}

.checkrow small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

/* Footer */

.foot {
    margin-top: 42px;
    padding: 23px 0 35px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    color: var(--muted);
    font-size: 12px;
}

.foot a {
    font-weight: 650;
}

/* Responsive */

@media (max-width: 900px) {
    .grid3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .topinner {
        flex-wrap: wrap;
        gap: 0 20px;
        padding-top: 8px;
    }

    .nav {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 4px;
    }

    .hero {
        grid-template-columns: 1fr;
        padding-top: 38px;
    }

    .grid2 {
        grid-template-columns: 1fr;
    }

    .milestones {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deliverables {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shell {
        padding: 0 17px;
    }

    .section {
        scroll-margin-top: 110px;
    }

    .section-title {
        align-items: start;
        flex-direction: column;
        gap: 4px;
    }

    .section-title p {
        text-align: left;
    }

    .hero h1 {
        font-size: 40px;
    }
}

@media (max-width: 520px) {
    .deliverables,
    .milestones {
        grid-template-columns: 1fr;
    }

    .stat strong {
        font-size: 21px;
    }
}
