:root{
  --bg: #14161f;
  --surface: #1b1e2a;
  --border: #2a2e3d;
  --text: #e8e6e3;
  --text-muted: #8a8d9b;
  --accent: #f2b84b;
  --accent-dim: #f2b84b26;
  --good: #6fcf97;
  --bad: #eb5757;
  --radius: 10px;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
a{color:inherit;}

header{
  border-bottom:1px solid var(--border);
  padding: 18px 28px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.brand{ display:flex; align-items:baseline; gap:10px; }
.brand-mark{ font-family:'Space Grotesk', sans-serif; font-weight:700; font-size:20px; letter-spacing:-0.02em; }
.brand-mark span{ color: var(--accent); }
.brand-sub{ font-size:13px; color:var(--text-muted); font-family:'IBM Plex Mono', monospace; }
nav.tools{ display:flex; gap:6px; flex-wrap:wrap; }
nav.tools a{ font-size:13px; color:var(--text-muted); text-decoration:none; padding:6px 10px; border-radius:6px; border:1px solid transparent; }
nav.tools a:hover{ border-color:var(--border); color:var(--text); }
nav.tools a.current{ color:var(--accent); border-color:var(--accent-dim); background:var(--accent-dim); }

main{
  flex:1;
  display:flex;
  flex-direction:column;
  padding: 22px 28px 40px;
  max-width:1400px;
  width:100%;
  margin:0 auto;
}

.intro{ margin-bottom:18px; }
h1{
  font-family:'Space Grotesk', sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  margin:0 0 6px;
  font-weight:600;
  letter-spacing:-0.01em;
}
.intro p{ margin:0; color:var(--text-muted); font-size:14.5px; max-width:640px; line-height:1.5; }

.toolbar{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin: 16px 0; }
button{
  font-family:'Inter', sans-serif;
  font-size:13.5px;
  font-weight:500;
  color: var(--text);
  background: var(--surface);
  border:1px solid var(--border);
  padding:9px 14px;
  border-radius:8px;
  cursor:pointer;
  transition: border-color .15s ease, background .15s ease;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
button:hover{ border-color:#3a3f52; background:#20232f; }
button.primary{ background: var(--accent); color:#1a1305; border-color:var(--accent); font-weight:600; }
button.primary:hover{ background:#f5c266; }
button:active{ transform: translateY(1px); }
.toolbar .spacer{ flex:1; }
select{
  font-family:'IBM Plex Mono', monospace;
  font-size:13px;
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:8px;
  padding:8px 10px;
}

.panes{ display:grid; grid-template-columns: 1fr 1fr; gap:16px; flex:1; min-height:420px; }
@media (max-width: 880px){ .panes{ grid-template-columns: 1fr; } }

.pane{ display:flex; flex-direction:column; border:1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow:hidden; }
.pane-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 14px; border-bottom:1px solid var(--border);
  font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--text-muted);
  letter-spacing:0.03em; text-transform:uppercase;
}
.pane-body{ flex:1; position:relative; display:flex; min-height:320px; }

textarea{
  flex:1; resize:none; border:none; outline:none; background:transparent;
  color:var(--text); font-family:'IBM Plex Mono', monospace; font-size:13.5px;
  line-height:1.6; padding:14px 16px; tab-size:2;
}
textarea::placeholder{ color:#565a6b; }

#output{
  flex:1; overflow:auto; padding:14px 16px;
  font-family:'IBM Plex Mono', monospace; font-size:13.5px; line-height:1.6; white-space:pre;
}
#output.empty{ color:#565a6b; white-space:normal; }

.status-strip{ height:3px; width:100%; background: var(--border); transition: background .25s ease; }
.status-strip.valid{ background: var(--good); }
.status-strip.invalid{ background: var(--bad); }

.status-bar{
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  border-top:1px solid var(--border); font-family:'IBM Plex Mono', monospace;
  font-size:12.5px; flex-wrap:wrap;
}
.status-dot{ width:8px;height:8px;border-radius:50%; background:var(--border); flex-shrink:0; }
.status-bar.valid .status-dot{ background:var(--good); box-shadow:0 0 8px var(--good); }
.status-bar.invalid .status-dot{ background:var(--bad); box-shadow:0 0 8px var(--bad); }
.status-bar.valid{ color:var(--good); }
.status-bar.invalid{ color:var(--bad); }
.status-bar .stats{ color:var(--text-muted); margin-left:auto; }

.tree{ font-family:'IBM Plex Mono', monospace; font-size:13.5px; line-height:1.7; }
.tree .row{ display:flex; align-items:flex-start; }
.tree .toggle{ cursor:pointer; width:14px; color:var(--text-muted); user-select:none; flex-shrink:0; }
.tree .key{ color:#7fb8f0; }
.tree .str{ color: var(--good); }
.tree .num{ color: var(--accent); }
.tree .bool{ color:#c792ea; }
.tree .null{ color:#8a8d9b; font-style:italic; }
.tree .brace{ color:var(--text-muted); }
.tree .count{ color:#565a6b; font-size:12px; margin-left:6px; }
.tree .children{ margin-left:16px; }
.tree .children.collapsed{ display:none; }

footer{ text-align:center; padding:18px; font-size:12.5px; color:#565a6b; border-top:1px solid var(--border); }
footer a{ color:var(--text-muted); text-decoration:underline; }

::selection{ background: var(--accent-dim); }

.toast{
  position:fixed; bottom:24px; left:50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface); border:1px solid var(--accent); color:var(--text);
  padding:10px 18px; border-radius:8px; font-size:13px; opacity:0; pointer-events:none;
  transition: all .25s ease; z-index:100;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

/* Content blocks below tools — real text for SEO, not thin pages */
.content-block{
  margin-top:40px;
  max-width:760px;
  border-top:1px solid var(--border);
  padding-top:28px;
}
.content-block h2{
  font-family:'Space Grotesk', sans-serif;
  font-size:19px;
  margin:0 0 10px;
}
.content-block p{ color:var(--text-muted); font-size:14px; line-height:1.65; margin:0 0 14px; }
.faq-item{ margin-bottom:16px; }
.faq-item h3{ font-size:14.5px; margin:0 0 4px; color:var(--text); }
.faq-item p{ margin:0; }

/* Homepage tool cards */
.tool-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap:14px;
  margin-top:20px;
}
.tool-card{
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:var(--radius);
  padding:18px;
  text-decoration:none;
  color:var(--text);
  display:flex;
  flex-direction:column;
  gap:8px;
  transition:border-color .15s ease;
}
.tool-card:hover{ border-color:var(--accent); }
.tool-card .tag{
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  color:var(--accent);
  text-transform:uppercase;
  letter-spacing:0.04em;
}
.tool-card h3{ font-family:'Space Grotesk', sans-serif; margin:0; font-size:17px; }
.tool-card p{ margin:0; color:var(--text-muted); font-size:13px; line-height:1.5; }
