/* OrsonCraft Base Styles */
@import url('./tokens.css');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: var(--text-4xl); margin-bottom: var(--sp-3); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--sp-2); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--sp-2); }
h4 { font-size: var(--text-xl); margin-bottom: var(--sp-1); }

p { margin-bottom: var(--sp-2); color: var(--text-muted); }

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--accent-blue); }
a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

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

ul, ol { padding-left: var(--sp-3); color: var(--text-muted); }
li { margin-bottom: var(--sp-1); }

code {
  font-family: var(--font-mono);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

/* Selection */
::selection {
  background: var(--accent-blue);
  color: white;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

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

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

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* No JS fallback */
.no-js-message {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
  text-align: center;
  margin: var(--sp-4) auto;
  max-width: 600px;
}
