/* emanix.org — documentation left on the desk
   ================================================================
   Consumes shared/tokens.css exclusively: no colour literal, no
   third-party font request. The six tokens (ground, ground-raise,
   rule, ink-mute, ink, signal) are the entire palette — every rule
   below resolves to one of them.

   This is a technical documentation site. It is deliberately not a
   corridor: no animated rail, no doors, no thesis. It is the manual
   left open on the desk — the face to the distribution's surfaces.
   The spec: "emanix is the documentation left on the desk."

   Two faces carry the thesis: a grotesque for headings, navigation
   and metadata, and a monospace for code and data. The serif is not
   used here — this is not the reading voice.
   ================================================================ */

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

.container {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- nav ---------- */

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: var(--rail) solid var(--rule);
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-data);
  font-weight: 500;
  font-size: var(--step--1);
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  white-space: nowrap;
}

.logo:hover {
  color: var(--ink-mute);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul a {
  font-size: var(--step--1);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease;
}

nav ul a:hover {
  color: var(--ink);
}

/* ---------- main ---------- */

main {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

article {
  max-width: var(--measure);
}

/* ---------- table of contents ---------- */

#table-of-contents {
  background: var(--ground-raise);
  padding: 1rem 1.4rem 0.75rem;
  margin: 0 0 2rem;
  border-left: 2px solid var(--signal);
}

#table-of-contents h2 {
  font-family: var(--font-inst);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin: 0 0 0.5rem;
  border: none;
  padding: 0;
}

#table-of-contents ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

#table-of-contents li {
  margin-bottom: 0.25rem;
  font-size: var(--step-0);
  line-height: 1.5;
}

#table-of-contents a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}

#table-of-contents a:hover {
  border-bottom-color: var(--ink-mute);
}

/* ---------- headings ---------- */

h1 {
  font-family: var(--font-inst);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1.12;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1:first-child {
  margin-top: 0;
}

h2 {
  font-family: var(--font-inst);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 2.8rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: var(--rail) solid var(--rule);
  text-wrap: balance;
  scroll-margin-top: 2rem;
}

h3 {
  font-family: var(--font-inst);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.3;
  margin: 2rem 0 0.4rem;
  scroll-margin-top: 2rem;
}

.section-number-2,
.section-number-3 {
  font-family: var(--font-data);
  font-weight: 400;
  color: var(--ink-mute);
  font-size: 0.82em;
  margin-right: 0.2em;
}

/* ---------- prose ---------- */

article p {
  margin: 0 0 1.15rem;
  line-height: 1.72;
}

/* body links are ink with a hairline. Signal is NOT the link affordance. */
article a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-mute);
  transition:
    border-color 180ms ease,
    color 180ms ease;
}

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

article ul,
article ol {
  padding-left: 1.2rem;
  margin: 0 0 1.15rem;
}

article li {
  margin-bottom: 0.35rem;
}

article li::marker {
  color: var(--ink-mute);
}

/* ---------- code (inline) ---------- */

article code {
  font-family: var(--font-data);
  font-size: 0.86em;
  background: var(--ground-raise);
  padding: 0.15em 0.4em;
}

/* ---------- pre (block code) ---------- */

.org-src-container {
  margin: 1.25rem 0;
  border-left: 2px solid var(--signal);
}

article pre {
  font-family: var(--font-data);
  font-size: var(--step--1);
  line-height: 1.55;
  background: var(--ground-raise);
  padding: 0.9rem 1.25rem;
  overflow-x: auto;
  margin: 0;
}

article pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* ---------- blockquote ---------- */

article blockquote {
  margin: 1.5rem 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--signal);
  color: var(--ink-mute);
}

/* ---------- tables ---------- */

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: var(--step-0);
}

article th {
  font-family: var(--font-data);
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: left;
  padding: 0.5rem 0.8rem 0.5rem 0;
  border-bottom: var(--rail) solid var(--rule);
}

article td {
  text-align: left;
  padding: 0.5rem 0.8rem 0.5rem 0;
  border-bottom: var(--rail) solid var(--rule);
  vertical-align: top;
}

article td:first-child,
article th:first-child {
  padding-left: 0;
}

article td:last-child,
article th:last-child {
  padding-right: 0;
}

/* ---------- hr ---------- */

article hr {
  border: none;
  border-top: var(--rail) solid var(--rule);
  margin: 2.5rem 0;
}

/* ---------- footer ---------- */

.footer {
  margin-top: auto;
  padding: 1.25rem 0;
  border-top: var(--rail) solid var(--rule);
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.5rem;
  flex-wrap: wrap;
  font-family: var(--font-data);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.footer-meta a {
  color: var(--ink-mute);
  text-decoration: none;
}

.footer-meta a:hover {
  color: var(--ink);
}

/* ---------- theme toggle ---------- */

.theme-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--ground-raise);
  border: var(--rail) solid var(--rule);
  padding: 0.45rem 0.7rem;
  font-family: var(--font-data);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink-mute);
  transition:
    background 180ms ease,
    color 180ms ease;
}

.theme-toggle:hover {
  background: var(--ink);
  color: var(--ground);
}

/* ---------- responsive ---------- */

@media (max-width: 50rem) {
  nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  nav ul {
    gap: 0.2rem 1.25rem;
  }

  h1 {
    font-size: var(--step-3);
  }

  .theme-toggle {
    bottom: 0.75rem;
    right: 0.75rem;
  }
}

@media (max-width: 34rem) {
  .container {
    padding: 0 calc(var(--gutter) * 0.6);
  }

  h1 {
    font-size: var(--step-2);
  }

  h2 {
    font-size: var(--step-0);
  }
}

/* ---------- selection ---------- */

::selection {
  background: var(--ink);
  color: var(--ground);
}
/* ---------- grouped nav ----------
   The flat 13-link list outgrew a single row when the manual moved onto the
   site. Groups are labelled so the row reads as four short lists rather than
   one long one; `nav ul` above still supplies the flex behaviour for both the
   group row and the links inside each group. */

.nav-groups {
  align-items: flex-start;
  gap: 1rem 2.25rem;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-group__label {
  font-family: var(--font-data);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--rule);
}

.nav-group > ul {
  flex-direction: column;
  gap: 0.2rem;
}

/* ---------- landing ---------- */

.landing .hero {
  margin: 0 0 2.5rem;
}

.landing .hero img {
  display: block;
  width: 100%;
  height: auto;
  border: var(--rail) solid var(--rule);
}

/* The claim. First thing on the page, and the only place type goes this big. */
.landing blockquote {
  margin: 0 0 2.5rem;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--signal);
  font-family: var(--font-read);
  font-size: var(--step-2);
  line-height: 1.35;
  max-width: var(--measure);
}

.landing blockquote p { margin: 0; }

/* The directory below the fold: dense, for lookup, not for persuasion. */
.landing dl {
  display: grid;
  grid-template-columns: minmax(9rem, max-content) 1fr;
  gap: 0.5rem 1.75rem;
  margin: 0;
  align-items: baseline;
}

.landing dt { font-family: var(--font-data); font-size: var(--step--1); }
.landing dd { margin: 0; color: var(--ink-mute); }

@media (max-width: 34rem) {
  .landing dl { grid-template-columns: 1fr; gap: 0.15rem; }
  .landing dd { margin-bottom: 0.75rem; }
}
