/* Slow Bloom — shared stylesheet */

:root {
  --paper: #f6f1e7;
  --paper-deep: #ece4d4;
  --ink: #221b14;
  --ink-soft: #5a4e41;
  --rule: #d5c9b3;
  --accent: #b4532a;
  --accent-deep: #8a3c1b;
  --leaf: #46614a;
  --card: #fbf8f1;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 66ch;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17130f;
    --paper-deep: #201a14;
    --ink: #efe6d6;
    --ink-soft: #b3a591;
    --rule: #3a3026;
    --accent: #e08a5b;
    --accent-deep: #f0a67c;
    --leaf: #9dbb9f;
    --card: #1d1812;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6.2vw, 4.6rem);
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  margin-top: 2.2em;
}

h3 {
  font-size: 1.28rem;
  margin-top: 1.6em;
}

p {
  margin: 0 0 1.1em;
  max-width: var(--measure);
}

ul,
ol {
  max-width: var(--measure);
  padding-left: 1.2em;
  margin: 0 0 1.2em;
}

li {
  margin-bottom: 0.4em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 10;
}

.skip:focus {
  left: 0;
}

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 2rem;
  padding-top: 1.1rem;
  padding-bottom: 1rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand svg {
  width: 1.5rem;
  height: 1.5rem;
}

.brand em {
  font-style: italic;
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav li {
  margin: 0;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.3rem 0;
  display: inline-block;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--rule);
}

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

/* ---------- Hero ---------- */

.hero {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: end;
}

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 1.1rem;
  font-weight: 600;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 34em;
}

.hero-art {
  color: var(--ink);
  justify-self: end;
  width: min(100%, 300px);
}

.art-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-fill {
  fill: var(--accent);
  stroke: none;
}

.art-soft {
  fill: var(--paper-deep);
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.art-drop {
  fill: var(--accent);
}

.art-steam {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* ---------- Page header ---------- */

.page-head {
  padding: clamp(2.2rem, 6vw, 4.2rem) 0 clamp(1.6rem, 4vw, 2.6rem);
  border-bottom: 1px solid var(--rule);
}

.page-head h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  max-width: 16em;
}

.section {
  padding: clamp(2rem, 5vw, 3.6rem) 0;
}

.section + .section {
  border-top: 1px solid var(--rule);
}

.section > .wrap > h2:first-child {
  margin-top: 0;
}

.tinted {
  background: var(--paper-deep);
}

/* ---------- Index: numbered chapter list ---------- */

.chapters {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: none;
  counter-reset: chapter;
  border-top: 1px solid var(--rule);
}

.chapters li {
  margin: 0;
  counter-increment: chapter;
  border-bottom: 1px solid var(--rule);
}

.chapters a {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 0.4rem 1.5rem;
  padding: 1.25rem 0;
  text-decoration: none;
  color: var(--ink);
  align-items: baseline;
}

.chapters a::before {
  content: counter(chapter, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-deep);
}

.chapters strong {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
}

.chapters span {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

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

/* ---------- Cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.4rem 1.4rem 1.2rem;
}

.card h3 {
  margin-top: 0;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card .meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-deep);
  margin-bottom: 0.6rem;
  display: block;
}

/* ---------- Recipe blocks ---------- */

.recipe {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 1rem 2.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

.recipe:first-of-type {
  border-top: 0;
  padding-top: 0.5rem;
}

.recipe h2 {
  margin-top: 0;
  font-size: 1.8rem;
}

.spec {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 0;
  font-size: 0.92rem;
}

.spec li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.38rem 0;
  border-bottom: 1px dotted var(--rule);
  margin: 0;
}

.spec span:first-child {
  color: var(--ink-soft);
}

.spec span:last-child {
  font-family: var(--mono);
  font-size: 0.86rem;
  text-align: right;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
  margin-bottom: 0.75rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.12em;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.5rem;
  text-align: center;
  color: var(--accent-deep);
}

/* ---------- Tables ---------- */

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 520px;
}

caption {
  text-align: left;
  font-size: 0.82rem;
  color: var(--ink-soft);
  padding-bottom: 0.6rem;
  letter-spacing: 0.04em;
}

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

thead th {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--ink);
  font-weight: 600;
}

