:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #273449;
  --border: #334155;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --accent: #f97316;
  --accent2: #fdba74;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: 'Courier New', 'Consolas', 'Source Code Pro', 'Fira Code', 'Cascadia Code', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  font-size: 0.92rem;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.c-container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Header */
.c-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  position: sticky; top: 0; z-index: 100;
}
.c-header .c-container {
  display: flex; align-items: center; justify-content: space-between;
}
.c-logo {
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.c-logo-icon { font-size: 1.2rem; }
.c-nav { display: flex; gap: 16px; }
.c-nav a { color: var(--text2); font-size: 0.85rem; transition: color .2s; }
.c-nav a:hover { color: var(--text); text-decoration: none; }

/* Main */
.c-main { padding: 24px 0 40px; }

/* Breadcrumb (d-trail) */
.d-trail {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.d-trail a { color: var(--accent2); }
.d-trail span { color: var(--text); }

/* Hero */
.c-hero { margin-bottom: 20px; }
.c-hero h1 { font-size: 1.5rem; margin-bottom: 4px; }
.c-subtitle { color: var(--text2); font-size: 0.9rem; margin-bottom: 16px; }

/* Tool zone (d-toolzone) */
.d-toolzone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  min-height: 120px;
  transition: border-color .2s;
}

/* d-links section */
.d-links { margin-bottom: 20px; }
.d-links h2 {
  font-size: 0.9rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* d-cards */
.d-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.d-card {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s, background .2s;
}
.d-card:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  text-decoration: none;
}
.d-card.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

/* Knowledge section (d-know) */
.d-know {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.d-know h2, .d-know h3 { font-size: 1rem; margin: 16px 0 8px; }
.d-know h2:first-child, .d-know h3:first-child { margin-top: 0; }
.d-know p { color: var(--text2); margin-bottom: 8px; }
.d-know ul, .d-know ol { padding-left: 20px; margin-bottom: 8px; }
.d-know li { color: var(--text2); margin-bottom: 4px; }

/* Buttons */
.c-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius); border: none;
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.c-btn-primary { background: var(--accent); color: #fff; }
.c-btn-primary:hover { background: var(--accent2); }
.c-btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.c-btn-secondary:hover { border-color: var(--accent); }

/* Inputs */
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px; border-radius: var(--radius);
  font-family: inherit; font-size: 0.88rem;
  width: 100%; max-width: 360px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}

/* Result area */
.c-result {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  font-size: 1rem;
  word-break: break-all;
}

/* Footer */
.c-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  color: var(--text2);
  font-size: 0.8rem;
}
.c-footer a { color: var(--text2); }

/* Responsive */
@media (max-width: 768px) {
  .c-hero h1 { font-size: 1.2rem; }
  .c-header .c-container { flex-direction: column; gap: 6px; }
  .d-cards { gap: 6px; }
  .d-card { padding: 5px 10px; font-size: 0.8rem; }
}

/* NameForge Tool Styles */
.nf-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.nf-optgroup { display: none; }
.nf-optgroup-active { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.nf-optgroup label { color: var(--text2); font-size: 0.85rem; }
.nf-cat { padding: 10px 18px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; font-size: 0.9rem; transition: all 0.2s; font-family: inherit; }
.nf-cat:hover { border-color: var(--accent); background: var(--surface2); }
.nf-cat.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: bold; }

.nf-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }
.nf-controls label { color: var(--text2); font-size: 0.85rem; }
.nf-controls select { padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: inherit; font-size: 0.85rem; }
.nf-controls select:focus { outline: none; border-color: var(--accent); }

.nf-btn { padding: 10px 28px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: 0.95rem; font-weight: 600; font-family: inherit; transition: background 0.2s; }
.nf-btn:hover { background: #ea580c; }

.nf-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; }
.nf-item span { font-size: 1.1rem; font-weight: 500; }
.nf-copy { padding: 6px 16px; background: var(--accent); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-family: inherit; }
.nf-copy:hover { background: #ea580c; }

.nf-name-tag { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; font-weight: 500; min-width: 140px; }
.nf-copy-sm { background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: 2px 6px; border-radius: 4px; }
.nf-copy-sm:hover { background: var(--surface2); }

#nfResults h3 { margin-bottom: 12px; color: var(--accent2); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }
