/* The two guides (/manual/, /studio-guide/, and their translations) in the FauxWall site look.
   The guides come from the /walkthrough engine, which draws its own light, purple commentary layer.
   tool/guides.py adds this stylesheet after the engine's <style>, plus the site's own header and footer
   (inside .fw-site), so the guides read as part of fauxwall.canonspike.com. The engine itself is untouched.
   Built to Google's Modern Web Guidance: tokens, dark scheme, rem type, motion opt-in, forced colors. */

:root {
  color-scheme: dark;
  /* FauxWall site palette (assets/site.css) */
  --fw-bg: #0B0E1A; --fw-bg2: #10142A; --fw-card: #151A2E; --fw-card2: #1F2642; --fw-line: #2A3256;
  --fw-text: #EEF1FB; --fw-muted: #A8AFCB; --fw-link: #8FB2FF;
  --fw-g1: #36E6D2; --fw-g2: #6F8BFF; --fw-g3: #F26FD0; --fw-accent: #FF8A3D;
  --fw-grad: linear-gradient(100deg in oklch, var(--fw-g1), var(--fw-g2) 50%, var(--fw-g3));
  --fw-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;

  /* The engine's commentary tokens, mapped onto the site palette. Notes use the site's blue, not purple. */
  --wt-note: var(--fw-g2);
  --wt-soft: var(--fw-card2);
  --wt-ink: #DCE3FF;
  --wt-line: var(--fw-line);
  --wt-text: var(--fw-text);
  --wt-text-2: var(--fw-muted);
  --wt-text-3: #8C94B4;
  --wt-rule: var(--fw-line);
  --wt-rule-2: #3A4473;
  --wt-page: var(--fw-bg);
  --wt-radius: 20px;
  --wt-max: 1180px;
  --wt-font: var(--fw-sans);
}

