/* AI-julekalenderen: base styles and shared primitives (buttons, chips, cards, stage, prose).
   Loaded on every page after tokens.css. Modules may use every class here. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100dvh; background: var(--night-0); color: var(--ink);
  font-family: var(--font-body); font-size: var(--fs-md); line-height: 1.5; letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 8px; }
.jk-paper :focus-visible, .jk-paper:focus-visible { outline-color: var(--paper-red); }
.jk-paper .jk-stage :focus-visible { outline-color: var(--gold-hi); }
::selection { background: rgba(245, 184, 61, .38); }
.jk-paper ::selection { background: rgba(225, 29, 46, .16); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* Display type: the system sans, bold and tight. One italic word may take the festive serif. */
.jk-display { font-family: var(--font-display); font-weight: 700; letter-spacing: var(--track-tight); line-height: 1.05; text-wrap: balance; }
.jk-display em, .jk-display i { font-family: var(--font-festive); font-style: italic; font-weight: 600; letter-spacing: -.015em; font-variation-settings: "SOFT" 100, "WONK" 1; padding-right: .04em; }
.jk-eyebrow { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0; }
.jk-gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jk-ai-text { background: var(--ai-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons: pills. Primary is solid red; .white is the white-on-dark primary; .link is a quiet text link. */
.jk-btn {
  --b-bg: rgba(245, 245, 247, .12); --b-fg: var(--ink); --b-bd: transparent; --b-hover: rgba(245, 245, 247, .18);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--r-pill); border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg); font-weight: 600; font-size: var(--fs-sm); line-height: 1.2; letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap; user-select: none; -webkit-user-select: none;
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-med), box-shadow var(--t-med), color var(--t-med), opacity var(--t-med);
}
.jk-btn:hover { background: var(--b-hover); }
.jk-btn:active { transform: scale(.97); }
.jk-btn svg { width: 18px; height: 18px; flex: none; }
.jk-btn.primary, .jk-btn.red { --b-bg: var(--red); --b-fg: #fff; --b-hover: var(--red-hi); }
.jk-btn.white { --b-bg: #fff; --b-fg: #1d1d1f; --b-hover: #e8e8ed; }
.jk-btn.ink { --b-bg: #f5f5f7; --b-fg: #1d1d1f; --b-hover: #fff; }
.jk-btn.ghost { --b-bg: transparent; --b-hover: rgba(245, 245, 247, .10); }
.jk-btn.small { min-height: 36px; padding: 7px 15px; font-size: var(--fs-xs); }
.jk-btn.small::after { content: ""; position: absolute; inset: -4px 0; }
.jk-btn.small svg { width: 16px; height: 16px; }
.jk-btn.lg { min-height: 52px; padding: 13px 28px; font-size: 1.0625rem; }
.jk-btn.icon { width: 44px; padding: 0; }
.jk-btn.link { --b-bg: transparent; --b-hover: transparent; --b-fg: var(--gold-hi); padding: 10px 4px; gap: 4px; }
.jk-btn.link:hover span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.jk-btn.link .ic:last-child { width: 16px; height: 16px; transition: transform var(--t-med) var(--ease-out); }
.jk-btn.link:hover .ic:last-child { transform: translateX(2px); }
.jk-btn[disabled], .jk-btn[aria-disabled="true"] { opacity: .42; pointer-events: none; }
.jk-paper .jk-btn { --b-bg: rgba(0, 0, 0, .05); --b-fg: var(--paper-ink); --b-hover: rgba(0, 0, 0, .09); }
.jk-paper .jk-btn.primary, .jk-paper .jk-btn.red { --b-bg: var(--red); --b-fg: #fff; --b-hover: #c9182a; }
.jk-paper .jk-btn.white { --b-bg: #fff; --b-fg: var(--paper-ink); --b-hover: #f5f5f7; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04); }
.jk-paper .jk-btn.ghost { --b-bg: transparent; --b-hover: rgba(0, 0, 0, .05); }
.jk-paper .jk-btn.link { --b-bg: transparent; --b-hover: transparent; --b-fg: var(--paper-red); }
.jk-paper .jk-btn.ink { --b-bg: var(--paper-ink); --b-fg: #fff; --b-hover: #3a3a3c; }

/* Chips: tiny labels, no borders */
.jk-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.3; border: 0; color: var(--ink-2);
  background: rgba(245, 245, 247, .10);
}
.jk-chip svg { width: 14px; height: 14px; }
.jk-paper .jk-chip { color: var(--paper-ink-2); background: rgba(0, 0, 0, .05); }
.jk-chip.st-ga, .jk-chip.st-preview, .jk-chip.st-frontier, .jk-chip.st-roadmap { color: #fff; }
.jk-chip.st-ga { background: var(--st-ga); }
.jk-chip.st-preview { background: var(--st-preview); }
.jk-chip.st-frontier { background: var(--st-frontier); }
.jk-chip.st-roadmap { background: var(--st-roadmap); }

/* Cards: one soft surface, no borders */
.jk-card { border-radius: var(--r-xl); background: rgba(245, 245, 247, .06); border: 0; box-shadow: none; }
.jk-paper .jk-card { background: var(--surface); color: var(--paper-ink); box-shadow: none; }

/* The white surface (open door) and the night stage (games, demos) */
.jk-paper { background: var(--paper); color: var(--paper-ink); color-scheme: light; }
.jk-stage {
  position: relative; isolation: isolate; overflow: hidden; color: var(--ink); color-scheme: dark;
  border-radius: var(--r-xl); border: 0;
  background:
    radial-gradient(110% 80% at 85% -10%, rgba(139, 92, 246, .20), transparent 55%),
    radial-gradient(90% 70% at 0% 0%, rgba(15, 123, 75, .30), transparent 60%),
    linear-gradient(180deg, var(--night-2), var(--night-0));
  box-shadow: 0 24px 60px rgba(5, 7, 13, .28);
}
.jk-stage .jk-btn { --b-bg: rgba(245, 245, 247, .12); --b-fg: var(--ink); --b-hover: rgba(245, 245, 247, .18); }
.jk-stage .jk-btn.primary, .jk-stage .jk-btn.red { --b-bg: var(--red); --b-fg: #fff; --b-hover: var(--red-hi); }
.jk-stage .jk-btn.white { --b-bg: #fff; --b-fg: #1d1d1f; --b-hover: #e8e8ed; }
.jk-stage .jk-btn.ink { --b-bg: #fff; --b-fg: #1d1d1f; --b-hover: #e8e8ed; }
.jk-stage .jk-btn.link { --b-bg: transparent; --b-fg: var(--gold-hi); }
.jk-stage .jk-chip { color: var(--ink-2); background: rgba(245, 245, 247, .10); }
.jk-module { position: relative; width: 100%; }

/* Prose on white */
.jk-prose { font-size: var(--fs-body); line-height: 1.5; color: var(--paper-ink); }
.jk-prose p { margin: 0 0 1em; }
.jk-prose h2, .jk-prose h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -.022em; margin: 1.6em 0 .5em; }
.jk-prose h2 { font-size: var(--fs-h2); }
.jk-prose h3 { font-size: 1.25rem; }
.jk-prose a { color: var(--paper-ink); text-decoration: underline; text-decoration-color: rgba(208, 20, 42, .55); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.jk-prose a:hover { color: var(--paper-red); }
.jk-prose strong { font-weight: 650; }
.jk-prose ul, .jk-prose ol { margin: 0 0 1em; padding-left: 1.25em; }
.jk-prose li { margin: .3em 0; }
.jk-prose li::marker { color: var(--paper-red); }

/* Toast */
.jk-toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 90; transform: translate(-50%, 16px) scale(.98);
  max-width: min(92vw, 440px); padding: 12px 20px; border-radius: var(--r-pill); background: rgba(29, 29, 31, .92);
  color: #f5f5f7; border: 0; box-shadow: 0 12px 40px rgba(0, 0, 0, .28); font-size: var(--fs-sm); font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity var(--t-med), transform var(--t-med) var(--ease-out);
  backdrop-filter: blur(16px) saturate(1.6); -webkit-backdrop-filter: blur(16px) saturate(1.6); text-align: center;
}
.jk-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
