/* ============================================
   BASE.CSS — Claris Magic Grimoire
   Core reset, variables, typography
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Fira+Code:wght@300;400;500&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Colors */
  --bg-deep: #0a0a0f;
  --bg-mid: #0f0f1a;
  --bg-card: #12121e;
  --bg-card-hover: #1a1a2e;

  --lux-gold: #ffd700;
  --lux-amber: #ffaa00;
  --shadow-purple: #b829ff;
  --shadow-violet: #8b00ff;
  --motus-teal: #00ffcc;
  --motus-cyan: #00d4aa;
  --ember-red: #ff4444;
  --ember-orange: #ff6600;

  --text-primary: #e8e8f0;
  --text-secondary: #9090a8;
  --text-muted: #555570;

  --border-dim: rgba(255,255,255,0.06);
  --border-glow: rgba(184,41,255,0.3);

  /* Fonts */
  --font-heading: 'Cinzel', serif;
  --font-code: 'Fira Code', monospace;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --nav-height: 64px;
  --section-pad: 5rem 1.5rem;
  --card-radius: 12px;
  --border-radius: 8px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-med: 0.3s ease;
  --transition-slow: 0.6s ease;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  max-width: 100vw;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--motus-teal);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--lux-gold); }

code, .code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: rgba(0, 255, 204, 0.05);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--motus-teal);
}

/* Utility classes */
.text-gold { color: var(--lux-gold); }
.text-purple { color: var(--shadow-purple); }
.text-teal { color: var(--motus-teal); }
.text-ember { color: var(--ember-red); }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }

.italic { font-style: italic; }
.bold { font-weight: 700; }

/* Layout containers */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.section {
  padding: var(--section-pad);
}

.section-title {
  font-family: var(--font-heading);
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-dim);
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Stars background */
.stars-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.stars-layer {
  position: absolute;
  top: 0; left: 0;
  width: 200%;
  height: 200%;
}

main {
  position: relative;
  z-index: 1;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--shadow-purple); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--motus-teal); }

/* Page fade-in */
.page-content {
  animation: pageIn 0.5s ease forwards;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
