/* ==========================================================================
   Plain Language Science
   Design notes: the identity here is a hand-drawn doodle in a lab notebook.
   Paper is a near-white with a green cast, ink is an archival green-black,
   and the one loud element is a highlighter mark. Everything else stays quiet.
   ========================================================================== */

:root {
  --paper:      #FCFCF9;
  --paper-deep: #F1F4EE;
  --ink:        #16231D;
  --ink-soft:   #5B6A61;
  --rule:       #DBE2D9;
  --accent:     #12655A;
  --accent-dim: #0E4E45;
  --marker:     #F5DE5E;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body:    "Newsreader", Georgia, "Times New Roman", serif;
  --mono:    "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 36rem;
  --wide:    52rem;

  --gap:    clamp(1.25rem, 4vw, 2.5rem);
  --step:   clamp(2.5rem, 6vw, 4.5rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.1875rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  z-index: 10;
}
.skip:focus { left: 0; }

/* --------------------------------------------------------------------------
   The marker. One shape, reused: a slightly crooked highlighter swipe that
   sits behind text. This is the only loud thing on the site.
   -------------------------------------------------------------------------- */

.marker {
  position: relative;
  display: inline;
  z-index: 0;
}
.marker::before {
  content: "";
  position: absolute;
  left: -0.16em;
  right: -0.16em;
  bottom: 0.02em;
  height: 0.52em;
  background: var(--marker);
  border-radius: 3px 9px 4px 11px / 11px 4px 9px 3px;
  transform: rotate(-0.7deg);
  z-index: -1;
  transform-origin: left center;
  animation: swipe 620ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

@keyframes swipe {
  from { transform: rotate(-0.7deg) scaleX(0); }
  to   { transform: rotate(-0.7deg) scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .marker::before { animation: none; }
  * { scroll-behavior: auto !important; }
}

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

.masthead {
  border-bottom: 1px solid var(--rule);
  background:
    linear-gradient(to right, rgba(18,101,90,0.045) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(to bottom, rgba(18,101,90,0.045) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--paper);
}

.masthead-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.4rem var(--gap);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.022em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.1;
}
.wordmark-tail { color: var(--ink-soft); font-weight: 500; }
.wordmark:hover .wordmark-tail { color: var(--accent); }

.nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav a { color: var(--ink-soft); text-decoration: none; }
.nav a:hover { color: var(--ink); text-decoration: underline; }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 3px; }

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6rem) var(--gap) var(--step);
}

.hero-statement {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 6.2vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.032em;
  margin: 0;
  max-width: 20ch;
}

.hero-sub {
  margin: 1.6rem 0 0;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.15rem;
}

.hero-note {
  margin: 1.1rem 0 0;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   Post list
   -------------------------------------------------------------------------- */

.listing {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gap) var(--step);
}

.listing-head {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
  margin: 0 0 0.4rem;
}

.entry {
  display: block;
  padding: 1.9rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}

.entry-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.4vw, 2.05rem);
  line-height: 1.16;
  letter-spacing: -0.024em;
  margin: 0;
}
.entry:hover .entry-title { color: var(--accent); }

.entry-dek {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.entry-meta {
  margin: 0.75rem 0 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.entry-meta span + span::before {
  content: "/";
  margin: 0 0.55em;
  color: var(--rule);
}

.listing-empty {
  padding: 2rem 0;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Article
   -------------------------------------------------------------------------- */

.article {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4.5rem) var(--gap) var(--step);
}

.kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
}

.article-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.05rem, 6vw, 3.35rem);
  line-height: 1.07;
  letter-spacing: -0.032em;
  margin: 0;
  max-width: 18ch;
}

.dek {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 1.15rem 0 0;
}

.meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 1.6rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}
.meta-sep { margin: 0 0.55em; color: var(--rule); }

.prose {
  max-width: var(--measure);
  margin-top: var(--step);
}

.prose > p { margin: 0 0 1.35em; }
.prose > p:first-child { margin-top: 0; }

.prose h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 2.8rem 0 1rem;
}

.prose h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.22rem;
  margin: 2rem 0 0.7rem;
}

.prose ul, .prose ol { margin: 0 0 1.35em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }

.prose blockquote {
  margin: 1.8em 0;
  padding-left: 1.15rem;
  border-left: 3px solid var(--marker);
  color: var(--ink-soft);
  font-style: italic;
}

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

/* Doodles get to break the text measure. They are the point. */
.prose img,
.prose figure {
  margin: 2.2rem 0;
  width: 100%;
}

@media (min-width: 56rem) {
  .prose img,
  .prose figure {
    width: calc(var(--measure) + 8rem);
    max-width: calc(100vw - 2 * var(--gap));
    margin-left: -4rem;
  }
}

.prose img {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fff;
}

.prose figure img { margin: 0 0 0.7rem; }

.prose figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.article-foot {
  max-width: var(--measure);
  margin-top: var(--step);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.signoff {
  color: var(--ink-soft);
  font-size: 1.02rem;
  margin: 0 0 1.2rem;
}

.backlink {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.backlink a { text-decoration: none; }
.backlink a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Callout used for the standing disclosure at the top of articles
   -------------------------------------------------------------------------- */

.note {
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.2rem 1.35rem;
  margin: 0 0 2.2rem;
  font-size: 1.02rem;
  color: var(--ink-soft);
}
.note p { margin: 0 0 0.8em; }
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--ink); }

details.note { padding: 0; }
details.note > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 1.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
details.note > summary::-webkit-details-marker { display: none; }
details.note > summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1rem;
  line-height: 1;
  color: var(--ink-soft);
}
details.note[open] > summary::after { content: "\2212"; }
details.note[open] > summary { border-bottom: 1px solid var(--rule); }
details.note > summary:hover { color: var(--accent); }
details.note > p { padding: 0 1.35rem; }
details.note > p:first-of-type { padding-top: 1.1rem; }
details.note > p:last-child { padding-bottom: 1.2rem; }

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

.footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-deep);
  margin-top: var(--step);
}

.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.4rem var(--gap) 3rem;
}

.footer-line {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  margin: 0 0 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 0 0 1.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

.footer-fine {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
