:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --ink: #221c17;
  --muted: #6f655c;
  --line: #e7ddd0;
  --accent: #c8641c;
  --accent-ink: #ffffff;
  --accent-soft: #fbe9d9;
  --try: #eef6ea;
  --try-line: #b9d8ac;
  --code: #f3ece3;
  --radius: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110f;
    --surface: #1f1a16;
    --ink: #f3ece4;
    --muted: #a99d91;
    --line: #362d26;
    --accent: #f08a3c;
    --accent-ink: #1a0f06;
    --accent-soft: #3a2616;
    --try: #1d2a1b;
    --try-line: #3b5a35;
    --code: #2c241e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--font); }
a { color: var(--accent); }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code); padding: 0.1em 0.35em; border-radius: 5px; }
h1, h2 { line-height: 1.2; letter-spacing: -0.01em; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; font-size: 1.15rem; }
.crumb { width: 14px; height: 12px; background: var(--accent); border-radius: 55% 45% 50% 40% / 60% 50% 45% 40%; transform: rotate(-12deg); box-shadow: 9px 5px 0 -3px var(--accent); margin-right: 6px; }

/* ---------- regular pages ---------- */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; max-width: 760px; margin: 0 auto; flex-wrap: wrap; }
.site-head nav { display: flex; gap: 16px; }
.site-head nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-head nav a[aria-current="page"], .site-head nav a:hover { color: var(--ink); }
.prose { max-width: 680px; margin: 0 auto; padding: 8px 16px 40px; }
.prose h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); margin: 0.3em 0 0.25em; }
.prose h2 { font-size: 1.2rem; margin-top: 2em; }
.lede { font-size: 1.15rem; color: var(--muted); margin-top: 0; }
.crumbs { margin: 0; font-size: 0.9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.meta { margin: 0 0 1em; }
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.small { font-size: 0.85rem; }
.muted { color: var(--muted); }

.steps { padding-left: 0; list-style: none; counter-reset: step; margin: 1em 0; }
.steps li { counter-increment: step; position: relative; padding: 0.15em 0 0.55em 2.3em; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0.1em; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 0.9em; display: grid; place-items: center; }
.tip { color: var(--muted); }
.try { background: var(--try); border: 1px solid var(--try-line); border-radius: 12px; padding: 12px 14px; }
.chip { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.skill-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.skill-list a { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
.skill-list a:hover { border-color: var(--accent); }
.skill-list .chip { justify-self: start; }
.skill-list .muted { font-size: 0.95rem; }
.gear li { margin-bottom: 0.4em; }
.sources { font-size: 0.92rem; }

.site-foot { max-width: 680px; margin: 0 auto; padding: 24px 16px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
.site-foot a { color: var(--muted); }

/* ---------- feed ---------- */
.feed-page { overflow: hidden; overscroll-behavior: none; }
.feed-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto auto 1fr; max-width: 600px; margin: 0 auto; }
.feed-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px 4px; }
.counter { margin-left: auto; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.head-link { font-size: 0.9rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; font: 600 0.88rem var(--font); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.feed { overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; outline: none; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.card { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; padding: 4px 12px 12px; display: flex; flex-direction: column; }
.card-body, .card .actions { background: var(--surface); border: 1px solid var(--line); }
.card-body { flex: 1; min-height: 0; overflow-y: auto; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; padding: 22px 20px 16px; }
.card h2 { font-size: clamp(1.5rem, 6vw, 1.9rem); margin: 0.45em 0 0.3em; }
.card .hook { font-size: 1.08rem; color: var(--muted); margin: 0 0 0.6em; }
.card .steps { margin: 0.6em 0; }
.card .try { margin-top: 0.6em; }
.card .tip { font-size: 0.95rem; margin: 0.4em 0; }
.card.review .card-body { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 55%); }

.actions { display: flex; justify-content: space-around; gap: 4px; padding: 8px; border-radius: 0 0 var(--radius) var(--radius); border-top: 1px solid var(--line) !important; }
.act { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 0.9rem var(--font); color: var(--ink); background: none; border: 0; border-radius: 12px; padding: 10px 6px; cursor: pointer; text-decoration: none; min-height: 44px; }
.act:hover { background: var(--accent-soft); }
.act[aria-pressed="true"] { color: var(--accent); }
.act.primary { background: var(--accent); color: var(--accent-ink); }
.act:disabled { opacity: 0.45; cursor: default; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: 0.2s; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 0.92rem; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
