/* Shared foundation for every pixie.codes page: tokens, type, the header and footer, buttons, fields.
   Keep QR artwork and export rendering independent. Design direction and the reasons for each value:
   claude-evidence/web-design-2026-11-21/DIRECTION.md in the handoff folder.

   Type: IBM Plex Sans (one variable file, weights 100 to 700) and IBM Plex Mono (SIL Open Font License 1.1,
   public/fonts/ibm-plex/OFL.txt), Latin-1 subsets, self-hosted. One file for every weight, so a page is never
   half Plex and half fallback. Until the file arrives, text draws in "Plex Sans Fallback", the system Arial resized to
   Plex's average width and line metrics, so the swap moves little (measured: no more layout shift than main
   development on Create, Sunrise 2027 and Pricing). Public pages preload both files. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url("/fonts/ibm-plex/IBMPlexSansVar-Roman-Latin1.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/fonts/ibm-plex/IBMPlexMono-Regular-Latin1.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans Fallback"; font-weight: 100 550; src: local("Arial"), local("ArialMT"); size-adjust: 101.6%; ascent-override: 100.9%; descent-override: 27.1%; line-gap-override: 0%; }
@font-face { font-family: "Plex Sans Fallback"; font-weight: 551 900; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 97.1%; ascent-override: 105.6%; descent-override: 28.3%; line-gap-override: 0%; }

:root {
  /* Colour. Ink on paper with one green; colour itself belongs to the art codes. */
  --px-canvas: #f5f4ef;        /* paper */
  --px-surface: #ffffff;
  --px-ink: #1b211d;           /* 14.9:1 on paper */
  --px-muted: #535c55;         /* 6.3:1 on paper */
  --px-line: #dcdfd7;          /* hairlines and dividers */
  --px-line-strong: #8a928b;   /* field and control borders, 3.2:1 on white */
  --px-accent: #16604b;        /* pixie green, 6.8:1 on paper */
  --px-accent-strong: #0e4636;
  --px-accent-soft: #e5eee7;
  --px-focus: #1d6dbe;
  --px-warn-bg: #fff6df; --px-warn-line: #c8a75b; --px-warn-ink: #5e4409;
  --px-error-bg: #fff0ed; --px-error-line: #e2afa5; --px-error-ink: #84271c;

  /* Type. */
  --px-font: "IBM Plex Sans", "Plex Sans Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --px-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --px-text-xs: 12px;     /* legal notice */
  --px-text-sm: 13px;     /* captions, labels */
  --px-text-ui: 15px;     /* controls, secondary text */
  --px-text-body: 17px;   /* reading text on public pages */
  --px-text-lede: 20px;
  --px-text-h3: 20px;
  --px-text-h2: 28px;
  --px-text-h1: clamp(36px, 2.6vw + 23px, 56px);
  --px-measure: 64ch;

  /* Space: an 8 px grid, with 4 and 12 for tight spots. */
  --px-space-1: 4px; --px-space-2: 8px; --px-space-3: 12px; --px-space-4: 16px; --px-space-5: 24px;
  --px-space-6: 32px; --px-space-7: 48px; --px-space-8: 64px; --px-space-9: 96px;
  --px-gutter: 16px;
  --px-page: 1200px;

  /* Shape. QR modules are square: corners stay small. */
  --px-radius: 4px;
  --px-radius-panel: 6px;
}
@media (min-width: 721px) { :root { --px-gutter: 32px; } }

body.px-workspace {
  --bg: var(--px-canvas);
  --card: var(--px-surface);
  --ink: var(--px-ink);
  --muted: var(--px-muted);
  --line: var(--px-line);
  --accent: var(--px-accent);
  --accent-soft: var(--px-accent-soft);
  margin: 0;
  background: var(--px-canvas);
  color: var(--px-ink);
  font: 16px/1.5 var(--px-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

.px-workspace *, .px-workspace *::before, .px-workspace *::after { box-sizing: border-box; }
.px-workspace :is(button, input, select, textarea) { font-family: inherit; }
.px-workspace :is(h1, h2, h3, h4) { font-weight: 600; letter-spacing: -0.01em; }
.px-workspace :is(code, kbd, samp, .px-mono) { font-family: var(--px-mono); font-size: 0.94em; }
.px-workspace :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--px-focus);
  outline-offset: 3px;
}
.px-skip-link { position: absolute; left: 16px; top: -100px; z-index: 10000; }
.px-skip-link:focus { top: 12px; padding: 12px 18px; background: white; color: var(--px-ink); }

