/* Random Test Project — shared styles */

:root {
  --bg-primary: #0f0f14;
  --bg-secondary: #1a1a24;
  --bg-card: #22222f;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --accent: #7c5cfc;
  --accent-hover: #9b7fff;
  --accent-glow: rgba(124, 92, 252, 0.35);
  --success: #34d399;
  --warning: #fbbf24;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-lg: 20px;
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", monospace;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Background mesh gradient */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(124, 92, 252, 0.15), transparent),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(52, 211, 153, 0.08), transparent),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(251, 191, 36, 0.05), transparent);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* Layout */
.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--text-primary);
}

.nav-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #34d399);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0 5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent), #34d399, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 3rem 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(124, 92, 252, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.card-icon.purple { background: rgba(124, 92, 252, 0.15); }
.card-icon.green { background: rgba(52, 211, 153, 0.15); }
.card-icon.amber { background: rgba(251, 191, 36, 0.15); }

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer a {
  color: var(--text-secondary);
}

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

/* Section headings */
.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-title p {
  color: var(--text-secondary);
}

/* Demo page specifics */
.demo-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.demo-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-swatches {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.swatch {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.swatch:hover,
.swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.1);
}

.counter-display {
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-mono);
  text-align: center;
  margin: 1rem 0;
  color: var(--accent);
}

.counter-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-box {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-box .value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.stat-box .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.code-block {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--success);
  overflow-x: auto;
  line-height: 1.7;
}

.code-block .comment { color: var(--text-secondary); }
.code-block .keyword { color: var(--accent); }
.code-block .string { color: var(--warning); }

/* Error page */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), #f87171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 1rem;
}

.error-page h1 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.error-page p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 600px) {
  .nav-links {
    gap: 1rem;
  }

  .hero {
    padding: 2.5rem 0 3rem;
  }
}
