:root {
  --wall: #fafaf8; --deep: #f2f2ee; --mat: #ffffff; --ink: #1d1d1f; --ink2: #3a3a3c;
  --stone: #6e6e73; --hair: #e3e3de; --accent: #3f6f55; --on-accent: #ffffff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --wall: #121211; --deep: #1a1a18; --mat: #222220; --ink: #f2f2ee; --ink2: #cfcfc9;
    --stone: #9c9c96; --hair: #2e2e2b; --accent: #7db592; --on-accent: #121211; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 16px/1.5 Geist, system-ui, sans-serif; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
header { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
nav a { color: var(--stone); text-decoration: none; margin-left: 20px; font-weight: 500; }
nav a:hover { color: var(--ink); }
.hero { padding: 36px 0 28px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: end; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 14px; }
.hero p { color: var(--ink2); margin: 0; max-width: 34em; }
.get { background: var(--mat); border: 1px solid var(--hair); border-radius: 16px; padding: 20px 22px; }
.get .code { font-size: 34px; font-weight: 600; letter-spacing: 0.04em; }
.get small { color: var(--stone); display: block; }
.tools { position: sticky; top: 0; background: var(--wall); padding: 14px 0; z-index: 2; border-bottom: 1px solid var(--hair); }
input[type=search] { width: 100%; font: inherit; font-size: 18px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--hair); background: var(--mat); color: var(--ink); }
input[type=search]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.chip { flex: none; font: inherit; font-size: 14px; padding: 5px 13px; border-radius: 99px; border: 1px solid var(--hair); background: transparent; color: var(--ink2); cursor: pointer; }
.chip[aria-pressed=true] { background: var(--ink); color: var(--wall); border-color: var(--ink); }
.count { color: var(--stone); font-size: 14px; margin: 18px 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; padding-bottom: 40px; }
.card { cursor: pointer; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; }
.art { aspect-ratio: 16 / 9; border-radius: 12px; background: var(--deep); overflow: hidden; display: grid; place-items: center; }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art img.icon { width: 30%; height: auto; object-fit: contain; border-radius: 14px; }
.card:hover .art, .card:focus-visible .art { outline: 3px solid var(--accent); outline-offset: 3px; }
.card h3 { font-size: 15.5px; margin: 10px 0 0; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card p { margin: 2px 0 0; color: var(--stone); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.more { display: block; margin: 0 auto 60px; }
.btn { font: inherit; font-weight: 600; padding: 10px 20px; border-radius: 99px; border: 1px solid var(--hair); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
.btn.solid { background: var(--ink); color: var(--wall); border-color: var(--ink); }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 32px)); background: var(--mat); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.sheet .art { border-radius: 0; }
.sheet .body { padding: 22px 24px 24px; }
.sheet h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.sheet .by { color: var(--stone); margin: 2px 0 10px; }
.sheet .big { display: flex; align-items: baseline; gap: 12px; background: var(--deep); border-radius: 12px; padding: 12px 16px; margin: 16px 0; }
.sheet .big b { font-size: 30px; letter-spacing: 0.05em; }
.sheet .big span { color: var(--stone); font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; font-size: 14px; margin: 0 0 18px; }
.facts dt { color: var(--stone); font-size: 12.5px; }
.facts dd { margin: 0; font-weight: 500; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
footer { color: var(--stone); font-size: 14px; padding: 30px 0 50px; border-top: 1px solid var(--hair); }
.guide { max-width: 760px; padding-bottom: 60px; }
.guide h1 { font-size: 40px; letter-spacing: -0.03em; margin: 20px 0 8px; }
.guide h2 { margin-top: 40px; letter-spacing: -0.01em; }
.guide section { scroll-margin-top: 20px; border-top: 1px solid var(--hair); padding-top: 4px; }
.guide section:target { border-top: 3px solid var(--accent); }
.guide ol li { margin: 6px 0; }
.guide code { background: var(--deep); padding: 2px 6px; border-radius: 6px; font-size: 14px; word-break: break-all; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 12px; }
  nav a { margin-left: 14px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .facts { grid-template-columns: 1fr; }
}
