/* ============================================================
   SLASHGIT.COM — Global Design System
   GitHub-dark inspired. Developer-first aesthetic.
   ============================================================ */

/* --- CSS Variables / Token System (Dark Mode Default) ------ */
:root {
  /* Colors — Dark (GitHub-inspired dev palette) */
  --clr-bg:          #010409;
  --clr-bg2:         #0d1117;
  --clr-surface:     #161b22;
  --clr-surface2:    #21262d;
  --clr-border:      rgba(48,54,61,0.9);
  --clr-border-glow: rgba(34,211,238,0.35);

  --clr-primary:     #22d3ee;   /* cyan */
  --clr-primary-d:   #0891b2;
  --clr-secondary:   #818cf8;   /* indigo */
  --clr-accent:      #34d399;   /* emerald */
  --clr-accent2:     #fb923c;   /* orange */
  --clr-accent3:     #a78bfa;   /* violet */
  --clr-danger:      #f87171;

  --clr-text:        #e6edf3;
  --clr-text-muted:  #8b949e;
  --clr-text-faint:  #484f58;

  /* Gradients */
  --grad-primary:    linear-gradient(135deg, #22d3ee 0%, #818cf8 100%);
  --grad-warm:       linear-gradient(135deg, #fb923c 0%, #f43f5e 100%);
  --grad-hero:       linear-gradient(135deg, #010409 0%, #0d1a2e 50%, #010409 100%);
  --grad-card:       linear-gradient(145deg, rgba(34,211,238,0.06) 0%, rgba(129,140,248,0.04) 100%);

  /* Typography */
  --font-sans:  'Inter', system-ui, sans-serif;
  --font-head:  'Space Grotesk', 'Inter', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --spacing-xs:  0.5rem;
  --spacing-sm:  1rem;
  --spacing-md:  1.5rem;
  --spacing-lg:  2.5rem;
  --spacing-xl:  4rem;
  --spacing-2xl: 6rem;

  /* Radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow:   0 0 40px rgba(34,211,238,0.15);
  --shadow-card:   0 0 0 1px rgba(48,54,61,0.8), 0 16px 48px rgba(0,0,0,0.5);

  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
}

/* --- Light Mode Variables ----------------------------------- */
[data-theme="light"] {
  --clr-bg:          #f0f9ff;
  --clr-bg2:         #e0f2fe;
  --clr-surface:     #ffffff;
  --clr-surface2:    #f0f9ff;
  --clr-border:      rgba(0,0,0,0.09);
  --clr-border-glow: rgba(8,145,178,0.3);

  --clr-primary:     #0891b2;
  --clr-primary-d:   #0e7490;
  --clr-secondary:   #6366f1;
  --clr-accent:      #059669;
  --clr-accent2:     #ea580c;
  --clr-accent3:     #7c3aed;
  --clr-danger:      #dc2626;

  --clr-text:        #0c1a2b;
  --clr-text-muted:  #475569;
  --clr-text-faint:  #94a3b8;

  --grad-hero:     linear-gradient(135deg, #f0f9ff 0%, #dbeafe 50%, #f0f9ff 100%);
  --grad-card:     linear-gradient(145deg, rgba(8,145,178,0.06) 0%, rgba(99,102,241,0.03) 100%);

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.1);
  --shadow-glow:   0 0 40px rgba(8,145,178,0.12);
  --shadow-card:   0 0 0 1px rgba(0,0,0,0.06), 0 16px 48px rgba(0,0,0,0.08);
}

/* --- System Default: Light Mode ---------------------------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --clr-bg:          #f0f9ff;
    --clr-bg2:         #e0f2fe;
    --clr-surface:     #ffffff;
    --clr-surface2:    #f0f9ff;
    --clr-border:      rgba(0,0,0,0.09);
    --clr-border-glow: rgba(8,145,178,0.3);
    --clr-primary:     #0891b2;
    --clr-primary-d:   #0e7490;
    --clr-secondary:   #6366f1;
    --clr-accent:      #059669;
    --clr-accent2:     #ea580c;
    --clr-accent3:     #7c3aed;
    --clr-danger:      #dc2626;
    --clr-text:        #0c1a2b;
    --clr-text-muted:  #475569;
    --clr-text-faint:  #94a3b8;
    --grad-hero:     linear-gradient(135deg, #f0f9ff 0%, #dbeafe 50%, #f0f9ff 100%);
    --grad-card:     linear-gradient(145deg, rgba(8,145,178,0.06) 0%, rgba(99,102,241,0.03) 100%);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.07);
    --shadow-md:     0 8px 32px rgba(0,0,0,0.1);
    --shadow-glow:   0 0 40px rgba(8,145,178,0.12);
    --shadow-card:   0 0 0 1px rgba(0,0,0,0.06), 0 16px 48px rgba(0,0,0,0.08);
  }
}

/* --- Smooth Theme Transition -------------------------------- */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.2s ease,
    box-shadow 0.3s ease !important;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: none; }
ul { list-style: none; }

/* --- Custom Cursor ----------------------------------------- */
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--clr-primary);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  transform: translate(-50%, -50%);
  z-index: 9999; pointer-events: none;
  transition: transform 0.1s;
}

.cursor-ring {
  width: 32px; height: 32px;
  border: 1.5px solid rgba(34,211,238,0.55);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  transform: translate(-50%, -50%);
  z-index: 9998; pointer-events: none;
  transition: transform 0.15s var(--ease-out), width 0.2s, height 0.2s, border-color 0.2s;
}

body.cursor-hover .cursor-ring {
  width: 48px; height: 48px;
  border-color: var(--clr-accent);
  background: rgba(34,211,238,0.04);
}

/* --- Particle Canvas --------------------------------------- */
#particleCanvas {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
}

