/* dao.subgenius — SubGenius constitutional aesthetic */
/* Cream + ink + occasional flash of pink. Serif body, mono accents. */

:root {
  --paper: #f5ecd9;
  --paper-edge: #e8dcc0;
  --ink: #1a1410;
  --ink-soft: #4a3f33;
  --rule: #8a6d3b;
  --pink: #ff3399;
  --pink-soft: #ffe0ef;
  --code-bg: #2a2018;
  --code-fg: #f5ecd9;
  --link: #8b1a1a;
  --link-hover: #ff3399;
  --draft: #b07d00;
  --ratified: #2d6a2d;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 17px;
  line-height: 1.62;
}

/* Tiled background lifted from dobbscoin.info — pale pleasure-saucer / "Bob"
   iconography on near-white. The .frame below floats on top so text never
   competes with the pattern. */
body {
  background-color: #fdfdfd;
  background-image: url('/images/bg.png');
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: center top;
  min-height: 100vh;
}

/* Reading column = cream "paper" card over the tiled bg. 94% opacity lets a
   faint texture of saucers show through, but text-on-paper contrast is
   preserved everywhere inside. */
.frame {
  max-width: 760px;
  margin: 1.75rem auto;
  padding: 2.5rem 2.25rem 4rem;
  background: rgba(245, 236, 217, 0.94);
  box-shadow:
    0 6px 30px rgba(26,20,16,0.18),
    0 0 0 1px rgba(138,109,59,0.25);
  border-top: 4px solid var(--rule);
}

/* Header / masthead */
.masthead {
  text-align: center;
  border-bottom: 3px double var(--rule);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}
.masthead .pre-title {
  font-family: "Courier New", "Courier", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.masthead h1 {
  font-family: "Bodoni 72", "Bodoni MT", "Didot", "Big Caslon", Georgia, serif;
  font-weight: 900;
  font-size: 2.4rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0.2rem 0 0.4rem;
}
.masthead .subtitle {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  margin: 0.3rem 0 0;
}
.masthead .subtitle a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dotted var(--rule);
  font-style: italic;
  transition: color 0.15s, border-color 0.15s;
}
.masthead .subtitle a:hover {
  color: var(--pink);
  border-bottom-color: var(--pink);
}

/* Footnote marker — small superscript "*" appended after a term, providing
   both an instant-on-hover tooltip and a click-through to the citation URL.
   The flowing prose stays untouched; the marker rides alongside it. */
.footnote-link {
  position: relative;
  display: inline-block;
  font-size: 0.6em;
  vertical-align: super;
  line-height: 1;
  margin-left: 1px;
  padding: 0 1px;
  font-style: normal;
  font-weight: bold;
  font-family: "Iowan Old Style", Georgia, serif;
  color: var(--link);
  text-decoration: none;
  border: none;
  transition: color 0.15s;
}
.footnote-link:hover, .footnote-link:focus {
  color: var(--pink);
  outline: none;
}
.footnote-link::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-style: normal;
  font-weight: normal;
  font-family: "Courier New", "Menlo", "Consolas", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.7rem;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 12px rgba(26,20,16,0.35);
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transition: none;
}
.footnote-link::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transition: none;
}
.footnote-link:hover::after, .footnote-link:focus::after,
.footnote-link:hover::before, .footnote-link:focus::before {
  opacity: 1;
  visibility: visible;
}
@media (max-width: 640px) {
  .footnote-link::after { font-size: 0.7rem; padding: 0.3rem 0.55rem; }
}

/* Don't let the subtitle's generic-link styling underline the footnote marker */
.masthead .subtitle .footnote-link {
  border-bottom: none;
}
.masthead .pope {
  margin-top: 0.8rem;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--rule);
  text-transform: uppercase;
}

/* Nav */
nav.toc {
  margin: 0 0 2rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,0.35);
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  justify-content: center;
}
nav.toc a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 1px;
}
nav.toc a:hover { color: var(--pink); border-bottom-color: var(--pink); }
nav.toc a.current { color: var(--link); font-weight: bold; border-bottom-style: solid; }

