:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #5a5a5a;
    --line: #e2e2e2;
    --card: #f6f6f4;
    --accent: #c44f00;
    --on-accent: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0e0e0e;
        --text: #f5f5f5;
        --muted: #a8a8a8;
        --line: #2a2a2a;
        --card: #171717;
        --accent: #ff6600;
        --on-accent: #111111;
    }
}

:root[data-theme="dark"] {
    --bg: #0e0e0e;
    --text: #f5f5f5;
    --muted: #a8a8a8;
    --line: #2a2a2a;
    --card: #171717;
    --accent: #ff6600;
    --on-accent: #111111;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
    padding: 48px 16px 40px;
    transition: background 0.4s ease, color 0.4s ease;
}

main { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 3rem; }

header { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; text-align: center; }

.logo { width: min(70vw, 320px); height: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .logo-light { display: none; }
    :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

.badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.tagline { font-size: clamp(1.15rem, 3vw, 1.6rem); font-weight: 400; color: var(--muted); }
.tagline strong { font-weight: 600; color: var(--text); }
.lead { max-width: 34rem; color: var(--muted); }

.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.button {
    display: inline-flex; flex-direction: column; align-items: center;
    min-width: 11rem; padding: 0.7rem 1.2rem;
    border: 1px solid var(--line); border-radius: 12px;
    color: var(--text); text-decoration: none; background: var(--card);
}
.button small { font-size: 0.75rem; color: var(--muted); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.button.primary small { color: var(--on-accent); opacity: 0.8; }
.button.pending { cursor: default; }
.applink { font-size: 0.85rem; color: var(--muted); }

h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }
p + p, ol + p, ul + p { margin-top: 0.6rem; }
a { color: var(--accent); }

.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.shots img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); }

ol, ul { padding-left: 1.3rem; }
li + li { margin-top: 0.4rem; }

.note { border-left: 3px solid var(--accent); padding: 0.6rem 0 0.6rem 1rem; background: var(--card); border-radius: 0 8px 8px 0; }

footer { border-top: 1px solid var(--line); padding-top: 1.25rem; font-size: 0.85rem; color: var(--muted); }
footer p + p { margin-top: 0.4rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; word-break: break-all; }

pre {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 0.75rem 1rem; overflow-x: auto; margin: 0.6rem 0;
}
pre code { font-size: 0.8rem; word-break: normal; white-space: pre; }

/* tutorial pages */
.crumb { font-size: 0.85rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.page-head { display: flex; flex-direction: column; gap: 0.75rem; }
.page-head h1 { font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; }
h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
p + pre, pre + p, ul + pre, pre + ul, dl + p { margin-top: 0.6rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin-top: 0.6rem; }
dt code { word-break: normal; }
dd { color: var(--muted); }
.steps-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.steps-shots figure { display: flex; flex-direction: column; gap: 0.35rem; }
.steps-shots img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.steps-shots figcaption { font-size: 0.8rem; color: var(--muted); }

@media (max-width: 520px) {
    dl { grid-template-columns: 1fr; }
    dd { margin-bottom: 0.4rem; }
    body { padding-top: 32px; }
    .button { min-width: 100%; }
}
