/* Wordledger — hand-written stylesheet, no framework. */

:root {
  --paper:      #fbf9f5;
  --ink:        #23201c;
  --ink-muted:  #6b6459;
  --rule:       #e3dcd1;
  --accent:     #7a3b2e;
  --accent-dim: #a86252;
  --mark:       #f3ede2;
  --measure:    34rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #1a1816;
    --ink:        #e6e0d6;
    --ink-muted:  #9b9285;
    --rule:       #34302b;
    --accent:     #d99578;
    --accent-dim: #b8785e;
    --mark:       #2a2622;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.4rem;
}

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

header.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 1.9rem 0 1.1rem;
  margin-bottom: 2.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: inherit;
}

.brand svg { flex: none; }

.brand b {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: .06em;
  text-transform: lowercase;
}

.brand span {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--ink-muted);
  letter-spacing: .02em;
}

nav {
  margin-top: .9rem;
  font-family: var(--sans);
  font-size: .82rem;
  letter-spacing: .01em;
}

nav a {
  color: var(--ink-muted);
  text-decoration: none;
  margin-right: 1.1rem;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- prose ------------------------------------------------------------- */

h1 {
  font-size: 1.85rem;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -.012em;
  margin: 0 0 .35rem;
}

.standfirst {
  color: var(--ink-muted);
  font-size: 1.04rem;
  font-style: italic;
  margin: 0 0 2.2rem;
}

h2 {
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -.005em;
  margin: 2.6rem 0 .7rem;
}

h3 {
  font-family: var(--sans);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 2rem 0 .5rem;
}

p { margin: 0 0 1.15rem; }

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

ul, ol { margin: 0 0 1.15rem; padding-left: 1.3rem; }
li { margin-bottom: .45rem; }

strong { font-weight: 600; }

blockquote {
  margin: 1.6rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-muted);
  font-style: italic;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.8rem 0;
}

code, .mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: .86em;
  background: var(--mark);
  padding: .1em .34em;
  border-radius: 3px;
}

/* ---- figures ----------------------------------------------------------- */

figure { margin: 2rem 0; }

figure svg { display: block; width: 100%; height: auto; }

figcaption {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--ink-muted);
  margin-top: .6rem;
  line-height: 1.5;
}

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

.table-scroll { overflow-x: auto; margin: 1.6rem 0; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: .92rem;
}

th, td {
  text-align: left;
  padding: .5rem .7rem .5rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

td.term { font-weight: 600; white-space: nowrap; }

/* ---- index page cards -------------------------------------------------- */

.entries { margin: 2.4rem 0 0; }

.entry {
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
}

.entry:last-child { border-bottom: 1px solid var(--rule); }

.entry a {
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.entry a:hover { color: var(--accent); }

.entry p {
  margin: .3rem 0 0;
  color: var(--ink-muted);
  font-size: .96rem;
}

/* ---- footer ------------------------------------------------------------ */

footer {
  margin-top: 4rem;
  padding: 1.4rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--ink-muted);
}

footer a { color: var(--ink-muted); }
footer a:hover { color: var(--accent); }

/* ---- small screens ----------------------------------------------------- */

@media (max-width: 30rem) {
  body { font-size: 17px; }
  h1 { font-size: 1.55rem; }
  nav a { margin-right: .85rem; }
}
