/*
 * Problem-card art: the "old way" scenes on a monotone forest gradient.
 *
 * Problems are drawn without the agent and in grey, like the problem half of
 * the home film (ad/home-film-v2: drained graphite, vignette, grain). Green
 * and the chat UI belong to the solution sections. Only amber and red (warn,
 * err) carry colour here, for the thing that went wrong.
 *
 * Self-contained on purpose: problem pages load this file and problem.js
 * only, not art.css / chat.css / animate.js, so scene class names can't
 * collide with the shared art styles or get the generic build-up animation.
 */
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('schibsted-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
:root {
  --fg: #192623;
  --ink: #0c0a09;
  --muted: #78716c;
  --border: #e7e5e4;
  --surface: #f5f5f4;
  --tint: #fafaf9;
  --grey-1: #57534e;
  --grey-2: #a8a29e;
  --grey-3: #d6d3d1;
  --err: #dc2626; --err-bg: #fef2f2; --err-line: #fecaca;
  --warn: #b45309; --warn-bg: #fffbeb; --warn-line: #fde68a;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 28px 56px -22px rgb(0 0 0 / .7);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #111; }
body.square { width: 520px; height: 520px; }
/* Home page problem cards (800 x 817). */
body.tall { width: 520px; height: 531px; }
body {
  position: relative;
  overflow: hidden;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  background: #111;
}

/* Monotone backdrop: forest gradient drained to graphite + vignette + grain. */
.forest { position: absolute; inset: 0; background: #032b20 center / cover no-repeat; filter: grayscale(1) brightness(.42) contrast(1.18); }
.forest[data-bg='diagonal'] { background-image: url('bg/diagonal.webp'); }
.forest[data-bg='halo'] { background-image: url('bg/halo.webp'); }
.forest[data-bg='dual-flow'] { background-image: url('bg/dual-flow.webp'); }
.forest[data-bg='crest'] { background-image: url('bg/crest.webp'); }
.forest[data-bg='rise'] { background-image: url('bg/rise.webp'); }
.forest[data-bg='sweep'] { background-image: url('bg/sweep.webp'); }
.forest[data-bg='wave'] { background-image: url('bg/wave.webp'); }
.vig { position: absolute; inset: 0; pointer-events: none; opacity: .55; background: radial-gradient(ellipse 75% 70% at 50% 50%, rgb(0 0 0 / 0) 40%, rgb(0 0 0 / .55)); }
.grain { position: absolute; inset: 0; pointer-events: none; opacity: .06; background-image: radial-gradient(rgb(255 255 255 / .9) .6px, transparent .7px); background-size: 3px 3px; mix-blend-mode: overlay; }

/* Keep the backdrop under the scene, whatever order layers get composited in. */
.forest, .vig, .grain { z-index: 0; }
body > :not(.forest):not(.vig):not(.grain) { z-index: 1; }

/* Shared pieces. Scenes add their own classes on top (prefix them per scene). */
.card { position: absolute; background: #fff; border-radius: 18px; box-shadow: var(--shadow); color: var(--fg); }
.t { font-size: 15px; font-weight: 600; color: var(--ink); }
.s { font-size: 12px; color: var(--muted); }
.chip { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border); background: var(--tint); color: var(--muted); white-space: nowrap; transition: .3s; }
.chip.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.chip.err { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.chip.dark { background: var(--fg); border-color: var(--fg); color: #fff; }
.av { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; flex: none; background: var(--grey-1); }
.av.g1 { background: var(--fg); } .av.g2 { background: var(--grey-1); } .av.g3 { background: var(--grey-2); }
.cursor { position: absolute; left: 0; top: 0; width: 22px; height: 22px; pointer-events: none; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35)); transition: opacity .3s; z-index: 20; }
.cursor.press { transform: scale(.85); }
.ring { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px solid #fff; opacity: 0; pointer-events: none; z-index: 19; }
.ring.go { animation: ps-ring .45s ease-out; }
@keyframes ps-ring { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(1.4); } }
@keyframes ps-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes ps-blink { 50% { opacity: .2; } }

/* Wrapper problem.js builds for <body data-scale>; scaled and centred there. */
.ps-ui { position: absolute; left: 0; top: 0; width: 520px; height: 520px; transform-origin: 0 0; z-index: 1; }

/* Set by problem.js while still() draws the end frame. */
.ps-still *, .ps-still *::before, .ps-still *::after { transition: none !important; animation-duration: 0s !important; animation-delay: 0s !important; }
