/* ==========================================================================
   BASE — base.css
   Reset, typography, reusable components.
   ========================================================================== */

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; font-size: 16px; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }

p { color: var(--text-secondary); max-width: 60ch; }

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

/* ── Container ──────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Section ────────────────────────────────────────────── */
.section {
  padding: 100px 0;
  border-top: 1px solid var(--border);
  position: relative;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 1px;
  margin-right: 10px;
  vertical-align: middle;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 13px 26px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.25s var(--ease);
}
.btn--primary {
  background: var(--accent);
  color: var(--bg-primary);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(226, 200, 126, 0.15);
}
.btn--outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-hover);
}
.btn--outline:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s var(--ease);
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.card:hover::before { opacity: 1; }

.card__image {
  width: 100%;
  height: 160px;
  background: var(--bg-tertiary);
  position: relative;
}
.card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg, transparent, transparent 10px,
    rgba(255,255,255,0.012) 10px, rgba(255,255,255,0.012) 11px
  );
}
.card__body { padding: 24px; }

.card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
}
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-4);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: gap 0.2s ease;
}
.card__link:hover { gap: 12px; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 2px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge--success { background: rgba(74,222,128,0.1); color: var(--success); }
.badge--info    { background: rgba(96,165,250,0.1);  color: var(--info); }

/* ── Divider ────────────────────────────────────────────── */
.divider {
  width: 60px;
  height: 1px;
  background: var(--accent);
  border: none;
}

/* ── Grid ───────────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ── Stats Row ──────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--bg-secondary);
  padding: 28px 24px;
  text-align: center;
}
.stat__number {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.stat__label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Loading Skeleton ───────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }
::selection { background: var(--accent); color: var(--bg-primary); }

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