/* keeper.hochmann.dev: one column of text set like a Keeper page, with the Markdown marks
   (#, ##, [[ ]]) showing faintly the way the editor shows them. */

:root {
  color-scheme: light dark;
  --paper: #fcfdfc;
  --ink: #18211d;
  --muted: #56625c;
  --mark: #a3ada8;
  --rule: #e1e7e3;
  --accent: #047857;
  --accent-hover: #065f46;
  --focus: #059669;
  --sans: "Inter Variable", "Inter", -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 38rem;
  --gutter: 3.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161a18;
    --ink: #e2e8e4;
    --muted: #a1aca6;
    --mark: #505b55;
    --rule: #29302c;
    --accent: #34d399;
    --accent-hover: #6ee7b7;
    --focus: #34d399;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.65 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

.page {
  width: min(var(--measure), 100% - 2.5rem);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

/* The small link home on the legal pages. */
.home {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 3rem;
}
.home img {
  width: 1.75rem;
  height: 1.75rem;
}

.icon {
  display: block;
  width: 4rem;
  height: 4rem;
  margin: 1.5rem 0 1.75rem;
}

h1,
h2,
h3 {
  position: relative;
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.25rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.6rem;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 650;
  margin: 1.75rem 0 0.4rem;
}

/* Markdown heading marks: inline on phones, hanging in the margin where there is one. */
h1::before,
h2::before,
h3::before {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--mark);
  letter-spacing: 0;
  margin-right: 0.45em;
}
h1::before {
  content: "#" / "";
}
h2::before {
  content: "##" / "";
}
h3::before {
  content: "###" / "";
}

@media (min-width: 52rem) {
  .page {
    padding-top: 3.5rem;
  }
  h1::before,
  h2::before,
  h3::before {
    position: absolute;
    right: 100%;
    margin-right: 0.6em;
  }
}

p,
ul,
ol,
address {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 2rem;
}

.updated {
  color: var(--muted);
  font-size: 0.925rem;
  margin-bottom: 2.25rem;
}

ul,
ol {
  padding-left: 1.4rem;
}
li {
  margin: 0.35rem 0;
}
li::marker {
  color: var(--mark);
}

address {
  font-style: normal;
}

strong {
  font-weight: 650;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}
a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Tables of facts (who processes what). */
.table {
  overflow-x: auto;
  margin: 0 0 1.25rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  line-height: 1.5;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
th {
  font-weight: 650;
}
thead th {
  border-bottom-color: var(--mark);
}

/* Footer: the other pages, written as Keeper links. */
footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.925rem;
}
footer ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}
footer li {
  margin: 0;
}
footer a::before,
footer a::after {
  display: inline-block; /* keeps the link's underline off the marks */
  font-family: var(--mono);
  color: var(--mark);
  font-size: 0.9em;
}
footer a::before {
  content: "[[" / "";
}
footer a::after {
  content: "]]" / "";
}
footer a[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
}
footer p {
  margin: 0;
}
