/* The user manual (/manual/) in the FauxClockNG site look.
   The manual is a /walkthrough engine build (docs/manual/mockup/fauxclockng-manual.html), which draws its own light
   commentary layer. tool/skin_manual.py adds this stylesheet after the engine's <style>, plus the site's header and
   footer (inside .ns-site). The engine itself is untouched. Adapted from netsd-website site/assets/guide.css. */

:root {
  color-scheme: dark;
  /* FauxClockNG site palette (assets/site.css) */
  --ns-bg: #000; --ns-bg2: #0d0c08; --ns-card: #110f0a; --ns-card2: #1b1810; --ns-line: #2e2817;
  --ns-text: #f5f2e9; --ns-muted: #aaa28f; --ns-link: #e8b53a;
  --ns-g1: #f6d98a; --ns-g2: #E8B53A; --ns-g3: #d9822b; --ns-accent: #E8B53A;
  --ns-grad: linear-gradient(100deg in oklch, var(--ns-g1), var(--ns-g2) 55%, var(--ns-g3));
  --ns-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 gold, not purple. */
  --wt-note: var(--ns-g2);
  --wt-soft: var(--ns-card2);
  --wt-ink: #F6E7C0;
  --wt-line: var(--ns-line);
  --wt-text: var(--ns-text);
  --wt-text-2: var(--ns-muted);
  --wt-text-3: #948C7B;
  --wt-rule: var(--ns-line);
  --wt-rule-2: #4A4336;
  --wt-page: var(--ns-bg);
  --wt-radius: 20px;
  --wt-max: 1180px;
  --wt-font: var(--ns-sans);
}

body { background: var(--ns-bg); color: var(--ns-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 ---------- */
.ns-site { font-family: var(--ns-sans); color: var(--ns-text); }
.ns-site .wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.ns-site header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--ns-line); }
.ns-site .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1875rem; color: var(--ns-g2); text-decoration: none; min-height: 44px; }
.ns-site .logo img { width: 36px; height: 36px; border-radius: 9px; }
.ns-site header nav { display: flex; flex-wrap: wrap; column-gap: 22px; }
.ns-site header nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--ns-muted); }
.ns-site header nav a:hover { color: var(--ns-g2); }
/* Phones: one row, like the main site's phone header. Below 480 px the brand is the icon alone (its alt text and the
   word stay in the link's accessible name), so the three links fit on one line in every language. */
@media (width <= 600px) {
  .ns-site header { flex-wrap: nowrap; padding: 8px 0; }
  .ns-site header nav { flex-wrap: nowrap; column-gap: 12px; }
  .ns-site header nav a { font-size: .875rem; white-space: nowrap; }
  .ns-site .logo { font-size: 1.0625rem; gap: 8px; flex: none; }
  .ns-site .logo img { width: 30px; height: 30px; }
}
@media (width <= 480px) {
  .ns-site .logo { font-size: 0; gap: 0; }
  .ns-site header nav { column-gap: 10px; }
  .ns-site header nav a { font-size: .8125rem; }
}
/* Longest link sets (Russian on a 360 px phone) still keep one row: the links scroll sideways inside the bar
   instead of pushing the page wider. */
