/* The Brew Counter. Palette comes from the coffee plant: leaf, green bean, cherry, and the crema on a shot.
   Headlines: Bricolage Grotesque (self-hosted). Body: Charter and friends from the system. */
@font-face {
  font-family: "Bricolage";
  src: url("/assets/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #e9eedd;
  --surface: #f4f7ea;
  --ink: #1c1712;
  --muted: #51554a;
  --line: #c6cfb4;
  --link: #17402f;
  --leaf: #17402f;
  --leaf-deep: #0f2e21;
  --on-leaf: #eef2e2;
  --on-leaf-muted: #b5c7b2;
  --crema: #e6b450;
  --cherry: #ff9d8c;
  --display: "Bricolage", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1c16;
    --surface: #15271f;
    --ink: #e8ecdc;
    --muted: #a3ad98;
    --line: #2b3d32;
    --link: #e6b450;
    --leaf: #1a4332;
    --leaf-deep: #12301f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.125rem/1.7 var(--body); }
.wrap { max-width: 68rem; margin-inline: auto; padding-inline: 1.25rem; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--crema); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 2; }

h1, h2, h3, .brand, .site-nav, .shot, .status, th, dt { font-family: var(--display); }
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 650; letter-spacing: -0.01em; }
p, ul, ol, dl { margin: 0 0 1rem; }

/* Header */
.header-row { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; padding-block: 1.1rem; flex-wrap: wrap; }
.brand { color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.25rem; letter-spacing: -0.02em; border-bottom: 4px solid var(--crema); padding-bottom: 1px; }
.site-nav { display: flex; gap: 1.25rem; font-size: .98rem; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }

/* Hero */
.hero { padding-block: clamp(1.5rem, 5vw, 4rem) clamp(2.5rem, 6vw, 5rem); }
.hero-grid { display: grid; gap: 2.25rem 3.5rem; align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(21rem, 26rem); } }
.hero-copy .lede { font-size: 1.25rem; line-height: 1.6; color: var(--muted); max-width: 34rem; margin-top: 1.25rem; }
.hero-tool h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); }

