:root {
  --color-paper: #faf8f4;
  --color-ink: #1a1a18;
  --color-accent: #5c4c3a;
  --color-faint: #746c64;
  --color-rule: rgba(26, 26, 24, 0.18);
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-paper: #141311;
    --color-ink: #f3ede4;
    --color-accent: #d4c4ab;
    --color-faint: #9c9288;
    --color-rule: rgba(243, 237, 228, 0.2);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { background: var(--color-paper); }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

.page {
  width: 100%;
  max-width: 42.5rem;
  margin-inline: auto;
  padding: 2.75rem 1rem 4.5rem;
}

.name {
  margin: 0 0 0.7rem;
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 6vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.lede {
  margin: 0 0 0.6rem;
  max-width: 38rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.45;
}

.lede:last-child { margin-bottom: 0; }

.note-name {
  margin: 0.6rem 0 1.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 5vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-title {
  margin: 2.5rem 0 0.85rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

#read .section-title { margin-top: 2rem; }

.meta, .greeting {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-faint);
}

.greeting {
  margin: 0 0 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cup {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  width: 24px;
  height: 24px;
  color: var(--color-ink);
  pointer-events: none;
}

.cup svg { position: relative; display: block; }

.cup-bowl {
  position: absolute;
  left: 6px;
  top: 7px;
  width: 10px;
  height: 11.5px;
  overflow: hidden;
  border-bottom-left-radius: 3.5px;
  border-bottom-right-radius: 3.5px;
}

.cup-liquid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: currentColor;
}

@keyframes cup-fill {
  from { height: 0%; }
  to { height: 100%; }
}

@supports (animation-timeline: scroll()) {
  .cup-liquid {
    animation: cup-fill linear both;
    animation-timeline: scroll(root block);
  }
}

.post-feature {
  padding: 0.25rem 0 1.25rem;
  border-top: 1px solid var(--color-ink);
}

.post-title {
  display: block;
  margin: 0.4rem 0 0.65rem;
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--color-ink);
  text-decoration: none;
}

a.post-title:hover { color: var(--color-accent); }

.post-feature .post-title {
  font-size: 1.625rem;
  line-height: 1.2;
  margin: 0 0 0.55rem;
}

.post-row, .note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: baseline;
  min-height: 48px;
  padding: 0.7rem 0;
  border-top: 1px solid var(--color-rule);
  color: inherit;
  text-decoration: none;
}

.post-row .post-title, .note-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  letter-spacing: -0.01em;
}

#post-list .post-row:last-child,
.note-row:last-child {
  border-bottom: 1px solid var(--color-rule);
}

.note-row:hover .note-title { color: var(--color-accent); }

.post-excerpt, .note-body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.post-excerpt p {
  margin: 0;
}

.post-excerpt p + p {
  margin-top: 0.9rem;
}

.note-body p { margin: 0 0 0.9rem; }

.all-posts, .continue, .footer a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--color-accent);
  text-decoration: none;
}

.all-posts, .continue { margin-top: 0.5rem; }

.all-posts:hover, .continue:hover, .footer a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.subscribe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.field, .area {
  width: 100%;
  border: 1px solid var(--color-ink);
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  padding: 0.75rem 0.85rem;
  border-radius: 0;
}

.field { min-height: 48px; flex: 1 1 12rem; }

.area { min-height: 9.5rem; resize: vertical; }

.field::placeholder, .area::placeholder { color: var(--color-faint); }

form .field, form .area, form .send { margin-top: 0.6rem; }

.subscribe .field, .subscribe .send { margin-top: 0; }

.send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 0.6rem;
  border: 1px solid var(--color-ink);
  background: var(--color-ink);
  color: var(--color-paper);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0 1.15rem;
  text-decoration: none;
}

.send:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-faint);
}

.form-error, .privacy, .sent { margin: 0.75rem 0 0; }

.sent { font-family: var(--font-serif); font-size: 1.5rem; }

.privacy, .advice, .copy, .been-label {
  color: var(--color-faint);
}

.privacy { font-size: 0.9rem; }

.advice, .copy, .been-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.advice { margin-top: 2rem; }

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.back {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: calc(100% + 2rem);
  min-height: 48px;
  margin: 0 -1rem 0.5rem;
  padding: 0.25rem 1rem;
  background: var(--color-paper);
  color: var(--color-ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.125rem;
}

.footer {
  margin-top: 4.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-rule);
}

.been {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin: 0;
}

.been-label { letter-spacing: 0.06em; }

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flags li {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  line-height: 1;
}

.flag {
  display: block;
  width: 18px;
  height: auto;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 24, 0.18);
}

.flag-code {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--color-faint);
}

.copy { margin: 0.25rem 0 0; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

h1.lede {
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
}

.lede a,
.talk {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.lede a:hover,
.talk:hover {
  color: var(--color-accent);
}

.talk {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 1rem;
}

.post-row .post-excerpt {
  display: block;
  margin-top: 0.35rem;
}

.note-tags {
  display: block;
  margin-top: 0.15rem;
}

#post-list .post-row:last-child,
#note-list .note-row:last-child {
  border-bottom: 1px solid var(--color-rule);
}

/* spacing */
#contact { margin-bottom: 2.25rem; }
#home > .subscribe { margin-top: 0.75rem; }
#home > .subscribe + .lede { margin-top: 2rem; }
#posts > .lede { margin: 2.5rem 0 0.75rem; }
#posts > .subscribe { margin-top: 0; }
