/* The 3D labs in the site's own look (the cheat sheets' and practicals' tokens:
 * src/features/resources/cheatsheet/cheatsheet.css). The labs keep their own
 * layout and their large touch targets; only type, colour and edges change.
 * `html.tura` is set by each lab's head; `html.in-site` when it is shown inside
 * its practical's 3D page, which carries the title and the way back. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }

html.tura {
  --t-ink: #1b2029; --t-muted: #69727f; --t-line: rgba(40, 50, 64, .16); --t-line-soft: rgba(40, 50, 64, .09);
  --t-paper: #f7f6f2; --t-card: #fff; --t-blue: #5372a2; --t-chip: rgba(40, 50, 64, .06);
  --bg: var(--t-paper); --ink: var(--t-ink); --mute: var(--t-muted); --line: var(--t-line); --acc: var(--t-blue); --card: var(--t-card);
}
html.tura, html.tura body {
  background: var(--t-paper) !important;
  color: var(--t-ink) !important;
  font-family: "IBM Plex Sans", ui-sans-serif, -apple-system, system-ui, sans-serif !important;
}
html.tura.in-site h1 { display: none !important; }

html.tura body h1 { font-weight: 600 !important; letter-spacing: -.01em; }
html.tura body h2, html.tura body h3 { font-weight: 600 !important; color: var(--t-ink) !important; letter-spacing: -.005em; }

/* Buttons: the site's outline button, ink when chosen. */
html.tura body .btn, html.tura body .tabs button, html.tura body .seg button, html.tura body .sw a {
  background: var(--t-card) !important;
  border: 1px solid var(--t-line) !important;
  border-radius: 8px !important;
  color: var(--t-ink) !important;
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif !important;
  font-weight: 500 !important;
  font-size: 15px !important;
  box-shadow: 0 1px 0 rgba(24, 30, 40, .03);
  transition: background .12s, border-color .12s;
}
html.tura body .btn:hover, html.tura body .tabs button:hover, html.tura body .seg button:hover, html.tura body .sw a:hover { background: #f1f2f0 !important; }
html.tura body .btn.on, html.tura body .tabs button.on, html.tura body .seg button.on, html.tura body .btn.go,
html.tura body .sw a.on, html.tura body .sw a.cur, html.tura body .sw a[aria-current] {
  background: var(--t-ink) !important; border-color: var(--t-ink) !important; color: #f4f6f9 !important; font-weight: 600 !important;
}
html.tura body .btn:disabled, html.tura body button:disabled { opacity: .45 !important; }
html.tura body .btn:focus-visible, html.tura body button:focus-visible { outline: 2px solid var(--t-blue) !important; outline-offset: 2px; }

/* Selects: the site's field. */
html.tura body select {
  background: var(--t-card) !important; border: 1px solid var(--t-line) !important; border-radius: 8px !important;
  color: var(--t-ink) !important; font: 500 15px "IBM Plex Sans", system-ui, sans-serif !important;
}

/* Page tags: quiet chips, the practical page's citation look. */
html.tura body .tag {
  background: var(--t-chip) !important; color: var(--t-muted) !important; border-radius: 4px !important;
  font: 500 12px/1.3 "IBM Plex Sans", system-ui, sans-serif !important; padding: 2px 6px !important;
}

/* Cards and the flowchart: white, hairline edge. */
html.tura body .card, html.tura body .flow {
  background: var(--t-card) !important; border: 1px solid var(--t-line-soft) !important; border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(24, 30, 40, .04);
}
html.tura body .node { border: 1px solid var(--t-line) !important; border-radius: 6px !important; background: var(--t-card) !important; }
html.tura body .node.on { background: var(--t-ink) !important; color: #f4f6f9 !important; border-color: var(--t-ink) !important; }

/* The 3D view: rounded, like the site's cards. */
html.tura body canvas { border-radius: 12px; }

/* Inside a page of the site (`useLabFrame`): the page scrolls, not the lab. */
html.tura.in-site, html.tura.in-site body { background: transparent !important; }
html.tura.in-page body { overflow: hidden !important; }
html.tura.in-page .wrap { max-width: 1080px !important; }
/* The bench sized from the real window, and scrolling with the page (not pinned over the steps). */
html.tura.in-page #stage {
  height: max(300px, calc(var(--tura-vh, 8px) * 44)) !important;
  position: relative !important; top: 0 !important;
}
/* Labs drawn to their width (scales, optics, circuits): wider only makes their
 * lettering huge, so they keep a reading column; the benches take the page. */
html.tura.in-page body:not(:has(#stage)) .wrap { max-width: 820px !important; }

/* Full screen for the 3D view (`tura-skin.js`): a button on the view, and in
 * full screen the view fills the screen with the next step at its foot. */
.turaFull {
  position: absolute; z-index: 20; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(20, 24, 31, .72); color: #f4f6f9;
  cursor: pointer; padding: 0; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.turaFull:hover { background: rgba(20, 24, 31, .9); }
.turaFull:focus-visible { outline: 2px solid #9db6dc; outline-offset: 2px; }
.turaBar { display: none; }
html.turaFullView #stage, html.turaFullView #view,
html.tura.in-page.turaFullView #stage, html.tura.in-page.turaFullView #view {
  position: fixed !important; inset: 0 !important; z-index: 1000 !important;
  width: 100vw !important; height: 100vh !important; height: 100dvh !important; max-width: none !important;
  min-height: 0 !important; margin: 0 !important; border-radius: 0 !important;
  transform: none !important; background: #1b2229 !important;
}
html.turaFullView #view.hide { display: block !important; }
html.turaFullView #stage canvas, html.turaFullView #view canvas { width: 100% !important; height: 100% !important; border-radius: 0 !important; }
html.turaFullView body { overflow: hidden !important; }
html.turaFullView .turaBar {
  display: flex; position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 20;
  align-items: center; gap: 14px; max-width: min(860px, calc(100% - 32px));
  padding: 10px 10px 10px 16px; border-radius: 12px; background: rgba(247, 246, 242, .96); color: #1b2029;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font: 500 15px/1.4 "IBM Plex Sans", system-ui, sans-serif;
}
html.turaFullView .turaNext { flex: 1; min-width: 0; }
html.turaFullView .turaNext .tag { margin-left: 4px; }
html.turaFullView body .turaBar .turaDo {
  flex: none !important; height: 40px !important; min-height: 0 !important; padding: 0 16px !important; border-radius: 8px !important;
  border: 1px solid #1b2029 !important; background: #1b2029 !important; color: #f4f6f9 !important; width: auto !important;
  font: 600 14px "IBM Plex Sans", system-ui, sans-serif !important; cursor: pointer; white-space: nowrap; margin: 0 !important;
}
html.turaFullView body .turaBar .turaDo:hover { background: #2a313d !important; }
html.turaFullView body .turaFull, body .turaFull { min-height: 0 !important; flex: none !important; margin: 0 !important; }
@media (max-width: 560px) {
  html.turaFullView .turaBar { left: 10px; right: 10px; transform: none; max-width: none; bottom: 10px; flex-wrap: wrap; }
  html.turaFullView body .turaBar .turaDo { width: 100% !important; }
}
