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

/* ── Variables ── */
:root {
  --bg:        #1e1e1e;
  --surface:   #252526;
  --surface2:  #2d2d2d;
  --border:    #3a3a3a;
  --accent:    #4e9eff;
  --text:      #e0e0e0;
  --muted:     #888;
  --success:   #4caf50;
  --radius:    8px;
  --nav-h:     52px;
  --mono:      'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Nav ── */
.site-nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav .logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

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

.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); background: var(--surface2); }
.nav-links a.active { color: var(--accent); }

/* ── Footer ── */
.site-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ── Top page ── */
.hero {
  padding: 56px 24px 36px;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

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

.hero p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 0 24px 64px;
  max-width: 880px;
  margin: 0 auto;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: border-color 0.15s, transform 0.15s;
}

.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card--soon { opacity: 0.45; pointer-events: none; }

.tool-card .icon { font-size: 1.4rem; margin-bottom: 10px; }

.tool-card h2 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tool-card p { font-size: 0.8rem; color: var(--muted); line-height: 1.55; }

.badge {
  font-size: 0.62rem;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--muted);
}

/* ── Tool page ── */
.tool-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--nav-h));
}

.tool-header {
  padding: 14px 24px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tool-header h1 { font-size: 0.98rem; font-weight: 600; }
.tool-header p { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.toggle-wrap {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.toggle-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  background: transparent;
  color: var(--muted);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.toggle-btn.active { background: var(--accent); color: #fff; }
.toggle-btn:not(.active):hover { background: var(--surface2); color: var(--text); }

.btn {
  padding: 6px 13px;
  font-size: 0.8rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn:hover         { border-color: var(--accent); color: var(--accent); }
.btn.danger:hover  { border-color: #e06c75; color: #e06c75; }

.editor-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
}

.pane { display: flex; flex-direction: column; }
.pane:first-child { border-right: 1px solid var(--border); }

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.pane-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.copy-btn {
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  min-width: 64px;
  text-align: center;
}

.copy-btn:hover  { background: var(--accent); color: #fff; }
.copy-btn.copied { background: var(--success); border-color: var(--success); color: #fff; }

textarea {
  flex: 1;
  width: 100%;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  border: none;
  outline: none;
  resize: none;
  font-family: var(--mono);
  font-size: 0.87rem;
  line-height: 1.7;
}

textarea::placeholder { color: #555; }
textarea[readonly] { color: #c8c8c8; }

/* ── Page content (usage / rules) ── */
.page-content {
  border-top: 1px solid var(--border);
  padding: 40px 24px 56px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.page-content section { margin-bottom: 36px; }

.page-content h2 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.page-content p, .page-content li {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.75;
}

.page-content ul { padding-left: 1.4em; margin-top: 8px; }
.page-content li + li { margin-top: 4px; }

.page-content code {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: #ce9178;
}

.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.81rem;
  margin-top: 10px;
}

.rule-table th {
  text-align: left;
  padding: 7px 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.rule-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #2a2a2a;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.rule-table tr:last-child td { border-bottom: none; }
.rule-table td:first-child { color: var(--text); }
.arrow { color: var(--border); }

/* ── Privacy / Prose ── */
.prose {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.prose h1 { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.prose .date { font-size: 0.78rem; color: var(--muted); margin-bottom: 36px; }
.prose h2 { font-size: 0.92rem; font-weight: 600; margin: 28px 0 10px; }
.prose p { font-size: 0.84rem; color: var(--muted); line-height: 1.8; margin-bottom: 10px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .editor-wrap { grid-template-columns: 1fr; }
  .pane:first-child { border-right: none; border-bottom: 1px solid var(--border); }
  .tool-page { height: auto; }
  .nav-links { display: none; }
  .hero h1 { font-size: 1.5rem; }
}
