/* Wrenworks shared styles — warm workshop, light & dark */

:root {
  --bg: #faf6ef;
  --bg-raised: #ffffff;
  --ink: #2b2521;
  --ink-soft: #6f645a;
  --accent: #b4552d;
  --accent-soft: #f3e2d8;
  --line: #e5dcd0;
  --ok: #3e7a4e;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #211d19;
    --bg-raised: #2b2622;
    --ink: #ece5da;
    --ink-soft: #a89c8e;
    --accent: #e08a5c;
    --accent-soft: #3d2e24;
    --line: #3a332c;
    --ok: #7dbb8c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.wrap-wide { max-width: 58rem; }

header.site {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.25rem 0 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

header.site .brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

header.site .brand .bird { color: var(--accent); }

header.site nav { display: flex; gap: 1.1rem; margin-left: auto; }

header.site nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--accent); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; margin: 2.2rem 0 0.6rem; }

a { color: var(--accent); }

p.lede { font-size: 1.15rem; color: var(--ink-soft); margin-top: 0; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.tool-card {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s;
}

.tool-card:hover { border-color: var(--accent); }
.tool-card strong { font-family: var(--serif); font-size: 1.08rem; display: block; margin-bottom: 0.25rem; }
.tool-card span { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.45; display: block; }

.promise {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  font-size: 0.98rem;
}

.post-list { list-style: none; padding: 0; }
.post-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); display: flex; gap: 1rem; flex-wrap: wrap; }
.post-list time { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-size: 0.95rem; min-width: 7rem; }
.post-list a { text-decoration: none; }
.post-list a:hover { text-decoration: underline; }

article.post time.dateline { color: var(--ink-soft); font-size: 0.95rem; }
article.post p { margin: 1rem 0; }
article.post blockquote { margin: 1.2rem 0; padding: 0.2rem 1.1rem; border-left: 3px solid var(--accent); color: var(--ink-soft); }

/* tool page primitives */
label.field { display: block; font-size: 0.9rem; color: var(--ink-soft); margin: 1.1rem 0 0.3rem; }

textarea, input[type="text"] {
  width: 100%;
  background: var(--bg-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.5;
}

textarea:focus, input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; min-height: 7.5rem; }

button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  font-family: var(--sans);
  cursor: pointer;
}

button.quiet { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button:hover { filter: brightness(1.08); }

.result-note { color: var(--ok); font-size: 0.92rem; min-height: 1.4em; }

/* stat grid — big numbers that update live */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 0.5rem;
}

.stat {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}

.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.stat span { display: block; color: var(--ink-soft); font-size: 0.82rem; line-height: 1.35; margin-top: 0.15rem; }

/* label/value pairs for secondary detail */
.detail-list { margin: 0.6rem 0 0; padding: 0; }
.detail-list > div {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.detail-list dt { color: var(--ink-soft); }
.detail-list dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }

/* simple data table */
table.freq { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.freq th, table.freq td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); }
table.freq th { color: var(--ink-soft); font-weight: 400; font-size: 0.85rem; }
table.freq th:not(:first-child), table.freq td:not(:first-child) { text-align: right; width: 5.5rem; font-variant-numeric: tabular-nums; }
table.freq td.word { font-family: var(--mono); overflow-wrap: anywhere; }
table.freq td.empty { color: var(--ink-soft); text-align: left; }

.opt-row { font-size: 0.93rem; color: var(--ink-soft); margin: 0.4rem 0 0.8rem; }
.opt-row label { display: inline-flex; gap: 0.45rem; align-items: baseline; cursor: pointer; }
.opt-row input[type="checkbox"] { accent-color: var(--accent); }

p.method, ul.method { color: var(--ink-soft); font-size: 0.92rem; }
ul.method { padding-left: 1.1rem; }
ul.method li { margin: 0.4rem 0; }
p.method strong, ul.method strong { color: var(--ink); font-weight: 600; }
code { font-family: var(--mono); font-size: 0.88em; }

footer.site {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.7;
}
footer.site a { color: var(--ink-soft); }
