/* ============================================================
   BASE.CSS — Reset, Typography, Body
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: var(--lh-body);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Body ambient glow */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(108,60,228,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(0,212,170,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(245,166,35,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  /* On mobile: absolute to avoid compositing overhead */
  will-change: auto;
}

/* On mobile, fixed radial-gradient trigger compositor layers — use absolute instead */
@media (max-width: 767px) {
  body::before {
    position: absolute;
    background:
      radial-gradient(ellipse at 15% 20%, rgba(108,60,228,0.08) 0%, transparent 55%),
      radial-gradient(ellipse at 85% 80%, rgba(0,212,170,0.05) 0%, transparent 55%);
  }
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 15% 20%, rgba(108,60,228,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(0,212,170,0.04) 0%, transparent 55%);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb {
  background: rgba(108,60,228,0.4);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(108,60,228,0.7); }

/* ── Selection ── */
::selection {
  background: rgba(108,60,228,0.35);
  color: var(--text-primary);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 700;
  line-height: var(--lh-heading);
  color: var(--text-primary);
}

h1 { font-size: clamp(var(--fs-2xl), 5vw, var(--fs-5xl)); }
h2 { font-size: clamp(var(--fs-xl), 3vw, var(--fs-3xl)); }
h3 { font-size: clamp(var(--fs-lg), 2.5vw, var(--fs-2xl)); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

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

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover { color: var(--accent); }

img {
  max-width: 100%;
  display: block;
}

ul, ol { list-style: none; }

button {
  font-family: var(--font-main);
  cursor: pointer;
  border: none;
  outline: none;
}

input, select, textarea {
  font-family: var(--font-main);
  font-size: var(--fs-base); /* min 16px — prevents iOS zoom */
  outline: none;
}

/* ── Gradient Text Utility ── */
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-gold {
  background: linear-gradient(135deg, #F5A623, #FCD34D, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Container ── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
  position: relative;
}

@media (min-width: 768px) {
  .container { padding: 0 var(--sp-8); }
}

/* ── Utility Classes ── */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-accent  { color: var(--accent); }
.text-gold    { color: var(--secondary); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.gap-2  { gap: var(--sp-2); }
.gap-3  { gap: var(--sp-3); }
.gap-4  { gap: var(--sp-4); }
.gap-6  { gap: var(--sp-6); }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Section Spacing ── */
.section { padding: var(--sp-16) 0; }
.section-sm { padding: var(--sp-10) 0; }