/* Doc body */
article h1 {
  font-family: "Bodoni 72", "Bodoni MT", "Didot", Georgia, serif;
  font-weight: 900;
  font-size: 2.1rem;
  line-height: 1.15;
  margin: 2rem 0 0.5rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.4rem;
  text-align: center;
}
article h2 {
  font-family: "Bodoni 72", "Didot", Georgia, serif;
  font-weight: 700;
  font-size: 1.45rem;
  margin: 2.2rem 0 0.6rem;
  color: var(--ink);
}
article h3 {
  font-family: "Bodoni 72", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin: 1.6rem 0 0.4rem;
  color: var(--ink-soft);
}
article h4 {
  font-size: 1rem;
  margin: 1.2rem 0 0.3rem;
  font-style: italic;
  color: var(--ink-soft);
}

article p { margin: 0.7em 0; }
article hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4rem 0;
  position: relative;
}
article hr::after {
  content: "✦";
  position: absolute;
  top: -0.7em;
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  padding: 0 0.6rem;
  color: var(--rule);
}

article a { color: var(--link); text-decoration: underline; text-decoration-color: rgba(139,26,26,0.4); text-underline-offset: 2px; }
article a:hover { color: var(--pink); text-decoration-color: var(--pink); }

article blockquote {
  margin: 1.2rem 0;
  padding: 0.6rem 1.2rem;
  border-left: 4px solid var(--pink);
  background: var(--pink-soft);
  font-style: italic;
  color: var(--ink);
}
article blockquote strong { font-style: normal; color: var(--link); }
article blockquote p:first-child { margin-top: 0; }
article blockquote p:last-child { margin-bottom: 0; }

article code {
  font-family: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.86em;
  background: rgba(42,32,24,0.07);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  word-break: break-all;
}
article pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 1rem 1.2rem;
  border-radius: 3px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.5;
  border-left: 3px solid var(--pink);
}
article pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

article ul, article ol { padding-left: 1.6rem; }
article li { margin: 0.25em 0; }
article li > p { margin: 0.2em 0; }

