/* Mark Reveley — site styles. */

:root {
  --bg: #090d0c;
  --surface: #101715;
  --ink: #eaf2df;
  --ink-soft: #b9c7b0;
  --ink-faint: #82917b;
  --rule: #62752c;
  --rule-soft: #293b25;
  --accent: #11bfff;
  --accent-strong: #ff168e;
  --accent-soft: rgba(255, 22, 142, .18);
  --quote: #f4f8eb;
  --shadow: 0 0 0 1px rgba(17, 191, 255, .08), 0 8px 24px rgba(0, 0, 0, .25);
  --measure: 40rem;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 var(--mono);
  padding: 0 1.25rem 4rem;
  background-image: linear-gradient(rgba(98, 117, 44, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(98, 117, 44, .09) 1px, transparent 1px);
  background-size: 32px 32px;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-style: dotted; }

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  left: 1rem; top: .5rem; position: fixed; z-index: 9;
  background: var(--surface); padding: .5rem .75rem; border: 1px solid var(--rule);
}

/* ---------- masthead ---------- */

.masthead,
main { max-width: var(--measure); margin: 0 auto; }

.masthead {
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
  align-items: baseline; justify-content: space-between;
  padding: 2.25rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-size: 1.15rem; font-weight: 600; letter-spacing: .01em;
  color: var(--accent); text-decoration: none;
}

.mainnav { display: flex; gap: 1.25rem; align-items: center; }

.mainnav a {
  font-family: var(--mono);
  font-size: .82rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
  padding-bottom: .15rem; border-bottom: 2px solid transparent;
}
.mainnav a:hover { color: var(--accent-strong); }
.mainnav a[aria-current] { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }

/* ---------- headings and prose ---------- */

main { padding-top: 2.5rem; }

h1 {
  font-size: 2rem; line-height: 1.15; margin: 0 0 .6rem;
  letter-spacing: .02em; font-weight: 700; color: var(--accent);
}
h2 { font-size: 1.3rem; line-height: 1.25; margin: 2.5rem 0 .5rem; font-weight: 600; color: var(--accent); }
h3 { font-size: 1.05rem; line-height: 1.3; margin: 0 0 .35rem; font-weight: 600; color: var(--accent); }

p { margin: 0 0 .9rem; }

.hero { margin-bottom: 2.5rem; }
.lede { font-size: 1.08rem; color: var(--ink-soft); }
.lede strong { color: var(--ink); font-weight: 600; }

.quote-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; margin: 0 0 .6rem;
}
.quote-heading h1 { margin: 0; }
.quote-controls {
  display: flex; align-items: center; gap: .45rem;
}
.filter-toggle,
.random-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0;
  text-decoration: none; line-height: 1;
}
.filter-toggle { color: var(--ink-faint); }
.random-toggle {
  appearance: none; border: 0; background: transparent;
  color: var(--ink-soft); cursor: pointer;
}
.filter-toggle:hover,
.filter-toggle:focus-visible,
.random-toggle:hover,
.random-toggle:focus-visible,
.random-toggle:active { color: var(--accent-strong); }
.filter-toggle.is-on { color: var(--accent-strong); }
.filter-toggle svg,
.random-toggle svg {
  display: block; width: 2rem; height: 2rem;
  fill: none; stroke: currentColor; stroke-width: 1.65;
  stroke-linecap: round; stroke-linejoin: round;
}
.random-toggle circle { fill: currentColor; stroke: none; }
.random-toggle .die-face { display: none; }
.random-toggle .die-face.is-visible { display: inline; }

