
:root {
  --bg: #0b0d14;
  --surface: #141824;
  --surface-hover: #1b2130;
  --text: #f3f4f8;
  --muted: #9ba3b7;
  --accent: #8b75ff;
  --border: #282e40;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
}

button, input, textarea {
  font: inherit;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px max(6%, calc((100% - 1100px) / 2));
  border-bottom: 1px solid var(--border);
}

.logo {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
}

.logo span, .hero h1 span {
  color: var(--accent);
}

.theme-toggle, button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 650;
  transition: opacity .2s, transform .2s;
}

button:hover, .theme-toggle:hover {
  opacity: .85;
  transform: translateY(-1px);
}

.container {
  width: min(1100px, 88%);
  margin: auto;
}

.hero {
  text-align: center;
  padding: 90px 0 65px;
}

.eyebrow {
  color: var(--accent);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.7rem, 7vw, 5rem);
  line-height: 1.08;
  letter-spacing: -3px;
}

.subtitle {
  color: var(--muted);
  margin: 20px 0 28px;
}

.search {
  width: min(480px, 100%);
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.search:focus, textarea:focus {
  border-color: var(--accent);
}

.tools-section {
  padding-bottom: 80px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: 1.5rem;
}

.section-heading span {
  color: var(--muted);
  font-size: .9rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  transition: transform .2s, border-color .2s;
  min-width: 0;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #27213f;
  color: #b9aaff;
  font-weight: 800;
  margin-bottom: 17px;
}

.tool-card h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.tool-card p {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 15px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 85px;
  resize: vertical;
  padding: 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin: 12px 0;
  outline: none;
}

.output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #b9aaff;
  font-size: .85rem;
  min-height: 20px;
  margin-top: 10px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}

.inline-control input {
  width: 75px;
  padding: 7px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

#color-input {
  width: 100%;
  height: 48px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.stats {
  margin: 5px 0 !important;
}

.stats strong {
  color: var(--text);
}

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 25px;
  color: var(--muted);
  font-size: .85rem;
}

body.light {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-hover: #eef0f8;
  --text: #171927;
  --muted: #646b7d;
  --border: #e0e3ed;
}

body.light .tool-icon {
  background: #eeeaff;
  color: #6045d8;
}

@media (max-width: 850px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 65px 0 45px;
  }

  .hero h1 {
    letter-spacing: -1.5px;
  }

  .topbar {
    padding: 18px 6%;
  }
}
