/* ==========================================================================
   Base Styles - Reset & Typography
   Mobile-first approach
   ========================================================================== */

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

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-page);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}

/* Remove default link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Remove default button styles */
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Remove default input styles */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* Images */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

h1 {
  font-size: var(--h1-size);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--h2-size);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--h3-size);
}

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

/* Muted text */
.text-muted {
  color: var(--text-muted);
}

.text-dim {
  color: var(--text-dim);
}

/* Monospace */
code,
pre,
.mono {
  font-family: var(--font-mono);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------------------------------------------------------------------------
   Links & Interactive Elements
   --------------------------------------------------------------------------- */

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Disable focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Selection */
::selection {
  background-color: var(--accent-start);
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1;
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-default);
  min-height: var(--touch-target-min);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-mid));
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  border-color: var(--accent-start);
  background: var(--bg-hover);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  min-height: 36px;
}

.btn-large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  min-height: 52px;
}

@media (min-width: 768px) {
  .btn {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
  }

  .btn-large {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
    min-height: 56px;
  }
}

/* ---------------------------------------------------------------------------
   Form Inputs
   --------------------------------------------------------------------------- */

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-default);
  min-height: var(--touch-target-min);
}

.input::placeholder {
  color: var(--text-dim);
}

.input:hover {
  border-color: var(--border-focus);
}

.input:focus {
  border-color: var(--accent-start);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ---------------------------------------------------------------------------
   Utility Classes
   --------------------------------------------------------------------------- */

/* Screen reader only */
.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;
}

/* Hide on mobile, show on desktop */
.desktop-only {
  display: none;
}

@media (min-width: 1024px) {
  .desktop-only {
    display: block;
  }
}

/* Hide on desktop, show on mobile */
.mobile-only {
  display: block;
}

@media (min-width: 1024px) {
  .mobile-only {
    display: none;
  }
}
