/* MoneyGym user guide */

:root {
    --bg: #f5f5f8;
    --card: #ffffff;
    --text: #1c1c1e;
    --muted: #6b6b73;
    --line: #e3e3e8;
    --accent: #0a84ff;
    --accent-soft: #e6f1ff;
    --tip: #fff7e0;
    --tip-line: #f2d98a;
    --warn: #fff0ec;
    --warn-line: #f3b5a6;
    --radius: 14px;
    --sidebar: 270px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #101012;
        --card: #1c1c1f;
        --text: #f2f2f5;
        --muted: #a0a0aa;
        --line: #2c2c31;
        --accent: #4da3ff;
        --accent-soft: #14283f;
        --tip: #2b2511;
        --tip-line: #6b5a1f;
        --warn: #2e1a16;
        --warn-line: #7a3a2c;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

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

/* Layout */

.layout { display: flex; min-height: 100vh; }

nav.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: var(--sidebar);
    height: 100vh;
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
    border-right: 1px solid var(--line);
    background: var(--card);
    flex-shrink: 0;
}

nav.sidebar .brand { font-size: 1.25rem; font-weight: 700; margin: 0 0 .15rem; }
nav.sidebar .tagline { color: var(--muted); font-size: .85rem; margin: 0 0 1.25rem; }
nav.sidebar ol { list-style: none; margin: 0; padding: 0; }
nav.sidebar > ol > li { margin: .15rem 0; }
nav.sidebar a { display: block; padding: .3rem .6rem; border-radius: 8px; color: var(--text); font-weight: 600; }
nav.sidebar a:hover { background: var(--accent-soft); text-decoration: none; }
nav.sidebar ol ol { margin: 0 0 .5rem .6rem; }
nav.sidebar ol ol a { font-weight: 400; font-size: .9rem; color: var(--muted); }

main { flex: 1; min-width: 0; padding: 2.5rem 3rem 5rem; max-width: 960px; }

@media (max-width: 860px) {
    .layout { display: block; }
    nav.sidebar { position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    main { padding: 1.5rem 1.1rem 4rem; }
}

/* Type */

h1 { font-size: 2.3rem; line-height: 1.2; margin: 0 0 .4rem; }
h2 { font-size: 1.7rem; margin: 3.2rem 0 .8rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.25rem; margin: 2rem 0 .5rem; }
h4 { font-size: 1.05rem; margin: 1.4rem 0 .3rem; }
p, ul, ol { margin: .6rem 0; }
li { margin: .25rem 0; }
.lead { font-size: 1.15rem; color: var(--muted); }
.hero { margin-bottom: 2rem; }

code, kbd {
    font: .9em ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--accent-soft);
    padding: .1em .4em;
    border-radius: 6px;
}

.ui { font-weight: 600; }

/* Screenshots */

figure.shot {
    margin: 1.4rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

figure.shot img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 28px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
    background: var(--card);
}

figure.shot figcaption { margin-top: .7rem; font-size: .88rem; color: var(--muted); text-align: center; max-width: 34rem; }

.shots { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; }
.shots figure.shot { flex: 1 1 220px; max-width: 300px; }

/* Side by side text + picture */

.with-shot { display: flex; gap: 2rem; align-items: flex-start; }
.with-shot > .text { flex: 1; min-width: 0; }
.with-shot > figure.shot { flex: 0 0 280px; margin-top: .6rem; }

@media (max-width: 760px) {
    .with-shot { display: block; }
}

/* Call-outs */

.note, .tip, .warn {
    border-radius: var(--radius);
    padding: .8rem 1.1rem;
    margin: 1.2rem 0;
    border: 1px solid var(--line);
    background: var(--card);
}

.note { background: var(--accent-soft); border-color: transparent; }
.tip  { background: var(--tip); border-color: var(--tip-line); }
.warn { background: var(--warn); border-color: var(--warn-line); }
.note > :first-child, .tip > :first-child, .warn > :first-child { margin-top: 0; }
.note > :last-child, .tip > :last-child, .warn > :last-child { margin-bottom: 0; }

/* Tables */

table { width: 100%; border-collapse: collapse; margin: 1rem 0; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .6rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--accent-soft); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }

/* Steps */

ol.steps { counter-reset: step; list-style: none; padding: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin: .8rem 0; }
ol.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: .05rem;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

footer { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

@media print {
    nav.sidebar { display: none; }
    main { max-width: none; padding: 0; }
    figure.shot img { box-shadow: none; border: 1px solid var(--line); }
    h2 { break-before: page; }
}