/* Header: white, one hairline, the pixel mark and the wordmark, links in ink. The page you are on is marked by a
   two-pixel rule under its link rather than a tinted pill. */
.px-app-header { background: var(--px-surface); border-bottom: 1px solid var(--px-line); }
.px-app-header__inner {
  max-width: calc(var(--px-page) + 2 * var(--px-gutter)); margin: auto; padding: 10px var(--px-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.px-brand {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  color: var(--px-ink); text-decoration: none; font-size: 18px; font-weight: 600; letter-spacing: -0.02em;
}
.px-brand img { display: block; width: 36px; height: 36px; image-rendering: pixelated; }
.px-app-nav { display: flex; align-items: center; gap: 4px; }
.px-app-nav a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 8px 12px; border-radius: var(--px-radius); color: var(--px-muted); text-decoration: none;
  font-size: 15px; font-weight: 500; white-space: nowrap;
}
.px-app-nav a:hover { color: var(--px-ink); background: var(--px-canvas); }
.px-app-nav a[aria-current] { color: var(--px-ink); background: transparent; box-shadow: inset 0 -2px 0 var(--px-accent); border-radius: 0; }
/* The phone menu button (workspace-nav.js adds it); shown only below 721px. */
.px-app-menu-button { display: none; }

.px-workspace .shell { max-width: calc(var(--px-page) + 2 * var(--px-gutter)); padding: 32px var(--px-gutter) 48px; margin: 0 auto; }
.px-workspace .card { border: 1px solid var(--px-line); border-radius: var(--px-radius-panel); box-shadow: none; padding: 24px; margin-bottom: 24px; animation: none; }
.px-workspace .hero { align-items: center; margin-bottom: 24px; gap: 24px; }
.px-workspace .hero h1 { font-size: clamp(30px, 2vw + 16px, 40px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 600; }
.px-workspace .hero p { max-width: 60ch; margin-top: 12px; font-size: 16px; line-height: 1.55; }

/* A label above a heading: mono, small capitals, led by one square module. */
.px-eyebrow {
  display: flex; align-items: center; gap: 8px;
  color: var(--px-accent); font: 500 var(--px-text-sm)/1.4 var(--px-mono); letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 12px;
}
.px-eyebrow::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; background: currentColor; }
/* The square leads only the label above a page title; section labels go without it, so it is used once a page. */
.px-eyebrow:not(:has(+ h1))::before { display: none; }
.px-workspace .hero .px-eyebrow { max-width: none; margin: 0 0 12px; font-size: var(--px-text-sm); line-height: 1.4; }

/* Buttons. One shape everywhere: a 4 px corner, 44 px tall (48 on public pages), medium weight. */
.px-workspace .btn { min-height: 44px; border-radius: var(--px-radius); padding: 10px 18px; font-size: 15px; font-weight: 500; line-height: 1.25; letter-spacing: 0; box-shadow: none; }
.px-workspace .btn.primary { background: var(--px-accent); border-color: var(--px-accent); color: #fff; }
.px-workspace .btn.primary:hover:not(:disabled) { background: var(--px-accent-strong); border-color: var(--px-accent-strong); }
.px-workspace .mini-btn { min-height: 36px; border-radius: var(--px-radius); padding: 7px 12px; }
.px-workspace .input, .px-workspace .select { min-height: 44px; border-radius: var(--px-radius); font-size: 15px; }
.px-workspace .field label { color: var(--px-muted); font-size: 13px; letter-spacing: 0; text-transform: none; }
.px-workspace .section-head h2 { font-size: 20px; letter-spacing: -0.01em; }
.px-workspace .section-sub { font-size: 14px; line-height: 1.5; }
.px-workspace .view-switch { border-bottom: 1px solid var(--px-line); gap: 24px; margin: 0 0 24px; }
.px-workspace .view-tab {
  min-height: 46px; padding: 10px 0; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; background: transparent; color: var(--px-muted); font-size: 15px; font-weight: 500;
}
.px-workspace .view-tab.active { border-color: var(--px-accent); color: var(--px-ink); background: transparent; }
.px-disclosure { border: 1px solid var(--px-line); border-radius: var(--px-radius-panel); background: var(--px-surface); margin-top: 16px; }
.px-disclosure > summary { cursor: pointer; padding: 16px 20px; font-size: 15px; font-weight: 600; min-height: 56px; }
.px-disclosure > summary::marker { color: var(--px-accent); }
.px-disclosure > summary span { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--px-muted); }
.px-disclosure[open] > summary { border-bottom: 1px solid var(--px-line); }
.px-disclosure__body { padding: 20px; }

/* Footer: one hairline, the brand line and the links on one row, the trademark notice under them in small type. */
.px-workspace-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--px-line); color: var(--px-muted); font-size: 13px; }
.px-workspace-footer nav { display: flex; gap: 0 20px; flex-wrap: wrap; }
.px-workspace-footer a { color: var(--px-muted); text-decoration: none; }
.px-workspace-footer a:hover { color: var(--px-ink); text-decoration: underline; text-underline-offset: 3px; }
/* The notice carries an inline style written for every page; inside the shared frame it lines up with the footer. */
.px-workspace .px-workspace-footer + .trademark-notice,
.px-workspace main + .trademark-notice { max-width: calc(var(--px-page) + 2 * var(--px-gutter)) !important; padding: 8px var(--px-gutter) 32px !important; text-align: left !important; color: var(--px-muted) !important; font-size: 13px !important; }
.px-workspace main > .px-workspace-footer + .trademark-notice { width: 100%; margin: 0 !important; padding: 16px 0 0 !important; }

