/* IBM Plex (OFL-1.1, see fonts/LICENSE.txt), self-hosted. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/IBMPlexSans-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --text: #1f2328;
  --text-muted: #59636e;
  --border: #d1d9e0;
  --accent: #0969da;
  --accent-strong: #0550ae;
  --header-bg: #0f172a;
  --header-text: #e2e8f0;
  --code-bg: #f6f8fa;

  --draft-fg: #bc4c00;
  --draft-bg: #fff1e5;
  --proposed-fg: #9a6700;
  --proposed-bg: #fff8c5;
  --active-fg: #1a7f37;
  --active-bg: #dafbe1;
  --final-fg: #0969da;
  --final-bg: #ddf4ff;
  --terminal-fg: #cf222e;
  --terminal-bg: #ffebe9;
  --historic-fg: #59636e;
  --historic-bg: #f6f8fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-soft: #161b22;
    --text: #e6edf3;
    --text-muted: #9198a1;
    --border: #30363d;
    --accent: #58a6ff;
    --accent-strong: #79b8ff;
    --header-bg: #010409;
    --header-text: #e6edf3;
    --code-bg: #161b22;

    --draft-fg: #f0883e;
    --draft-bg: #2b1a10;
    --proposed-fg: #d4a72c;
    --proposed-bg: #272115;
    --active-fg: #3fb950;
    --active-bg: #12261e;
    --final-fg: #58a6ff;
    --final-bg: #121d2f;
    --terminal-fg: #f85149;
    --terminal-bg: #2b1214;
    --historic-fg: #9198a1;
    --historic-bg: #161b22;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* bips.dev article size (Tailwind prose-lg); eips.ethereum.org uses 16px. */
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* Content width follows eips.ethereum.org: 1152px wrapper, 30px side padding. */
.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.875rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

h3 {
  font-size: 1.25rem;
}

/* Header */

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0.85rem 0;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}

.site-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--header-text);
}

.site-title:hover {
  color: #ffffff;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--header-text);
  opacity: 0.85;
}

.site-nav a:hover {
  opacity: 1;
  color: #ffffff;
}

/* Main content */

main.wrap {
  padding-top: 1rem;
  padding-bottom: 3rem;
}

.lead,
.pip-description {
  color: var(--text-muted);
}

.empty {
  color: var(--text-muted);
  font-style: italic;
}

.count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 1rem;
}

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

thead th {
  background: var(--bg-soft);
}

.pip-table .col-number {
  white-space: nowrap;
  width: 4.5rem;
}

.pip-table .col-type {
  width: 12rem;
}

.pip-table .col-authors {
  width: 14rem;
}

/* PIP preamble table */

.preamble {
  font-size: 0.95rem;
}

.preamble th {
  background: var(--bg-soft);
  white-space: nowrap;
  width: 9.5rem;
  font-weight: 600;
}

.preamble td {
  word-break: break-word;
}

/* Status badges */

.status {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-draft {
  color: var(--draft-fg);
  background: var(--draft-bg);
}

.status-proposed {
  color: var(--proposed-fg);
  background: var(--proposed-bg);
}

.status-active {
  color: var(--active-fg);
  background: var(--active-bg);
}

.status-final {
  color: var(--final-fg);
  background: var(--final-bg);
}

.status-withdrawn,
.status-rejected {
  color: var(--terminal-fg);
  background: var(--terminal-bg);
}

.status-replaced,
.status-obsolete {
  color: var(--historic-fg);
  background: var(--historic-bg);
}

/* Banners */

.banner {
  margin: 1.25rem 0;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  border: 1px solid;
  font-size: 0.92rem;
}

.banner-draft {
  color: var(--draft-fg);
  background: var(--draft-bg);
  border-color: var(--draft-fg);
}

.banner-proposed {
  color: var(--proposed-fg);
  background: var(--proposed-bg);
  border-color: var(--proposed-fg);
}

.banner-terminal {
  color: var(--terminal-fg);
  background: var(--terminal-bg);
  border-color: var(--terminal-fg);
}

/* Table of contents */

.toc {
  margin: 1.5rem 0;
  padding: 0.65rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
}

.toc summary {
  cursor: pointer;
  font-weight: 600;
}

.toc ul {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

/* Content */

.pip-content img {
  max-width: 100%;
}

code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 4px solid var(--border);
  color: var(--text-muted);
}

dl dt {
  font-weight: 600;
  margin-top: 0.75rem;
}

dl dd {
  margin: 0.15rem 0 0 0;
  padding-left: 1.25rem;
}

/* Citation */

.pip-citation .citation {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .pip-table .col-type,
  .pip-table .col-authors {
    display: none;
  }
}