/* --- Noise Overlay ----------------------------------------- */
.noise-overlay {
  position: fixed; inset: 0;
  z-index: 1; pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Navigation -------------------------------------------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.1rem 2rem;
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
}

.navbar.scrolled {
  background: rgba(1,4,9,0.88);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid var(--clr-border);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(240,249,255,0.9);
}

.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}

/* Logo */
.logo {
  font-family: var(--font-mono);
  font-size: 1.3rem; font-weight: 700;
  letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 2px;
  position: relative; z-index: 2;
}

.logo-slash { color: var(--clr-primary); }
.logo-git   { color: var(--clr-text); }
.logo-dot   { color: var(--clr-accent); font-size: 1.6rem; line-height: 0.8; }

/* Nav Links */
.nav-links {
  display: flex; align-items: center; gap: 0.25rem;
}

.nav-link {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem; font-weight: 500;
  color: var(--clr-text-muted);
  transition: all 0.25s var(--ease-out);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--clr-text);
  background: rgba(255,255,255,0.06);
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
  background: rgba(0,0,0,0.06);
}

.nav-link.active::after {
  content: '';
  position: absolute; bottom: 4px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--clr-primary);
}

.nav-cta {
  background: var(--grad-primary);
  color: #fff !important;
  padding: 0.45rem 1.1rem; font-weight: 600;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(34,211,238,0.35);
  background: var(--grad-primary) !important;
}

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 4px; z-index: 1001;
}

.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--clr-text); border-radius: 2px;
  transition: all 0.3s var(--ease-spring);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Theme Toggle Button ----------------------------------- */
.theme-toggle-btn {
  display: flex; align-items: center; gap: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-pill);
  padding: 3px; cursor: pointer;
  z-index: 1001; flex-shrink: 0;
  transition: border-color 0.3s;
}

.theme-toggle-btn:hover { border-color: rgba(34,211,238,0.4); }

[data-theme="light"] .theme-toggle-btn { background: rgba(0,0,0,0.05); }

.theme-opt {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 26px;
  border-radius: var(--radius-pill); font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--ease-spring);
  background: transparent; color: var(--clr-text-faint);
  border: none; padding: 0; position: relative;
}

.theme-opt:hover { color: var(--clr-text); }

.theme-opt.active {
  background: var(--grad-primary); color: #fff;
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgba(34,211,238,0.35);
}

.theme-opt[title]::after {
  content: attr(title);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: rgba(1,4,9,0.9); color: #fff;
  font-size: 0.65rem; font-weight: 600; white-space: nowrap;
  padding: 0.25rem 0.6rem; border-radius: var(--radius-pill);
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.theme-opt:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

/* --- Buttons ----------------------------------------------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--grad-primary); color: #fff;
  border-radius: var(--radius-pill); font-weight: 600;
  font-size: 0.95rem; border: none;
  transition: all 0.3s var(--ease-spring);
  position: relative; overflow: hidden; white-space: nowrap;
}

.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(34,211,238,0.4);
}

.btn-primary:hover::after { opacity: 1; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: rgba(255,255,255,0.05); color: var(--clr-text);
  border-radius: var(--radius-pill); font-weight: 600;
  font-size: 0.95rem; border: 1px solid var(--clr-border);
  transition: all 0.3s var(--ease-spring); white-space: nowrap;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: transparent; color: var(--clr-primary);
  border-radius: var(--radius-pill); font-weight: 600;
  font-size: 0.9rem; border: 1.5px solid var(--clr-primary);
  transition: all 0.3s var(--ease-spring);
}

.btn-outline:hover {
  background: var(--clr-primary); color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(34,211,238,0.3);
}

/* --- Section Containers ------------------------------------ */
.section-container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }

.section-header { text-align: center; margin-bottom: var(--spacing-xl); }

.section-tag {
  display: inline-block; padding: 0.3rem 1rem;
  background: rgba(34,211,238,0.1);
  border: 1px solid rgba(34,211,238,0.22);
  border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 600;
  color: var(--clr-primary);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.2; margin-bottom: 0.75rem;
}

