/* Self-hosted IBM Plex (woff2 subsets in fonts/). No third-party
   requests; URLs are relative to this stylesheet. */

/* IBM Plex Mono 400 cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* IBM Plex Mono 400 latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono 400 latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono 500 cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* IBM Plex Mono 500 latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono 500 latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/ibm-plex-mono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans 400 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Sans 400 latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans 500 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Sans 500 latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans 600 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Sans 600 latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans 700 latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Sans 700 latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --fg: #1a1a1a;
  --fg-muted: #6b6b6b;
  --bg: #fdfdfc;
  --bg-code: #f3f3f0;
  --border: #e2e2dd;
  --border-strong: #c4c4be;
  --accent: #0f62fe;
  --accent-hover: #002d9c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e8e8;
    --fg-muted: #9a9a9a;
    --bg: #161616;
    --bg-code: #262626;
    --border: #393939;
    --border-strong: #525252;
    --accent: #78a9ff;
    --accent-hover: #a6c8ff;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 4rem 1.5rem 6rem;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.page-home,
body.page-spec {
  margin: 0 auto;
}

body.page-home { max-width: 740px; }
body.page-spec { max-width: 880px; }

/* Typography */

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 2.5em 0 0.6em;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0;
}

h2 {
  font-size: 1.55rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.2rem;
  margin-top: 2.25rem;
}

h4 {
  font-size: 1.02rem;
  margin-top: 1.75rem;
  color: var(--fg-muted);
  text-transform: none;
}

h2:first-of-type { border-top: 0; padding-top: 0; }

p { margin: 0 0 1em; }

strong { font-weight: 600; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.1s ease;
}

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

ul, ol { padding-left: 1.5em; margin: 1em 0; }
li { margin: 0.25em 0; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3em 0;
}

/* Code */

code {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 0.12em 0.35em;
  border-radius: 3px;
  white-space: nowrap;
}

pre {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  background: var(--bg-code);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.25em 0;
}

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

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 1.5em 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92em;
}

th, td {
  text-align: left;
  padding: 0.55em 0.85em;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-weight: 600;
  border-bottom: 2px solid var(--border-strong);
  white-space: nowrap;
}

td code, th code {
  font-size: 0.95em;
  white-space: nowrap;
}

/* Hero (homepage) */

.hero {
  padding-bottom: 2.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 0.5rem;
}

.hero .tagline {
  color: var(--fg-muted);
  font-size: 1.2rem;
  font-style: italic;
  margin: 0 0 1.5rem;
}

.hero .meta {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero .meta span + span::before {
  content: "·";
  margin: 0 0.7em;
  color: var(--border-strong);
}


.hero .meta a {
  color: inherit;
  border-bottom: 1px solid var(--border-strong);
}

.hero .meta a:hover { color: var(--accent); }

.hero-example {
  margin: 1.75rem 0 0.5rem;
  font-size: 0.9rem;
}

.hero-example .jot {
  color: var(--accent);
  font-weight: 500;
}

.example-caption {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
}

.hero .cta {
  margin: 0 0 1.5rem;
}

.hero .cta a {
  font-weight: 600;
  font-size: 1.05rem;
}

/* Spec header */

.spec-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.spec-header h1 {
  margin: 0 0 1rem;
  font-size: 2.1rem;
}

.spec-header .meta {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.spec-header .meta span + span::before {
  content: "·";
  margin: 0 0.7em;
  color: var(--border-strong);
}

.spec-header p {
  color: var(--fg-muted);
  margin-bottom: 0.6em;
}

/* TOC */

.toc {
  font-size: 0.94em;
  margin: 2.5em 0 3em;
  padding: 1.25em 1.5em 1.5em;
  background: var(--bg-code);
  border-radius: 4px;
}

.toc h2 {
  font-size: 0.78rem;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin: 0 0 1em;
  padding: 0;
  border: 0;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc > ul > li {
  margin: 0.6em 0 0.2em;
}

.toc > ul > li > strong {
  font-weight: 600;
  font-size: 0.96em;
}

.toc ul ul {
  padding-left: 1.5em;
  margin-top: 0.25em;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.86em;
}

.toc ul ul li { margin: 0.15em 0; }

.toc ul ul ul { padding-left: 1.5em; }

.toc a {
  color: var(--fg);
  border: 0;
}

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

.toc .num {
  display: inline-block;
  min-width: 2.8em;
  color: var(--fg-muted);
}

/* Section numbering on headings */

.spec-body h2,
.spec-body h3,
.spec-body h4 {
  font-variant-numeric: tabular-nums;
}

.spec-body h2 .num,
.spec-body h3 .num,
.spec-body h4 .num {
  display: inline-block;
  margin-right: 0.5em;
  color: var(--fg-muted);
  font-weight: 500;
}

/* Construct callout (homepage) */

.construct {
  margin: 1.75em 0;
}

.construct > p:first-of-type { margin-bottom: 0.5em; }

/* Anchor target offset */

[id] { scroll-margin-top: 1.5rem; }

/* Footer */

footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--fg-muted);
  text-align: center;
  font-style: italic;
}

/* Read-spec callout (homepage bottom) */

.read-spec {
  margin: 3rem 0 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  text-align: center;
}

.read-spec a {
  font-weight: 600;
  font-size: 1.05rem;
}

.read-spec .formats {
  margin: 0;
}

.read-spec .companion {
  margin: 0.9rem 0 0;
  font-size: 0.88rem;
  color: var(--fg-muted);
}

.read-spec .companion a {
  font-size: inherit;
  font-weight: 500;
}

/* Responsive */

@media (max-width: 600px) {
  body { padding: 2rem 1.1rem 4rem; font-size: 15px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.1rem; }
  .hero h1 { font-size: 2.1rem; }
  .spec-header h1 { font-size: 1.8rem; }
}
