/* Terrazza documentation: the theme's stone palette and Instrument type. */
:root {
  --bg: #f8f7f4;
  --soft: #f0efeb;
  --text: #1a1918;
  --mute: #6b6863;
  --line: #e7e5e0;
  --line-strong: #8b8882;
  --accent: #1a1918;
  --accent-label: #f8f7f4;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1918;
    --soft: #242321;
    --text: #f8f7f4;
    --mute: #b9b6af;
    --line: #34322f;
    --line-strong: #8b8882;
    --accent: #f8f7f4;
    --accent-label: #1a1918;
    color-scheme: dark;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--gutter); top: 8px; background: var(--bg); padding: 8px 12px; z-index: 10; }

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 20px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.wordmark { font: 400 28px/1 var(--serif); text-decoration: none; }
.wordmark span { font: 500 13px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); margin-left: 8px; }
.header-link { font-size: 15px; white-space: nowrap; }

.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}

.sidebar ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 24px; }
.sidebar li a { display: block; padding: 6px 0; color: var(--mute); text-decoration: none; font-size: 15px; }
.sidebar li a:hover, .sidebar li a[aria-current='page'] { color: var(--text); }
.sidebar li a[aria-current='page'] { font-weight: 600; }
.sidebar summary { display: none; }

.prose { max-width: 760px; min-width: 0; }
.prose h1 { font: 400 clamp(40px, 6vw, 60px)/1.05 var(--serif); margin: 0 0 24px; letter-spacing: -0.01em; }
.prose h2 { font: 400 32px/1.15 var(--serif); margin: 56px 0 12px; }
.prose h3 { font: 600 19px/1.3 var(--sans); margin: 36px 0 8px; }
.prose h4 { font: 600 17px/1.3 var(--sans); margin: 28px 0 6px; }
.prose .anchor { text-decoration: none; }
.prose .anchor:hover::after { content: ' #'; color: var(--mute); }
.prose h2[id], .prose h3[id] { scroll-margin-top: 24px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose code { font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
.prose pre { background: var(--soft); padding: 16px; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 2px solid var(--line-strong); color: var(--mute); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; }
.prose img { max-width: 100%; height: auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.support-form { margin: 40px 0; padding: clamp(20px, 4vw, 32px); background: var(--soft); border-radius: 12px; }
.support-form h2 { margin-top: 0; }
.support-form__note { color: var(--mute); font-size: 15px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; font-size: 15px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%;
  font: 400 16px/1.4 var(--sans);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 11px 12px;
}
.field textarea { resize: vertical; }
.field--trap { position: absolute; left: -9999px; }
.button {
  font: 500 16px/1 var(--sans);
  color: var(--accent-label);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 15px 28px;
  min-height: 48px;
  cursor: pointer;
}
.button:disabled { opacity: 0.6; cursor: wait; }
.support-form__status { margin: 16px 0 0; font-weight: 500; min-height: 1.6em; }

.site-footer { border-top: 1px solid var(--line); padding: 24px var(--gutter); color: var(--mute); font-size: 14px; }
.site-footer p { max-width: 1200px; margin: 0 auto; }

.not-found { margin: 80px auto; padding: 0 var(--gutter); }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-top: 16px; gap: 8px; }
  .sidebar ul { position: static; padding-bottom: 8px; }
  .sidebar summary { display: list-item; cursor: pointer; font-weight: 600; padding: 10px 0; }
  .sidebar__toggle { border-bottom: 1px solid var(--line); }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .wordmark span { display: none; }
}
