/* base.css — THEON admin global resets, base element styling, motion language.
   Element rules use ONLY tokens.css variables. Component CSS lives in
   assets/components/ (batches 2-3). */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;600&display=swap');

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Buttons (§4.1) */
button {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 1px;
  cursor: pointer;
  transition: all 120ms cubic-bezier(.2,.7,.2,1);
}
button:hover { border-color: var(--accent); color: var(--accent); }
button.primary {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
  font-weight: 600;
}
button.danger:hover { border-color: var(--warn); color: var(--warn); }

/* Form inputs (§4.2) */
input[type="text"], input[type="number"], input[type="date"],
input[type="email"], input[type="password"], textarea, select {
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 11px;
  border-radius: 1px;
  transition: border-color 120ms;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }
/* Kill the native up/down spinner on number fields — a raw OS widget on THEON chrome
   (§4.3 #3 / §8). Editor v2 Slice 2 puts box-model number fields (padding/gap) in the
   high-traffic editor; the value is typed, the spinner adds nothing. */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* Replace the native OS dropdown triangle with a THEON warm-grey chevron (§4.3 #3 /
   §8) — Editor v2 Slice 3 adds shadow/border/filter selects to the container editor. */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%23a89e8f' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 28px;
}

/* Status pills (§4.4) */
.pill {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 1px;
  font-weight: 600;
}
.pill.open     { color: var(--info);     background: var(--info-soft); }
.pill.done     { color: var(--accent);   background: var(--accent-soft); }
.pill.modifier { color: var(--modifier); background: var(--modifier-soft); }

/* Hairline section blocks (§4.6) */
.fc-section {
  border: none;
  border-top: 1px solid var(--rule);
  padding: var(--sp-4) 4px 4px;
  background: transparent;
}
.fc-section:first-child { border-top: none; padding-top: 0; }
.fc-section-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.20em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; margin-bottom: var(--sp-3); }
/* WP8-B7 (I1) — progressive disclosure: a labeled group becomes a one-click header.
   The label carries a chevron that rotates with state; a collapsed section hides its
   fields (everything after the label). Calm + keyboard-operable (role=button/tabindex). */
.fc-section.fc-collapsible > .fc-section-label {
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  margin-bottom: var(--sp-3); user-select: none; outline: none;
}
.fc-section.fc-collapsible > .fc-section-label::before {
  content: ""; width: 5px; height: 5px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease; opacity: .7;
}
.fc-section.fc-collapsible.is-collapsed > .fc-section-label::before { transform: rotate(-45deg); }
.fc-section.fc-collapsible > .fc-section-label:hover { color: var(--accent); }
.fc-section.fc-collapsible > .fc-section-label:focus-visible { color: var(--accent); text-decoration: underline; }
.fc-section.fc-collapsible.is-collapsed > :not(.fc-section-label) { display: none; }
.fc-section.fc-collapsible.is-collapsed { padding-bottom: var(--sp-4); }

/* audit Tier-2 — section Dimensions: a greyed LOCKED placeholder for "vertical align" when it
   can't apply (instead of the row silently vanishing), with a hint on how to unlock it. */
.sd-locked { display: flex; align-items: baseline; gap: 8px; opacity: 0.5; padding: 2px 0; }
.sd-locked-lab { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.sd-locked-hint { font-size: 11px; color: var(--ink-faint); font-style: italic; }

/* Editorial voice (§2.2): italic serif = human voice */
.voice { font-family: var(--serif); font-style: italic; color: var(--ink-mid); }

/* Motion language (§5) */
@keyframes highlightIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes hlDockIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes focusFadeIn { from { opacity: 0; } to { opacity: 1; } }
/* Canonical AI "thinking…" ellipsis (shared by the slash prompt + the effects prompt). */
@keyframes aiDots { 0% { width: 0; } 100% { width: 1.1em; } }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  60%  { box-shadow: 0 0 0 16px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Warm-black scrollbars (token-only) */
* { scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 1px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
