/* ============================================
   Base Styles & Reset
   Minimal reset + Apple-inspired base styles
   ============================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-system);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

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); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
}

/* Links */
a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--accent-blue-hover);
}

/* Buttons */
button {
  font-family: inherit;
  font-size: inherit;
  font-weight: var(--weight-medium);
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Inputs */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background-color: var(--glass-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  transition: all var(--duration-fast) var(--ease-out);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-blue);
  background-color: var(--bg-secondary);
}

input::placeholder, textarea::placeholder {
  color: var(--text-tertiary);
}

/* Scrollbars (WebKit) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-medium);
  border-radius: var(--radius-full);
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--glass-darker);
  background-clip: content-box;
}

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

/* Lists */
ul, ol {
  list-style: none;
}

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

/* Code */
code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

code {
  background-color: var(--glass-dark);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

pre {
  background-color: var(--glass-dark);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* Utility */
.hidden {
  display: none !important;
}

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

/* Prevent text selection on UI elements */
.no-select {
  -webkit-user-select: none;
  user-select: none;
}

/* Prevent dragging of images/elements */
.no-drag {
  -webkit-user-drag: none;
  user-select: none;
}
