/* mcabyte tools — shared theme. Matches the mcabyte landing / KeyForge look. */
:root {
  --bg: #07090d; --bg-2: #0c1017;
  --panel: rgba(16, 22, 31, 0.78);
  --line: rgba(120, 160, 200, 0.14);
  --text: #e6edf5; --muted: #8b98a9; --faint: #56637a;
  --accent: #35f0b4; --accent-2: #7c6cff; --warn: #ffb547; --err: #ff6b6b;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(124,108,255,0.16), transparent 70%),
    radial-gradient(700px 500px at 90% 85%, rgba(53,240,180,0.10), transparent 70%),
    linear-gradient(var(--bg), var(--bg-2)); }
.bg::before { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  opacity: 0.55; }

a { color: inherit; }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 22px; }

/* Header */
header { padding: 22px 0; padding-top: max(22px, env(safe-area-inset-top)); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid rgba(53,240,180,0.4); color: var(--accent); font-size: 0.85rem; background: rgba(53,240,180,0.07); }
.brand b { color: var(--accent); }
.back { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: rgba(12,16,23,0.6); white-space: nowrap; }
.back:hover { color: var(--text); border-color: rgba(53,240,180,0.5); }
.pill { font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  display: inline-flex; align-items: center; gap: 8px; background: rgba(12,16,23,0.6); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s infinite; }

/* Main + titles */
main { flex: 1; padding: 14px 0 56px; }
.eyebrow { font-family: var(--mono); font-size: 0.78rem; color: var(--accent);
  letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 10px; }
h1 { font-family: var(--mono); font-weight: 800; margin: 0 0 8px;
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1.04; letter-spacing: -0.02em; }
h1 .hl { background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.cursor { display: inline-block; width: 0.5em; height: 0.85em; margin-left: 6px; vertical-align: -0.06em;
  background: var(--accent); animation: blink 1.1s steps(1) infinite; }
.lead { color: var(--muted); max-width: 60ch; margin: 0 0 26px; }

/* Terminal panel */
.term { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8); overflow: hidden; }
.term + .term { margin-top: 18px; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); background: rgba(7,9,13,0.5); font-family: var(--mono); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; color: var(--muted); font-size: 0.78rem; }
.body { padding: 20px; }

/* Controls */
label { display: block; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin: 0 0 8px; }
label .p { color: var(--accent); }
textarea.io, input.io, select.io {
  width: 100%; font-family: var(--mono); font-size: 15px; color: var(--text);
  background: rgba(7,9,13,0.7); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease; }
textarea.io { min-height: 120px; resize: vertical; line-height: 1.5; }
select.io { cursor: pointer; }
.io:focus { border-color: rgba(53,240,180,0.6); box-shadow: 0 0 0 3px rgba(53,240,180,0.12); }
.row { margin-bottom: 16px; }
.row:last-child { margin-bottom: 0; }
.count { display: block; text-align: right; font-size: 0.7rem; color: var(--faint); margin-top: 5px; font-family: var(--mono); }
.inline { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.inline > * { margin: 0; }
.check { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* Buttons */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.btn { font-family: var(--mono); font-size: 0.9rem; cursor: pointer; text-decoration: none;
  padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line); background: rgba(12,16,23,0.6); color: var(--text);
  display: inline-flex; align-items: center; gap: 8px; transition: transform .15s ease, border-color .15s ease, background-color .15s ease; }
.btn:hover { transform: translateY(-1px); border-color: rgba(53,240,180,0.5); }
.btn.primary { background: var(--accent); color: #04120d; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { background: #5cf5c6; }
.btn:focus-visible, .copy:focus-visible, .seg button:focus-visible, .io:focus-visible, .back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Segmented toggle */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: rgba(7,9,13,0.5); }
.seg button { font-family: var(--mono); font-size: 0.85rem; padding: 9px 16px; background: transparent; color: var(--muted); border: 0; cursor: pointer; }
.seg button[aria-pressed="true"] { background: rgba(53,240,180,0.12); color: var(--accent); }

/* Output */
.out { position: relative; background: rgba(7,9,13,0.7); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 14px; font-family: var(--mono); font-size: 14px; line-height: 1.55; color: var(--text);
  white-space: pre-wrap; word-break: break-word; min-height: 46px; overflow-wrap: anywhere; }
.out.empty { color: var(--faint); }
.out.error { border-color: rgba(255,107,107,0.5); color: var(--err); }
.out.ok { border-color: rgba(53,240,180,0.35); }
.copy { position: absolute; top: 8px; right: 8px; font-family: var(--mono); font-size: 0.72rem; cursor: pointer;
  background: rgba(12,16,23,0.8); border: 1px solid var(--line); border-radius: 7px; color: var(--muted); padding: 5px 9px; }
.copy:hover { color: var(--text); border-color: rgba(53,240,180,0.5); }
.copy.done { color: var(--accent); border-color: var(--accent); }
.out-label { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 7px; }

/* key/value rows */
.kv { font-family: var(--mono); font-size: 0.86rem; }
.kv div { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv div:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); min-width: 130px; }
.kv .v { color: var(--text); word-break: break-all; }
.kv .v.g { color: var(--accent); }
.kv .v.w { color: var(--warn); }

mark { background: rgba(53,240,180,0.28); color: var(--text); border-radius: 3px; padding: 0 1px; }
.badge { font-family: var(--mono); font-size: 0.7rem; padding: 3px 8px; border-radius: 6px; margin-left: 8px; }
.badge.good { color: var(--accent); border: 1px solid rgba(53,240,180,0.35); background: rgba(53,240,180,0.07); }
.badge.bad { color: var(--err); border: 1px solid rgba(255,107,107,0.35); background: rgba(255,107,107,0.07); }
.hint { font-family: var(--mono); font-size: 0.74rem; color: var(--faint); margin-top: 12px; }

/* Tool hub grid */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 10px; }
.tool-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; text-decoration: none; color: inherit; transition: border-color .2s ease, transform .2s ease;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tool-card:hover { border-color: rgba(53,240,180,0.45); transform: translateY(-2px); }
.tool-card .tc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tool-card .ico { font-family: var(--mono); font-weight: 700; color: var(--accent); border: 1px solid rgba(53,240,180,0.3);
  background: rgba(53,240,180,0.06); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 0.9rem; }
.tool-card .slug { font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }
.tool-card h3 { font-family: var(--mono); font-size: 1rem; margin: 0 0 6px; }
.tool-card p { color: var(--muted); font-size: 0.9rem; margin: 0; flex: 1; }
.tool-card .go { font-family: var(--mono); font-size: 0.74rem; color: var(--accent); margin-top: 14px; }
.tool-card:hover .go { text-decoration: underline; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 6px 0 16px; flex-wrap: wrap; }
.sec-note { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

/* Footer + toast */
footer { border-top: 1px solid var(--line); padding: 22px 0; padding-bottom: max(22px, env(safe-area-inset-bottom));
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: rgba(12,16,23,0.96); border: 1px solid rgba(53,240,180,0.4); color: var(--accent);
  font-family: var(--mono); font-size: 0.82rem; padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(53,240,180,0.55);} 70% { box-shadow: 0 0 0 8px rgba(53,240,180,0);} 100% { box-shadow: 0 0 0 0 rgba(53,240,180,0);} }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 760px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .wrap { padding: 0 16px; } .body { padding: 16px; }
  .tool-grid { grid-template-columns: 1fr; }
  .foot { justify-content: center; text-align: center; }
}
