/* ======================================================================
   Spoonerisms Galore
   quirky · vintage · warm — digital-garden, archival, well-typeset
   ====================================================================== */

/* ----- design tokens ----- */
:root {
  /* warm cream paper, slightly tinted toward terracotta brand hue */
  --bg:        oklch(0.972 0.012 75);
  --bg-soft:   oklch(0.935 0.020 75);
  --bg-deep:   oklch(0.890 0.024 70);

  /* ink: warm dark, never pure black. ink-faint clears 4.5:1 on --bg */
  --ink:       oklch(0.230 0.018 50);
  --ink-soft:  oklch(0.420 0.018 50);
  --ink-faint: oklch(0.490 0.024 60);

  /* hairlines tinted toward the same hue */
  --rule:      oklch(0.860 0.020 65);
  --rule-soft: oklch(0.910 0.016 70);

  /* single warm accent — terracotta/rust */
  --accent:        oklch(0.520 0.150 38);
  --accent-soft:   oklch(0.620 0.110 38);
  --accent-tint:   oklch(0.940 0.040 50);

  /* type families — none from the AI-tell list */
  --serif:   "Spectral", "Iowan Old Style", "Charter", Georgia, serif;
  --display: "Gloock", "Spectral", Georgia, serif;
  --sans:    "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* spacing — 4pt scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --measure: 64ch;
  --measure-wide: 72ch;
  --gutter: clamp(20px, 4vw, 40px);

  /* radius — book-page corners, slabs, pills */
  --radius-tight: 2px;
  --radius-soft:  4px;
  --radius-pill:  999px;

  /* type scale — fluid for marketing surfaces, generous ratio */
  --fs-xs:   0.78rem;
  --fs-sm:   0.92rem;
  --fs-base: 1.0625rem;          /* 17px */
  --fs-md:   1.25rem;
  --fs-lg:   clamp(1.4rem, 1.1rem + 1.2vw, 1.7rem);
  --fs-xl:   clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --fs-2xl:  clamp(2.4rem, 1.6rem + 3.4vw, 3.75rem);
  --fs-3xl:  clamp(3rem, 2rem + 4.5vw, 5rem);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-base);
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "onum";  /* oldstyle figures throughout */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;  /* prevents 1-2px scroll from negative side margins */
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.12s ease;
}

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

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

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

/* skip link — visible only when focused via keyboard */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 8px;
  z-index: 100;
  transform: translateY(-200%);
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-soft);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ----- layout primitives ----- */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

main {
  flex: 1;
  padding-block: clamp(32px, 6vw, 64px);
}

/* ----- header ----- */
.site-header {
  border-bottom: 1px solid var(--rule-soft);
  padding-block: var(--s-4);
  font-family: var(--sans);
  font-size: var(--fs-sm);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: 6px 0;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.005em;
  text-decoration: none;
  color: var(--ink);
}

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

.site-logo {
  width: 32px;
  height: 32px;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  color: var(--ink-soft);
  font-weight: 500;
}

.site-nav a {
  color: inherit;
  text-decoration: none;
}

.site-nav a:hover { color: var(--accent); }

/* ----- footer ----- */
.site-footer {
  border-top: 1px solid var(--rule-soft);
  padding-block: var(--s-6);
  margin-top: var(--s-9);
  font-family: var(--sans);
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  text-align: center;
}

/* ----- HOMEPAGE ----- */

/* hero with banner + title in display face */
.home-hero {
  text-align: center;
  margin: var(--s-5) 0 var(--s-7);
}

.home-banner {
  width: 220px;
  height: 220px;
  margin: 0 auto var(--s-5);
  filter: drop-shadow(0 12px 28px oklch(0.4 0.05 50 / 0.16));
}

.home-title {
  font-family: var(--display);
  font-size: var(--fs-3xl);
  line-height: 0.95;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-3);
  color: var(--ink);
}

.home-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-md);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 38ch;
  margin: 0 auto;
}

/* dictionary-style definition (dl/dt/dd) */
.definition {
  margin: var(--s-7) auto;
  padding: var(--s-5) var(--s-6);
  background: var(--bg-soft);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-soft);  /* book-page corners, not pillowy */
  max-width: 56ch;
}

