/*
 * Global stylesheet baseline.
 */

:root {
  --bg: #fcfcfb;
  --surface: #ffffff;
  --text: #1d232b;
  --muted: #5b6470;
  --line: #e4e8ee;
  --accent: #0f5bd8;
  --accent-soft: #eaf1ff;
  --radius: 10px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

a:hover,
a:focus-visible {
  text-decoration-thickness: 0.12em;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-nav {
  max-width: 880px;
  margin: 0 auto;
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
}

.site-nav__link {
  display: inline-block;
  padding: 0.3rem 0.58rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--text);
  background: #f2f5f9;
}

.page-content {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.1rem 2.6rem;
}

h1,
h2,
h3 {
  line-height: 1.24;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(1.65rem, 3.2vw, 2.2rem);
}

h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  margin-top: 1.85rem;
}

p,
ul,
ol,
pre,
form {
  margin: 0 0 0.95rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.38rem;
}

section {
  margin-top: 1.6rem;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

code {
  background: #f3f6fb;
  border-radius: 6px;
  padding: 0.06rem 0.28rem;
}

pre {
  background: #f3f6fb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  overflow-x: auto;
}

button,
input[type="submit"] {
  border: 1px solid #cfd8e6;
  background: #f7f9fc;
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
  background: #eef3fb;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.chat-stub__form {
  display: grid;
  gap: 0.55rem;
}

.writing-page {
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.writing-page__title {
  margin: 0 0 0.8rem;
  color: var(--text);
  font-family: inherit;
  font-size: clamp(1.65rem, 3.2vw, 2.2rem);
  font-weight: 700;
}

.writing-page__list {
  margin: 0;
  padding-left: 1.2rem;
}

.writing-page__item {
  margin: 0.38rem 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.writing-page__link {
  color: var(--accent);
  transition: color 120ms ease;
}

.writing-page__link:hover,
.writing-page__link:focus-visible {
  color: #0b4ab0;
}

.writing-page__text {
  color: var(--text);
}

@media (max-width: 48rem) {
  .page-content {
    padding-top: 1.4rem;
  }

  .site-nav {
    padding: 0.7rem 0.9rem;
  }
}
