/*
 * The Growth Advisory look, taken from https://growth-advisory.de/ (measured 2026-09-30).
 *
 * Where the site's own pairing fails WCAG AA contrast, the colour is replaced by a darker
 * step of the same family: amber text becomes #804f00 (#b36e00 in large headings), mint
 * text becomes #186848, and secondary text is the site's slate #475569.
 */

@font-face {
  font-family: "Mona Sans";
  src: url("../fonts/MonaSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist%5Bwght%5D.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f8faf9;          /* neutral */
  --card: #ffffff;
  --sunken: #f0f4f2;      /* neutral ultra-light */
  --ink: #022c1d;         /* base: headings */
  --text: #35554a;        /* base at 80 % on --bg, as the site sets body text */
  --muted: #475569;       /* tertiary */
  --line: #dfe1e0;        /* the site's rgba(0,0,0,.1) on --bg */
  --accent: #125543;
  --amber: #ffb53d;       /* primary: fills only */
  --amber-text: #804f00;  /* primary-dark */
  --amber-large: #b36e00; /* primary-semi-dark: headings of 24 px and up */
  --eyebrow: #186848;     /* secondary-dark */
  --grid: rgba(43, 41, 41, 0.05);

  --font-heading: "Mona Sans", system-ui, sans-serif;
  --font-body: "Geist", system-ui, sans-serif;

  --radius: 16px;
  --btn-radius: 10px;
  --shadow: 0 1px 2px rgba(2, 44, 29, 0.04), 0 8px 24px rgba(2, 44, 29, 0.06);

  --wrap: 72rem;
  --measure: 42rem;
  --gutter: clamp(1rem, 4vw, 2.25rem);
}

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

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

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  /* The site's 42 px square grid, fading out below the hero. */
  background:
    linear-gradient(to bottom, transparent 0, var(--bg) 36rem),
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--bg);
  background-repeat: no-repeat, repeat, repeat;
}

main { flex: 1; padding-bottom: 5rem; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

img { max-width: 100%; height: auto; }

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

.skip-link {
  position: absolute;
  left: 0;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 0 0 8px 0;
  z-index: 10;
}
.skip-link:focus { top: 0; }

/* Type */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 1.4rem + 3.2vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
h3 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.55rem); font-weight: 500; }

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

.highlight { color: var(--amber-large); }

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--eyebrow);
}

.lede {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--ink);
  max-width: var(--measure);
}

.empty { color: var(--muted); }

.button {
  display: inline-block;
  padding: 1rem 1.75rem;
  border-radius: var(--btn-radius);
  background: var(--amber);
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 4px 0 #b36e00;
}
.button:hover { background: #ffc66b; }

/* Header and footer */

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.site-header__home { display: inline-flex; padding: 0.25rem 0; }
.site-header__home img { height: 40px; width: auto; display: block; }

.site-nav {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--btn-radius);
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover { background: var(--sunken); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 2rem;
}
.site-footer p { margin: 0; }
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer a { color: rgba(255, 255, 255, 0.75); }
.site-footer a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: #2ecc8e; }

/* Home and tags */

.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); }
.hero h1 { max-width: 20ch; }

.post-list {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 52rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.card .eyebrow { margin-bottom: 0.5rem; }
.card h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); margin-bottom: 0.5rem; }
.card h2 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
.card p { margin: 0 0 0.75rem; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags a {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--accent);
  font-size: 0.875rem;
  text-decoration: none;
}
.tags a:hover { background: #c0f2e4; }

.tag-group { max-width: 52rem; margin-bottom: 2.5rem; scroll-margin-top: 1rem; }
.tag-group h2 { font-size: 1.5rem; }
.tag-group .count { font-family: var(--font-body); font-size: 1rem; color: var(--muted); }
.tag-group ul { margin: 0; padding: 0; list-style: none; }
.tag-group li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.tag-group time { color: var(--muted); font-size: 0.875rem; }

/* A post */

.post { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.post__header { padding-block: clamp(2.5rem, 6vw, 4.5rem) 1.5rem; }
.post__header h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 2.9rem); }
.byline { margin: 1.5rem 0 0; color: var(--muted); font-size: 0.9375rem; }

.post__footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.back { text-decoration: none; }
.back:hover { text-decoration: underline; }

/* Running text. Links in prose are underlined: colour alone does not set them apart. */

.prose {
  font-size: 1.125rem;
  line-height: 1.7;
}
.prose > * + * { margin-top: 1.25em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin-bottom: 0; }
.prose h2 { margin-top: 2.25em; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem); }
.prose h3 { margin-top: 1.75em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.5em; }
.prose a { text-decoration: underline; text-underline-offset: 0.15em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose li + li { margin-top: 0.35em; }
.prose img { border-radius: var(--radius); }

.prose blockquote {
  margin-inline: 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--amber);
  color: var(--ink);
  font-style: italic;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--sunken);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.prose pre {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  background: var(--sunken);
  border-radius: var(--btn-radius);
  line-height: 1.5;
}
.prose pre code { background: none; padding: 0; font-size: 0.875rem; }
.prose .highlight { color: inherit; } /* Rouge's wrapper, not the amber word */

.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink); font-weight: 600; }

.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5em; }

@media (max-width: 30rem) {
  .site-header__row { flex-wrap: wrap; }
  .site-nav a { padding-inline: 0.5rem; }
}
