:root {
  --page: #f1ece6;
  --panel: #fdfcf9;
  --ink: #292824;
  --muted: #6a6457;
  --line: #ddd5ca;
  --accent: #9b2c4a;
  --on-accent: #ffffff;
  --ok: #1d7a4a;
  --warn: #8c5200;
  --bad: #b42318;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="dark"] {
  --page: #171412;
  --panel: #211c19;
  --ink: #f3ece4;
  --muted: #b7ad9f;
  --line: #3a322d;
  --accent: #f0a1b5;
  --on-accent: #2a1218;
  --ok: #67d49b;
  --warn: #f2b45a;
  --bad: #ff8a80;
}

.m-soft { --tile: #fde4ec; --tile-ink: #6b2742; --tile-line: #f4bfd0; }
.m-y2k { --tile: #dfe4ff; --tile-ink: #26308a; --tile-line: #b9c2fa; }
.m-gothic { --tile: #231c2b; --tile-ink: #eadcf5; --tile-line: #46375a; }
.m-coquette { --tile: #fff1e8; --tile-ink: #8f2a3b; --tile-line: #f1cdbd; }
.m-minimal { --tile: #ecebe6; --tile-ink: #2b2a27; --tile-line: #d3d1c8; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; padding-bottom: 66px; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--page); padding: 10px 14px; z-index: 100; border-radius: 8px; }
.skip:focus { top: 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }

.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-family: var(--serif); font-size: 24px; letter-spacing: -.05em; text-decoration: none; font-style: italic; min-height: 44px; display: inline-flex; align-items: center; }
.brand b { font-style: normal; color: var(--accent); font-weight: 400; }
.top nav { display: flex; align-items: center; gap: 2px; }
.top nav a, .icon-btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 22px; border: 0; background: transparent; text-decoration: none; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.top nav a:hover, .icon-btn:hover { background: var(--line); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }

.moodnav { position: sticky; top: 56px; z-index: 40; background: var(--page); border-bottom: 1px solid var(--line); }
.moodnav .wrap { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 8px; padding-bottom: 8px; }
.moodnav .wrap::-webkit-scrollbar { display: none; }
.moodnav a { flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; font-size: 14px; font-family: var(--serif); font-style: italic; transition: background .2s, color .2s, border-color .2s; }
.moodnav a[aria-current="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }

.hero { padding: 26px 0 8px; display: grid; gap: 20px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 11vw, 84px); line-height: .98; letter-spacing: -.055em; margin: 10px 0 0; }
.hero h1 em { color: var(--accent); }
.hero .lead { margin: 12px 0 0; color: var(--muted); max-width: 46ch; }
.hero { grid-template-areas: "lead" "stage" "extra"; }
.herolead { grid-area: lead; display: grid; gap: 14px; align-content: start; }
.stage { grid-area: stage; }
.heroextra { grid-area: extra; display: grid; gap: 10px; }
.hero .lead { display: none; }
.tryfield { display: flex; align-items: center; background: var(--panel); border: 1.5px solid var(--line); border-radius: 30px; padding: 0 8px 0 20px; min-height: 58px; transition: border-color .15s, box-shadow .15s; }
.tryfield:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.tryfield input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 20px; min-height: 54px; }
.tryfield input:focus-visible { outline: none; }
.tryfield input::placeholder { color: var(--muted); }
.stage { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: 28px 18px 16px; min-height: 230px; display: flex; flex-direction: column; justify-content: space-between; text-align: center; overflow: hidden; }
.stage .big { font-size: clamp(34px, 9vw, 58px); line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; transition: opacity .3s var(--ease), transform .3s var(--ease); margin: auto 0; padding: 8px 0; }
.stage .big.out { opacity: 0; transform: translateY(8px); }
.stage .big.ghost { opacity: .6; }
.stage .cap { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.stage .cap b { color: var(--ink); font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 16px; }
.stage .ctl { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: transparent; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.pill:hover { background: var(--line); }
.pill.solid { background: var(--ink); color: var(--page); border-color: var(--ink); }
.pill.solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.fit { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fit .f { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; min-height: 32px; }
.fit .f b { font-variant-numeric: tabular-nums; font-weight: 700; }
.fit .f.over { border-color: var(--bad); color: var(--bad); }
.fit .f.ok b { color: var(--ok); }
.fit .f.over b { color: var(--bad); }
.fit-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; width: 100%; }

.opts { display: flex; flex-wrap: wrap; gap: 0 18px; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; background: transparent; border: 0; padding: 0; font-size: 14px; }
.switch .track { width: 40px; height: 24px; border-radius: 24px; background: var(--line); position: relative; transition: background .2s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] .track { background: var(--accent); }
.switch[aria-checked="true"] .track::after { transform: translateX(16px); }

.ad { display: grid; place-items: center; height: 100px; margin: 18px 0; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.ad.tall { height: 250px; }
.anchor-ad { position: fixed; left: 0; right: 0; bottom: 0; height: 50px; z-index: 60; display: grid; place-items: center; background: var(--panel); border-top: 1px dashed var(--line); color: var(--muted); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }

.shelf { margin: 8px 0 0; }
.shelf:empty { display: none; }
.shelf-in { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; align-items: center; padding: 4px 0; }
.shelf-in::-webkit-scrollbar { display: none; }
.shelf .lab { flex: none; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.chip { flex: none; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mood { padding: 36px 0 10px; }
.mood header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mood h2 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(34px, 8vw, 56px); letter-spacing: -.05em; line-height: 1; margin: 0; }
.mood header p { margin: 0; color: var(--muted); font-size: 14px; max-width: 40ch; }
.masonry { list-style: none; margin: 0; padding: 0; column-count: 2; column-gap: 12px; }
.masonry > li { break-inside: avoid; margin: 0 0 12px; position: relative; }
.tile { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; background: var(--tile, var(--panel)); color: var(--tile-ink, var(--ink)); border: 1px solid var(--tile-line, var(--line)); border-radius: 20px; padding: 18px 14px 12px; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(41, 40, 36, .14); }
.tile:active { transform: scale(.985); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile .pv { display: block; font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; white-space: pre-wrap; }
.tile .pv.s1 { font-size: 30px; }
.tile .pv.s2 { font-size: 21px; }
.tile .pv.s3 { font-size: 34px; line-height: 1.2; }
.tile .pv.ghost { opacity: .6; }
.tile .plainline { display: none; font-size: 12px; margin-top: 8px; opacity: .8; overflow-wrap: anywhere; }
body.readable .tile .plainline { display: block; }
.tile .meta { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-right: 40px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; opacity: .85; flex-wrap: wrap; }
.tile .meta i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.tile .meta i.r1 { background: var(--warn); }
.tile .meta i.r2 { background: var(--bad); }
.tile .meta .len { font-variant-numeric: tabular-nums; opacity: .8; }
.tile .meta .len.over { color: var(--bad); }
.m-gothic .tile .meta i.r0 { background: #67d49b; }
.m-gothic .tile .meta i.r1 { background: #f2b45a; }
.m-gothic .tile .meta i.r2 { background: #ff8a80; }
.fav { position: absolute; right: 2px; bottom: 2px; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; color: var(--tile-ink, var(--ink)); }
.fav:hover { background: rgba(127, 127, 127, .18); }
.fav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.more { display: flex; justify-content: center; margin-top: 4px; }

.hub { padding: 44px 0 10px; }
.hub h2 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(34px, 8vw, 56px); letter-spacing: -.05em; line-height: 1; margin: 0 0 6px; }
.hub > p { color: var(--muted); margin: 0 0 16px; max-width: 52ch; }
.hubgrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.hubtile { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.hubtile h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -.03em; margin: 0 0 10px; display: flex; align-items: baseline; justify-content: space-between; }
.hubtile h3 a { min-height: 44px; display: inline-flex; align-items: center; margin: -12px 0; font-family: var(--sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.symchips { display: flex; flex-wrap: wrap; gap: 6px; }
.symchips button { min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: transparent; font-size: 20px; }
.symchips button:hover { background: var(--line); }
.divlist { display: grid; gap: 4px; }
.divlist button { min-height: 44px; text-align: center; border: 1px solid var(--line); background: transparent; border-radius: 14px; padding: 6px 10px; overflow-wrap: anywhere; }
.divlist button:hover { background: var(--line); }

.prose { padding: 44px 0 6px; max-width: 64ch; }
.prose h2, .faq h2, .related h2 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 36px; letter-spacing: -.05em; line-height: 1.05; margin: 0 0 14px; }
.prose p { margin: 0 0 14px; }
.faq { padding: 26px 0 6px; max-width: 64ch; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { min-height: 56px; display: flex; align-items: center; font-family: var(--serif); font-size: 19px; cursor: pointer; }
.faq p { margin: 0 0 14px; color: var(--muted); }
.related { padding: 26px 0 20px; }
.related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 18px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.related a:hover { background: var(--ink); color: var(--page); }
.crumbs { font-size: 12px; color: var(--muted); padding: 14px 0 0; letter-spacing: .04em; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }
.explain { margin-top: 20px; max-width: 64ch; }
.explain summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.explain p { color: var(--muted); margin: 0 0 12px; }

footer { margin-top: 30px; border-top: 1px solid var(--line); padding: 22px 0 32px; font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; flex-direction: column; gap: 6px; }

#toast { position: fixed; left: 50%; bottom: 74px; transform: translate(-50%, 12px); background: var(--ink); color: var(--page); padding: 10px 20px; border-radius: 22px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); z-index: 70; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  :root { --gutter: 32px; }
  body { padding-bottom: 0; }
  .anchor-ad { display: none; }
  #toast { bottom: 28px; }
  .masonry { column-count: 3; column-gap: 16px; }
  .masonry > li { margin-bottom: 16px; }
  .hero { grid-template-columns: 1.05fr 1fr; grid-template-areas: "lead stage" "extra stage"; gap: 20px 40px; padding: 56px 0 14px; align-items: start; }
  .hero .lead { display: block; }
  .stage { min-height: 360px; padding: 36px 28px 20px; }
  .hubgrid { grid-template-columns: repeat(2, 1fr); }
  .hubtile.wide { grid-column: span 2; }
  .divlist { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1100px) {
  .masonry { column-count: 4; }
  .hubgrid { grid-template-columns: repeat(4, 1fr); }
  .hubtile.wide { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
