/* The lens on weichseltree.com: today's look (dark, brass, serif), now around a marble. */
:root {
  color-scheme: dark;
  --bg: #070c12;
  --panel: #0c1521;
  --text: #f0eadf;
  --body: #bec5cf;
  --dim: #7e8b9b;
  --brass: #e1bd82;
  --edge: #1d2733;
  --rule: #4c5a69;
  --veil: rgba(7, 12, 18, 0.72);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --gutter: max(clamp(16px, 4vw, 56px), env(safe-area-inset-left), env(safe-area-inset-right));
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4efe6;
  --panel: #ebe3d6;
  --text: #1a1f26;
  --body: #39424d;
  --dim: #66717e;
  --brass: #8a6326;
  --edge: #d6ccbc;
  --rule: #a99c88;
  --veil: rgba(244, 239, 230, 0.78);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, sans-serif; }
a { color: var(--brass); text-underline-offset: 5px; }
a:hover { color: var(--text); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
.skip { position: absolute; left: 24px; top: 12px; transform: translateY(-200%); background: var(--text); color: var(--bg); padding: 10px 18px; z-index: 10; }
.skip:focus { transform: none; }

/* --- without script ---------------------------------------------------------------------------- */
.plain-head { padding: clamp(40px, 6vw, 88px) var(--gutter) 24px; }
.plain-head .mark { width: 26px; height: 36px; color: var(--brass); }
.plain-head h1 { font-size: clamp(2.6rem, 5.4vw, 6rem); letter-spacing: -0.05em; line-height: 0.94; margin-top: 16px; }
.plain-head .lede { max-width: 34rem; margin-top: 16px; color: var(--body); font-family: var(--serif); font-size: 1.2rem; }
.plain-list { list-style: none; margin: 0; padding: 8px var(--gutter) 40px; display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.plain-list a { display: block; text-decoration: none; border: 1px solid var(--edge); background: var(--panel); }
.plain-list img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--edge); }
.plain-list .title { display: block; padding: 12px 14px 0; font-family: var(--serif); font-size: 1.3rem; color: var(--text); }
.plain-list .version { display: block; padding: 0 14px 12px; font: 0.75rem/1.6 ui-monospace, monospace; color: var(--dim); }
.plain-list .empty { color: var(--dim); }
.plain-foot { padding: 0 var(--gutter) 40px; font-size: 0.85rem; }

/* --- the lens ---------------------------------------------------------------------------------- */
html.lens, html.lens body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.lens .plain-head, html.lens .plain-list, html.lens .plain-foot, html.lens .skip { display: none; }
#lens-app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; background: var(--bg); }
#stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }
#stage iframe.hidden { visibility: hidden; }

#ring { position: absolute; pointer-events: none; border: 1px solid color-mix(in srgb, var(--brass) 55%, transparent); border-radius: 50%; transition: border-color 0.3s, opacity 0.3s; }
#ring.target { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass), 0 0 40px color-mix(in srgb, var(--brass) 30%, transparent); }

#reading { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; max-width: min(36rem, calc(100vw - 32px)); text-shadow: 0 1px 8px var(--bg); }
#r-title { font-size: clamp(1.3rem, 2.2vw, 1.9rem); letter-spacing: -0.02em; line-height: 1.1; }
#r-line { color: var(--body); font-family: var(--serif); font-size: 1rem; margin-top: 2px; min-height: 1.6em; }
#r-trust { color: var(--dim); font: 0.72rem/1.5 ui-monospace, monospace; letter-spacing: 0.02em; }
#r-trust .warn { color: var(--brass); }

#bands { position: absolute; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; width: min(32rem, calc(100vw - 32px)); }
.band { display: grid; grid-template-columns: 6.5rem 1fr 5.5rem; align-items: center; gap: 10px; background: var(--veil); border: 1px solid var(--edge); padding: 4px 10px; backdrop-filter: blur(6px); }
.band label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band output { font: 0.75rem/1 ui-monospace, monospace; color: var(--body); text-align: right; white-space: nowrap; }
.band input[type="range"] { width: 100%; accent-color: var(--brass); min-height: 32px; }
.band .stops { display: flex; gap: 4px; flex-wrap: wrap; }
.band .stops button { font: inherit; font-size: 0.75rem; color: var(--body); background: transparent; border: 1px solid var(--edge); padding: 4px 8px; min-height: 32px; cursor: pointer; }
.band .stops button[aria-pressed="true"] { color: var(--bg); background: var(--brass); border-color: var(--brass); }

#strip { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; padding: 10px var(--gutter) max(10px, env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none; background: linear-gradient(transparent, var(--veil) 40%); touch-action: pan-x; }
#strip::-webkit-scrollbar { display: none; }
.pebble { flex: 0 0 auto; width: 132px; border: 1px solid var(--edge); background: var(--panel); color: var(--text); padding: 0; cursor: grab; text-align: left; font: inherit; user-select: none; -webkit-user-select: none; touch-action: pan-x; }
.pebble img, .pebble .blank { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--edge); pointer-events: none; }
.pebble span { display: block; padding: 4px 8px 6px; font-family: var(--serif); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pebble[aria-current="true"] { border-color: var(--brass); }
.pebble.failed span::after { content: " · hidden here"; color: var(--dim); font-family: system-ui, sans-serif; font-size: 0.7rem; }
.ghost { position: fixed; z-index: 20; width: 132px; pointer-events: none; opacity: 0.85; border: 1px solid var(--brass); transform: translate(-50%, -50%) scale(1.05); }
.ghost img, .ghost .blank { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--edge); }

.corner { position: absolute; display: flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 8px 12px; background: var(--veil); color: var(--body); border: 1px solid var(--edge); font: 0.72rem/1 system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; cursor: pointer; backdrop-filter: blur(6px); z-index: 5; }
.corner:hover { color: var(--text); }
.corner .icon { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--brass); transition: transform 0.4s, background 0.4s; }
.corner[aria-pressed="true"] .icon { background: var(--brass); transform: scale(0.8); }
#c-theme .icon { background: linear-gradient(90deg, var(--brass) 50%, transparent 50%); }
#c-theme[aria-pressed="true"] .icon { transform: rotate(180deg); background: linear-gradient(90deg, var(--brass) 50%, transparent 50%); }
.tr { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.br { right: max(12px, env(safe-area-inset-right)); bottom: calc(var(--strip-h, 120px) + 8px); }
.bl { left: max(12px, env(safe-area-inset-left)); bottom: calc(var(--strip-h, 120px) + 8px); }

html.bare #ring, html.bare #reading, html.bare #bands, html.bare #strip, html.bare #c-theme, html.bare #c-privacy { opacity: 0; pointer-events: none; }
html.bare #ring, html.bare #reading, html.bare #bands, html.bare #strip { transition: opacity 0.3s; }
html.bare .br { bottom: max(12px, env(safe-area-inset-bottom)); }

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

/* --- the privacy page -------------------------------------------------------------------------- */
.plain-text { max-width: 40rem; padding: 0 var(--gutter) 56px; color: var(--body); }
.plain-text h2 { color: var(--text); font-size: 1.4rem; margin: 28px 0 8px; }
.plain-text p + p { margin-top: 10px; }
.plain-text code { color: var(--text); font-size: 0.9em; }
