/* Cubes website: the look of the page. */
/* Layout: the game world is a fixed background; one see-through sheet, like a catalogue entry, sits over its left side,
   with small labels in a margin column and the text beside them. One dark look by choice, matching the game. */
:root {
  --bg: #0e181e;
  --sheet: rgba(44, 60, 69, 0.78);
  --ink: #e9eff0;
  --ink-dim: #b4c3c8;
  --ink-faint: #8a9ea5;
  --rule: rgba(214, 236, 244, 0.16);
  --slot: rgba(214, 236, 244, 0.06);
  /* The masthead sits on the world itself, so it keeps light text whatever the sheet looks like. */
  --mast-ink: #e9eff0;
  --mast-dim: #a2b3b8;
  --c1: #26384a; --c2: #d95d52; --c3: #e0ad3b; --c4: #4ba69d;
  --mark: "Krona One", "Arial Black", system-ui, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --label: "Barlow Semi Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --column: 880px;   /* the width of the text panel; the menu ends at its right edge */
  color-scheme: dark;
}
html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 1.62; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
a:focus-visible { outline: 2px solid var(--c3); outline-offset: 3px; border-radius: 2px; }

/* The full screen height with a phone's address bar hidden (lvh; vh for older browsers), so the world keeps its size,
   and its camera its framing, while the bar slides in and out on scrolling; the bar just covers the bottom strip. */
#world { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; display: block; z-index: 0; }
.page { position: relative; z-index: 1; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: clamp(20px, 4vw, 44px) calc(clamp(32px, 6vw, 72px) + env(safe-area-inset-bottom, 0px)); }
.frame { max-width: 1180px; margin: 0 auto; display: grid; gap: clamp(36px, 9vw, 120px); }

.label { font-family: var(--label); font-weight: 600; font-size: 13px; line-height: 1.4; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }

/* Masthead on the open world */
.mast { max-width: var(--column); box-sizing: border-box; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 32px; }
.mark { display: flex; align-items: center; gap: 14px; }
.mark h1 { color: var(--mast-ink); display: flex; align-items: center; gap: 10px; font-family: var(--mark); font-weight: 400; font-size: 22px; line-height: 1; letter-spacing: 0.2em; }
.mark h1 .home { text-decoration: none; }
.mark h1 .working { font-family: var(--label); font-weight: 500; font-size: 15px; letter-spacing: 0.06em; line-height: 1; color: var(--mast-dim); }
.mast nav ul { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.mast nav a { font-family: var(--label); font-weight: 500; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--mast-dim); }
.mast nav a:hover { color: var(--mast-ink); }
.mast, .mast nav a { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }

/* The sections: one see-through panel each, with a strip of the world showing between them */
.sheet { max-width: var(--column); box-sizing: border-box; display: grid; gap: clamp(12px, 2vw, 20px); }
.entry { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 10px 28px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: clamp(22px, 3.6vw, 36px) clamp(20px, 4vw, 48px); }
.entry > .label { padding-top: 5px; }
.body { display: grid; gap: 16px; min-width: 0; }
.body p { max-width: 36em; }
/* The About text in the menu's font. Delete this rule to go back to the serif. */
#about .body p { font-family: var(--label); font-weight: 400; font-size: 17px; line-height: 1.5; letter-spacing: 0.01em; }
.wip { color: var(--ink-dim); font-style: italic; }

/* Catalogue data */
.meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; }
.meta dt { font-family: var(--label); font-weight: 500; font-size: 15px; letter-spacing: 0.04em; color: var(--ink-faint); padding-top: 1px; }
.meta dd { color: var(--ink); }

