/* Lens site chrome: gallery, piece pages, theater. The piece frame itself is engine/v1/lens.css. Design 1 "Darkroom". */
:root {
  --bg: #050608; --bg-2: #0b0e12; --card: #0d1116; --ink: #e9edf2; --soft: #a3adb9; --faint: #6c7682; --line: #1d232b;
  --accent: #f2f4f7; --accent-ink: #050608; --warm: #f2c27b; --note: #1a1710; --note-line: #4d4126; --note-ink: #ecd6a5;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #f4f5f7; --bg-2: #eceef1; --card: #ffffff; --ink: #11151b; --soft: #4d5764; --faint: #77818d; --line: #d9dee4;
    --accent: #11151b; --accent-ink: #fff; --warm: #9a5b12; --note: #fff6df; --note-line: #e6cc8c; --note-ink: #5e4205; }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 16px/1.6 var(--sans); background: radial-gradient(ellipse at 20% -20%, var(--bg-2), transparent 60%), var(--bg); min-height: 100vh; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lens-focus, #8fd3ff); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 8px 16px 64px; }
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1120px; margin: 0 auto; padding: 14px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 18px var(--serif); letter-spacing: .04em; }
.brand .mark { width: 26px; height: 26px; }
.site-head nav { display: flex; gap: 4px; }
.site-head nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--soft); font-size: 15px; }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--ink); background: var(--card); }
.site-foot { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.site-foot p { margin: 0 0 6px; max-width: 70ch; }

h1 { font: 500 clamp(34px, 6vw, 58px)/1.05 var(--serif); margin: 8px 0 12px; letter-spacing: -.005em; }
h2 { font: 500 22px/1.25 var(--serif); margin: 0 0 8px; }
.kicker { font: 600 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin: 28px 0 4px; }
.lede { font-size: 19px; color: var(--soft); max-width: 60ch; margin: 0 0 16px; }
.muted { color: var(--soft); }
.small { font-size: 13px; }
.crumbs { font: 13px var(--mono); color: var(--faint); margin: 12px 0 0; }
.crumbs a { text-decoration: none; color: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--soft); }
.chip.soft { text-transform: none; letter-spacing: 0; font-weight: 500; }
.chip.stage-playable, .chip.stage-polished { color: var(--ink); border-color: var(--soft); }
.chip.stage-seed, .chip.stage-sketch { color: var(--warm); border-color: color-mix(in srgb, var(--warm) 45%, transparent); }
.stance { color: var(--faint); font-size: 14px; margin: 0 0 14px; max-width: 75ch; }
.note { background: var(--note); border: 1px solid var(--note-line); color: var(--note-ink); padding: 8px 12px; border-radius: 10px; font-size: 14px; max-width: 75ch; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  text-decoration: none; font: 500 15px var(--sans); cursor: pointer; }
.btn:hover { border-color: var(--soft); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.piece-host { margin: 6px 0 4px; }
.text { max-width: 72ch; margin-top: 28px; }
.text h2, .text h3 { font-family: var(--serif); font-weight: 500; margin: 28px 0 8px; }
.text p, .text li { color: var(--soft); }
.text strong { color: var(--ink); }
.text blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--line); }
.text code, .block code { font: 13px var(--mono); background: var(--card); padding: 1px 5px; border-radius: 4px; }
.block { margin-top: 32px; max-width: 80ch; }
.code { width: 100%; font: 12.5px/1.5 var(--mono); color: var(--soft); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin: 0 0 4px; }
.questions { margin: 20px 0; padding: 16px 18px; border: 1px dashed var(--warm); border-radius: 12px; max-width: 75ch; }
.questions h2 { color: var(--warm); font-size: 19px; }
.questions p, .questions li { color: var(--soft); }

/* Gallery */
.hero { padding: 12px 0 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 18px; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--soft); font-size: 14px; cursor: pointer; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card[data-stage="seed"], .card[data-stage="sketch"] { display: none; }
.show-wip .card[data-stage="seed"], .show-wip .card[data-stage="sketch"] { display: flex; }
.card-pic { display: block; aspect-ratio: 16 / 9; background: radial-gradient(circle at 50% 55%, hsl(var(--h) 60% 22%), #000 70%); position: relative; }
.card-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-pic .glyph { position: absolute; left: 50%; top: 50%; width: 36%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  border: 2px solid hsl(var(--h) 70% 72% / .8); box-shadow: 0 0 40px hsl(var(--h) 80% 60% / .35), inset 0 0 30px hsl(var(--h) 80% 60% / .25); }
.card-pic .glyph::after { content: ""; position: absolute; inset: 28%; border-radius: 50%; border: 1px solid hsl(var(--h) 70% 80% / .6); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-body h2 { font-size: 21px; margin: 0 0 4px; }
.card-body h2 a { text-decoration: none; }
.card-body p { margin: 0 0 10px; color: var(--soft); font-size: 15px; }
.card-actions { margin-top: auto !important; display: flex; gap: 14px; }
.card-actions a { font-size: 14px; color: var(--ink); }
.empty { margin-top: 18px; }

/* Theater */
.page-theater { background: var(--lens-stage, #000); overflow: hidden; }
.theater-back, .theater-full, .theater-note { position: fixed; z-index: 6; transition: opacity .5s ease; }
.theater-back { top: 12px; left: 12px; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: #fff; background: rgba(0,0,0,.45); font-size: 14px; backdrop-filter: blur(6px); }
.theater-full { top: 12px; right: 12px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); color: #fff; background: rgba(0,0,0,.45); font: 500 14px var(--sans); cursor: pointer; backdrop-filter: blur(6px); }
.theater-note { left: 14px; top: 54px; margin: 0; max-width: 46ch; font-size: 11.5px; line-height: 1.4; color: #fff; padding: 4px 8px; border-radius: 8px; background: rgba(0,0,0,.4); opacity: .8; }
.lens-idle .theater-back, .lens-idle .theater-full { opacity: 0; pointer-events: none; }
.lens-idle .theater-note { opacity: .35; }
@media (max-width: 640px) { .theater-back span { display: none; } }
