/* Kate Keeps Growing
   Layout: ink-drawing banner, a grid of picture cards for garden pages, a quiet list of retired experiments.
   Pages without a cover photo get a stipple-dot band (a nod to stipple-shaded tattoo work). */
:root {
  --paper: #fbfbf8;
  --paper-2: #f0f2ec;
  --ink: #1f231f;
  --ink-soft: #5c635a;
  --rule: #dfe2da;
  --leaf: #3d6a47;
  --leaf-wash: #e3ece2;
  --dot: rgba(31, 35, 31, 0.22);
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 4px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151815; --paper-2: #1c201c; --ink: #e5e8e1; --ink-soft: #a3aa9f; --rule: #2e332d;
    --leaf: #93c39b; --leaf-wash: #1f2b21; --dot: rgba(229, 232, 225, 0.2); color-scheme: dark;
  }
  .home-cover { filter: invert(0.88) hue-rotate(180deg); }
}

* { 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.6;
}
img { max-width: 100%; height: auto; }

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.wrap.wide { max-width: 68rem; }

a { color: var(--leaf); text-decoration-thickness: 1px; text-underline-offset: 0.18em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 { font-weight: 400; text-wrap: balance; line-height: 1.15; }
.kind {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--leaf);
}

/* ---------- stipple pattern, shared ---------- */
.hero-stipple, .thumb-stipple {
  background-color: var(--leaf-wash);
  background-image:
    radial-gradient(var(--dot) 1.1px, transparent 1.6px),
    radial-gradient(var(--dot) 1.1px, transparent 1.6px);
  background-size: 9px 9px, 9px 9px;
  background-position: 0 0, 4.5px 4.5px;
}

/* ---------- home ---------- */
.home-hero { position: relative; }
.home-cover {
  height: clamp(13rem, 38vw, 24rem);
  background-size: cover;
  background-position: center 0%;
}
.home-title {
  position: relative;
  margin-top: clamp(-4.5rem, -6vw, -2.5rem);
}
.home-title h1 {
  display: inline-block;
  margin: 0;
  padding: 0.6rem 1.25rem 0.5rem 0;
  background: var(--paper);
  font-family: var(--display);
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  letter-spacing: -0.01em;
}
.tagline { margin: 0.25rem 0 0; font-style: italic; color: var(--ink-soft); font-size: 1.35rem; }

.cards {
  list-style: none; padding: 0; margin: 2.75rem 0 0;
  display: grid; gap: 2.25rem 1.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}
.card a { display: flex; flex-direction: column; gap: 0.9rem; color: var(--ink); text-decoration: none; height: 100%; }
.thumb {
  position: relative; display: block; aspect-ratio: 4 / 3; max-width: 100%;
  border-radius: var(--radius); overflow: hidden;
  background-size: cover; background-position: center;
  transition: transform 0.25s ease;
}
.thumb-letter {
  position: absolute; left: 1.1rem; bottom: 0.2rem;
  font-family: var(--display); font-size: 6rem; line-height: 1; color: var(--leaf); opacity: 0.85;
}
.card a:hover .thumb { transform: translateY(-3px); }
.card-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.card-title { font-family: var(--display); font-size: 1.5rem; line-height: 1.2; }
.card a:hover .card-title { color: var(--leaf); }
.card-summary { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.5; }

.retired-list { margin: 4.5rem 0 3rem; max-width: 42rem; }
.section-label {
  font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--ink-soft); margin: 0 0 0.6rem;
}
.retired-list ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.retired-list li { border-bottom: 1px solid var(--rule); }
.retired-list a {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0.25rem 1rem; padding: 0.85rem 0.1rem; color: var(--ink-soft); text-decoration: none;
}
.retired-list .t { font-family: var(--display); font-size: 1.15rem; }
.retired-list .k { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.retired-list a:hover .t { color: var(--leaf); }

/* ---------- inner pages ---------- */
.hero { height: clamp(8rem, 24vw, 15rem); }
.hero-img { height: 100%; background-size: cover; background-position: center; }
main.wrap { padding-block: 1.5rem 3.5rem; }
.crumb { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0.5rem; }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:first-child::before { content: "← "; }
.crumb a:hover { color: var(--leaf); }
.page-head { margin-block: 1.75rem 2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.page-head h1 { font-family: var(--display); font-size: clamp(2.2rem, 6vw, 3.2rem); margin: 0; }
.dek { margin: 0; font-size: 1.3rem; font-style: italic; color: var(--ink-soft); line-height: 1.45; }

.retired {
  background: var(--paper-2);
  border-left: 3px solid var(--leaf);
  padding: 0.85rem 1.1rem;
  margin: 0 0 2rem;
  font-style: italic;
  color: var(--ink-soft);
}

.prose h2 { font-family: var(--display); font-size: 1.55rem; margin: 2.75rem 0 0.75rem; }
.prose h3 { font-family: var(--display); font-size: 1.25rem; margin: 2rem 0 0.5rem; }
.prose h4 { font-family: var(--body); font-weight: 600; font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--leaf); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.prose del, .prose s { color: var(--ink-soft); }
.prose img { display: block; border-radius: var(--radius); margin: 1.75rem 0; }
.prose img[alt^="Portrait"] { max-width: 16rem; }
.prose a[href$=".pdf"]::before { content: "↓ "; display: inline-block; text-decoration: none; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1.1rem; border-left: 3px solid var(--rule); font-style: italic; color: var(--ink-soft); }
.prose .katex-display { overflow-x: auto; overflow-y: hidden; }

.video { margin: 2rem 0; }
.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radius); background: var(--paper-2); }

.gallery {
  display: grid; gap: 0.75rem; margin: 2rem 0;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
}
.gallery a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.gallery a:hover img { transform: scale(1.03); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); padding-block: 1.5rem 2.5rem; font-family: var(--mono); font-size: 0.8rem; }
.foot .wrap { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.home .foot .wrap { max-width: 68rem; }
.foot a { color: var(--ink-soft); }

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

/* keep the stipple dots small on cards (the generic .thumb rule sets cover sizing) */
.thumb.thumb-stipple { background-size: 9px 9px, 9px 9px; }
