:root {
  --color-paper: #edeae1;
  --color-surface: #f7f5ee;
  --color-inset: #d6d2c4;
  --color-ink: #1c1b18;
  --color-ink-muted: #1c1b18b3;
  --color-ink-line: #1c1b1833;
  --color-ink-wash: #1c1b180d;

  /* Note colours — one per card or chip dot, never mixed within one */
  --color-note-periwinkle: #a3a5f5;
  --color-note-yellow: #f7e06e;
  --color-note-green: #9dd0b4;
  --color-note-pink: #eda6b4;
  --color-note-cream: #f2e6cf;
  --color-note-orange: #f58f66;
  --color-note-lilac: #c9a0f0;
  --color-note-sky: #a0c8ee;
  --color-note-sand: #f1d596;
  --color-note-blue: #6690d6;
  --color-note-line: #00000099;

  --shadow-corner: 0 1em 0.5em #0000004d;

  --font-sans: 'Figtree', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-decorative: 'Caveat', 'Bradley Hand', cursive;
  --font-mono: 'Fira Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-md: 0.375rem;
  --radius-xl: 0.75rem;
  --gutter: 1.5rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background: var(--color-ink);
  color: var(--color-paper);
}

body {
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.625;
  background: var(--color-paper);
  color: var(--color-ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell {
  width: 100%;
  max-width: calc(61rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

header.shell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.wordmark {
  font-size: 18px;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 16px;
  font-size: 15px;
}

.site-nav a {
  color: var(--color-ink-muted);
  text-decoration: none;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--color-ink);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.headline {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  font-size: 14px;
  color: var(--color-ink-muted);
  margin-bottom: 1rem;
}

.site-footer {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  font-size: 13px;
  color: var(--color-ink-muted);
  text-align: center;
}

main.shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  text-align: center;
  padding-top: 3rem;
  padding-bottom: 6rem;
}

.signup {
  width: 100%;
  max-width: 34rem;
}

h1 {
  font-family: var(--font-sans);
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  max-width: 16em;
  isolation: isolate;
  text-wrap: balance;
}

.marker {
  position: relative;
  white-space: nowrap;
}

.marker::before {
  content: "";
  position: absolute;
  inset: 0.02em -0.14em -0.02em;
  background: var(--color-inset);
  border-radius: 0.18em;
  transform: rotate(-1.2deg);
  z-index: -1;
}

.subheadline {
  font-size: 17px;
  margin-bottom: 2rem;
}

form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 15px;
  border: 1px solid var(--color-ink-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-ink);
  outline: none;
  transition: border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="email"]::placeholder {
  color: var(--color-ink-muted);
}

input[type="email"]:focus {
  border-color: var(--color-ink);
}

button {
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-md);
  background: var(--color-note-orange);
  color: var(--color-ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 350ms cubic-bezier(0.2, 0, 0, 1), color 350ms cubic-bezier(0.2, 0, 0, 1), transform 200ms cubic-bezier(0.2, 0, 0, 1);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:hover,
button:focus-visible {
  background-color: var(--color-ink);
  color: var(--color-paper);
  outline: none;
}

button:disabled {
  background: var(--color-inset);
  border-color: var(--color-inset);
  color: var(--color-ink);
  cursor: default;
}

.fine-print {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-ink-muted);
}

.success {
  display: none;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px dashed var(--color-ink-line);
  border-radius: var(--radius-xl);
}

/* Filter chip: muted pill with an optional colour dot */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 999px;
  background: var(--color-ink-wash);
  color: var(--color-ink-muted);
  text-decoration: none;
  transition: background 150ms cubic-bezier(0.4, 0, 0.2, 1), color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

a.chip:hover,
a.chip:focus-visible {
  background: #1c1b181a;
  color: var(--color-ink);
}

.chip.is-active {
  background: var(--color-ink);
  color: var(--color-paper);
}

.chip-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--note-color, var(--color-inset));
}

/* Note card: flat colour paper, inked inner frame, slightly askew.
   Set --note-color and --note-tilt per card. */
.note {
  position: relative;
  display: block;
  padding: 8px;
  background: var(--note-color, var(--color-note-yellow));
  color: #000;
  text-align: left;
  text-decoration: none;
  transform: rotate(var(--note-tilt, -1deg));
}

.note::before,
.note::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 80%;
  bottom: 16px;
  width: 50%;
  box-shadow: var(--shadow-corner);
}

.note::before {
  left: 8px;
  transform: rotate(-3deg);
}

.note::after {
  right: 8px;
  transform: rotate(3deg);
}

.note-frame {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 12px;
  border: 1px solid var(--color-note-line);
  background: var(--note-color, var(--color-note-yellow));
}

.note-tag {
  align-self: flex-start;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--color-note-line);
  border-radius: 999px;
}

.note-title {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.note-rule {
  border: 0;
  border-top: 1px dashed #000;
}

.note-body {
  font-family: var(--font-decorative);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0.9;
  transform: rotate(1deg);
}

.note-meta {
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 820px) {
  main.shell {
    padding-top: 2rem;
    padding-bottom: 4rem;
  }
}

@media (max-width: 480px) {
  form {
    flex-direction: column;
  }
}

/* Article page: single reading column */
main.shell.article {
  display: grid;
  align-items: start;
  text-align: left;
  grid-template-columns: minmax(0, 42rem);
  justify-content: center;
  padding-top: 3rem;
  padding-bottom: 6rem;
}

.article h1 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.25;
  max-width: none;
}

.article-lede {
  margin-top: 0.75rem;
  font-size: 17px;
  color: var(--color-ink-muted);
}

.prose {
  margin-top: 3rem;
  font-family: var(--font-sans);
  font-size: clamp(1.0625rem, 0.6vw + 0.95rem, 1.3rem);
  line-height: 1.625;
}

.prose > * + * {
  margin-top: 1.75em;
}

.prose h2 {
  margin-top: 3.5em;
  font-size: 1.4em;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  scroll-margin-top: 2rem;
}

.prose h2 + * {
  margin-top: 0.75em;
}

.prose blockquote {
  padding-left: 1.25rem;
  border-left: 2px dotted var(--color-ink-muted);
  max-width: 26em;
}

.prose blockquote footer {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-ink-muted);
}

.prose a {
  color: inherit;
  text-underline-offset: 4px;
}

.prose ul {
  padding-left: 1.25em;
}

.prose .timeline {
  list-style: none;
  padding-left: 1.25rem;
  border-left: 2px dotted var(--color-ink-muted);
}

.prose li + li {
  margin-top: 0.5em;
}

.prose figure {
  margin-top: 3em;
  margin-bottom: 3em;
}

.prose figcaption {
  margin-top: 2rem;
  font-size: 13px;
  color: var(--color-ink-muted);
}
