/* weichseltree.com: the lens (glass and metal, drawn by glass.js) and the plain pages. */
: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: 34px; height: 34px; 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 ----------------------------------------------------------------------------------
   The exhibit's frame lies under two canvases (glass.js: the glass and the metal; lens.js: what is
   engraved on it) and one layer that takes the hands. */
html.lens, html.lens body { height: 100%; overflow: hidden; overscroll-behavior: none; background: #070c12; }
html.lens .plain-head, html.lens .plain-list, html.lens .plain-foot, html.lens .skip { display: none; }
#lens-app { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
#stage { position: absolute; inset: 0; }
.socket { position: absolute; left: 0; top: 0; border-radius: 50%; overflow: hidden; clip-path: circle(50%); background: #05080d; will-change: transform; }
.socket iframe, .socket video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #05080d; transform-origin: 50% 50%; }
.socket video { object-fit: cover; }
.socket canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the credit of a globe's layer, at the foot of the glass: small, but there, as its sources ask */
#credit { position: absolute; height: 34px; margin: 0; display: flex; align-items: flex-end; justify-content: center; text-align: center; font: 10px/1.35 system-ui, sans-serif; color: var(--dim); text-shadow: 0 1px 3px #000; pointer-events: none; z-index: 4; }
#credit:empty { display: none; }
#credit a { color: #c4ccd6; text-decoration: none; pointer-events: auto; display: -webkit-inline-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; padding: 2px 8px; border-radius: 8px; background: rgba(5, 8, 13, 0.62); }
#credit a.plain { pointer-events: none; }
#credit a:hover, #credit a:focus-visible { color: var(--text); }
html.gl .socket video { opacity: 0; }
#glass, #flat, #marks { position: absolute; left: 0; top: 0; pointer-events: none; }
#touch { position: absolute; inset: 0; touch-action: none; cursor: default; }
#touch[data-over="glass"] { cursor: zoom-in; }
#touch[data-over="bezel"], #touch[data-over="ring"] { cursor: grab; }
#touch:active[data-over="bezel"], #touch:active[data-over="ring"] { cursor: grabbing; }

/* Words only when asked for (the corner with the i), or when the glass has nothing to show. */
#reading { position: absolute; left: max(12px, env(safe-area-inset-left)); top: calc(max(12px, env(safe-area-inset-top)) + 54px); max-width: min(22rem, calc(100vw - 24px)); padding: 12px 16px; border-radius: 14px; background: var(--veil); border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 6; }
#reading.closed { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }
html[data-status="hidden"] #reading.closed, html[data-status="empty"] #reading.closed { left: 50%; top: calc(50% + min(11vw, 11vh)); width: auto; height: auto; margin: 0; padding: 0; clip-path: none; overflow: visible; white-space: normal; transform: translateX(-50%); text-align: center; background: none; backdrop-filter: none; pointer-events: none; max-width: min(18rem, 50vmin); }
html[data-status="hidden"] #reading.closed > :not(#r-line), html[data-status="empty"] #reading.closed > :not(#r-line) { display: none; }
#r-title { font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.15; }
#r-line { color: var(--body); font-family: var(--serif); font-size: 0.95rem; margin-top: 2px; }
#r-trust { color: var(--dim); font: 0.7rem/1.5 ui-monospace, monospace; letter-spacing: 0.02em; margin-top: 4px; }
#r-trust .warn { color: var(--brass); }
#reading a { font-size: 0.8rem; }
/* the reading opens beside the focus that is lit */
#reading[data-corner="tr"] { left: auto; right: max(12px, env(safe-area-inset-right)); }
#reading[data-corner="bl"] { top: auto; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 54px); }

/* The dials as plain controls: for a keyboard and a screen reader. What is seen is the rings. */
.sr, #bands { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The small spheres in the corners (glass.js draws them): two switches, and the turret's neighbours. */
.tip { position: absolute; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #dfe8f2; cursor: pointer; z-index: 5; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.tip[hidden] { display: none; } /* (the sphere's own display would win over the attribute) */
html.no-gl .tip { background: color-mix(in srgb, var(--panel) 80%, transparent); }
.tip .ico { grid-area: 1 / 1; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s cubic-bezier(.3, 1.4, .5, 1), opacity 0.3s; }
.tip:hover .ico, .tip[aria-pressed="true"] .ico { color: #ffd696; }
.tip:active .ico { transform: scale(0.86); }
.tip.failed .ico { opacity: 0.45; }
.tip.focus[aria-expanded="true"] .ico { transform: rotate(360deg); }
#c-account[aria-pressed="true"] .ico { transform: scale(1.15); }

/* The session: what this device holds, on request, as the reading is. */
#account { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 54px); max-width: min(22rem, calc(100vw - 24px)); padding: 12px 16px; border-radius: 14px; background: var(--veil); border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: 6; }
#account.closed { display: none; }
#account h2 { font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.15; }
#account ul { list-style: none; margin: 6px 0 0; padding: 0; color: var(--body); font-family: var(--serif); font-size: 0.95rem; }
#account li span { color: var(--dim); font: 0.7rem/1.5 ui-monospace, monospace; margin-left: 6px; }
#a-note { color: var(--dim); font-size: 0.8rem; margin-top: 6px; }
#a-forget { margin-top: 8px; font: inherit; font-size: 0.85rem; color: var(--text); background: transparent; border: 1px solid var(--rule); border-radius: 8px; padding: 6px 12px; min-height: 36px; cursor: pointer; }
#a-forget:hover { border-color: var(--brass); color: var(--brass); }
.tl { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); }
.tr { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
.bl { bottom: max(12px, env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left)); }
.br { bottom: max(12px, env(safe-area-inset-bottom)); right: max(12px, env(safe-area-inset-right)); }

@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; }
