/* ragstone.ai — stone ground, lapis ink. One serif for the questions, one sans for reading aids. */
:root {
  --stone: #eceeea;
  --stone-deep: #e1e5e0;
  --ink: #1e2a2f;
  --muted: #56636a;
  --rule: #c5ccc7;
  --lapis: #234e86;
  --lapis-soft: #dbe3ee;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 38rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stone: #172024;
    --stone-deep: #1e292e;
    --ink: #e4e8e5;
    --muted: #9ba8ae;
    --rule: #34434a;
    --lapis: #9db7e4;
    --lapis-soft: #22324a;
  }
}
:root[data-theme="dark"] {
  --stone: #172024; --stone-deep: #1e292e; --ink: #e4e8e5; --muted: #9ba8ae;
  --rule: #34434a; --lapis: #9db7e4; --lapis-soft: #22324a;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font: 1.1875rem/1.65 var(--serif);
  font-optical-sizing: auto;
}
a { color: var(--lapis); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lapis); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--stone); padding: .5rem 1rem; }
.skip:focus { left: 1rem; }

header.site, main, footer.site { width: min(100% - 2rem, var(--measure)); margin-inline: auto; }

header.site {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: baseline; justify-content: space-between;
  padding: 1.75rem 0 1rem; font-family: var(--sans); font-size: .9375rem;
}
header.site .name { color: var(--ink); text-decoration: none; font-weight: 600; }
header.site nav { display: flex; gap: 1.25rem; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

main { padding: 2.5rem 0 4rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.25rem; }

/* Home: the principle is the one big thing on the site. */
.principle h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  max-width: 24ch;
}
.lede { font-size: 1.125rem; color: var(--muted); margin: 0 0 2rem; }

.author {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.25rem; align-items: start;
  padding: 1.5rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-size: 1.0625rem;
}
.author img { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; background: var(--stone-deep); }
.author p { margin: 0; }

.page-title { font-size: clamp(1.5rem, 3.5vw, 1.9rem); margin: 0 0 1rem; }
.library { margin-top: 3rem; }

/* The question index: questions set large, grouped by the decision they serve. */
.group h2, .group h3 {
  font-family: var(--sans); font-size: .875rem; font-weight: 600; color: var(--muted);
  letter-spacing: 0; margin: 2.25rem 0 .5rem;
}
ol.questions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
ol.questions li { border-bottom: 1px solid var(--rule); }
ol.questions a {
  display: block; padding: .9rem 0; color: var(--ink); text-decoration: none;
  font-size: clamp(1.125rem, 2.5vw, 1.3rem); line-height: 1.35;
}
ol.questions a:hover { color: var(--lapis); }

/* Question page */
.crumb { font-family: var(--sans); font-size: .875rem; color: var(--muted); margin: 0 0 1rem; }
.crumb a { color: var(--muted); }
.answer h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 0 0 1.5rem; }
.short {
  font-size: 1.1875rem; line-height: 1.55; margin: 0 0 2rem;
  padding: 1.25rem 1.4rem; background: var(--lapis-soft); border-left: 4px solid var(--lapis);
}
.answer ul { padding-left: 1.2rem; }
.answer li { margin: .5rem 0; }
.byline { font-family: var(--sans); font-size: .875rem; color: var(--muted); margin-top: 2.5rem; }
.next { border-top: 1px solid var(--rule); padding-top: 1.25rem; font-size: 1.0625rem; }

/* About and contact */
.prose .portrait { float: right; width: 8rem; height: 8rem; margin: .4rem 0 1rem 1.5rem; border-radius: 50%; object-fit: cover; background: var(--stone-deep); }
form.contact { display: grid; gap: 1.1rem; margin-top: 2rem; font-family: var(--sans); font-size: 1rem; }
form.contact label { display: grid; gap: .35rem; font-weight: 600; }
form.contact .optional { font-weight: 400; color: var(--muted); }
form.contact input, form.contact textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--stone);
  border: 1px solid var(--muted); border-radius: 3px; padding: .65rem .75rem; width: 100%;
}
form.contact textarea { resize: vertical; }
form.contact button {
  justify-self: start; font: inherit; font-weight: 600; color: #fff; background: var(--lapis);
  border: 0; border-radius: 3px; padding: .75rem 1.4rem; cursor: pointer;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) form.contact button { color: #10181c; } }
form.contact button:disabled { opacity: .6; cursor: progress; }
.status { margin: 0; min-height: 1.5em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

footer.site { border-top: 1px solid var(--rule); padding: 1.5rem 0 3rem; font-family: var(--sans); font-size: .875rem; color: var(--muted); }
footer.site p { margin: .25rem 0; }
footer.site a { color: var(--muted); }

@media (max-width: 30rem) {
  body { font-size: 1.125rem; }
  .prose .portrait { float: none; display: block; margin: 0 0 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