@media (width <= 600px) { .ns-site header nav { min-width: 0; overflow-x: auto; scrollbar-width: none; } }
.ns-site footer { margin-top: 0; border-top: 1px solid var(--ns-line); color: var(--ns-muted); padding: 24px 0 32px; font-size: .95rem; background: var(--ns-bg2); }
.ns-site footer .foot-in { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.ns-site footer a { color: var(--ns-muted); display: inline-block; padding: 10px 0; margin-inline-end: 18px; }
.ns-site footer a:hover { color: var(--ns-text); }
.ns-site footer .langs { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 14px; }
.ns-site footer .langs a { padding: 6px 0; }
.ns-site footer .langs a[aria-current] { color: var(--ns-g2); font-weight: 600; text-decoration: none; }
.ns-site :focus-visible { outline: 3px solid var(--ns-g2); outline-offset: 2px; border-radius: 6px; }

/* ---------- engine bar and chapter rail ---------- */
.wt-proto { background: color-mix(in oklab, var(--ns-bg2) 94%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ns-line); color: var(--ns-text); }
.wt-tag { background: color-mix(in oklab, var(--ns-g1) 18%, transparent); color: var(--ns-g1); }
.wt-proto select { background: var(--ns-card2); color: var(--ns-text); border: 1px solid var(--ns-line); font-size: .85rem; }
.wt-pbtn { border-color: var(--ns-line); color: var(--ns-text); border-radius: 999px; font-size: .85rem; min-height: 2.25rem; padding-inline: .9rem; }
.wt-pbtn:hover { background: var(--ns-card2); }
.wt-pbtn.wt-on { background: var(--ns-accent); border-color: var(--ns-accent); color: #1A1200; }
.wt-pbtn:focus-visible, .wt-proto select:focus-visible { outline-color: var(--ns-g1); }
.wt-clicks { background: var(--ns-card2); }
.wt-clicks b { color: var(--ns-accent); }
.wt-rail { background: var(--ns-bg); border-bottom-color: var(--ns-line); }
.wt-rail button { background: var(--ns-card); border-color: var(--ns-line); color: var(--ns-text); border-radius: 14px; }
.wt-rail button:hover { border-color: var(--ns-g2); }
.wt-rail .wt-k { color: var(--ns-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(--ns-g1) 18%, transparent), transparent 70%),
    radial-gradient(50% 120% at 100% 0%, color-mix(in oklab, var(--ns-g3) 16%, transparent), transparent 70%),
    var(--ns-card);
  border: 1px solid var(--ns-line); border-left: 1px solid var(--ns-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(--ns-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(--ns-text) 88%, var(--ns-muted)); max-width: 62ch; }
.wt-how { font-size: .9rem; color: var(--ns-muted); }
.wt-jump { color: var(--ns-link); }
.wt-pin { background: var(--ns-card2); border-color: var(--ns-g2); color: var(--ns-text); }
.wt-pin::before { border-top-color: color-mix(in oklab, var(--ns-g2) 60%, transparent); }
.wt-pin:hover, .wt-pin.wt-active { background: var(--ns-g2); border-color: var(--ns-g2); color: #1A1200; }
.wt-sample { color: var(--ns-muted); }

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

/* ---------- step-by-step help ---------- */
.wt-manual-in { background: var(--ns-card); border: 1px solid var(--ns-line); border-left: 1px solid var(--ns-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(--ns-g1), var(--ns-g2)); }
.wt-manual > .wt-manual-in > p { font-size: 1.05rem; }
.wt-task { background: var(--ns-bg2); border: 1px solid var(--ns-line); border-radius: 20px; }
.wt-task h3 { color: var(--ns-text); font-size: 1.1rem; }
.wt-task a, .wt-task button { color: var(--ns-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(--ns-g2) 30%, transparent); }
.wt-noted { box-shadow: 0 0 0 2px color-mix(in oklab, var(--ns-g1) 70%, transparent); }
.wt-note { font-size: .95rem; }
.wt-note dt { font-size: .7rem; color: var(--ns-muted); }
.wt-note dt.wt-howto { color: var(--ns-g1); }
.wt-note .wt-newtag { font-size: .66rem; }
.wt-intro details { font-size: .9rem; color: var(--ns-muted); }
.wt-intro summary { color: var(--ns-g1); }
.wt-task ol { font-size: 1rem; }
.wt-task .wt-result { font-size: .95rem; color: var(--ns-muted); }
.wt-showme { font-size: .875rem; }
.wt-words h3, .wt-trouble h3 { font-size: 1.05rem; color: var(--ns-text); }
.wt-words dl, .wt-trouble dl { font-size: .95rem; }
.wt-words dt, .wt-trouble dt { color: var(--ns-text); font-weight: 600; }
.wt-words dd, .wt-trouble dd { color: var(--ns-muted); }
.wt-manual-in kbd, .wt-note kbd { background: var(--ns-card2); color: var(--ns-text); border: 1px solid var(--ns-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(--ns-bg); border-color: #05070f; box-shadow: 0 24px 60px rgb(0 0 0 / .45); }
.wt-v { font-size: .78rem; color: var(--ns-muted); }
.wt-x { font-size: 1.375rem; color: var(--ns-muted); }

/* Right-to-left languages (Hebrew): the notes and manual read right to left, but the phone mockup draws the
   English app, so it stays left to right. */
[dir="rtl"] .wt-frame { direction: ltr; }
