/* nvsble on the shared system (system.css), after Cognition's company page: a paper page in black
   ink, a column of links on the left, numbered sections in a reading column set in IBM Plex
   Serif, and faint rules that mark the columns, each with a tick at the top. Headings stay in
   Plex Sans; labels and the footer in Plex Mono. No colour but the ink. */

@font-face {
  font-family: "Plex Serif";
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSerif-Regular-Latin.woff2") format("woff2");
}
@font-face {
  font-family: "Plex Serif";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSerif-Italic-Latin.woff2") format("woff2");
}
@font-face {
  font-family: "Plex Serif";
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSerif-SemiBold-Latin.woff2") format("woff2");
}

:root,
[data-theme="light"] {
  --serif: "Plex Serif", Georgia, serif;
  --page: #f7f6f4;
  --ink: oklch(0.16 0.004 70);
  --rule: color-mix(in oklab, var(--ink) 7%, transparent);
  --tick: color-mix(in oklab, var(--ink) 30%, transparent);
}
[data-theme="dark"] {
  --page: #0d0d0c;
  --ink: oklch(0.96 0.004 70);
}

/* The columns: links, the reading column, and a margin. */
.frame {
  --columns: minmax(200px, 1fr) minmax(0, 640px) minmax(64px, 1fr);
  position: relative;
  display: grid;
  grid-template-columns: var(--columns);
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 64px;
}
.rules {
  position: absolute;
  inset: 0 64px;
  display: grid;
  grid-template-columns: var(--columns);
  pointer-events: none;
}
.rules span {
  position: relative;
  border-left: 1px solid var(--rule);
}
.rules span:last-child {
  position: absolute;
  right: 0;
  height: 100%;
}
.rules span::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -1px;
  width: 1px;
  height: 8px;
  background: var(--tick);
}

.side {
  position: sticky;
  top: 0;
  align-self: start;
  display: grid;
  justify-items: start;
  gap: 24px;
  padding: 148px 24px 0 0;
}
.side-mark {
  display: flex;
  color: var(--text-1);
}
.side-nav {
  display: grid;
  gap: 2px;
  font-size: 15px;
}
.side-nav a {
  color: var(--text-1);
  text-decoration: none;
}
.side-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* A plain boxed control, black when it is the main one. */
.box {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--text-1);
  font: 400 15px var(--sans);
  color: var(--text-1);
  text-decoration: none;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.box:hover,
.box-solid {
  background: var(--text-1);
  color: var(--page);
}
.box-solid:hover {
  background: transparent;
  color: var(--text-1);
}

/* The reading column. */
.reading {
  grid-column: 2;
  padding-top: 148px;
}
.part {
  display: grid;
  row-gap: 18px;
  padding-bottom: 64px;
  font: 400 17px/1.6 var(--serif);
  color: var(--text-1);
}
.part-title {
  font: 400 22px/1.25 var(--sans);
  letter-spacing: -0.015em;
}
.part-title.lead {
  font-size: clamp(30px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.part-title a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  text-decoration-color: var(--text-3);
}
.part b {
  font-weight: 600;
}
/* A principle's name stands a little apart from what follows, as on Cognition's page. */
.part b::after {
  content: " ";
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* The footer: the name, then small mono columns, after a hairline. */
.foot {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: start;
  margin-top: 80px;
  padding: 28px 0 56px;
  border-top: 1px solid var(--line);
}
.foot-brand {
  display: flex;
  align-items: center;
  /* The mark ends at about 20 of its 24 units, so the name sits a little closer. */
  gap: 6px;
  font: 500 17px var(--sans);
  letter-spacing: -0.015em;
  color: var(--text-1);
  text-decoration: none;
}
.foot-links {
  display: grid;
  align-content: start;
  gap: 4px;
  font: 400 12px/1.5 var(--mono);
  color: var(--text-3);
}
.foot-cols {
  grid-column: 2;
  display: flex;
  gap: 64px;
}
.foot-links a {
  color: inherit;
  text-decoration: none;
}
.foot-links a:hover {
  color: var(--text-1);
}
.foot .theme-switch {
  grid-column: 3;
  justify-self: end;
}

@media (max-width: 960px) {
  .frame {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: var(--gutter);
  }
  .rules {
    display: none;
  }
  .side {
    position: static;
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 24px 0 0;
  }
  .side-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 14px;
  }
  .reading {
    grid-column: 1;
    padding-top: 72px;
  }
  .foot {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
  }
  .foot-cols {
    grid-column: 1 / -1;
    gap: 40px;
  }
  .foot .theme-switch {
    grid-column: auto;
    justify-self: start;
  }
}
@media (max-width: 560px) {
  .side-nav {
    display: none;
  }
}

/* nvsble → invisible: the missing i's appear when the name is pointed at, as on the first
   nvsble.io site. Screen readers read the name as it is written. */
.name {
  white-space: nowrap;
}
.name .i {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  vertical-align: bottom;
  transition:
    max-width 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 320ms;
}
a:hover > .name .i,
a:focus-visible > .name .i {
  max-width: 1ch;
  opacity: 0.4;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