.section-sub {
  font-size: 1.05rem; color: var(--clr-text-muted);
  max-width: 560px; margin: 0 auto;
}

.section-cta { text-align: center; margin-top: var(--spacing-lg); }

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

.gradient-text-warm {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Cards ------------------------------------------------- */
.tool-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: all 0.3s var(--ease-spring);
  position: relative; overflow: hidden;
  cursor: none; text-decoration: none; color: inherit;
}

.tool-card:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: var(--clr-border-glow);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 24px rgba(34,211,238,0.08);
}

.tool-card-emoji { font-size: 2.2rem; line-height: 1; }

.tool-card h3 {
  font-family: var(--font-head); font-size: 1rem;
  font-weight: 700; margin-bottom: 0.1rem;
}

.tool-card p { font-size: 0.83rem; color: var(--clr-text-muted); line-height: 1.5; flex: 1; }

.tool-card-badge {
  display: inline-block; padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(34,211,238,0.1);
  color: var(--clr-primary);
  border: 1px solid rgba(34,211,238,0.2);
  width: fit-content;
}

.tool-card-arrow {
  font-size: 0.82rem; font-weight: 600;
  color: var(--clr-primary);
  transition: transform 0.25s var(--ease-spring);
  margin-top: auto;
}

.tool-card:hover .tool-card-arrow { transform: translateX(5px); }

/* --- Mini Game Card ---------------------------------------- */
.game-mini-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: all 0.35s var(--ease-spring);
  position: relative; cursor: none; text-decoration: none; color: inherit;
}

.game-mini-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(34,211,238,0.35);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px rgba(34,211,238,0.08);
  background: var(--clr-surface2);
}

.gmc-emoji { font-size: 2.5rem; line-height: 1; transition: transform 0.3s var(--ease-spring); }
.game-mini-card:hover .gmc-emoji { transform: scale(1.2) rotate(-5deg); }

.gmc-info h4 { font-family: var(--font-head); font-size: 0.92rem; font-weight: 600; margin-bottom: 0.3rem; }
.gmc-info p  { font-size: 0.78rem; color: var(--clr-text-muted); line-height: 1.5; }

.gmc-badge {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: rgba(34,211,238,0.08);
  color: var(--clr-primary);
  border: 1px solid rgba(34,211,238,0.18);
  width: fit-content;
}

/* --- Site Footer ------------------------------------------- */
.site-footer {
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  padding: var(--spacing-xl) 0 var(--spacing-md);
  position: relative; z-index: 5;
}

.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem; margin-bottom: var(--spacing-lg);
}

.footer-tagline { color: var(--clr-text-muted); font-size: 0.9rem; margin-top: 0.75rem; max-width: 280px; line-height: 1.6; }
.footer-heading { font-size: 0.75rem; font-weight: 600; color: var(--clr-text-faint); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.25rem; }

.footer-links { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-links a { color: var(--clr-text-muted); font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--clr-primary); }

.footer-bottom {
  border-top: 1px solid var(--clr-border);
  padding-top: var(--spacing-md);
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}

.footer-bottom p { font-size: 0.85rem; color: var(--clr-text-muted); }
.footer-mood { color: var(--clr-text-faint); }

/* --- Toast ------------------------------------------------- */
.toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(22,27,34,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--clr-border-glow);
  color: var(--clr-text);
  padding: 0.8rem 1.5rem; border-radius: var(--radius-pill);
  font-size: 0.9rem; font-weight: 500;
  box-shadow: var(--shadow-glow);
  z-index: 10000; opacity: 0; visibility: hidden;
  transition: all 0.4s var(--ease-spring);
  display: flex; align-items: center; gap: 0.5rem;
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

/* --- Utility Classes --------------------------------------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.fade-in-up { opacity: 0; transform: translateY(30px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.fade-in-up.visible { opacity: 1; transform: translateY(0); }

/* --- Ad Container ------------------------------------------ */
.ad-container { max-width: 1280px; margin: 0 auto; padding: 1rem 2rem; }
.ad-placeholder { background: rgba(255,255,255,0.02); border: 1px dashed rgba(255,255,255,0.06); border-radius: var(--radius-md); padding: 2rem; text-align: center; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-label { font-size: 0.7rem; color: var(--clr-text-faint); letter-spacing: 0.1em; text-transform: uppercase; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }

  .hamburger { display: flex; }

  .nav-links {
    position: fixed; top: 0; right: 0;
    width: 280px; height: 100vh;
    background: rgba(1,4,9,0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    flex-direction: column; align-items: flex-start;
    padding: 6rem 2rem 2rem; gap: 0.5rem;
    border-left: 1px solid var(--clr-border);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-spring);
    z-index: 1000;
  }

  [data-theme="light"] .nav-links { background: rgba(240,249,255,0.97); }

  .nav-links.open { transform: translateX(0); }

  .nav-link { width: 100%; padding: 0.75rem 1rem; font-size: 1rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .section-container { padding: 0 1.25rem; }
}
