/* file: css/base.css */

:root {
  --bg: #020617;
  --bg-gradient: radial-gradient(circle at top, #4f46e5 0, #020617 40%, #020617 100%);
  --primary: #ff6ec7;
  --secondary: #4f46e5;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --card: rgba(15, 23, 42, 0.9);
  --card-soft: rgba(15, 23, 42, 0.8);
  --card-border: rgba(148, 163, 184, 0.4);
  --radius: 18px;
  --transition: 0.25s ease;
  --max-width: 1100px;
  --header-h: 70px;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.9);
}

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

html,
body {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-gradient);
  position: relative;
  overflow-x: hidden;
  cursor: none;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

/* Background layers */
.overlay,
.background-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.overlay {
  background: var(--bg-gradient);
}

.background-overlay {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.85),
    rgba(15, 23, 42, 0.96)
  );
}

/* Matrix-style Java code rain */
#code-rain {
  position: fixed;
  inset: 0;
  z-index: -1; /* above overlays, below content */
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: screen;
}

/* Custom cursor */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f97316, #ec4899);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.9);
}

.cursor-outline {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: 0 0 30px rgba(79, 70, 229, 0.7);
  backdrop-filter: blur(6px);
}

/* On mobile: native cursor */
@media (max-width: 800px) {
  body {
    cursor: auto;
  }
  .cursor-dot,
  .cursor-outline {
    display: none;
  }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Floating Java code chips */
.code-chip {
  position: absolute;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.08;
  transform: translate(-50%, -50%);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.85);
  color: #fecaca;
  box-shadow: 0 0 18px rgba(248, 113, 113, 0.35);
  filter: blur(0.1px);
  animation: codeChipFloat 22s linear infinite;
}

/* Java click pulse */
.click-pulse {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.78rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.85);
  color: #fee2e2;
  box-shadow: 0 0 24px rgba(248, 113, 113, 0.6);
  animation: clickPulse 0.9s ease-out forwards;
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: 1rem;
}

.lang-btn {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.7rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.lang-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 250, 252, 0.7);
}

.lang-btn.active {
  background: linear-gradient(90deg, #f97316, #ec4899, #4f46e5);
  color: #f9fafb;
  border-color: transparent;
}
.theme-toggle {
  margin-left: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: #e5e7eb;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 250, 252, 0.8);
}

.theme-toggle .theme-icon-light {
  display: none;
}

/* When body has light theme, invert icons + button bg */
body.theme-light .theme-toggle {
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.9);
}

body.theme-light .theme-toggle .theme-icon-dark {
  display: none;
}

body.theme-light .theme-toggle .theme-icon-light {
  display: inline;
}
