/* Cluster home — follows the D-INFK kiosk look: the ETH wordmark on a bar in
   the cluster color, round icon buttons, white cards on light grey.
   --cluster-color comes from /static/cluster.css (per cluster). */

:root {
  --cluster-color: #6F6F6F;
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --border: #e3e6eb;
  --text: #1c2430;
  --text-2: #4a5567;
  --muted: #7a8494;
  --link: color-mix(in srgb, var(--cluster-color) 82%, #000);
  --code-bg: #f1f3f6;
  --code-text: #2a3340;
  --cmd-bg: #1d2430;
  --cmd-text: #e8ecf2;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --bar: var(--cluster-color);
  --radius: 6px;
  --font: "Nunito Sans", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #10151c;
  --surface: #171d26;
  --surface-2: #1c232e;
  --border: #283241;
  --text: #e6e9ee;
  --text-2: #b9c1cd;
  --muted: #8b95a5;
  --link: color-mix(in srgb, var(--cluster-color) 45%, #fff);
  --code-bg: #212938;
  --code-text: #dfe5ee;
  --cmd-bg: #0c1016;
  --shadow: none;
  --bar: color-mix(in srgb, var(--cluster-color) 72%, #000);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; }

.icon {
  width: 1.3em; height: 1.3em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 1em; height: 1em; }

/* ---------- layout ---------- */

/* Anchors land below the sticky top bar. */
.prose :is(h1, h2, h3, h4) { scroll-margin-top: 92px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* One bar in the cluster color: the ETH wordmark and the cluster
   name on the left, the dark-mode button on the right. */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bar);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .12);
}
.topbar-inner {
  display: flex; align-items: center; gap: 28px;
  max-width: 1240px; margin: 0 auto;
  min-height: 68px; padding: 10px 32px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-logo svg { display: block; width: 118px; height: auto; }
.brand-sep { width: 1px; height: 28px; background: rgba(255, 255, 255, .4); }
.brand-cluster { font-family: var(--mono); font-size: 1.2rem; font-weight: 700; white-space: nowrap; }
.brand-env {
  padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: none; margin-left: auto;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  cursor: pointer;
}
.icon-btn:hover { text-decoration: none; background: rgba(255, 255, 255, .26); }
.icon-btn .icon { width: 1.35em; height: 1.35em; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 8px; }
.footer { max-width: 1240px; margin: 0 auto; padding: 8px 32px 32px; color: var(--muted); font-size: .88rem; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px;
  margin-bottom: 24px;
}
.card p { color: var(--text-2); }
.card-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
  font-size: 1.2rem;
}
.card-title .icon { color: var(--link); }
.muted, .card p.muted { color: var(--muted); font-size: .92rem; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 24px; }
.card-title { font-size: 1.15rem; }
.grid > .card { margin-bottom: 24px; }

.cmd {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0;
  padding: 12px 12px 12px 18px;
  border-radius: var(--radius);
  background: var(--cmd-bg);
  color: var(--cmd-text);
}
.cmd code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
.cmd-sm code { font-size: .85rem; }
.copy {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  color: inherit; font: inherit; font-size: .85rem;
  cursor: pointer;
}
.copy:hover { background: rgba(255, 255, 255, .16); }
.copy.done { border-color: #7fbf7f; }

.actions { display: flex; gap: 10px; margin: 14px 0; }
.actions .btn { flex: 1 1 0; justify-content: center; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface);
  color: var(--text); font-weight: 600; font-size: .95rem;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-primary { background: var(--cluster-color); border-color: transparent; color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--cluster-color) 85%, #000); }
.btn .icon { width: 1.1em; height: 1.1em; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.tiles .card { margin-bottom: 0; }
.tile { display: flex; gap: 14px; align-items: center; color: var(--text); padding: 18px 20px; }
.tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--cluster-color) 45%, var(--border)); }
.tile-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: color-mix(in srgb, var(--cluster-color) 12%, var(--surface));
  color: var(--link);
}
.tile-body { display: flex; flex-direction: column; gap: 2px; }
.tile-title { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.tile-title .icon { color: var(--muted); }
.tile-text { color: var(--muted); font-size: .88rem; line-height: 1.4; }

/* ---------- docs ---------- */

/* Docs pages: every page within reach on the left, the page on the right. */
.docs { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 32px; align-items: start; }
.docs-main { min-width: 0; }
.docnav {
  position: sticky; top: 92px;
  display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100vh - 112px); overflow-y: auto;
}
.docnav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-left: 3px solid transparent; border-radius: 0 6px 6px 0;
  color: var(--text-2); font-weight: 600; font-size: .95rem; white-space: nowrap;
}
.docnav-item:hover { text-decoration: none; background: var(--code-bg); color: var(--text); }
.docnav-item[aria-current] { border-left-color: var(--cluster-color); background: var(--surface); color: var(--link); font-weight: 700; }
.docnav-sub { padding-left: 26px; font-weight: 500; }
.docnav-sep { margin: 8px 12px; border-top: 1px solid var(--border); }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--muted); font-size: .95rem; }
.crumbs a { color: var(--text-2); }
.crumbs [aria-current] { color: var(--text); font-weight: 700; }
.crumb-sep { color: var(--muted); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.pager-link { display: flex; flex-direction: column; gap: 2px; padding: 16px 22px; color: var(--text); }
.pager-link:hover { text-decoration: none; border-color: color-mix(in srgb, var(--cluster-color) 45%, var(--border)); }
.pager-link.next { text-align: right; }
.pager-dir { color: var(--muted); font-size: .85rem; }
.pager-title { font-weight: 700; color: var(--link); }

/* Cards span the full width; the text inside keeps a readable line length. */
.prose { padding: 34px 44px; }
.prose > :not(pre):not(table) { max-width: 82ch; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 18px; }
.prose h2 { font-size: 1.4rem; margin: 2.1em 0 .6em; padding-top: .2em; }
.prose h3 { font-size: 1.12rem; margin: 1.8em 0 .5em; }
.prose h2, .prose h3 { scroll-margin-top: 90px; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .25em; }
.prose blockquote {
  margin: 1.2em 0; padding: 12px 18px;
  border-left: 4px solid var(--cluster-color);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
}
.prose blockquote p { margin: .3em 0; }
.prose td code { white-space: nowrap; }
.prose :not(pre) > code { padding: .12em .4em; border-radius: 4px; background: var(--code-bg); color: var(--code-text); overflow-wrap: anywhere; }
.prose pre {
  position: relative;
  margin: 1.1em 0; padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--cmd-bg); color: var(--cmd-text);
  overflow-x: auto;
  font-size: .9rem; line-height: 1.55;
}
.prose pre .copy { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .15s; }
.prose pre:hover .copy, .prose pre .copy:focus { opacity: 1; }
.prose table { width: 100%; margin: 1.2em 0; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th { text-align: left; font-weight: 700; color: var(--text); padding: 12px 14px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.prose td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.prose tbody tr:hover { background: var(--surface-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- small screens ---------- */

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (max-width: 980px) {
  .topbar-inner { gap: 12px; padding: 10px 16px; min-height: 60px; }
  .icon-btn { width: 38px; height: 38px; }
  .content { padding: 16px; }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  /* The navigation becomes one row to swipe through. */
  .docnav { position: static; flex-direction: row; max-height: none; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; }
  .docnav-item, .docnav-sub { padding: 7px 12px; border-left: 0; border-radius: 999px; }
  .docnav-sep { margin: 6px 2px; border-top: 0; border-left: 1px solid var(--border); }
  .footer { padding: 8px 16px 24px; }
  .card { padding: 20px 18px; margin-bottom: 16px; }
  .tiles { gap: 12px; margin-bottom: 16px; }
  .prose { padding: 22px 18px; }
  .pager { gap: 12px; }
}

@media (max-width: 560px) {
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .brand { gap: 10px; }
  .brand-logo svg { width: 92px; }
  .brand-sep, .brand-env { display: none; }
  .brand-cluster { font-size: 1rem; }
  .cmd { flex-direction: column; align-items: stretch; }
  .copy { justify-content: center; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-link.next { text-align: left; }
}