/* Five links and the brand only just fit one row above 720px: tighter link padding keeps them from
   pushing the page sideways. */
@media (min-width: 721px) and (max-width: 860px) {
  .px-app-nav { gap: 4px; }
  .px-app-nav a { padding: 8px 10px; }
}
@media (max-width: 720px) {
  .px-app-header__inner { flex-wrap: wrap; padding: 12px 16px; gap: 8px; }
  /* Without the menu (no JavaScript, or workspace-nav.js did not arrive) the links take their own rows under the brand. */
  .px-app-nav { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .px-app-nav a { padding: 9px 8px; font-size: 13px; }
  /* With the menu, one row from the first paint: the brand and the Menu button. The head script puts
     px-menu-pending on <html> before anything is drawn and workspace-nav.js swaps it for px-menu-ready; if the menu
     never mounts, the class goes and the links above show. The brand is as tall as the button, so the row does not
     grow when the button arrives: nothing moves while the page loads. */
  :is(.px-menu-pending, .px-menu-ready) .px-app-header .px-brand { min-height: 44px; }
  :is(.px-menu-pending, .px-menu-ready) .px-app-header .px-app-menu-button {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    min-height: 44px; padding: 8px 16px; border: 1px solid var(--px-line-strong); border-radius: var(--px-radius);
    background: var(--px-surface); color: var(--px-ink); font: 500 15px/1.25 var(--px-font); cursor: pointer;
  }
  .px-menu-ready .px-app-header.px-app-header--open .px-app-menu-button { border-color: var(--px-ink); background: var(--px-ink); color: #fff; }
  :is(.px-menu-pending, .px-menu-ready) .px-app-header .px-app-header__inner .px-app-nav { display: none; }
  /* The opened list lies over the page, hung from the header's bottom edge (November 28, 2026). It used to open in
     the header's own flow, which pushed the whole page down by the list's height: a layout shift after input of
     0.24 on a 375 px phone. The header's row is laid out the same open or closed, so nothing moves. */
  .px-menu-ready .px-app-header.px-app-header--open { position: relative; z-index: 1000; }
  .px-menu-ready .px-app-header.px-app-header--open .px-app-header__inner .px-app-nav {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 1000;
    display: flex; flex-direction: column; align-items: stretch; gap: 0; width: auto; margin: 0; padding: 4px 16px 8px;
    background: var(--px-surface); border-top: 1px solid var(--px-line); border-bottom: 1px solid var(--px-line);
    box-shadow: 0 16px 24px -16px rgba(27, 33, 29, 0.35);
  }
  .px-menu-ready .px-app-header.px-app-header--open .px-app-nav a { justify-content: flex-start; padding: 12px 12px; font-size: 17px; color: var(--px-ink); border-radius: 0; }
  .px-menu-ready .px-app-header.px-app-header--open .px-app-nav a[aria-current] { box-shadow: inset 2px 0 0 var(--px-accent); }
  .px-workspace .shell { padding: 24px 16px 32px; }
  .px-workspace .hero { align-items: flex-start; flex-direction: column; gap: 16px; }
  .px-workspace .hero h1 { font-size: 30px; }
  .px-workspace .card { padding: 20px 16px; }
  .px-disclosure > summary span { display: block; margin: 4px 0 0 18px; }
  .px-disclosure__body { padding: 16px; }
  .px-workspace .input, .px-workspace .select { font-size: 16px; }
  .px-workspace-footer { margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .px-workspace *, .px-workspace *::before, .px-workspace *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
