/* DIO/ODI Reference Model — shared dark design system
   Human-readable HTML only. Machine-readable RDF, JSON-LD, SKOS and source artifacts are unchanged. */

:root {
  color-scheme: dark;
  --page-bg: #111113;
  --surface: #1b1b1f;
  --surface-raised: #232329;
  --surface-soft: #19191d;
  --text: #e8e8ed;
  --muted: #b1b1bb;
  --border: #414149;
  --border-strong: #585861;
  --link: #9bbcff;
  --link-hover: #c9d9ff;
  --code-bg: #25252b;
  --diagram-bg: #ffffff;
  --content-width: 72rem;
  --reading-measure: 44rem;
  --page-gutter: clamp(1rem, 2.2vw, 1.6rem);
}

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

html {
  background: var(--page-bg);
  color-scheme: dark;
  scroll-behavior: smooth;
  scrollbar-color: var(--border-strong) var(--page-bg);
}

body {
  width: min(calc(100% - 1.5rem), var(--content-width));
  max-width: none;
  margin: clamp(2rem, 4vw, 4rem) auto;
  padding-inline: var(--page-gutter);
  background: var(--page-bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  width: min(100%, var(--reading-measure));
  max-width: var(--reading-measure);
  margin-inline: auto;
  color: var(--text);
  line-height: 1.22;
  text-align: left;
  text-wrap: pretty;
}

h1 {
  width: min(100%, 58ch);
  max-width: 58ch;
  margin-block: 1.6rem 1.1rem;
  font-size: clamp(1.85rem, 3vw, 2.55rem);
  letter-spacing: -0.025em;
}

body.page--vocabulary > h1,
body.page--index > h1 {
  width: min(100%, var(--reading-measure));
  max-width: var(--reading-measure);
}

body.page--mapping > h1 {
  width: min(100%, 58ch);
  max-width: 58ch;
}

/* Explicit mapping-page override: align section headings with the same reading measure as prose. */
body.page--mapping > h2,
body.page--mapping > h3,
body.page--mapping > h4 {
  display: block;
  width: min(100%, var(--reading-measure));
  max-width: var(--reading-measure);
  margin-left: auto;
  margin-right: auto;
  padding-inline: 0;
  text-indent: 0;
}

h2 {
  margin-top: 2.4rem;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}

h3 {
  margin-top: 1.8rem;
  font-size: 1.15rem;
}

p,
li {
  width: min(100%, var(--reading-measure));
  max-width: var(--reading-measure);
  margin-inline: auto;
  text-align: left;
}

p {
  margin-block: 0.9rem;
}

ul,
ol {
  width: min(100%, var(--reading-measure));
  margin-inline: auto;
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.35rem;
}

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

a:hover {
  color: var(--link-hover);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 0.15rem;
}

strong,
b {
  color: #f3f3f7;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: 2rem;
}

code,
kbd,
samp {
  border-radius: 0.25rem;
  padding: 0.12rem 0.32rem;
  background: var(--code-bg);
  color: #ededf4;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  overflow: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--surface-soft);
  color: var(--text);
  line-height: 1.55;
  tab-size: 2;
}

pre code {
  padding: 0;
  border: 0;
  background: transparent;
  overflow-wrap: normal;
}

.note,
.status,
.source,
.card,
.derived-layer,
blockquote {
  border-radius: 0.6rem;
}

.note {
  margin-block: 1.25rem;
  padding: 0.85rem 1rem 0.85rem 1.15rem;
  border-left: 4px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--muted);
}

.note strong {
  color: var(--text);
}

.status {
  margin-block: 1.2rem 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.source {
  margin-block: 1.2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.source p:last-child,
.derived-layer p:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.card {
  margin-block: 1.25rem;
  padding: 1.2rem 1.35rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.card h2,
.derived-layer > h2 {
  margin-top: 0;
}

.mapping-entry {
  max-width: 100%;
  margin: 1.3rem auto 1.8rem;
  padding: 0.9rem 1.15rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--link);
  border-radius: 0.6rem;
  background: var(--surface);
}

.mapping-entry p:last-child {
  margin-bottom: 0;
}

.meta,
figcaption,
.caption {
  color: var(--muted);
  font-size: 0.92rem;
}

.tag {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
}

table {
  width: 100%;
  margin-block: 1.5rem;
  border-collapse: collapse;
  border-spacing: 0;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.55;
}

th,
td {
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-raised);
  color: #f2f2f6;
  font-weight: 650;
}

td {
  background: var(--surface-soft);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

figure {
  margin: 2rem 0;
}

figure img,
figure picture,
figure svg,
.concept-map img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  color-scheme: light;
  background: var(--diagram-bg);
  border: 1px solid #d8d8d8;
  border-radius: 0.5rem;
}

figure img,
.concept-map img {
  padding: 0.45rem;
}

figure figcaption {
  max-width: 82ch;
  margin: 0.65rem auto 0;
  color: var(--muted);
  font-size: 0.92rem;
}

figure.concept-map {
  margin-block: 2rem;
}

figure.concept-map img {
  width: 100%;
  background: var(--diagram-bg);
}

blockquote {
  margin-inline: 0;
  padding: 0.9rem 1.2rem;
  border-left: 3px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
}

img,
video,
iframe {
  max-width: 100%;
}

::selection {
  color: #111113;
  background: #b8ceff;
}

@media (max-width: 760px) {
  body {
    width: 100%;
    margin-block: 1.5rem;
    padding-inline: 1rem;
    font-size: 0.98rem;
  }

  h1 {
    font-size: clamp(1.7rem, 7vw, 2.1rem);
  }

  h2 {
    margin-top: 2rem;
  }

  .card,
  .source,
  .status {
    padding: 0.9rem;
  }

  .table-wrap {
    margin-inline: 0;
  }

  table {
    font-size: 0.88rem;
  }

  th,
  td {
    padding: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