body { background: var(--fw-bg); color: var(--fw-text); font-size: 1rem; line-height: 1.55; overflow-wrap: break-word; }
html { scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
:where(h1, h2, h3) { text-wrap: balance; }
:where(p) { text-wrap: pretty; }

/* ---------- the site's header and footer, scoped so they cannot touch the app mockup ---------- */
.fw-site { font-family: var(--fw-sans); color: var(--fw-text); }
.fw-site .wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.fw-site .head { position: relative; background: var(--fw-bg); border-bottom: 1px solid var(--fw-line); }
.fw-site .head::after { content: ""; display: block; height: 2px; background: var(--fw-grad); }
.fw-site .head-in { display: flex; align-items: center; gap: 8px; min-height: 60px; }
.fw-site .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--fw-text); text-decoration: none; margin-inline-end: auto; min-height: 44px; }
.fw-site .brand img { border-radius: 9px; flex: none; display: block; }
.fw-site .head nav { display: flex; gap: 4px; }
.fw-site .head nav a { color: var(--fw-text); text-decoration: none; padding: 0 14px; display: inline-flex; align-items: center; min-height: 44px; border-radius: 999px; font-weight: 600; white-space: nowrap; transition: background-color .15s; }
.fw-site .head nav a:hover { background: var(--fw-card2); }
@media (width <= 480px) {
  .fw-site .head nav { gap: 0; }
  .fw-site .head nav a { padding: 0 7px; font-size: .9rem; }
  .fw-site .head nav a.wide { display: none; }
  .fw-site .brand { font-size: 1.08rem; }
}
.fw-site footer { margin-top: 0; border-top: 1px solid var(--fw-line); color: var(--fw-muted); padding: 24px 0 32px; font-size: .95rem; background: var(--fw-bg2); }
.fw-site footer .foot-in { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.fw-site footer a { color: var(--fw-muted); display: inline-block; padding: 10px 0; }
.fw-site footer a:hover { color: var(--fw-text); }
.fw-site footer .langs { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.fw-site footer .langs a[aria-current] { color: var(--fw-text); font-weight: 600; text-decoration: none; }
.fw-site :focus-visible { outline: 3px solid var(--fw-g2); outline-offset: 2px; border-radius: 6px; }

/* ---------- engine bar and chapter rail ---------- */
.wt-proto { background: color-mix(in oklab, var(--fw-bg2) 94%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--fw-line); color: var(--fw-text); }
.wt-tag { background: color-mix(in oklab, var(--fw-g1) 18%, transparent); color: var(--fw-g1); }
.wt-proto select { background: var(--fw-card2); color: var(--fw-text); border: 1px solid var(--fw-line); font-size: .85rem; }
.wt-pbtn { border-color: var(--fw-line); color: var(--fw-text); border-radius: 999px; font-size: .85rem; min-height: 2.25rem; padding-inline: .9rem; }
.wt-pbtn:hover { background: var(--fw-card2); }
.wt-pbtn.wt-on { background: var(--fw-accent); border-color: var(--fw-accent); color: #1a0d03; }
.wt-pbtn:focus-visible, .wt-proto select:focus-visible { outline-color: var(--fw-g1); }
.wt-clicks { background: var(--fw-card2); }
.wt-clicks b { color: var(--fw-accent); }
.wt-rail { background: var(--fw-bg); border-bottom-color: var(--fw-line); }
.wt-rail button { background: var(--fw-card); border-color: var(--fw-line); color: var(--fw-text); border-radius: 14px; }
.wt-rail button:hover { border-color: var(--fw-g2); }
.wt-rail .wt-k { color: var(--fw-g1); }

/* ---------- intro: a hero like the other pages ---------- */
.wt-intro { max-width: var(--wt-max); }
.wt-intro-in {
  position: relative; isolation: isolate; overflow: clip;
  background:
    radial-gradient(60% 120% at 0% 0%, color-mix(in oklab, var(--fw-g1) 18%, transparent), transparent 70%),
    radial-gradient(50% 120% at 100% 0%, color-mix(in oklab, var(--fw-g3) 16%, transparent), transparent 70%),
    var(--fw-card);
  border: 1px solid var(--fw-line); border-left: 1px solid var(--fw-line); border-radius: 28px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
.wt-intro h1 {
  font-size: clamp(2.25rem, 1.3rem + 3.6vw, 4.25rem); line-height: 1; font-weight: 900; letter-spacing: -.035em;
  background: var(--fw-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wt-intro-in > p { font-size: clamp(1.05rem, .95rem + .4vw, 1.25rem); color: color-mix(in oklab, var(--fw-text) 88%, var(--fw-muted)); max-width: 62ch; }
.wt-how { font-size: .9rem; color: var(--fw-muted); }
.wt-jump { color: var(--fw-link); }
.wt-pin { background: var(--fw-card2); border-color: var(--fw-g2); color: var(--fw-text); }
.wt-pin::before { border-top-color: color-mix(in oklab, var(--fw-g2) 60%, transparent); }
.wt-pin:hover, .wt-pin.wt-active { background: var(--fw-g2); border-color: var(--fw-g2); color: #0B0E1A; }
.wt-sample { color: var(--fw-muted); }

/* ---------- the note panel ---------- */
.wt-note { background: var(--fw-card); color: var(--fw-text); border-color: var(--fw-line); border-top-color: var(--fw-g2); border-radius: 20px; box-shadow: 0 24px 60px rgb(0 0 0 / .5); }
.wt-note footer { border-top-color: var(--fw-line); color: var(--fw-muted); }
.wt-note footer button { background: var(--fw-card2); color: var(--fw-text); border-color: var(--fw-line); border-radius: 999px; padding-inline: 1rem; }
.wt-note footer button.wt-next { background: var(--fw-accent); border-color: var(--fw-accent); color: #1a0d03; }
.wt-note .wt-newtag { color: #0B0E1A; background: var(--fw-g1); }
.wt-note dd.wt-story { background: var(--fw-card2); color: var(--fw-text); }

/* ---------- step-by-step help ---------- */
.wt-manual-in { background: var(--fw-card); border: 1px solid var(--fw-line); border-left: 1px solid var(--fw-line); border-radius: 28px; padding: clamp(1.25rem, 3vw, 2.25rem); }
.wt-manual h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); line-height: 1.1; display: flex; align-items: center; gap: 10px; }
.wt-manual h2::before { content: ""; flex: none; width: 5px; height: 1.1em; border-radius: 3px; background: linear-gradient(var(--fw-g1), var(--fw-g2)); }
.wt-manual > .wt-manual-in > p { font-size: 1.05rem; }
.wt-task { background: var(--fw-bg2); border: 1px solid var(--fw-line); border-radius: 20px; }
.wt-task h3 { color: var(--fw-text); font-size: 1.1rem; }
.wt-task a, .wt-task button { color: var(--fw-link); }

/* ---------- the rest of the engine's light surfaces, and its pixel type in rem ---------- */
.wt-proto, .wt-rail { font-size: .875rem; }
.wt-rail .wt-k { font-size: .7rem; }
.wt-pin { font-size: .7rem; }
.wt-pin.wt-active { box-shadow: 0 0 0 4px color-mix(in oklab, var(--fw-g2) 30%, transparent); }
.wt-noted { box-shadow: 0 0 0 2px color-mix(in oklab, var(--fw-g1) 70%, transparent); }
.wt-note { font-size: .95rem; }
.wt-note dt { font-size: .7rem; color: var(--fw-muted); }
.wt-note dt.wt-howto { color: var(--fw-g1); }
.wt-note .wt-newtag { font-size: .66rem; }
.wt-intro details { font-size: .9rem; color: var(--fw-muted); }
.wt-intro summary { color: var(--fw-g1); }
.wt-task ol { font-size: 1rem; }
.wt-task .wt-result { font-size: .95rem; color: var(--fw-muted); }
.wt-showme { font-size: .875rem; }
.wt-words h3, .wt-trouble h3 { font-size: 1.05rem; color: var(--fw-text); }
.wt-words dl, .wt-trouble dl { font-size: .95rem; }
.wt-words dt, .wt-trouble dt { color: var(--fw-text); font-weight: 600; }
.wt-words dd, .wt-trouble dd { color: var(--fw-muted); }
.wt-manual-in kbd, .wt-note kbd { background: var(--fw-card2); color: var(--fw-text); border: 1px solid var(--fw-line); border-radius: 6px; padding: 0 .35em; }

@supports (corner-shape: squircle) {
  .wt-intro-in, .wt-manual-in { corner-shape: squircle; border-radius: 48px; }
  .wt-task, .wt-note { corner-shape: squircle; border-radius: 36px; }
}

@media (forced-colors: active) {
  .wt-intro h1 { background: none; color: CanvasText; }
  .wt-intro-in, .wt-manual-in, .wt-task, .wt-note { border: 1px solid CanvasText; }
}

/* Phone frame behind the app, and the note panel's small text. */
.wt-frame { background: var(--fw-bg); border-color: #05070f; box-shadow: 0 24px 60px rgb(0 0 0 / .45); }
.wt-v { font-size: .78rem; color: var(--fw-muted); }
.wt-x { font-size: 1.375rem; color: var(--fw-muted); }

/* On a phone the engine's two sticky bars would cover half the screen; let them scroll away. */
@media (width <= 600px), (height <= 520px) {
  .wt-proto, .wt-rail { position: relative; top: auto; }
}

/* On a phone the engine bar is one row that scrolls sideways: the select labels stay for screen readers
   (each select also has its own aria-label), the product name is already in the site header. */
@media (width <= 600px) {
  .wt-proto-in { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; gap: 6px; padding: 8px 16px; }
  .wt-proto-in > * { flex: none; }
  #wt-product, .wt-proto .wt-spacer { display: none; }
  .wt-proto label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .wt-proto select { max-width: 9.5rem; min-height: 2.25rem; }
  .wt-pbtn { font-size: .8rem; padding-inline: .7rem; min-height: 2.25rem; white-space: nowrap; }
}

/* On a phone the main action comes first, so it is on screen without scrolling the bar. */
@media (width <= 600px) {
  .wt-proto-in > * { order: 9; }
  #wt-tour { order: 1; }
  #wt-tour-new { order: 2; }
  #wt-toggle { order: 3; }
  #wt-persona-label { order: 4; }
  #wt-scenario-label { order: 5; }
  #wt-reset { order: 6; }
}
