/* OneTag AI site: one stylesheet, system fonts, no external assets. */

:root {
  --text: #17181c;
  --muted: #5b606b;
  --bg: #ffffff;
  --soft: #f4f4f1;
  --line: #e2e2dc;
  --accent: #2450d6;
  --accent-dark: #1b3fae;
  --error: #b42318;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

.site-header,
main,
.site-footer {
  max-width: 752px; /* 720px of content plus 16px of padding on each side */
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-dark);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.wordmark {
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark:hover {
  color: var(--text);
}

.site-header nav {
  display: flex;
  gap: 20px;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--text);
}

/* Text */

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(32px, 7vw, 46px);
  margin: 0 0 20px;
}

h2 {
  font-size: 26px;
  margin: 64px 0 16px;
}

h3 {
  font-size: 19px;
  margin: 40px 0 12px;
}

p,
ul,
ol {
  margin: 0 0 16px;
}

.lead {
  font-size: 20px;
  color: var(--muted);
}

.note {
  font-size: 15px;
  color: var(--muted);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--soft);
  border-radius: 4px;
  padding: 0.1em 0.3em;
}

/* Sections */

section {
  margin: 64px 0;
}

.hero {
  margin-top: 56px;
}

.hero .lead {
  margin-bottom: 28px;
}

.hero .note {
  margin-top: 24px;
}

/* Code blocks */

.code {
  position: relative;
  margin: 0 0 20px;
}

pre {
  margin: 0 0 20px;
  padding: 16px;
  overflow-x: auto;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 14px/1.6 var(--mono);
}

.code pre {
  margin: 0;
}

pre code {
  font-size: inherit;
  background: none;
  border-radius: 0;
  padding: 0;
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  font: 600 13px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.copy:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* Buttons and forms */

.button,
button[type="submit"] {
  display: inline-block;
  padding: 12px 22px;
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button[type="submit"]:hover {
  color: #ffffff;
  background: var(--accent-dark);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: progress;
}

form {
  max-width: 480px;
}

label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 15px;
}

label .optional {
  font-weight: 400;
  color: var(--muted);
}

input[type="email"],
input[type="text"] {
  display: block;
  width: 100%;
  margin: 0 0 18px;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming in on focus */
  color: var(--text);
  background: var(--bg);
  border: 1px solid #c9c9c2;
  border-radius: 8px;
}

input[type="email"]:focus,
input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

input::placeholder {
  color: #8b8f98;
}

.status {
  min-height: 1.6em;
  margin: 16px 0 0;
  font-weight: 600;
}

.status.ok {
  color: var(--accent);
}

.status.error {
  color: var(--error);
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
  border-bottom-color: var(--text);
}

td code {
  overflow-wrap: anywhere;
}

/* Codes in the first column break only at the <wbr> after an underscore. */
td:first-child code {
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Docs */

.toc {
  margin: 32px 0 0;
  padding: 16px 20px;
  background: var(--soft);
  border-radius: 10px;
  font-size: 15px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
}

.toc li {
  margin: 2px 0;
}

/* Footer */

.site-footer {
  margin-top: 96px;
  padding-bottom: 48px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.site-footer a {
  color: var(--muted);
}

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

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .lead {
    font-size: 18px;
  }

  h2 {
    font-size: 23px;
    margin-top: 48px;
  }

  section {
    margin: 48px 0;
  }

  .hero {
    margin-top: 32px;
  }

  pre {
    font-size: 13px;
  }

  table {
    font-size: 14px;
  }

  td:first-child code {
    white-space: normal;
  }
}

.site-footer .legal { margin-top: 6px; opacity: .8; }
