/* ==========================================================================
   CrazyEditor — Base Reset + Global Typography
   Depends on: tokens.css
   ========================================================================== */

/* --- CSS Reset --- */

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

ul,
ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img,
picture {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* --- Global Typography --- */

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--banner-height);
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); font-weight: var(--font-semibold); }
h6 { font-size: var(--text-base); font-weight: var(--font-semibold); }

p {
  line-height: var(--leading-normal);
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

pre {
  overflow-x: auto;
}

/* --- Links --- */

a:not([class]) {
  color: var(--color-primary);
  transition: color 150ms var(--ease-default);
}

a:not([class]):hover {
  color: var(--color-primary-hover);
}

a:not([class]):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Focus Visible --- */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* --- Selection --- */

::selection {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

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

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