@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Spline Sans Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/spline-sans-mono-latin-500-normal.woff2") format("woff2"); }

html { color-scheme: light; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
@media (prefers-color-scheme: dark) { html { color-scheme: dark; } }
body { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.loading {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--line);
  pointer-events: none;
}
.loading[hidden] { display: none; }
/* Layout: one full-height stage with the 3D pamphlet and fold controls docked at the bottom. */
:root {
  --bg: #d9dee9;
  --ink: #1f2557;
  --muted: #4a5280;
  --panel: rgba(247, 248, 252, 0.86);
  --line: rgba(31, 37, 87, 0.28);
  --accent: #0e7a3b;
  --on-accent: #ffffff;
  --green: #22b258;
  --orange: #f58b33;
  --pink: #e96da8;
  --font-ui: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12163a;
    --ink: #e9ecfa;
    --muted: #a7add6;
    --panel: rgba(22, 27, 72, 0.86);
    --line: rgba(233, 236, 250, 0.3);
    --accent: #45d482;
    --on-accent: #0b1030;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12163a;
  --ink: #e9ecfa;
  --muted: #a7add6;
  --panel: rgba(22, 27, 72, 0.86);
  --line: rgba(233, 236, 250, 0.3);
  --accent: #45d482;
  --on-accent: #0b1030;
  color-scheme: dark;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
}
.app {
  position: relative;
  height: 100%;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  padding-block: 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
#gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  pointer-events: auto;
}
#gl.dragging { cursor: grabbing; }
#gl.hot { cursor: pointer; }

.dock {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hint {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 10px;
  max-width: 62ch;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  text-wrap: balance;
}
.hint .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--ink);
  color: var(--bg);
}
.bar {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--line);
  min-height: 42px;
  padding: 0 14px 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
button:hover { border-color: var(--ink); }
button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button.plain { padding: 0 14px; color: var(--muted); }
.num {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: #1f2557;
}
.n1 { background: var(--green); }
.n2 { background: var(--orange); }
.n3 { background: var(--pink); }
.n4 { background: transparent; border: 1.5px solid currentColor; color: inherit; }
@media (max-width: 520px) {
  button { font-size: 13px; padding-right: 10px; gap: 7px; }
  .hint { font-size: 14px; }
}

.zoom {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 46px;
}
.zoom button {
  justify-content: center;
  padding: 0;
  min-height: 46px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}
.zoom .lvl {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.zoom button.fit { font-size: 12px; min-height: 34px; font-family: var(--font-mono); letter-spacing: 0.04em; }
@media (max-width: 640px) {
  .zoom {
    position: static;
    transform: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: auto;
    gap: 6px;
  }
  .zoom button { width: 46px; min-height: 38px; font-size: 22px; }
  .zoom button.fit { min-height: 38px; font-size: 12px; width: 52px; }
  .zoom #zout { order: 1; }
  .zoom .lvl { order: 2; min-width: 38px; font-size: 12px; }
  .zoom #zin { order: 3; }
  .zoom #zfit { order: 4; }
}
@media (prefers-reduced-motion: reduce) {
  #gl { cursor: default; }
}

button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dock { margin-top: auto; }   /* the header is gone, so push the controls to the bottom */
