/* ─────────────────────────────────────────────────────────
   ATOMIC  ·  Base
   Reset, element defaults, focus ring, icons, keyframes. Tokens only.
   ───────────────────────────────────────────────────────── */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
h1,h2,h3,h4,p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

body { background: var(--bg); color: var(--t1); font-family: var(--ff); }

/* Theme swap: app.js sets .is-theme-switching on <html> for two frames. Zero durations
   make colors change at once instead of interpolating while the tokens change. */
.is-theme-switching { --dur-press: 0s; --dur-fast: 0s; --dur-med: 0s; --dur-slow: 0s; --dur-sidebar: 0s; }

.atomic {
  font-family: var(--ff);
  background: var(--canvas);
  color: var(--t1);
  width: 100%; height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
}

/* ── Animations ── */
@keyframes spin { 100% { transform: rotate(360deg); } }
.spin { animation: spin 0.9s linear infinite; transform-origin: center; }
.spin svg, svg.spin { transform-origin: center; }

/* ── Focus (UI audit 3.2) ──
   One ring for every interactive element and field. The only outline reset in the theme. */
:is(a, button, summary, [role="button"]):focus-visible { outline: none; box-shadow: var(--focus-ring); }
:is(.input, .select, .textarea):focus-visible, .input-affix:focus-within { outline: none; border-color: var(--ac-dim); box-shadow: var(--well-inset), var(--focus-ring); }
.input-affix input:focus-visible { outline: none; }

/* ── Icons and tones (contract §3.9, §5.6) ──
   icon() / product_icon() render <svg class="ic"><use href="#i-…"/></svg>
   from the sprite printed in head.atom.php. Size and color come from here. */
.icon-sprite { display: none; }
.ic {
  width: var(--icon-md); height: var(--icon-md); flex: none;
  fill: none; stroke: currentColor; stroke-width: var(--ic-stroke);
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
/* Brand marks (google, telegram) are filled shapes in their own colors: no outline stroke. */
.ic-brand { stroke: none; }
