/* Alberta Oil content kit — shared tokens and components.
   Fonts (add to <head>):
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..900&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=IBM+Plex+Mono:wght@400;500&display=swap">
*/
:root {
  --ground: #f8fafc;
  --surface: #ffffff;
  --sunken: #eaf2f8;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dce7ef;
  --accent: #006ca8;      /* Alberta blue */
  --accent-ink: #ffffff;
  --ochre: #b27c08;       /* Alberta gold */
  --flare: #d24a1c;       /* hi-vis */
  --good: #2c7a4b;
  --bad: #b3261e;
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 6px;
  /* strata colours used by 3D scenes and the core log */
  --till: #b7ab8f;
  --shale: #6f7478;
  --oilsand: #3a2f22;
  --limestone: #c9c6b6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0f1214;
    --surface: #171b1e;
    --sunken: #0b0d0f;
    --ink: #e6e9e7;
    --muted: #98a1a8;
    --line: #2a3035;
    --accent: #7fb0ea;
    --accent-ink: #0c1620;
    --ochre: #d8ae5e;
    --flare: #f0784c;
    --good: #6fc794;
    --bad: #f08a80;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0f1214;
  --surface: #171b1e;
  --sunken: #0b0d0f;
  --ink: #e6e9e7;
  --muted: #98a1a8;
  --line: #2a3035;
  --accent: #7fb0ea;
  --accent-ink: #0c1620;
  --ochre: #d8ae5e;
  --flare: #f0784c;
  --good: #6fc794;
  --bad: #f08a80;
}

.ao-page {
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  padding-inline: 16px;
  padding-block: 24px 48px;
  min-height: 100%;
}
.ao-page [hidden] { display: none !important; }
.ao-wrap { max-width: 1080px; margin-inline: auto; }
.ao-page h1, .ao-page h2, .ao-page h3 {
  font-family: var(--display);
  font-stretch: 112%;
  line-height: 1.08;
  text-wrap: balance;
  margin: 0;
}
.ao-page h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 850; letter-spacing: -0.01em; }
.ao-page h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; }
.ao-page h3 { font-size: 1.1rem; font-weight: 750; }
.ao-page p { margin: 0; max-width: 65ch; }
.ao-page a { color: var(--accent); text-underline-offset: 3px; }
.ao-eyebrow {
  font: 500 0.75rem/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ochre);
}
.ao-lede { font-size: 1.15rem; color: var(--muted); }
.ao-stack { display: flex; flex-direction: column; gap: 16px; }
.ao-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ao-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ao-note { font: 400 0.8rem/1.5 var(--mono); color: var(--muted); }

.ao-btn {
  font: 600 0.9rem/1 var(--display);
  font-stretch: 105%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
}
.ao-btn:hover { border-color: var(--accent); }
.ao-btn[aria-pressed="true"], .ao-btn.is-primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.ao-btn:focus-visible, .ao-input:focus-visible, .ao-page a:focus-visible, .ao-chip:focus-visible {
  outline: 2px solid var(--flare); outline-offset: 2px;
}
.ao-input {
  font: 400 1rem/1.2 var(--mono);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-width: 0;
  width: 100%;
}
.ao-chip {
  font: 500 0.78rem/1 var(--mono);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.ao-chip[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.ao-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* 3D stage */
.ao-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--surface), var(--sunken));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  touch-action: none;
}
.ao-stage canvas { display: block; width: 100%; height: 100%; }
.ao-stage .ao-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: 24px; text-align: center; color: var(--muted); font: 400 0.9rem/1.5 var(--mono);
}
.ao-tag {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -50%);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.04em;
  padding: 5px 7px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
}
.ao-tag.is-active { background: var(--flare); border-color: var(--flare); color: #fff; }
.ao-tag[hidden] { display: none !important; }
.ao-hud {
  position: absolute; left: 12px; bottom: 12px; right: 12px;
  display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none;
}
.ao-hud > * { pointer-events: auto; }
.ao-readout {
  font: 500 0.75rem/1.3 var(--mono);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  font-variant-numeric: tabular-nums;
}
.ao-split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .ao-split { grid-template-columns: minmax(0, 1fr); } .ao-stage { aspect-ratio: 4 / 3; } }

@media (prefers-reduced-motion: reduce) {
  .ao-page * { transition: none !important; animation: none !important; }
}
