/* The look shared by every workbook.
   Colours are estimated from the logo PNG: swap in the brand guideline values when we have them. */

:root {
  --navy: #1f2a44;
  --grey: #6b7280;
  --cyan: #3bb4e5;
  --blue: #4a5bb5;
  --purple: #7b3fa0;
  --paper: #f7f8fb;
  --gradient: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple));
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--navy);
  background: var(--paper);
}

/* ---- Workbook page: the 3D canvas fills the window ---- */

canvas.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

header.title {
  position: fixed;
  top: 24px;
  left: 28px;
  pointer-events: none;
}
header.title .zoom {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
}
header.title h1 {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
header.title h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--gradient);
}

/* a line under the title that's always in view, even with the controls folded */
header.title .status {
  margin: 10px 0 0;
  max-width: min(420px, 60vw);
  font-size: 14px;
  color: var(--grey);
}

/* the control panel: plain HTML inputs */
.controls {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 260px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 24px rgba(31, 42, 68, 0.12);
}
.controls summary {
  font-weight: 700;
  cursor: pointer;
}
.controls label {
  display: block;
  margin: 10px 0 4px;
  font-size: 13px;
  color: var(--grey);
}
.controls input[type="range"] { width: 100%; accent-color: var(--blue); }
.controls input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d5d9e2;
  border-radius: 6px;
  font: inherit;
}
.controls button {
  margin-top: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--navy);
  font: inherit;
  cursor: pointer;
}

.controls .places button { margin: 4px 4px 0 0; padding: 6px 10px; }
.controls p { margin: 14px 0 4px; font-weight: 600; }
.controls a { color: var(--blue); font-weight: 600; }

footer.back {
  position: fixed;
  bottom: 20px;
  left: 28px;
  font-size: 13px;
}
footer.back a { color: var(--grey); }

/* an error, shown on screen by shared/errors.js */
.error {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(480px, 85vw);
  margin: 0;
  padding: 14px 18px;
  border-radius: 10px;
  color: white;
  background: #9b2c3a;
  z-index: 10;
}

/* ---- Phones: the controls become a bar along the bottom that folds away ---- */

@media (max-width: 700px) {
  header.title { top: 16px; left: 18px; }
  header.title h1 { font-size: 22px; }

  .controls {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 40vh;
    background: rgba(255, 255, 255, 0.75);
    overflow-y: auto;
  }

  /* the bottom is taken by the controls: the back link goes to the top right */
  footer.back { top: 22px; right: 18px; bottom: auto; left: auto; }
}

/* placeholder message until a workbook is written */
.placeholder {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--grey);
}
.placeholder strong { color: var(--navy); font-size: 20px; }
