/*
 * Base Styles
 * Reset, body defaults, typography, and shared utilities.
 * These apply globally to all sections.
 */

/* ═══════════════════════════════════════════════════════════════════════════
   RESET
   ═══════════════════════════════════════════════════════════════════════════ */

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

* {
  margin: 0;
}

html, body {
  height: 100%;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

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

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BODY DEFAULTS
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* Optional: Background gradients (can be toggled in layout.css) */
body.with-gradient {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124, 92, 255, 0.15), transparent 60%),
    radial-gradient(800px 500px at -10% 20%, rgba(0, 229, 255, 0.10), transparent 60%),
    var(--color-bg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY DEFAULTS
   ═══════════════════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-5xl); }
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); }

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

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

/* ═══════════════════════════════════════════════════════════════════════════
   FOCUS STATES
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

/* Content wrapper */
.wrap {
  width: var(--content-width);
  margin: 0 auto;
}

.wrap-narrow {
  width: var(--content-width-narrow);
  margin: 0 auto;
}

.wrap-wide {
  width: var(--content-width-wide);
  margin: 0 auto;
}

/* Text colors */
.text-muted {
  color: var(--color-text-secondary);
}

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

/* Gradient text */
.text-gradient {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHARED COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tags */
.tag {
  display: inline-block;
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.button:hover {
  border-color: var(--color-text-secondary);
  transform: translateY(-1px);
}

/* Status messages */
.status {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Reveal animation - elements fade in when they enter viewport */
.reveal {
  opacity: 0;
  transform: translateY(8px);
}

.reveal.show {
  opacity: 1;
  transform: none;
  transition: opacity var(--transition-slower), transform var(--transition-slower);
}

/* Keyframes for typing indicators etc */
@keyframes blink {
  0%, 45% { opacity: 1; }
  55%, 100% { opacity: 0; }
}

@keyframes pulse {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}