tbody th {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}

td.num {
  font-family: var(--mono);
  font-size: 0.88rem;
  white-space: nowrap;
}

/* ---------- Grind scale ---------- */

.scale {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.scale li {
  margin: 0;
  border-top: 3px solid var(--ink);
  padding-top: 0.7rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.scale b {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
}

.dots {
  height: 2.6rem;
  margin-bottom: 0.6rem;
  border-radius: 4px;
  background-color: var(--paper-deep);
  background-image: radial-gradient(var(--ink) 38%, transparent 40%);
}

.dots-1 { background-size: 3px 3px; }
.dots-2 { background-size: 5px 5px; }
.dots-3 { background-size: 7px 7px; }
.dots-4 { background-size: 9px 9px; }
.dots-5 { background-size: 12px 12px; }
.dots-6 { background-size: 16px 16px; }

/* ---------- Ratio bars ---------- */

.bars {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0;
  max-width: 46rem;
}

.bars li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 3.6rem;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
}

.bar {
  height: 0.7rem;
  background: var(--paper-deep);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.w-12 { width: 12%; }
.w-45 { width: 45%; }
.w-72 { width: 72%; }
.w-88 { width: 88%; }
.w-94 { width: 94%; }
.w-100 { width: 100%; }

.bars .num {
  font-family: var(--mono);
  font-size: 0.84rem;
  text-align: right;
}

/* ---------- Callouts & quotes ---------- */

.note {
  border-left: 3px solid var(--leaf);
  padding: 0.2rem 0 0.2rem 1.2rem;
  margin: 1.6rem 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.note strong {
  color: var(--ink);
}

.pull {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.3;
  max-width: 24em;
  margin: 0;
}

/* ---------- Journal ---------- */

.entry {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 0.5rem 2.5rem;
  padding: 2.2rem 0;
  border-top: 1px solid var(--rule);
}

.entry:first-of-type {
  border-top: 0;
  padding-top: 0.5rem;
}

.entry time {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-deep);
  padding-top: 0.5rem;
}

.entry h2 {
  margin-top: 0;
  font-size: 1.75rem;
}

/* ---------- Two-column prose ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 3rem;
}

.split h2,
.split h3 {
  margin-top: 0;
}

/* ---------- Next link ---------- */

.next {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.next a {
  font-family: var(--serif);
  font-size: 1.3rem;
  text-decoration: none;
}

.next a:hover {
  text-decoration: underline;
}

/* ---------- 404 ---------- */

.lost {
  padding: clamp(3rem, 12vw, 8rem) 0;
  text-align: center;
}

.lost .code {
  font-family: var(--serif);
  font-size: clamp(5rem, 22vw, 12rem);
  line-height: 0.9;
  color: var(--accent);
  font-style: italic;
  margin: 0 auto 0.2em;
  max-width: none;
}

.lost p {
  margin-left: auto;
  margin-right: auto;
}

.button {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--ink);
  border-radius: 99px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.button:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Footer ---------- */

.colophon {
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
  padding: 2.2rem 0 2.6rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.colophon .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
}

.colophon h2 {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 0.7rem;
}

.colophon ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.colophon li {
  margin-bottom: 0.3rem;
}

.colophon a {
  color: var(--ink-soft);
}

.colophon p {
  margin-bottom: 0.6em;
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .hero-grid,
  .recipe,
  .entry,
  .split,
  .colophon .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    justify-self: start;
    width: 170px;
    order: -1;
  }

  .chapters a {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .chapters span {
    grid-column: 2;
  }

  .scale {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 0.5rem;
  }

  .bars li {
    grid-template-columns: 5.6rem minmax(0, 1fr) 3.2rem;
    gap: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .masthead nav,
  .colophon,
  .next {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
