:root {
  --bg: #0c0c0d; --bg2: #141416; --bg3: #1c1c1f; --line: #26262a; --fg: #ececee; --dim: #9a9aa2; --faint: #64646c;
  --acc: #f2b35b; --r: 14px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Charter", "Source Serif Pro", "Noto Serif", Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: var(--fg); }
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
.dim { color: var(--dim); } .small { font-size: 13px; } .tiny { font-size: 11.5px; }
.err { color: #ff8f7d; min-height: 1.4em; } .ok { color: #7dd3a8; }
.btn { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); }
.btn:hover { border-color: #3a3a40; }
.btn.primary { background: var(--acc); color: #1a1408; border-color: var(--acc); font-weight: 600; }
.btn.ghost { background: none; margin: 8px 0; }
.icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--dim); font-size: 18px; }
.icon:hover { background: var(--bg3); color: var(--fg); }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); }
.pad { padding: 16px; } .left { text-align: left; width: 100%; }

/* ---- boot / lock */
.center { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.lock { max-width: 420px; margin: 0 auto; }
.lock h1 { font-size: 40px; margin: 0; }
.lock input:not([type=checkbox]) { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-size: 18px; text-align: center; letter-spacing: .1em; outline: none; margin: 8px 0; }
.lock input:focus { border-color: var(--acc); }
.check { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: 14px; }
.orb { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe3b0, var(--acc) 40%, #7a4a10 75%, transparent 76%); box-shadow: 0 0 60px #f2b35b55; animation: breathe 2.4s ease-in-out infinite; }
.orb.small { width: 44px; height: 44px; }
@keyframes breathe { 50% { transform: scale(1.08); box-shadow: 0 0 90px #f2b35b77; } }

/* ---- header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 22px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--serif); font-size: 21px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 14px var(--acc); }
.qbox { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.qbox:focus-within { border-color: #f2b35b88; }
.qbox span { color: var(--faint); } .qbox input { flex: 1; background: none; border: 0; outline: none; padding: 9px 0; }
kbd { font: 11px var(--sans); color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.looks { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-left: auto; }
.looks button { padding: 5px 13px; border-radius: 999px; font-size: 13px; color: var(--dim); }
.looks button.on { background: var(--bg3); color: var(--fg); box-shadow: inset 0 0 0 1px #3a3a40; }
.pop { position: fixed; right: 18px; top: 60px; z-index: 40; width: 260px; padding: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 20px 60px #000a; display: flex; flex-direction: column; gap: 6px; }
.pop[hidden], .sheet[hidden] { display: none; }
.pop hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 6px 0; }
.pop button { text-align: left; padding: 8px 10px; border-radius: 8px; } .pop button:hover { background: var(--bg3); }
.pop .danger { color: #ff8f7d; }

main { max-width: 1180px; margin: 0 auto; padding: 0 22px 80px; }
section { margin-top: 34px; }
h4.sec { font: 600 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 26px 0 12px; }

/* ---- note cards */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.card.note { display: block; padding: 15px 16px; transition: border-color .15s, transform .15s, background .15s; position: relative; overflow: hidden; }
.card.note:hover { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); background: var(--bg3); transform: translateY(-1px); }
.card.note .meta { display: flex; justify-content: space-between; align-items: center; color: var(--faint); font-size: 12px; gap: 10px; }
.card.note h3 { font: 600 16px/1.3 var(--serif); margin: 9px 0 6px; }
.card.note p { margin: 0; color: var(--dim); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.list.tight { grid-template-columns: 1fr; }

/* ---- Look 1: search home */
.hero { text-align: center; padding: 70px 0 10px; }
.hero h1.big { font-size: clamp(30px, 5vw, 52px); margin: 6px 0 26px; line-height: 1.1; }
.qbig { max-width: 720px; margin: 0 auto; display: flex; gap: 12px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 4px 20px; box-shadow: 0 0 0 6px #f2b35b0a, 0 30px 80px #0008; }
.qbig:focus-within { border-color: #f2b35b99; box-shadow: 0 0 0 6px #f2b35b1c, 0 30px 80px #0008; }
.qbig span { font-size: 22px; color: var(--acc); } .qbig input { flex: 1; background: none; border: 0; outline: none; padding: 16px 0; font-size: 18px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.suggest a { font-size: 13px; color: var(--dim); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.suggest a:hover { color: var(--fg); border-color: #3a3a40; }
.spark { margin-top: 46px; border-radius: 20px; padding: 2px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 60%, transparent), transparent 55%); }
.spark > a { display: block; border-radius: 18px; padding: 26px 30px; background: radial-gradient(800px 200px at 0 0, color-mix(in srgb, var(--c) 10%, transparent), transparent), var(--bg2); }
.spark .label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--c); font-weight: 600; margin-bottom: 10px; }
.spark h2 { font-size: clamp(22px, 3vw, 32px); margin: 0 0 10px; }
.spark p { font: 17px/1.6 var(--serif); color: #cfcfd4; margin: 0 0 14px; max-width: 820px; }
.more { color: var(--acc); font-size: 14px; font-weight: 500; }
.shelves { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.shelf { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--r); background: var(--bg2); border: 1px solid var(--line); transition: .15s; }
.shelf:hover { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); background: radial-gradient(200px 80px at 0 0, color-mix(in srgb, var(--c) 14%, transparent), transparent), var(--bg2); }
.shelf .ic { color: var(--c); font-size: 18px; } .shelf b { font-weight: 600; font-size: 14px; }

/* ---- Look 2: map */
body[data-view=map] main { max-width: none; padding: 0; }
.mapwrap { position: relative; height: calc(100dvh - 61px); background: radial-gradient(1200px 800px at 50% 45%, #17140f, var(--bg) 70%); overflow: hidden; }
#cv { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.maplegend { position: absolute; left: 18px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: 70%; font-size: 12px; color: var(--dim); }
.maplegend span { display: flex; gap: 6px; align-items: center; } .maplegend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.maphint { position: absolute; right: 18px; bottom: 16px; font-size: 12px; }
.maptip { position: absolute; left: 18px; top: 16px; width: 320px; padding: 14px; background: #141416ee; border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(10px); pointer-events: none; }
.maptip b { display: block; font: 600 16px/1.3 var(--serif); margin: 8px 0 4px; } .maptip p { margin: 0; color: var(--dim); font-size: 13px; }

/* ---- Look 3: magazine */
.mag { max-width: 1080px; margin: 0 auto; padding-top: 30px; font-family: var(--serif); }
.mast { text-align: center; border-bottom: 3px double #3a3a40; padding-bottom: 14px; }
.mast h1 { font-size: clamp(48px, 9vw, 96px); margin: 2px 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.mast .small { font-family: var(--sans); letter-spacing: .14em; text-transform: uppercase; font-size: 11px; }
.lead { display: block; padding: 34px 0 30px; border-bottom: 1px solid var(--line); text-align: center; }
.kicker, .kick { font: 600 11.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.kick { color: var(--acc); border-top: 2px solid var(--fg); padding-top: 8px; margin: 26px 0 10px; }
.lead h2 { font-size: clamp(30px, 5vw, 54px); line-height: 1.08; margin: 10px auto 14px; max-width: 860px; letter-spacing: -0.02em; }
.lead .stand { font-size: 19px; line-height: 1.6; color: #c9c9ce; max-width: 720px; margin: 0 auto 12px; font-style: italic; }
.cols { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 0 34px; }
.cols section { margin: 0; }
.cols section + section { border-left: 1px solid var(--line); padding-left: 34px; }
.item { display: block; padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.item h3 { font-size: 19px; line-height: 1.25; margin: 0 0 6px; } .item.small h3 { font-size: 16px; }
.item p { margin: 0 0 4px; color: var(--dim); font-size: 15px; line-height: 1.5; }
.item:hover h3 { color: var(--acc); }
.item .tiny { font-family: var(--sans); }

/* ---- results */
.rhead { display: flex; align-items: baseline; gap: 14px; margin: 26px 0 6px; } .rhead h2 { font-size: 30px; margin: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 18px; }
.filters button { font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.filters button.on { color: var(--fg); border-color: var(--c, var(--acc)); background: color-mix(in srgb, var(--c, var(--acc)) 12%, transparent); }

/* ---- reader sheet */
.sheet { position: fixed; inset: 0; z-index: 30; background: #0008; opacity: 0; transition: opacity .2s; }
.sheet.open { opacity: 1; }
.sheet-in { position: absolute; right: 0; top: 0; bottom: 0; width: min(760px, 100%); overflow-y: auto; background: var(--bg); border-left: 1px solid var(--line); padding: 18px 40px 80px; transform: translateX(30px); transition: transform .22s ease; }
.sheet.open .sheet-in { transform: none; }
.rtop { display: flex; align-items: center; gap: 10px; position: sticky; top: -18px; background: var(--bg); padding: 10px 0; z-index: 2; font-size: 13px; }
h1.rt { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; margin: 14px 0 12px; }
.src { display: inline-block; margin: 0 8px 8px 0; font-size: 13px; color: var(--acc); border: 1px solid #f2b35b44; padding: 4px 12px; border-radius: 999px; }
.prose { font: 18px/1.7 var(--serif); color: #dcdce0; }
.prose h1 { display: none; }
.prose h2 { font-size: 24px; margin: 34px 0 10px; } .prose h3 { font-size: 19px; margin: 26px 0 8px; }
.prose a { color: var(--acc); border-bottom: 1px solid #f2b35b44; } .prose .wl.dead { color: var(--dim); }
.prose code { font: 14px ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--bg3); padding: 2px 6px; border-radius: 5px; }
.prose pre { background: #101012; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.55; }
.prose table { border-collapse: collapse; font: 14px var(--sans); width: 100%; margin: 14px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { color: var(--dim); font-weight: 600; }
.prose blockquote { margin: 16px 0; padding: 4px 18px; border-left: 3px solid #3a3a40; color: var(--dim); }
.prose ul, .prose ol { padding-left: 22px; } .prose li { margin: 5px 0; }
.callout { border: 1px solid var(--line) !important; border-left: 3px solid var(--cc, var(--acc)) !important; background: color-mix(in srgb, var(--cc, var(--acc)) 7%, var(--bg2)); border-radius: 12px; padding: 12px 18px !important; color: #dcdce0 !important; }
.callout-title { font: 600 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--cc, var(--acc)); margin: 4px 0 6px; }
.callout p { margin: 6px 0; }
.c-question { --cc: #8ab4ff; } .c-tip { --cc: #7dd3a8; } .c-warning { --cc: #ff8f7d; } .c-note { --cc: #c4a7ff; }
.tl { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.tl li { display: flex; gap: 14px; padding: 6px 0 6px 16px; position: relative; font-size: 14.5px; }
.tl li::before { content: ""; position: absolute; left: -4px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.tl-d { color: var(--faint); min-width: 64px; font-size: 12.5px; padding-top: 2px; }
.tl a:hover { color: var(--acc); }
.tl li:nth-child(n+26) { display: none; } .tl.all li { display: flex; }
body.reading { overflow: hidden; }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .qbox { order: 3; flex-basis: 100%; max-width: none; } kbd { display: none; }
  .looks { margin-left: auto; } .looks button { padding: 5px 10px; }
  main { padding: 0 14px 60px; }
  .hero { padding-top: 34px; } .qbig input { font-size: 16px; }
  .spark > a { padding: 22px; }
  .cols { grid-template-columns: 1fr; } .cols section + section { border-left: 0; padding-left: 0; }
  .sheet-in { padding: 14px 18px 60px; } .prose { font-size: 17px; }
  .list { grid-template-columns: 1fr; }
  .mapwrap { height: calc(100dvh - 105px); } .maptip { right: 14px; width: auto; } .maplegend { max-width: 100%; bottom: 40px; } .maphint { left: 14px; }
}
