/* Art Bibles site. Neutral chrome so each style's own colours and type carry its page. */
:root {
  --bg: #f6f4ef;
  --panel: #ffffff;
  --text: #1d1b18;
  --dim: #6b665e;
  --line: #e2ddd3;
  --link: #2f5bd3;
  --chip: #ece8df;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .06);
  --radius: 10px;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f;
    --panel: #1f1d18;
    --text: #ece7dc;
    --dim: #a39c8e;
    --line: #34312a;
    --link: #8fb0ff;
    --chip: #2b2822;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: .86em var(--mono); background: var(--chip); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow: auto; }
pre code { background: none; padding: 0; font-size: 13px; }
h1, h2, h3 { line-height: 1.2; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.dim { color: var(--dim); }
small { color: var(--dim); font-weight: 400; font-size: .8em; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; white-space: nowrap; align-items: center; gap: 10px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.brand-mark { width: 20px; height: 20px; border-radius: 5px; background: conic-gradient(#D62828 0 25%, #1F5FBF 0 50%, #FFD23F 0 75%, #2E9E5B 0); }
.topbar nav { display: flex; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.topbar nav a { color: var(--dim); }
.topbar nav a:hover { color: var(--text); text-decoration: none; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; max-width: 1240px; margin: 64px auto 0; padding: 24px; color: var(--dim); font-size: 13px; border-top: 1px solid var(--line); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font: 600 14px var(--sans); cursor: pointer;
  background: var(--s-accent, var(--text)); color: var(--s-bg, var(--bg)); border: 1px solid transparent; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; opacity: .85; }
.linkish { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; background: var(--chip); color: var(--text); }

/* ---------- index ---------- */
.intro { padding: 48px 0 24px; max-width: 760px; }
.intro h1 { font-size: clamp(36px, 6vw, 56px); margin: 0 0 12px; letter-spacing: -.03em; }
.intro p { color: var(--dim); font-size: 18px; margin: 0 0 24px; }
.filters { display: grid; gap: 12px; }
#q { width: 100%; max-width: 520px; padding: 11px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: var(--dim); border-radius: 999px; padding: 3px 10px; font: 13px var(--sans); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; padding: 8px 0; }
.card { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); color: var(--text); transition: transform .15s; }
.card:hover { transform: translateY(-3px); text-decoration: none; }
.card[hidden] { display: none; }
.card-mosaic { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; height: 200px; gap: 2px; background: var(--s-bg); }
.card-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.card-mosaic img:first-child { grid-row: span 2; }
.card-mosaic img:nth-child(n+4) { display: none; }
.card-head { background: var(--s-bg); color: var(--s-fg); padding: 16px 18px 14px; }
.card-head h2 { margin: 0 0 10px; font-size: 28px; }
.card-body { padding: 14px 18px 18px; display: grid; gap: 6px; }
.card-body .idea { margin: 0 0 4px; font-size: 16.5px; }
.card-body .meta { margin: 0; font-size: 13.5px; color: var(--dim); }
.card-body .meta b { color: var(--text); font-weight: 600; margin-right: 4px; }
.strip { display: flex; height: 10px; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 1px rgba(127, 127, 127, .25); }
.strip span { flex: 1; }
.strip.big { height: 18px; border-radius: 9px; max-width: 520px; }
.empty { color: var(--dim); }

/* ---------- style page ---------- */
.hero { background: var(--s-bg); color: var(--s-fg); transition: background .3s, color .3s; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 6px; background: var(--s-accent); }
.hero-inner { padding-top: 40px; padding-bottom: 40px; display: grid; gap: 14px; }
.hero a { color: inherit; }
.crumbs { margin: 0; font-size: 13px; opacity: .75; }
.hero h1 { font-size: clamp(42px, 7vw, 84px); margin: 0; letter-spacing: -.01em; }
.hero-idea { font-size: clamp(18px, 2.2vw, 23px); margin: 0; max-width: 820px; opacity: .92; }
.hero .tag { background: color-mix(in srgb, var(--s-fg) 14%, transparent); color: var(--s-fg); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hero .btn { background: var(--s-accent); color: var(--s-bg); }
.hero .btn.ghost { background: transparent; color: var(--s-fg); }
.variant-pick { font-size: 14px; display: flex; gap: 8px; align-items: center; opacity: .9; }
.variant-pick select { font: inherit; padding: 4px 8px; border-radius: 6px; }

.layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; padding-top: 32px; }
.toc { position: sticky; top: 72px; align-self: start; font-size: 14px; }
.toc nav { display: grid; gap: 2px; border-left: 2px solid var(--line); }
.toc a { color: var(--dim); padding: 4px 12px; margin-left: -2px; border-left: 2px solid transparent; }
.toc a.on { color: var(--text); border-left-color: var(--s-accent, var(--text)); font-weight: 600; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc .best { color: var(--dim); font-size: 13px; padding: 0 12px; }
.toc .best b { display: block; color: var(--text); }
.content { min-width: 0; }
.block { padding: 8px 0 40px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.block:last-child { border-bottom: 0; }
.block > h2 { font-size: 30px; margin: 0 0 6px; font-family: var(--display, var(--sans)); letter-spacing: -.01em; }
.lede { color: var(--dim); margin: 0 0 22px; }
.idea-block { font-size: 19px; line-height: 1.7; }
.idea-block h2 { font-size: 30px; }

.touch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 0; border-top: 1px solid var(--line); }
.touch:first-of-type { border-top: 0; }
.touch-pics { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.touch-pics img, .refs img { cursor: zoom-in; border-radius: 8px; background: var(--chip); }
.touch-pics img { height: 220px; width: auto; max-width: 420px; object-fit: cover; flex: none; scroll-snap-align: start; box-shadow: var(--shadow); }
.touch-text h3 { margin: 0 0 4px; font-size: 19px; }
.touch-text p { margin: 0 0 6px; max-width: 820px; }
.more { font-size: 14px; }
.touch-group { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin: 28px 0 0; padding-top: 8px; }
.touch-group + .touch { border-top: 0; }
.img-missing.link-tile { height: 96px; width: 260px; text-decoration: none; }
.img-missing.link-tile:hover { border-color: var(--s-accent, var(--link)); text-decoration: none; }
.img-missing { display: inline-flex; flex-direction: column; justify-content: center; gap: 6px; height: 220px; width: 220px; flex: none; padding: 16px;
  border-radius: 8px; border: 1px dashed var(--line); color: var(--dim); font-size: 13px; background: var(--panel); }
.img-missing b { color: var(--text); font-weight: 600; }

.core { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: c; }
.core li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; background: var(--panel); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.core .n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; background: var(--s-accent, var(--text)); color: var(--s-bg, var(--bg)); }

.dials { display: grid; gap: 12px; }
.dial { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.dial h3 { margin: 0 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.dial-ends { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; position: relative; }
.dial-ends::before { content: ''; position: absolute; left: 0; right: 0; top: -4px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--s-accent, var(--text)), var(--s-surface, var(--dim))); opacity: .5; }
.dial-ends span:last-child { text-align: right; }

.directions, .traps { padding-left: 20px; display: grid; gap: 10px; }
.traps li::marker { content: '✕  '; color: #c0392b; }

.variant { background: var(--panel); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); outline: 2px solid transparent; transition: outline-color .2s; }
.variant.current { outline-color: var(--s-accent); }
.variant-head h3 { margin: 0; font-size: 17px; }
.variant-head p { margin: 2px 0 8px; color: var(--dim); font-size: 14px; }
.pairs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pair { font-size: 12.5px; padding: 3px 9px; border-radius: 6px; box-shadow: 0 0 0 1px rgba(127, 127, 127, .25); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.swatch { display: grid; grid-template-rows: 64px auto auto; text-align: left; padding: 0; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 8px; overflow: hidden; cursor: copy; font: inherit; }
.swatch .chip-c { background: var(--c); }
.swatch .sw-role { font-weight: 600; font-size: 13.5px; padding: 6px 10px 0; }
.swatch code { background: none; padding: 0 10px; font-size: 12px; color: var(--dim); }
.swatch .sw-note { font-size: 12px; color: var(--dim); padding: 2px 10px 8px; line-height: 1.35; }
.swatch:not(:has(.sw-note)) code { padding-bottom: 8px; }
.starting { color: var(--dim); font-size: 15px; }

.type-spec { background: var(--panel); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.type-label { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; font-size: 13px; }
.type-label span { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--dim); }
.type-label code.dim { color: var(--dim); }
.type-sample { margin: 10px 0 0; line-height: 1.3; outline: none; }
.audio h3 { font-size: 15px; margin: 20px 0 8px; }
.audio .tag { margin: 0 4px 6px 0; }

.refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.refs figure { margin: 0; background: var(--panel); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.refs img { width: 100%; height: 220px; object-fit: contain; display: block; }
.refs img.pixel { image-rendering: pixelated; }
.refs figcaption { font-size: 13px; color: var(--dim); padding-top: 8px; }

.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

.brief-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
#brief-form { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.field textarea, .field select, #b-text { font: 14px var(--sans); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 14px; }
legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.b-dial-name { font-weight: 600; font-size: 14px; }
.b-dial-row { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 10px; align-items: center; font-size: 12.5px; color: var(--dim); }
.b-dial-row span:last-child { text-align: right; }
.b-dial-row input { width: 100%; accent-color: var(--s-accent, var(--link)); }
.b-dial.open .b-dial-row { opacity: .45; }
.b-open { font-size: 12.5px; color: var(--dim); display: inline-flex; gap: 4px; align-items: center; }
.b-touch { display: grid; gap: 6px; font-size: 13.5px; }
.b-touch label { display: flex; gap: 8px; align-items: baseline; }
.brief-out { position: sticky; top: 72px; display: grid; gap: 10px; }
#b-text { font: 13px/1.55 var(--mono); width: 100%; resize: vertical; }
.brief-actions { display: flex; gap: 8px; }

.prose { max-width: 860px; padding-top: 32px; }
.pal-style { margin: 0 0 36px; }
.pal-style h2 { margin: 0 0 10px; font-size: 22px; }
.pal-style h2 a { color: var(--text); }
.pal-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; margin-bottom: 6px; }
.pal-name { font-size: 14px; color: var(--dim); }
.pal-cells { display: flex; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px rgba(127, 127, 127, .25); }
.pal-cell { flex: 1; min-width: 0; height: 56px; border: 0; padding: 6px; font: 11px var(--sans); text-align: left; display: flex; flex-direction: column; justify-content: flex-end; cursor: copy; overflow: hidden; }
.pal-cell span, .pal-cell code { opacity: 0; transition: opacity .15s; white-space: nowrap; background: none; padding: 0; font-size: 10.5px; }
.pal-cell:hover span, .pal-cell:hover code { opacity: 1; }

.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(10, 9, 8, .92); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.viewer[hidden] { display: none; }
.viewer figure { margin: 0; display: grid; justify-items: center; gap: 12px; padding: 24px 0; max-height: 100vh; }
.viewer img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 6px; }
.viewer figcaption { color: #eee; font-size: 15px; text-align: center; max-width: 80ch; }
.viewer figcaption a { color: #9cb8ff; }
.viewer button { background: none; border: 0; color: #fff; font-size: 44px; cursor: pointer; opacity: .7; height: 100%; }
.viewer button:hover { opacity: 1; }
.viewer-close { position: absolute; top: 8px; right: 16px; height: auto !important; font-size: 36px !important; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-size: 14px; z-index: 60; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .brief-grid { grid-template-columns: 1fr; }
  .brief-out { position: static; }
  .pal-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .topbar { padding: 10px 16px; }
  .topbar nav { gap: 12px; }
  .topbar nav a:last-child { display: none; }
  .cards { grid-template-columns: 1fr; }
  .touch-pics img { height: 170px; max-width: 300px; }
  .dial-ends { grid-template-columns: 1fr; gap: 6px; }
  .dial-ends span:last-child { text-align: left; }
  .b-dial-row { grid-template-columns: 1fr; }
  .b-dial-row span:last-child { text-align: left; }
}
