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

:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --dim: #555;
  --border: #e0e0e0;
  --green: #2a7d2a;
}

body {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

/* --- header --- */

header {
  margin-bottom: 3rem;
}

header nav {
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 0.75rem;
}

header nav a {
  color: var(--dim);
  text-decoration: none;
}

header nav a:hover {
  color: var(--text);
}

h1 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--dim);
  font-size: 12px;
}

/* --- ascii diagram --- */

.ascii-box {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px dashed var(--border);
  white-space: pre;
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  color: var(--dim);
}

/* --- sections --- */

section {
  margin-bottom: 2.5rem;
}

section h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

section h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}

section h3:first-of-type {
  margin-top: 0;
}

section p {
  margin-bottom: 0.75rem;
}

.hint {
  color: var(--dim);
  font-size: 12px;
  margin: 0.5rem 0;
}

/* --- code blocks --- */

pre {
  background: #f5f5f5;
  border: 1px solid var(--border);
  padding: 1rem;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 1rem;
}

pre.terminal {
  background: #1a1a1a;
  color: #e0e0e0;
  border-color: #333;
  margin-bottom: 1rem;
}

pre.terminal .prompt {
  color: #666;
}

code {
  font-family: inherit;
}

/* --- endpoints --- */

.endpoint {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f0f0f0;
}

.endpoint:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.endpoint .method {
  font-weight: 600;
  color: var(--green);
}

.endpoint .path {
  color: var(--text);
}

.endpoint .desc {
  color: var(--dim);
  font-size: 12px;
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* --- rules --- */

.rules-table {
  width: 100%;
  border-collapse: collapse;
}

.rules-table td {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
  vertical-align: top;
}

.rules-table td:first-child {
  font-weight: 600;
  width: 5.5rem;
  color: var(--text);
}

.rules-table td:last-child {
  color: var(--dim);
}

.rules-table tr:last-child td {
  border-bottom: none;
}

/* --- stats --- */

#slug-input {
  font-family: inherit;
  font-size: 13px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0;
  width: 100%;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

#slug-input:focus {
  border-bottom-color: var(--text);
}

#slug-input::placeholder {
  color: var(--dim);
}

#stats-result {
  margin-top: 1rem;
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.8;
}

/* --- footer --- */

footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 11px;
}

footer a {
  color: var(--dim);
  text-decoration: none;
}

footer a:hover {
  color: var(--text);
}

/* --- mobile --- */

@media (max-width: 480px) {
  body {
    padding: 1.5rem 1rem;
    font-size: 12px;
  }

  h1 {
    font-size: 14px;
  }

  header {
    margin-bottom: 2rem;
  }

  .ascii-box {
    font-size: 10px;
    padding: 1rem;
    margin: 1.5rem -1rem;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  pre, pre.terminal {
    font-size: 11px;
    padding: 0.75rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  section {
    margin-bottom: 2rem;
  }

  section h2 {
    font-size: 10px;
  }

  .endpoint {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }

  footer {
    margin-top: 3rem;
  }
}