/* Documentation: figure slots until the images and videos arrive */
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
.figs figure { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.figs .wide { grid-column: 1 / -1; }
.slot { aspect-ratio: 16 / 10; width: 100%; max-width: 100%; box-sizing: border-box; background: var(--slot); border: 1px dashed var(--rule); display: grid; place-items: center;
  font-family: var(--label); font-weight: 500; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.wide .slot { aspect-ratio: 16 / 9; }
.play { width: 0; height: 0; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent var(--ink-faint); }
.slot span { display: grid; justify-items: center; }
figcaption { font-size: 13.5px; line-height: 1.45; color: var(--ink-faint); }
figcaption b { font-family: var(--label); font-weight: 600; letter-spacing: 0.06em; color: var(--ink); margin-right: 6px; }

/* Exhibitions, in CV form */
.cv { display: grid; gap: 22px; }
.cv h3 { font-family: var(--label); font-weight: 600; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 4px; }
.cv li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 2px 18px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.cv li:last-child { border-bottom: 0; }
.cv .when { font-family: var(--label); font-weight: 500; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--ink-dim); padding-top: 1px; }
.cv .what { min-width: 0; }
.cv .what i { display: block; color: var(--ink); }
.cv .what .detail { display: block; color: var(--ink-dim); }
.tba { color: var(--ink-faint); font-style: italic; }

.to-top { position: fixed; z-index: 2; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  padding: 9px 14px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  color: var(--ink-dim); text-decoration: none; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s, visibility 0s 0.25s; }
.to-top.shown { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s, transform 0.25s; }
.to-top:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .to-top, .to-top.shown { transition: none; transform: none; } }
.colophon { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: clamp(22px, 3vw, 30px); margin-top: clamp(4px, 1vw, 8px); border-top: 1px solid var(--rule); }

@media (max-width: 640px) {
  .entry { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .entry > .label { padding-top: 0; }
  .figs { grid-template-columns: minmax(0, 1fr); }
  }

/* Real media in the documentation: an <img>, <video> or embedded player takes the place of a .slot */
.figs img, .figs video, .figs iframe { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 0; background: var(--slot); }
.figs .wide img, .figs .wide video, .figs .wide iframe { aspect-ratio: 16 / 9; }
.figs .tall img, .figs .tall video, .figs .tall iframe { aspect-ratio: 4 / 3; }

/* The picture viewer (page.js): a Documentation picture shown large and whole over a dark backdrop.
   It keeps the masthead's light colours, so it looks the same whichever sheet style the page uses. */
.figs img { cursor: zoom-in; }
.figs img:focus-visible { outline: 2px solid var(--c3); outline-offset: 3px; }
html.lightbox-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--mast-ink); }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; box-sizing: border-box; cursor: zoom-out;
  padding: max(56px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: lightbox-in 0.2s ease; }
.lightbox::backdrop { background: rgba(5, 10, 13, 0.96); }
.lightbox[open]::backdrop { animation: lightbox-in 0.2s ease; }
.lightbox img { display: block; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-caption { flex: none; font-size: 13.5px; line-height: 1.45; color: var(--mast-dim); }
.lightbox button { cursor: pointer; border: 0; background: none; color: var(--mast-dim); }
.lightbox button:hover { color: var(--mast-ink); }
.lightbox button:focus-visible { outline: 2px solid var(--c3); outline-offset: 2px; }
.lightbox-close { position: absolute; top: max(10px, env(safe-area-inset-top, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); padding: 10px; }
.lightbox-step { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; display: grid; place-items: center;
  border-radius: 3px; font-family: var(--label); font-size: 36px; line-height: 1; }
.lightbox button.lightbox-step { background: rgba(5, 10, 13, 0.5); }
.lightbox-step[hidden] { display: none; }
.lightbox-step.prev { left: max(8px, env(safe-area-inset-left, 0px)); }
.lightbox-step.next { right: max(8px, env(safe-area-inset-right, 0px)); }
@keyframes lightbox-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lightbox[open], .lightbox[open]::backdrop { animation: none; } }

/* Sheet styles. The default (no class) is a lighter slate. Put one of these classes on <body> in index.html
   to try another:  <body class="sheet-pale">  a pale paper sheet with dark text,
                    <body class="sheet-dark">  the original dark sheet. */
body.sheet-pale { --sheet: rgba(226, 233, 235, 0.88); --ink: #15222a; --ink-dim: #3f5159; --ink-faint: #6a7c83;
  --rule: rgba(21, 34, 42, 0.14); --slot: rgba(21, 34, 42, 0.05); color-scheme: light; }
body.sheet-dark { --sheet: rgba(8, 14, 18, 0.80); --ink-dim: #a2b3b8; --ink-faint: #6f8389;
  --rule: rgba(214, 236, 244, 0.12); --slot: rgba(214, 236, 244, 0.04); }
