/* ==========================================================================
   MKH - Base reset and element defaults
   Follows the Claude Design token layer's element defaults.
   Requires tokens.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: var(--lh-normal);
  font-weight: var(--fw-regular);
  color: var(--txt);
  /* The bloom is fixed so it stays put while the page scrolls. */
  background-color: var(--app-bg);
  background-image: var(--app-bloom);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--txt);
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd, dt, figure { margin: 0; padding: 0; }
li { list-style: none; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }

img, video { display: block; max-width: 100%; height: auto; }

/* A default size, so an icon without explicit dimensions never renders huge
   while its stylesheet is still loading. */
svg { width: 18px; height: 18px; flex: none; }

button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
select { cursor: pointer; }

table { border-collapse: collapse; border-spacing: 0; }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
::placeholder { color: var(--txt-3); opacity: 1; }
::selection { background: var(--primary-soft); color: var(--primary-soft-fg); }

[hidden] { display: none !important; }

/* Visible only to screen readers.
   clip-path rather than the old clip/absolute recipe: it hides the element
   without giving it a position that can escape a scroll container and drag
   the document's scroll width out with it. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Keyboard focus. Never remove the indicator - only restyle it. */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* Monetary and quantity figures line up in columns. */
.figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.figure--credit { color: var(--credit); }
.figure--debit  { color: var(--debit); }

/* ---- Scrollbars ---------------------------------------------------------- */

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid transparent;
  border-radius: var(--r-full);
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--txt-3); background-clip: content-box; }

/* ---- Motion -------------------------------------------------------------- */

@keyframes mkh-spin   { to { transform: rotate(360deg); } }
@keyframes mkh-rise   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes mkh-fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes mkh-slide-r{ from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mkh-bloom  { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.12) translate(2%, -3%); opacity: 1; } }
@keyframes mkh-shine  { 0% { transform: translateX(-130%) skewX(-18deg); } 100% { transform: translateX(320%) skewX(-18deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
