@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@400;600;700;800&display=swap');

:root {
  --bg: #0a0a0f;
  --bg2: #0f0f18;
  --surface: #13131f;
  --surface2: #1a1a2e;
  --border: #2a2a45;
  --border-bright: #3d3d6b;
  --accent: #00ff87;
  --accent2: #00d4ff;
  --accent3: #ff006e;
  --text: #e8e8f0;
  --text-muted: #6b6b8a;
  --text-dim: #3d3d5c;
  --mono: 'Space Mono', monospace;
  --sans: 'Syne', sans-serif;
  --radius: 6px;
  --glow: 0 0 20px rgba(0, 255, 135, 0.15);
  --glow-strong: 0 0 40px rgba(0, 255, 135, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

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

/* Grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 135, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 135, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

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

/* --- NAV --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo span {
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.nav-links a:hover {
  color: var(--accent);
  border-color: var(--border);
  background: rgba(0, 255, 135, 0.05);
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--bg) !important;
  font-weight: 700 !important;
  border-color: transparent !important;
}

.nav-cta:hover {
  background: #00cc6e !important;
  box-shadow: var(--glow) !important;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
  transition: all 0.3s;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 1rem;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.mobile-menu a:hover {
  color: var(--accent);
  background: rgba(0, 255, 135, 0.05);
  border-color: var(--border);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
  letter-spacing: 0.03em;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #00cc6e;
  box-shadow: var(--glow-strong);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--border-bright);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(0, 255, 135, 0.05);
  box-shadow: var(--glow);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border-bright);
}

.btn-danger {
  background: transparent;
  color: var(--accent3);
  border-color: rgba(255, 0, 110, 0.3);
}

.btn-danger:hover {
  background: rgba(255, 0, 110, 0.1);
  border-color: var(--accent3);
}

/* --- TOOL LAYOUT --- */
.page-wrapper {
  position: relative;
  z-index: 1;
  padding-top: 64px;
  min-height: 100vh;
}

.tool-header {
  padding: 3rem 2rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.tool-header .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 255, 135, 0.1);
  border: 1px solid rgba(0, 255, 135, 0.25);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.tool-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.1;
}

.tool-header p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
}

.tool-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

/* --- PANELS --- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- TEXTAREAS & INPUTS --- */
textarea,
input[type="text"],
input[type="url"],
input[type="number"] {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
  resize: vertical;
  outline: none;
  line-height: 1.7;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 255, 135, 0.1);
}

textarea {
  min-height: 200px;
}

label {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* --- ALERTS --- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1rem;
}

.alert-error {
  background: rgba(255, 0, 110, 0.08);
  border: 1px solid rgba(255, 0, 110, 0.25);
  color: #ff6b9d;
}

.alert-success {
  background: rgba(0, 255, 135, 0.08);
  border: 1px solid rgba(0, 255, 135, 0.25);
  color: var(--accent);
}

.alert-info {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--accent2);
}

/* --- RANGE --- */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 255, 135, 0.5);
}

/* --- GRID UTILITIES --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.flex-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.hidden {
  display: none !important;
}

/* --- FOOTER --- */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

footer .footer-logo {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: block;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  list-style: none;
}

footer .footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  transition: color 0.2s;
}

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

footer .copyright {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
}

footer .footer-logo-created {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.75rem;
  margin-top: 0.5rem;
  display: block;
}

/* --- TOOL NAV (back link) --- */
.tool-nav-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.tool-nav-bar a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.tool-nav-bar a:hover {
  color: var(--accent);
}

.tool-nav-bar .separator {
  color: var(--text-dim);
}

/* --- COLOR SWATCH --- */
.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.1);
  border-color: var(--accent);
}

/* --- PREVIEW AREA --- */
.preview-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  overflow: hidden;
  position: relative;
}

/* --- COPY FLASH --- */
@keyframes copyFlash {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

.copy-flash {
  animation: copyFlash 0.4s;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .tool-body {
    padding: 1.25rem;
  }

  .tool-header {
    padding: 2rem 1.25rem 1.5rem;
  }

  nav {
    padding: 0 1.25rem;
  }
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}