/* Explain the Data: one stylesheet for every page. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --wash: #f3f8fc;
  --ink: #12283b;
  --muted: #516370;
  --link: #17618b;
  --logo: #4a90c8;
  --highlight: #d5ecf9;
  --rule: #d9e4ec;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --page: 68rem;
  --measure: 38rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

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

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

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.1;
  margin: 0;
}

p {
  margin: 0 0 1rem;
}

.wrap {
  width: min(100% - 2.5rem, var(--page));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 10;
}

/* Small uppercase labels for dates, topics and section names. */
.label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
}

.brand svg {
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
}

/* The nav link color above would otherwise hide the button text. */
.site-nav .button,
.site-nav .button:hover {
  color: var(--paper);
  text-decoration: none;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
}

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

.button.small {
  padding: 0.5rem 0.95rem;
  font-size: 0.9rem;
}

.text-link {
  font-weight: 600;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

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

.hero {
  padding-block: 3.75rem 3rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  max-width: 17ch;
  margin-bottom: 1.25rem;
}

.hero .intro {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: var(--measure);
  margin-bottom: 2rem;
}

.hero .reach {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Sections ---------- */

.section {
  padding-block: 4rem;
  border-top: 1px solid var(--rule);
}

.section.tinted {
  background: var(--wash);
  border-top: 0;
}

.section h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

.section .lead {
  max-width: var(--measure);
  color: var(--muted);
}

/* ---------- Featured story with the real answer ---------- */

.feature {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 3.5rem;
  align-items: start;
}

.feature h2 a {
  color: var(--ink);
  text-decoration: none;
}

.feature h2 a:hover {
  text-decoration: underline;
}

.feature .meta {
  margin-top: 1.25rem;
}

/* The answer card: a real reply from my newsletter assistant, with its checked quotes. */
.answer {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 1px 0 var(--rule), 0 12px 30px -18px rgba(18, 40, 59, 0.35);
}

.answer .question {
  font-weight: 600;
  margin-bottom: 1rem;
}

.answer .question::before {
  content: "Q ";
  font-family: var(--mono);
  color: var(--logo);
}

.answer .reply {
  margin-bottom: 1.25rem;
}


.sources {
  list-style: none;
  margin: 0;
  padding: 1rem 0 0;
  border-top: 1px dashed var(--rule);
  display: grid;
  gap: 0.85rem;
}

.sources li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  font-size: 0.95rem;
}

.sources .marker {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--link);
  padding-top: 0.1rem;
}

/* Quoted text is marked like a highlighter, so you can see exactly what was checked. */
.sources q {
  background: var(--highlight);
  padding: 0.05em 0.25em;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.sources small {
  display: block;
  color: var(--muted);
  margin-top: 0.2rem;
}

.answer figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1.25rem;
}

/* ---------- Writing list ---------- */

.posts {
  list-style: none;
  margin: 2rem 0 1.75rem;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.posts li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--rule);
}

.posts .label {
  margin: 0.3rem 0 0;
}

.posts .topic {
  display: block;
  color: var(--logo);
}

.posts h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.posts h3 a {
  color: var(--ink);
  text-decoration: none;
}

.posts h3 a:hover {
  text-decoration: underline;
}

.posts p {
  margin: 0;
  color: var(--muted);
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 3rem;
  align-items: start;
}

.about img {
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--wash);
}

.about .text {
  max-width: var(--measure);
}

/* ---------- Work with me ---------- */

.offers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.offer {
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.5rem;
}

.offer h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.offer p {
  margin: 0;
  color: var(--muted);
}

/* ---------- Closing subscribe band ---------- */

.subscribe {
  background: var(--ink);
  color: var(--paper);
  padding-block: 3.5rem;
}

.subscribe .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.subscribe h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
}

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

.subscribe .button:hover {
  background: var(--highlight);
}

.subscribe a:not(.button),
.subscribe a:not(.button):hover {
  color: var(--paper);
  font-weight: 600;
}

/* ---------- Resources page ---------- */

.page-intro {
  padding-block: 3.5rem 2.5rem;
}

.page-intro h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.page-intro p {
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.15rem;
}

.datasets {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.dataset {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
}

.dataset h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.dataset ul {
  margin: 0;
  padding-left: 1.1rem;
}

.dataset li {
  margin-bottom: 0.4rem;
}

.templates {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0 2.5rem;
}

.templates li {
  padding-block: 1.1rem;
  border-top: 1px solid var(--rule);
}

.templates a {
  font-weight: 600;
}

.templates p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.site-footer {
  padding-block: 2.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

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

@media (max-width: 52rem) {
  .feature,
  .dataset,
  .offers {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about img {
    width: 9rem;
    height: auto;
  }

  .posts li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .hero {
    padding-block: 3rem 2.5rem;
  }
}

@media (max-width: 34rem) {
  .site-nav {
    gap: 0.6rem 1rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
  }
}