.definition-word {
  font-family: var(--display);
  font-size: var(--fs-lg);
  margin: 0 0 var(--s-2);
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}

.definition-pos {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-base);
  color: var(--ink-faint);
}

.definition-body {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--fs-base);
  line-height: 1.6;
  border: 0;
  padding: 0;
}

.definition-body cite {
  display: block;
  margin-top: var(--s-3);
  font-size: var(--fs-xs);
  font-style: italic;
  color: var(--ink-faint);
  font-family: var(--serif);
}

/* top spine noonerisms — old-style numerals as a feature */
.top-list {
  margin: var(--s-7) auto;
  max-width: 56ch;
}

.top-list-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-4) var(--s-5);
  counter-reset: spoon;
}

.top-list-items li {
  font-family: var(--serif);
  font-size: var(--fs-base);
  counter-increment: spoon;
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: var(--s-2);
}

.top-list-items li::before {
  content: counter(spoon) / "";
  font-family: var(--display);
  font-size: 1.15em;
  color: var(--accent);
  line-height: 1;
  font-feature-settings: "onum";
  min-width: 1.4em;
}

/* directory of posts */
.section-heading {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: var(--s-7) 0 var(--s-5);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--rule);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.section-heading::after {
  content: "";
  flex: 1;
  height: 0;
}

.directory { margin-bottom: var(--s-7); }

.category {
  margin-bottom: var(--s-7);
  scroll-margin-top: var(--s-5);
}

.category-label {
  font-family: var(--display);
  font-size: var(--fs-xl);
  letter-spacing: -0.005em;
  margin: 0 0 var(--s-4);
  color: var(--ink);
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24ch), 1fr));
  gap: var(--s-2) var(--s-5);
}

.category-list li {
  font-family: var(--serif);
  font-size: var(--fs-base);
  line-height: 1.4;
}

.category-list a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-origin: content-box;
  transition: background-size 0.2s ease, color 0.15s ease;
}

.category-list a:hover {
  color: var(--accent);
  background-size: 100% 1px;
}

/* external links — small, polite */
.external {
  margin: var(--s-7) 0 0;
}

.external-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.external-list a {
  display: inline-block;
  padding: 10px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-base);
  color: var(--ink-soft);
  text-decoration-color: var(--rule);
}

.external-list a::after {
  content: " ↗" / "";
  font-style: normal;
  color: var(--ink-faint);
  font-size: 0.85em;
}

.external-list a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ----- POST PAGE ----- */
.post { --measure: 64ch; }

.post-header {
  margin-bottom: var(--s-7);
}

.post-meta {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 var(--s-4);
}

.post-meta a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  display: inline-block;
}

.post-meta a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.post-title {
  font-family: var(--display);
  font-size: var(--fs-2xl);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

.post-excerpt {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: var(--s-4) 0 0;
  max-width: 52ch;
}

/* feature image — wider than text column, soft sepia warmth */
.post-feature {
  margin: 0 calc(var(--gutter) * -0.5) var(--s-7);
}

.post-feature img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-tight);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
}

/* prose */
.post-body {
  font-size: var(--fs-base);
  line-height: 1.78;
  color: var(--ink);
}

.post-body > * + * { margin-top: 1.1em; }
.post-body > p + p { margin-top: 1.4em; }

/* drop cap on the very first paragraph of the body */
.post-body > p:first-of-type::first-letter {
  font-family: var(--display);
  font-size: 4.5em;
  float: left;
  line-height: 0.85;
  margin: 0.06em 0.08em 0 0;
  color: var(--accent);
  font-feature-settings: "lnum";
}

.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: var(--display);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-top: 2.2em;
  margin-bottom: 0.4em;
  color: var(--ink);
}

.post-body h2 { font-size: var(--fs-xl); }
.post-body h3 { font-size: var(--fs-lg); }
.post-body h4 { font-size: var(--fs-md); }

.post-body a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: oklch(from var(--accent) l c h / 0.4);
}

.post-body a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

