/* Guides (/guides/): plain dark pages with white and gray Manrope text. */

@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --white: #f4f4f4;
  --gray: rgba(255, 255, 255, .66);
  --dim: rgba(255, 255, 255, .42);
  --line: rgba(255, 255, 255, .1);
}

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

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

body {
  margin: 0;
  background: #000;
  color: var(--gray);
  font: 16px/1.7 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

a {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .3);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--white); }
:focus-visible { outline: 1px solid var(--white); outline-offset: 3px; border-radius: 2px; }

.g-top,
.g-main,
.g-foot { width: min(680px, 100% - 40px); margin-inline: auto; }

/* top line */
.g-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  font-size: 14px;
}
.g-brand { color: var(--white); font-weight: 700; text-decoration: none; }
.g-top nav { display: flex; gap: 20px; }
.g-top nav a { color: var(--gray); text-decoration: none; }
.g-top nav a:hover,
.g-top nav a[aria-current="page"] { color: var(--white); }

.g-main { padding: 28px 0 40px; }

.g-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; color: var(--dim); font-size: 13px; }
.g-crumbs li + li::before { content: '/'; margin-right: 6px; }
.g-crumbs a { color: var(--dim); text-decoration: none; }
.g-crumbs a:hover { color: var(--white); }

h1 { margin: 0 0 8px; color: var(--white); font-size: clamp(26px, 5vw, 34px); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
h2 { margin: 40px 0 10px; color: var(--white); font-size: 20px; font-weight: 700; line-height: 1.3; }
h3 { margin: 22px 0 4px; color: var(--white); font-size: 16px; font-weight: 600; line-height: 1.4; }
p, ul { margin: 0 0 14px; }
ul { padding-left: 20px; }
li { margin-bottom: 6px; }
pre {
  margin: 0 0 14px;
  overflow-x: auto;
  color: var(--white);
  font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.g-meta { margin: 0 0 22px; color: var(--dim); font-size: 13px; }
.g-lead { color: var(--white); font-size: 18px; line-height: 1.6; }

/* "Ixonian is being built" */
.g-built { margin: 36px 0; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.g-built h2 { margin: 0 0 10px; font-size: clamp(26px, 5vw, 34px); line-height: 1.15; }
.g-built p { margin: 0 0 10px; }
.g-built p:last-child { margin: 0; }
.g-built-link { font-weight: 700; }

/* lists of guides */
.g-topics { margin: 0 0 8px; color: var(--dim); font-size: 14px; }
.g-topics a { color: var(--gray); }
.g-list { margin: 0 0 14px; padding: 0; list-style: none; }
.g-list li { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.g-list li:first-child { border-top: 1px solid var(--line); }
.g-list a { font-weight: 600; text-decoration: none; }
.g-list a:hover { text-decoration: underline; }
.g-list span { display: block; color: var(--dim); font-size: 14px; line-height: 1.55; }

/* pictures (original SVG drawings, tap to open full size) */
.g-fig { margin: 28px 0 32px; }
.g-fig-link { display: block; text-decoration: none; }
.g-fig img { display: block; width: 100%; height: auto; }
.g-fig figcaption { margin-top: 10px; color: var(--dim); font-size: 13px; line-height: 1.6; }
.g-fig figcaption a { color: var(--gray); }

/* charts: plain HTML bars, ranges and before-and-after dots */
.g-chart {
  --c-accent: #b8862b;
  --c-blue: #3987e5;
  --c-muted: #5c5c5c;
  --c-grid: rgba(255, 255, 255, .1);
  padding: 20px 0 4px;
  border-top: 1px solid var(--line);
}
.g-chart-title { margin: 0 0 2px; color: var(--white); font-size: 16px; font-weight: 700; line-height: 1.4; }
.g-chart-sub { margin: 0 0 14px; color: var(--dim); font-size: 13px; line-height: 1.5; }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; padding: 0; list-style: none; color: var(--gray); font-size: 13px; }
.g-legend li { display: flex; align-items: center; gap: 7px; margin: 0; }
.g-key { width: 10px; height: 10px; border-radius: 2px; background: var(--c-accent); }
.g-key.is-blue { background: var(--c-blue); }
.g-key.is-muted { background: var(--c-muted); }
.g-bars { display: grid; grid-template-columns: minmax(70px, max-content) minmax(0, 1fr); gap: 9px 14px; align-items: center; }
.g-bars.is-three { grid-template-columns: minmax(70px, max-content) minmax(0, 1fr) max-content; }
.g-row { display: contents; }
.g-row-label { color: var(--gray); font-size: 14px; line-height: 1.3; }
.g-row-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.g-row-stack { display: grid; gap: 3px; }
.g-row-value { color: var(--white); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-bar {
  display: block;
  flex: none;
  width: calc((100% - 76px) * var(--v));
  min-width: 2px;
  height: 14px;
  border-radius: 0 4px 4px 0; /* square at the baseline, rounded at the data end */
  background: var(--c-accent);
  transition: filter .15s;
}
.g-bar.is-thin { height: 9px; }
.g-bar.is-blue { background: var(--c-blue); }
.g-bar.is-muted { background: var(--c-muted); }
.g-bar:hover, .g-dot:hover, .g-range:hover { filter: brightness(1.3); }
.g-dumb { position: relative; height: 16px; }
.g-dumb::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--c-grid); }
.g-dumb-line { position: absolute; top: calc(50% - 1px); height: 2px; background: #8a8a8a; }
.g-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 0 2px #000; }
.g-dot.is-muted { background: #8a8a8a; }
.g-range { position: absolute; top: 3px; height: 10px; border-radius: 4px; background: var(--c-accent); }
.g-axis > span { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.g-axis-track { position: relative; height: 18px; }
.g-axis-track span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.g-axis-track span:first-child { transform: none; }
.g-axis-track span:last-child { transform: translateX(-100%); }
.g-chart figcaption { margin-top: 14px; }

/* narrow screens: the label goes above its bar, so the bars get the full width */
@media (max-width: 560px) {
  .g-bars.is-three { grid-template-columns: minmax(0, 1fr) max-content; row-gap: 4px; }
  .g-bars.is-three .g-row-label { grid-column: 1 / -1; margin-top: 8px; }
  .g-bars.is-three .g-axis-gap { display: none; }
}

/* "Show the numbers" and other tables */
.g-data { margin: 10px 0 0; font-size: 13px; }
.g-data summary { width: max-content; color: var(--gray); cursor: pointer; }
.g-data summary:hover { color: var(--white); }
.g-data table { margin-top: 10px; }
.g-table { margin: 4px 0 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
caption { margin-bottom: 8px; color: var(--dim); font-size: 13px; text-align: left; }
th, td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { color: var(--white); font-size: 13px; font-weight: 700; }
tbody th { color: var(--white); font-weight: 600; }
td { color: var(--gray); }

/* smaller headings inside a section, and anchors to headings */
h2[id], h3[id], dt[id] { scroll-margin-top: 16px; }

/* the glossary */
.g-letters { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.g-letters a { text-decoration: none; }
.g-terms { margin: 0 0 8px; }
.g-terms dt { margin: 18px 0 2px; color: var(--white); font-weight: 700; }
.g-terms dd { margin: 0; }

.g-sources { font-size: 14px; }
.g-sources a { color: var(--gray); }
.g-sources a:hover { color: var(--white); }

/* ads (Google AdSense, filled by assets/js/ads.js) */
.g-ad { text-align: center; }
.g-ad-label { display: block; margin-bottom: 6px; color: var(--dim); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.g-ad ins { display: block; }
.g-ad-inline { margin: 36px 0; padding: 14px 0; border-block: 1px solid var(--line); }
.g-rail { display: none; }

/* wide screens: a tall ad on each side of the text, which stays in view while reading */
@media (min-width: 1140px) and (min-height: 720px) {
  .g-layout { display: grid; grid-template-columns: 1fr 680px 1fr; column-gap: 40px; }
  .g-layout > .g-main { grid-column: 2; grid-row: 1; width: auto; margin: 0; }
  .g-rail { display: block; grid-row: 1; align-self: start; position: sticky; top: 24px; margin-top: 28px; }
  .g-rail-left { grid-column: 1; justify-self: end; }
  .g-rail-right { grid-column: 3; justify-self: start; }
  .g-rail .g-ad ins { width: 160px; height: 600px; }
}
@media (min-width: 1440px) and (min-height: 720px) {
  .g-rail .g-ad ins { width: 300px; height: 600px; }
}

/* footer */
.g-foot { padding: 20px 0 40px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.g-foot p { margin: 0 0 8px; }
.g-foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.g-foot-links a,
.g-link { color: var(--dim); text-decoration: none; }
.g-foot-links a:hover,
.g-link:hover { color: var(--white); }
.g-link { appearance: none; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