/* Shot calculator */
.shot { background: var(--leaf); color: var(--on-leaf); border-radius: 22px; padding: 1.5rem; font-size: 1rem; line-height: 1.3; box-shadow: 0 1.5rem 3rem -1.5rem rgb(15 46 33 / .55); }
.shot-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.shot-row > label, .shot legend { font-weight: 550; }
.stepper { display: flex; align-items: center; gap: .35rem; background: var(--leaf-deep); border-radius: 999px; padding: .25rem; }
.stepper input { width: 3.6rem; background: none; border: 0; color: inherit; font: 650 1.35rem/1 var(--display); text-align: center; font-variant-numeric: tabular-nums; padding: .2rem 0; appearance: textfield; -moz-appearance: textfield; border-radius: 6px; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .unit { margin: 0 .3rem 0 -.5rem; color: var(--on-leaf-muted); }
.stepper button { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: var(--leaf); color: inherit; font: 500 1.4rem/1 var(--display); cursor: pointer; }
.stepper button:hover { background: var(--crema); color: #1c1712; }

.shot-styles { border: 0; padding: 0; margin: 1.25rem 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.shot-styles legend { padding: 0; margin-bottom: .5rem; }
.shot-styles label { position: relative; cursor: pointer; }
.shot-styles input { position: absolute; opacity: 0; inset: 0; }
.shot-styles span { display: block; text-align: center; padding: .6rem .25rem; border-radius: 12px; background: var(--leaf-deep); font-weight: 600; }
.shot-styles small { display: block; font-weight: 400; font-size: .85rem; color: var(--on-leaf-muted); margin-top: .15rem; }
.shot-styles input:checked + span { background: var(--crema); color: #1c1712; }
.shot-styles input:checked + span small { color: #4a3a17; }
.shot-styles input:focus-visible + span { outline: 3px solid var(--on-leaf); outline-offset: 2px; }

.shot-out { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid rgb(238 242 226 / .2); font-weight: 550; }
.shot-out output { display: block; font: 750 clamp(4rem, 14vw, 5.5rem)/0.95 var(--display); letter-spacing: -0.04em; color: var(--crema); font-variant-numeric: tabular-nums; margin-top: .25rem; }
.shot-out span { color: var(--on-leaf-muted); font-weight: 400; }

.shot-timer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; background: var(--leaf-deep); border-radius: 16px; padding: .75rem .75rem .75rem 1.1rem; }
.shot-clock { font: 650 2rem/1 var(--display); font-variant-numeric: tabular-nums; }
.shot-clock .unit { font-size: 1rem; font-weight: 400; color: var(--on-leaf-muted); }
.shot-timer[data-state="window"] .shot-clock { color: var(--crema); }
.shot-timer[data-state="long"] .shot-clock { color: var(--cherry); }
.btn { font: 650 1rem/1 var(--display); border: 0; border-radius: 999px; padding: .85rem 1.3rem; background: var(--on-leaf); color: #12301f; cursor: pointer; }
.btn:hover { background: var(--crema); color: #1c1712; }
.btn-quiet { background: none; color: var(--on-leaf); box-shadow: inset 0 0 0 2px var(--on-leaf-muted); }
.shot-verdict { margin: .85rem 0 0; font-size: .95rem; line-height: 1.45; color: var(--on-leaf-muted); min-height: 2.9em; }
.shot :focus-visible { outline-color: var(--on-leaf); }

/* Guides: three pieces of gear standing on the counter */
.guides { padding-block: clamp(2rem, 5vw, 4rem); }
.section-lede { color: var(--muted); max-width: 38rem; margin-top: .6rem; }
.shelf { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 2.5rem; }
@media (min-width: 48rem) { .shelf { grid-template-columns: repeat(3, 1fr); gap: 0 2.5rem; } }
.shelf li { display: grid; grid-template-rows: auto auto 1fr auto; justify-items: start; }
.shelf svg { width: 7.5rem; height: 7rem; color: var(--leaf); display: block; }
@media (prefers-color-scheme: dark) { .shelf svg { color: var(--crema); } }
.shelf h3 { width: 100%; border-top: 5px solid var(--ink); padding-top: 1rem; margin-bottom: .4rem; }
.shelf p { font-size: 1.02rem; line-height: 1.6; color: var(--muted); margin-bottom: .8rem; }
.status { font-size: .85rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; }

/* How we write */
.promises { padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 5.5rem); }
.promises dl { display: grid; gap: 1.5rem 3rem; margin: 1.75rem 0 0; }
@media (min-width: 44rem) { .promises dl { grid-template-columns: 1fr 1fr; } }
.promises dt { font-weight: 650; font-size: 1.15rem; letter-spacing: -0.01em; }
.promises dd { margin: .25rem 0 0; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }

/* Reading pages */
.prose { max-width: 42rem; }
main.prose { padding-block: clamp(2rem, 5vw, 3.5rem) 4rem; }
.prose h1 { font-size: clamp(2.1rem, 5.5vw, 3.2rem); margin-bottom: 1.25rem; }
.prose h2 { font-size: 1.6rem; margin: 2.5rem 0 .75rem; }
.prose h3 { margin: 1.75rem 0 .4rem; }
.prose li { margin-bottom: .4rem; }
.updated { color: var(--muted); font-size: .95rem; }
.tool-notes { padding-bottom: 4rem; }
.tool-notes h2:first-child { margin-top: 0; }
.table-scroll { overflow-x: auto; margin-bottom: 1rem; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; line-height: 1.4; }
th, td { text-align: left; padding: .6rem .9rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; font-size: .92rem; border-bottom: 3px solid var(--ink); }
.disclosure { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; font-size: .98rem; margin-bottom: 2rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font: .92rem/1.5 var(--display); }
.footer-row { display: flex; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; padding-block: 1.5rem; }
.footer-row p { margin: 0; }
.footer-row nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.footer-row a { color: inherit; }

/* Guides (long reads) */
.guide-head { margin-bottom: 2rem; }
.guide-head .lede { font-size: 1.25rem; line-height: 1.6; color: var(--muted); margin-bottom: .75rem; }
.crumb { font: 600 .95rem/1 var(--display); margin-bottom: 1rem; }
.prose table { display: block; overflow-x: auto; margin-bottom: 1.25rem; }
.prose td:first-child { font-weight: 600; }
.verdict { background: var(--leaf); color: var(--on-leaf); border-radius: 16px; padding: 1.1rem 1.3rem; margin: 1.5rem 0; }
.verdict strong { color: var(--crema); font-family: var(--display); }
.verdict a { color: inherit; }
.method { border-top: 5px solid var(--ink); margin-top: 3rem; padding-top: 1rem; color: var(--muted); font-size: 1rem; }
.prose .method h2 { font-size: 1.15rem; margin: 0 0 .4rem; color: var(--ink); }
.shelf h3 a { color: inherit; text-decoration: none; }
.shelf h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.read { font: 600 1rem/1.3 var(--display); }
