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

/* Design tokens — VS Code Dark+ palette */
:root {
  --bg: #1e1e1e;
  --bg-surface: #252526;
  --bg-border: #3c3c3c;
  --bg-header: #2d2d30;
  --text: #d4d4d4;
  --text-muted: #858585;
  --key: #9cdcfe; /* JSON keys — light blue */
  --string: #ce9178; /* String values — muted orange */
  --number: #b5cea8; /* Numbers — light green */
  --punct: #808080; /* Braces, brackets, colons, commas */
  --link: #4ec9b0; /* URLs and mailto — teal */
  --link-hover: #6ddfc6;
  --focus: #0078d4;
  --rh-method: #569cd6; /* GET method — blue */
  --rh-status: #4ec9b0; /* 200 OK — teal */
}

html {
  background-color: var(--bg);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", "Fira Code", Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 1.5rem;
  overflow-x: hidden;
}

main {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

/* HTTP response header strip */
.response-header {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  font-size: 12px;
  color: var(--text-muted);
  background-color: var(--bg-header);
  border: 1px solid var(--bg-border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.5rem 1.5rem;
  letter-spacing: 0.01em;
}

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

.rh-path {
  color: var(--text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-status {
  color: var(--rh-status);
  margin-left: auto;
  flex-shrink: 0;
}

/* JSON code block */
.json-response {
  font-size: 15px;
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: 0 0 8px 8px;
  padding: 2rem 2.25rem;
  /* Scrollbar styling for consistency */
  scrollbar-width: thin;
  scrollbar-color: var(--bg-border) var(--bg-surface);
}

.json-response::-webkit-scrollbar {
  height: 6px;
}

.json-response::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

.json-response::-webkit-scrollbar-thumb {
  background-color: var(--bg-border);
  border-radius: 3px;
}

/* Syntax highlighting */
.k {
  color: var(--key);
}
.s {
  color: var(--string);
}
.n {
  color: var(--number);
}
.p {
  color: var(--punct);
}

/* Links inside JSON string values */
.s a,
.s a:visited {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--link);
}

.s a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

.s a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
  text-decoration: none;
}

/* Mobile — small viewports */
@media (max-width: 640px) {
  body {
    padding: 1.25rem 0.75rem;
    justify-content: flex-start;
  }

  .response-header {
    font-size: 11px;
    padding: 0.4rem 1rem;
    border-radius: 6px 6px 0 0;
  }

  .json-response {
    font-size: 12px;
    line-height: 1.7;
    padding: 1.25rem 1rem;
    border-radius: 0 0 6px 6px;
  }
}

@media (max-width: 375px) {
  .response-header {
    font-size: 10px;
    padding: 0.375rem 0.875rem;
    gap: 0.5rem;
  }

  .json-response {
    font-size: 11px;
    padding: 1rem 0.875rem;
  }
}
