/* =============================================
   Base Styles — Typography, Reset, Scrollbar
   ============================================= */

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

html {
  height: 100%;
  width: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Helvetica Neue', sans-serif;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.15;
}

h1 {
  font-size: 34px;
  letter-spacing: -0.025em;
  font-weight: 700;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h3 {
  font-size: 17px;
  letter-spacing: -0.015em;
  font-weight: 600;
}

h4 {
  font-size: 15px;
  letter-spacing: -0.01em;
  font-weight: 600;
}

p {
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Links */
a {
  color: var(--info);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

/* Selection */
::selection {
  background: rgba(var(--primary-rgb), 0.3);
  color: var(--text-primary);
}

/* Inherited form fonts */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

/* Scrollbar — Minimal, Apple-style */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* Smooth scroll */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

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