/* Shared look for every page on dehumaniz.ing: the memo-on-carpet style.
   Tokens, page chrome (memo header, tools menu, footer) and the few primitives
   every page uses. Page-specific styling stays in each page. */

:root {
  --paper: #F7F7F4;
  --ink: #142033;
  --ink-soft: #4A5566;
  --rule: #C9CED3;
  --carpet: #E6E9EC;
  --highlighter: #FFE84A;
  --stamp: #C8332E;
  --radius: 3px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16191E;
    --ink: #EDEEF0;
    --ink-soft: #A5ADB8;
    --rule: #3A4049;
    --carpet: #20242A;
    --highlighter: #E6D23A;
    --stamp: #E0493F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #16191E;
  --ink: #EDEEF0;
  --ink-soft: #A5ADB8;
  --rule: #3A4049;
  --carpet: #20242A;
  --highlighter: #E6D23A;
  --stamp: #E0493F;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--carpet);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: var(--main-width, 860px);
  margin: 0 auto;
  padding: 32px 16px 48px;
}
a { color: inherit; text-decoration-color: var(--ink-soft); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

/* ---- Buttons ---- */
/* :where() keeps these at zero specificity, so a tool with its own button styles can override them. */
:where(button) {
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: var(--radius);
  padding: 12px 22px;
  cursor: pointer;
  white-space: nowrap;
}
:where(button):hover { background: var(--ink-soft); }
:where(button):focus-visible, :where(a):focus-visible { outline: 3px solid var(--highlighter); outline-offset: 2px; }
:where(button):disabled { opacity: 0.55; cursor: progress; }
button.quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  font-weight: 500;
  font-size: 13px;
  padding: 6px 12px;
}
button.quiet:hover { background: var(--carpet); }
.cta {
  display: inline-block;
  margin-top: 12px;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
}
.cta:hover { background: var(--ink-soft); }

/* ---- Memo header ---- */
header.memo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 20px;
  align-items: baseline;
  padding-bottom: 20px;
  border-bottom: 3px double var(--rule);
  margin-bottom: 24px;
  position: relative;
}
header.memo > * { grid-column: 1 / -1; }
header.memo > dl { display: contents; }
header.memo dt { grid-column: 1; color: var(--ink-soft); font-size: 14px; }
header.memo dd { grid-column: 2; margin: 0; font-size: 14px; }
header.memo h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
header.memo.big h1 { font-size: clamp(40px, 7vw, 72px); line-height: 0.95; }
header.memo h1 mark, .wordmark mark {
  background: linear-gradient(transparent 55%, var(--highlighter) 55%, var(--highlighter) 92%, transparent 92%);
  color: inherit;
}
header.memo h1 .ai, .wordmark .ai { color: var(--stamp); }
header.memo .tagline {
  margin: 0 0 12px;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--ink-soft);
}
header.memo .back { font-size: 14px; color: var(--ink-soft); white-space: nowrap; }

/* Top row: tools menu on the left, theme toggle on the right (both added by site.js) */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-bottom: 8px;
}
.bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.menu-btn, .theme-toggle {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  font-weight: 400;
  font-size: 13px;
  padding: 4px 10px;
}
.menu-btn { display: inline-flex; align-items: center; gap: 8px; }
.menu-btn svg { display: block; }
.menu-btn:hover, .theme-toggle:hover, .menu-btn[aria-expanded="true"] {
  color: var(--ink);
  border-color: var(--ink-soft);
  background: transparent;
}

.menu {
  position: absolute;
  top: 36px;
  left: 0;
  z-index: 40;
  width: min(380px, 100%);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 -3px var(--rule);
  font-size: 15px;
}
.menu h2 {
  margin: 0;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
}
.menu a { display: block; padding: 12px 16px; text-decoration: none; border-bottom: 1px solid var(--rule); }
.menu a:last-child { border-bottom: 0; }
.menu a:hover, .menu a:focus-visible { background: var(--carpet); outline-offset: -3px; }
.menu a b { display: block; font-weight: 700; }
.menu a span { display: block; font-size: 13px; color: var(--ink-soft); }
.menu a[aria-current="page"] b {
  display: inline;
  background: linear-gradient(transparent 55%, var(--highlighter) 55%, var(--highlighter) 92%, transparent 92%);
}
.menu a.all { font-size: 13px; color: var(--ink-soft); }

/* ---- Article pages (how it works, privacy) ---- */
article {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 8px 28px 28px;
  line-height: 1.6;
}
@media (max-width: 600px) { article { padding: 4px 16px 20px; } }
article h2 { margin: 32px 0 8px; font-size: 22px; letter-spacing: -0.01em; }
article h3 { margin: 24px 0 6px; font-size: 17px; }
article p, article li { max-width: 68ch; }

/* ---- Footer ---- */
footer { margin-top: 24px; font-size: 13px; color: var(--ink-soft); }
footer a { color: inherit; text-underline-offset: 3px; }
