@import "./tokens.css";
@import "./utilities.css";
@import "./components.css";

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

html {
  scroll-behavior: smooth;
}

::selection {
  background: light-dark(rgba(168, 162, 158, 0.3), rgba(168, 162, 158, 0.25));
}

body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

p {
  line-height: 1.625;
}

/* -- Reduced motion -- */
@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;
  }
}

/* ── TipTap editor styles ── */

.tiptap {
  outline: none;
}

.tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--text-muted);
  pointer-events: none;
  height: 0;
}

.tiptap h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.tiptap h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.tiptap h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.tiptap ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  line-height: 1.7;
}

.tiptap ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  line-height: 1.7;
}

.tiptap li {
  margin-top: 0.25rem;
}

.tiptap blockquote {
  border-left: 2px solid var(--border-default);
  padding-left: 1rem;
  font-style: italic;
  color: var(--text-secondary);
}

.tiptap pre {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.tiptap code {
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.375rem;
  font-size: var(--text-sm);
}

.tiptap pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.tiptap hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: 1.5rem 0;
}

.tiptap p {
  min-height: 1.5em;
}

/* TipTap prose sizing (replaces Tailwind prose-sm) */
.tiptap-prose {
  font-size: var(--text-sm);
  line-height: 1.7;
}
