/* Shared dark theme — a-my-hobby tools */
:root {
  --bg-deep: #0a0a0c;
  --bg-surface: #12121a;
  --bg-elevated: #1a1a24;
  --border: #2a2a38;
  --text: #e8e6f2;
  --text-muted: #9898a8;
  --accent: #7c9cff;
  --accent-soft: rgba(124, 156, 255, 0.12);
  --success: #6ee7a8;
  --warning: #fbbf77;
  --radius: 10px;
  --font-sans: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(124, 156, 255, 0.08), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(110, 231, 168, 0.04), transparent 45%),
    var(--bg-deep);
  line-height: 1.55;
}

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

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

header.hero {
  margin-bottom: 2rem;
}

header.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

header.hero p.lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 52ch;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  padding: 0.85rem 1.15rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.panel-body {
  padding: 1.15rem;
}

label.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

textarea.input,
pre.output {
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--bg-deep);
  color: var(--text);
  resize: vertical;
  min-height: 140px;
}

textarea.input {
  min-height: 180px;
}
textarea.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

pre.output {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 120px;
  max-height: 480px;
  overflow: auto;
}

pre.output.empty {
  color: var(--text-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

button.btn {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

button.btn:active {
  transform: scale(0.98);
}

button.btn-primary {
  background: linear-gradient(135deg, #5a6fd4, var(--accent));
  color: #0a0a12;
}

button.btn-primary:hover {
  filter: brightness(1.08);
}

button.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

button.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.msg {
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.85rem;
}

.msg-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.msg-hint {
  background: var(--accent-soft);
  border: 1px solid rgba(124, 156, 255, 0.25);
  color: var(--text-muted);
}

.doc-section {
  margin-top: 2rem;
}

.doc-section h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.doc-section p,
.doc-section li {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.doc-section ul {
  padding-left: 1.25rem;
}

.doc-section code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-elevated);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--success);
}

.nav-tools {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.nav-tools a {
  margin-right: 1rem;
}

footer.site-foot {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Catalog (index) */
.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}

@media (min-width: 640px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
  }
}

a.catalog-card {
  display: block;
  padding: 1.25rem 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
}

a.catalog-card:hover {
  border-color: rgba(124, 156, 255, 0.45);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(124, 156, 255, 0.12);
  transform: translateY(-2px);
  text-decoration: none;
}

a.catalog-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--accent-soft),
    0 8px 32px rgba(0, 0, 0, 0.45);
  border-color: var(--accent);
}

.catalog-card-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

a.catalog-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

a.catalog-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.catalog-card-arrow {
  display: inline-flex;
  align-items: center;
  margin-top: 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

a.catalog-card:hover .catalog-card-arrow {
  text-decoration: underline;
}

a.catalog-card code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-elevated);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--success);
}
