/* The plain page (#plain), and the switch between it and the 3daml view (html.engine, set by site.js). */
:root { --bg: #0A0A12; --surface: #161622; --surface2: #1E1C30; --text: #F3F2FA; --muted: #A9A7C2; --accent: #8F7CFF; --radius: 18px; color-scheme: dark; }
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font: 17px/1.6 Roboto, system-ui, "Segoe UI", sans-serif; scroll-behavior: smooth; }
body { margin: 0; }
a { color: var(--accent); }

/* the 3daml view takes the window; the plain page stays for screen readers and search engines */
#host { display: none; }
html.engine, html.engine body { height: 100%; overflow: hidden; }
html.engine #host { display: block; position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
html.engine #stage { position: absolute; transform-origin: 0 0; }
html.engine #plain { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#modeToggle { position: fixed; right: 16px; bottom: 16px; z-index: 30; font: 600 14px Roboto, system-ui, sans-serif; color: var(--text); background: rgba(22,22,34,.85);
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 8px 14px; cursor: pointer; backdrop-filter: blur(8px); }
#modeToggle[hidden] { display: none; }
#modeToggle:hover, #modeToggle:focus-visible { border-color: var(--accent); outline: none; }

/* ---- the plain page */
#plain { max-width: 1240px; margin: 0 auto; padding: 0 16px 48px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; flex-wrap: wrap; }
.brand { font: 800 30px/1 "Roboto Condensed", Roboto, sans-serif; letter-spacing: .2em; color: var(--text); text-decoration: none; }
.top nav { display: flex; gap: 6px; flex-wrap: wrap; }
.top nav a { color: var(--text); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.top nav a:hover, .top nav a:focus-visible { background: var(--accent); color: #0A0A12; outline: none; }
section { padding: 40px 0; border-top: 1px solid rgba(255,255,255,.06); }
.hero { display: grid; grid-template-columns: 5fr 6fr; gap: 40px; align-items: center; border-top: 0; }
.kicker { text-transform: uppercase; letter-spacing: .15em; color: var(--muted); font-size: 14px; margin: 0 0 8px; }
h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1.05; margin: 0 0 18px; }
h2 { font-size: clamp(26px, 3.4vw, 40px); margin: 0 0 22px; }
h3 { font-size: 21px; margin: 14px 0 6px; }
.lead { font-size: 19px; color: var(--text); max-width: 60ch; }
.heroArt video { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); box-shadow: 0 30px 80px #000c; background: var(--surface); display: block; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 999px; background: var(--accent); color: #0A0A12; font-weight: 700; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.25); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.cards.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: linear-gradient(160deg, var(--surface2), var(--surface)); border-radius: var(--radius); padding: 14px 16px 18px; }
.card img, .card video { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; display: block; background: #000; }
.card p { color: var(--muted); margin: 0; }
.card.text { padding: 22px; }
.where { color: var(--text) !important; margin-bottom: 6px !important; }
.tag { font-size: 12px; font-weight: 700; color: #0A0A12; background: var(--accent); border-radius: 999px; padding: 2px 9px; vertical-align: middle; margin-left: 6px; }
.split { display: grid; grid-template-columns: 2fr 3fr; gap: 32px; align-items: start; }
pre { background: #07070B; border-left: 4px solid var(--accent); border-radius: 12px; padding: 16px; overflow-x: auto; color: #C9F59A; font: 14px/1.55 "DejaVu Sans Mono", ui-monospace, monospace; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
figure { margin: 0; }
figure img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; display: block; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
figcaption b { color: var(--text); }
footer { border-top: 1px solid rgba(255,255,255,.06); padding-top: 22px; color: var(--muted); font-size: 14px; }
@media (max-width: 820px) {
  .hero, .split { grid-template-columns: 1fr; }
  .hero { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
