@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a26;
  --surface: #1e1e2e;
  --border: #2a2a3a;
  --text: #e8e8f0;
  --text2: #9898b0;
  --accent: #00d4ff;
  --accent2: #7b5cff;
  --accent3: #ff6b9d;
  --glow: rgba(0, 212, 255, 0.15);
  --glow2: rgba(123, 92, 255, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
  background: var(--glow);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* === HERO === */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--glow) 0%, var(--glow2) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
}

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

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

/* === SECTIONS === */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  font-size: 1.3rem;
}

.section-sub {
  color: var(--text2);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

/* === TOOL GRID === */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.25s;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.1);
}

.tool-card:hover::before { opacity: 1; }

.tool-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.tool-card .card-icon.blue { background: var(--glow); }
.tool-card .card-icon.purple { background: var(--glow2); }
.tool-card .card-icon.pink { background: rgba(255, 107, 157, 0.15); }

.tool-card h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.tool-card p {
  color: var(--text2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.tool-card .badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.badge.tools { background: var(--glow); color: var(--accent); }
.badge.games { background: var(--glow2); color: var(--accent2); }
.badge.ai { background: rgba(255, 107, 157, 0.15); color: var(--accent3); }
.badge.new { background: rgba(0,255,136,0.12); color: #00ff88; }

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text2);
  font-size: 0.85rem;
  margin-top: 60px;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* === TOOL PAGE LAYOUT === */
.tool-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.tool-page h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.tool-page .tool-desc {
  color: var(--text2);
  margin-bottom: 32px;
}

.tool-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.tool-box textarea,
.tool-box input[type="text"],
.tool-box input[type="number"],
.tool-box select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 14px 16px;
  resize: vertical;
  transition: border-color 0.2s;
}

.tool-box textarea:focus,
.tool-box input:focus,
.tool-box select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.tool-box textarea { min-height: 160px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

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

.btn-secondary:hover {
  border-color: var(--accent);
}

.result-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 20px;
  min-height: 60px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-item .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-item .stat-label {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 4px;
}

/* === BREADCRUMB === */
.breadcrumb {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 24px 0;
  font-size: 0.85rem;
  color: var(--text2);
}

.breadcrumb a {
  color: var(--text2);
  text-decoration: none;
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .hero { padding: 50px 20px 40px; }
  .tool-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === GAME SPECIFIC === */
.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.memory-grid {
  display: grid;
  gap: 10px;
  width: fit-content;
}

.memory-card {
  width: 80px;
  height: 80px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s;
  user-select: none;
}

.memory-card:hover { border-color: var(--accent); }
.memory-card.flipped { background: var(--glow); border-color: var(--accent); }
.memory-card.matched { background: rgba(0,255,136,0.1); border-color: #00ff88; opacity: 0.7; }

.game-stats {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
  color: var(--text2);
}

.game-stats span { color: var(--accent); font-weight: 700; }

/* === COPY FEEDBACK === */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--accent);
  color: #000;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.3s ease;
  z-index: 999;
}

.copy-toast.show { transform: translateX(-50%) translateY(0); }

/* === COLOR TOOL === */
.color-preview {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  transition: background 0.2s;
}

.color-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.color-inputs label {
  font-size: 0.82rem;
  color: var(--text2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.5s ease forwards;
  opacity: 0;
}

.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.1s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }
.fade-up:nth-child(4) { animation-delay: 0.2s; }
.fade-up:nth-child(5) { animation-delay: 0.25s; }
.fade-up:nth-child(6) { animation-delay: 0.3s; }
