/* =====================================================
   BASE — Reset, Grid, Typography, Utilities
   ===================================================== */

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* ── Selection ── */
::selection {
  background: rgba(99, 102, 241, 0.35);
  color: var(--text-primary);
}

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

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

/* ── Section layout ── */
section {
  padding: 96px 0;
  position: relative;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-secondary); }

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

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

ul { list-style: none; }

/* ── Section header ── */
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-secondary);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  margin-bottom: 16px;
}
.section-title {
  margin-bottom: 12px;
}
.section-title span {
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
}

/* ── Grid helpers ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

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

/* ── Button system ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-main);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.55);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-glass-light);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  backdrop-filter: var(--blur-glass);
}
.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--border-bright);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 1.5px solid var(--accent-primary);
}
.btn-outline:hover {
  background: var(--accent-primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-primary {
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.25);
}
.badge-cyan {
  background: rgba(6,182,212,0.12);
  color: #67e8f9;
  border: 1px solid rgba(6,182,212,0.25);
}
.badge-green {
  background: rgba(16,185,129,0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.25);
}
.badge-amber {
  background: rgba(245,158,11,0.12);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,0.25);
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0;
}

/* ── Responsive breakpoints ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  section { padding: 64px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .container { padding: 0 16px; }
  .section-header { margin-bottom: 40px; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
}