.post-body blockquote {
  margin: 1.8em 0 1.8em var(--s-2);
  padding: 0 0 0 var(--s-5);
  font-style: italic;
  color: var(--ink-soft);
  position: relative;
}

.post-body blockquote::before {
  content: "“" / "";
  position: absolute;
  left: -0.05em;
  top: -0.15em;
  font-family: var(--display);
  font-size: 3em;
  color: var(--accent);
  line-height: 1;
  opacity: 0.4;
}

.post-body code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-tight);
}

.post-body figure { margin: 2em 0; }

.post-body figcaption {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  text-align: center;
  margin-top: 0.5em;
  font-style: italic;
}

.post-body img,
.post-body figure img {
  margin: 2em auto;
  border-radius: var(--radius-tight);
}

.post-body ul,
.post-body ol {
  padding-left: 1.5em;
}

.post-body li + li { margin-top: 0.4em; }

.post-body hr {
  margin: 3em auto;
  border: 0;
  width: 0;
  text-align: center;
  height: auto;
  overflow: visible;
}

.post-body hr::before {
  content: "✶" / "";
  display: block;
  color: var(--accent);
  font-size: 1.1rem;
  letter-spacing: 0.5em;
  font-family: var(--display);
}

/* audio player */
.audio-player {
  margin: 2em 0 2.5em;
  padding: var(--s-4) var(--s-5) var(--s-5);
  background: var(--bg-soft);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-soft);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.audio-player figcaption {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-style: normal;
  text-align: left;
}

.audio-player figcaption::before {
  content: "▸" / "";
  color: var(--accent);
  font-size: 1em;
  line-height: 1;
}

.audio-player audio {
  width: 100%;
  height: 38px;
}

/* Inline note tucked inside the figure (does NOT trigger drop cap) */
.audio-player .audio-note {
  margin: var(--s-1) 0 0;
  font-family: var(--serif);
  font-size: var(--fs-sm);
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* Byline at the end of a post — quiet, right-aligned, italic */
.post-body .post-byline {
  margin-top: var(--s-7);
  text-align: right;
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-sm);
  color: var(--ink-faint);
}

.post-body .post-byline cite {
  font-style: italic;
}

.post-body .post-byline::first-letter {
  font: inherit;
  font-size: inherit;
  color: inherit;
  float: none;
  margin: 0;
}

/* end of post — back to collection */
.post-end {
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--s-3);
}

.share-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 11px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  background: var(--bg);
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.share-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint);
}

/* siblings (more in this category) */
.related {
  margin-top: var(--s-7);
  padding-top: var(--s-6);
}

.related .section-heading {
  margin-top: 0;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24ch), 1fr));
  gap: var(--s-2) var(--s-5);
}

.related-list li {
  font-family: var(--serif);
  font-size: var(--fs-base);
  line-height: 1.4;
}

.related-list a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-origin: content-box;
  transition: background-size 0.2s ease, color 0.15s ease;
}

.related-list a:hover {
  color: var(--accent);
  background-size: 100% 1px;
}

/* ----- search ----- */
.search-toggle {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 10px 18px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.search-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-modal {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh var(--gutter) var(--gutter);
  z-index: 50;
  border: 0;
}

.search-modal[open] { display: flex; }

.search-modal-inner {
  width: 100%;
  max-width: 600px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-soft);
  box-shadow: 0 30px 60px -20px oklch(0.3 0.05 50 / 0.25);
  padding: var(--s-4);
  position: relative;
}

.search-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.search-close:hover,
.search-close:focus-visible {
  color: var(--accent);
  background: var(--bg-soft);
}

/* Pagefind UI variable overrides */
.pagefind-ui {
  --pagefind-ui-primary: var(--accent);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--bg);
  --pagefind-ui-border: var(--rule);
  --pagefind-ui-tag: var(--bg-soft);
  --pagefind-ui-border-radius: 3px;
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-font: var(--sans);
}

/* ----- 404 ----- */
.not-found {
  text-align: center;
  padding-block: var(--s-9);
}

.not-found h1 {
  font-family: var(--display);
  font-size: var(--fs-3xl);
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-4);
}

.not-found p {
  font-family: var(--serif);
  color: var(--ink-soft);
  font-style: italic;
}

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