article table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2rem 0;
  font-size: 0.92rem;
}
article th, article td {
  border: 1px solid var(--rule);
  padding: 0.45rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
article th {
  background: rgba(138,109,59,0.15);
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
article tr:nth-child(even) td { background: rgba(255,255,255,0.3); }

article strong { color: var(--ink); }

/* Centered lede block on the index intro */
.lede {
  text-align: center;
  max-width: 620px;
  margin: 0.5rem auto 1.5rem;
}
.lede p { text-wrap: pretty; }

/* Status badges */
.badge {
  display: inline-block;
  font-family: "Courier New", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  padding: 0.25em 0.6em;
  border-radius: 2px;
  text-transform: uppercase;
  vertical-align: middle;
}
.badge.draft { background: var(--draft); color: var(--paper); }
.badge.ratified { background: var(--ratified); color: var(--paper); }

/* Index page */
.doc-card {
  display: block;
  padding: 1.2rem 1.4rem;
  margin: 0.9rem 0;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,0.4);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s;
}
.doc-card:hover {
  background: rgba(255,255,255,0.7);
  border-color: var(--pink);
  transform: translateX(2px);
}
.doc-card .title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.doc-card h3 {
  font-family: "Bodoni 72", Georgia, serif;
  font-size: 1.3rem;
  margin: 0;
  color: var(--ink);
}
.doc-card p {
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.doc-card .meta {
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

/* Footer */
footer.colophon {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 3px double var(--rule);
  font-family: "Courier New", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.7;
}
footer.colophon a { color: var(--link); text-decoration: none; border-bottom: 1px dotted var(--rule); }
footer.colophon a:hover { color: var(--pink); border-bottom-color: var(--pink); }
footer.colophon .disclaimer {
  margin-top: 1rem;
  padding: 0.85rem 0.6rem;
  font-style: italic;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: normal;
  color: var(--ink);
  line-height: 1.45;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
footer.colophon .disclaimer p {
  margin: 0.25rem 0;
  text-wrap: balance; /* let the browser pick humane wrap points where supported */
}

/* Recent changes box */
.changes {
  background: var(--pink-soft);
  border: 1px dashed var(--pink);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
}
.changes h4 {
  margin: 0 0 0.5rem;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--link);
  font-style: normal;
}
.changes ul { margin: 0; padding-left: 1.4rem; }
.changes li { margin: 0.2rem 0; }
.changes time { color: var(--ink-soft); }

/* Comments — per-page discussion section */
section.comments {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 3px double var(--rule);
}
section.comments h2 {
  font-family: "Bodoni 72", "Didot", Georgia, serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 1rem;
  text-align: center;
  letter-spacing: 0.04em;
}
section.comments h2::before { content: "✦ "; color: var(--rule); }
section.comments h2::after  { content: " ✦"; color: var(--rule); }
section.comments .count {
  text-align: center;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin: -0.6rem 0 1.5rem;
}
.comment {
  border: 1px solid var(--rule);
  background: rgba(255,255,255,0.4);
  padding: 0.85rem 1.1rem;
  margin: 0.7rem 0;
  position: relative;
}
.comment.pinned {
  background: var(--pink-soft);
  border-color: var(--pink);
}
.comment.pinned::after {
  content: "PINNED";
  position: absolute;
  top: -0.55rem;
  right: 0.7rem;
  background: var(--pink);
  color: var(--paper);
  font-family: "Courier New", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  padding: 0.15em 0.5em;
  border-radius: 1px;
}
.comment .meta {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.comment .author { color: var(--link); font-weight: bold; }
.comment .body {
  font-size: 0.96rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.comment .body a { color: var(--link); }
.comment-empty {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  padding: 1rem 0 1.5rem;
}

form.comment-form {
  margin-top: 2rem;
  padding: 1.2rem 1.3rem;
  background: rgba(255,255,255,0.5);
  border: 1px dashed var(--rule);
}
form.comment-form h3 {
  font-family: "Bodoni 72", Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 0.7rem;
  color: var(--ink);
}
form.comment-form label {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.6rem 0 0.25rem;
}
form.comment-form input[type=text],
form.comment-form textarea {
  width: 100%;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
  box-sizing: border-box;
}
form.comment-form textarea {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.45;
}
form.comment-form input:focus,
form.comment-form textarea:focus {
  outline: none;
  border-color: var(--pink);
  background: #fff;
}
form.comment-form .hp { display: none !important; }   /* honeypot */
form.comment-form .submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: 1rem;
}
form.comment-form button {
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.55rem 1.4rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s;
}
form.comment-form button:hover { background: var(--pink); }
form.comment-form button:disabled { opacity: 0.5; cursor: not-allowed; background: var(--ink-soft); }
form.comment-form .status {
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
form.comment-form .status.error { color: var(--link); font-weight: bold; }
form.comment-form .status.success { color: var(--ratified); font-weight: bold; }
form.comment-form .help {
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin-top: 0.6rem;
  font-style: italic;
}

@media (max-width: 640px) {
  section.comments h2 { font-size: 1.15rem; }
  .comment .meta { flex-direction: column; gap: 0.1rem; }
  form.comment-form .submit-row { flex-direction: column; align-items: stretch; }
}

/* Responsive */
@media (max-width: 640px) {
  .frame {
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    box-shadow: none;
    border-top-width: 3px;
  }
  .masthead h1 { font-size: 1.7rem; }
  article h1 { font-size: 1.6rem; }
  article h2 { font-size: 1.2rem; }
  nav.toc { font-size: 0.72rem; gap: 0.3rem 0.7rem; }
  article table { font-size: 0.78rem; }
  article th, article td { padding: 0.3rem 0.4rem; }
  footer.colophon {
    margin-top: 2.5rem;
    padding-top: 1rem;
    line-height: 1.55;
  }
  footer.colophon .disclaimer {
    font-style: normal; /* italic Georgia at small px is hard to read on phones */
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 0.8rem 0.4rem;
  }
  footer.colophon .disclaimer p {
    margin: 0.4rem 0;
  }
}