.about-photo {
  display: block; width: min(100%, 24rem); height: auto;
  border-radius: 4px; border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.counts, .attrib, .source-title, .empty-note {
  font-family: var(--sans); font-size: .8rem;
}
.counts { color: var(--ink-faint); margin-bottom: 0; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 1.15rem 1.25rem 1rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}

.card h2 { margin-top: 0; }
.card:target { scroll-margin-top: 1rem; }
.card:target {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- posts ---------- */

.empty {
  font-size: 1.25rem; color: var(--ink-faint); font-style: italic;
  border: 1px dashed var(--rule); border-radius: 4px;
  padding: 2.5rem 1rem; text-align: center; margin-bottom: .9rem;
}
.empty-note { color: var(--ink-faint); text-align: center; }

/* ---------- a quote ----------
   The quote text is the card. Everything that describes the quote — note,
   attribution, source, labels — sits under it, in descending weight. */

.said blockquote {
  margin: 0 0 .7rem; padding-left: 1rem;
  border-left: 3px solid var(--accent-strong);
  color: var(--quote);
  font-size: 1.16rem; line-height: 1.5;
}
.said blockquote p { margin: 0 0 .5rem; }
.said blockquote p:last-child { margin-bottom: 0; }

/* An excerpt that carries two quotations labels the second one. */
.said > p {
  font-family: var(--sans); font-size: .78rem;
  color: var(--ink-faint); margin: 0 0 .5rem;
}
.said > p strong { color: var(--ink-soft); font-weight: 600; }

.note p { color: var(--ink-soft); font-size: .93rem; margin: 0 0 .5rem; }
.note p:last-child { margin-bottom: 0; }

.attrib { color: var(--ink-faint); margin: .7rem 0 .2rem; }
.source-title { color: var(--ink-soft); margin: .25rem 0 .15rem; }
.source-title a { color: var(--accent); }
/* ---------- the topic list ---------- */

.topics-head {
  font-family: var(--mono);
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
  border-bottom: 1px solid var(--rule); padding-bottom: .4rem;
  margin: 0 0 .2rem;
}

ul.topics {
  list-style: none; margin: 0; padding: 0;
  columns: 2; column-gap: 2rem;
}
ul.topics li {
  display: flex; align-items: baseline; gap: .5rem;
  break-inside: avoid;
  padding: .4rem 0; border-bottom: 1px solid var(--rule-soft);
}
ul.topics a {
  font-family: var(--mono); font-size: .88rem;
  color: var(--ink); text-decoration: none;
}
ul.topics a:hover { color: var(--accent-strong); text-decoration: underline; }

/* ---------- quote browser ---------- */

.quote-browser-feed { min-width: 0; }

.filter-rail {
  position: fixed; top: 7.5rem; bottom: 1.25rem;
  width: min(13rem, calc((100vw - var(--measure)) / 2 - 2.5rem));
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}
.filter-rail-tags { left: 1.25rem; }
.filter-rail-sources { right: 1.25rem; text-align: right; }
.filter-rail h2 {
  position: sticky; top: 0; z-index: 1;
  margin: 0; padding: 0 0 .5rem;
  background: var(--bg); color: var(--ink-faint);
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
}
.filter-rail ul { list-style: none; margin: 0; padding: 0; }
.filter-rail li { margin: 0 0 .28rem; line-height: 1.25; }
.filter-rail a {
  color: var(--ink); font-size: .75rem; text-decoration: none;
  overflow-wrap: anywhere;
}
.filter-rail-tags a::before { content: "#"; color: var(--ink-faint); }
.filter-rail a:hover { color: var(--accent-strong); text-decoration: underline; }
.filter-rail a[aria-current="page"] { color: var(--accent-strong); }
.filter-rail-tags a[aria-current="page"]::before { color: var(--accent-strong); }
.filter-rail-tags .filter-path a,
.filter-rail-tags .filter-path a::before { color: var(--accent-strong); }
.filter-rail-sources .filter-path a { color: var(--accent-strong); }
.filter-rail .filter-divider {
  height: 0; margin: .55rem 0 .65rem; border-top: 1px solid var(--rule);
}
/* ---------- labels ---------- */

ul.tags {
  list-style: none; display: flex; flex-wrap: wrap; gap: .3rem .5rem;
  padding: .6rem 0 0; margin: .8rem 0 0; border-top: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: .7rem;
  color: var(--ink-faint); align-items: baseline;
}
ul.tags a { color: inherit; text-decoration: none; }
ul.tags a:hover { color: var(--accent); text-decoration: underline; }
ul.tags li::before { content: "#"; opacity: .5; }
ul.tags li.kind {
  letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid var(--rule); border-radius: 2px;
  padding: .05rem .4rem; margin-right: .15rem;
  color: var(--accent-strong); font-size: .66rem;
}
ul.tags li.kind::before { content: none; }

/* ---------- about ---------- */

.about-more { margin-bottom: 2rem; }

.about-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: 0 0 .6rem;
}
.about-heading h1 { margin: 0; }

.about-social-links {
  display: flex; align-items: center; gap: .4rem;
}

.about-social-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; color: var(--ink-soft);
  border: 1px solid transparent; text-decoration: none;
}

.about-social-links a:hover,
.about-social-links a:focus-visible {
  color: var(--accent-strong); border-color: var(--accent-strong);
}

.social-icon {
  display: block; width: 1.15rem; height: 1.15rem;
  fill: currentColor;
}

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

.scroll { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td {
  text-align: left; vertical-align: top;
  padding: .45rem .6rem; border-bottom: 1px solid var(--rule-soft);
}
th {
  font-family: var(--sans); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint);
  border-bottom: 1px solid var(--rule); white-space: nowrap;
}

@media (max-width: 62rem) {
  .quote-browser {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem; align-items: start;
  }
  .filter-rail {
    position: static; width: auto; max-height: 14rem;
    padding: .75rem; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--rule);
  }
  .filter-rail h2 { background: var(--surface); }
  .quote-browser-feed { grid-column: 1 / -1; }
}

@media (max-width: 34rem) {
  body { font-size: 16px; padding: 0 1rem 3rem; }
  h1 { font-size: 1.65rem; }
  .filter-toggle, .filter-toggle svg,
  .random-toggle, .random-toggle svg { width: 1.65rem; height: 1.65rem; }
  .said blockquote { font-size: 1.08rem; }
  ul.topics { columns: 1; }
  .quote-browser { grid-template-columns: 1fr; gap: .75rem; }
  .quote-browser-feed { grid-column: auto; }
  td:first-child { white-space: normal; }
}
