/* Uskeep blog, direction "Front door": the Worker-rendered /blog pages (src/worker/blog/render.ts).
 * A quieter room in the same house as uskeep.app: cream canvas, forest ink, Nunito 900 headings,
 * 1px rules, 22px cards, one ink pill button. The coral dot and the heart are the only ornaments.
 * Light theme only. The blog-* class names in render.ts are the contract for this file. */

@font-face {
  font-family: "Uskeep Nunito";
  src: url("/welcome/nunito-variable.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #284b40;
  --ink-hover: #355f51;
  --ink-shadow: #17382e;
  --muted: #52645a;
  --canvas: #fcf9f1;
  --surface: #fffdf7;
  --rule: #d9ddd0;
  --rule-strong: #829078;
  --heart: #e8947d;
  --coral-dot: #c9775e;
  --coral-text: #a14d37;
  --peach: #f6b79b;
  --peach-subtle: #f9e3d5;
  --peach-rule: #efcdb9;
  --mint: #dce8d1;
  --mint-subtle: #e9ede0;
  --butter: #f5e9b8;
  --focus: #a44830;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --gutter: clamp(16px, 4.2vw, 54px);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

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

body.blog {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 500 17px/1.6 "Uskeep Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: anywhere;
}
/* Zero-specificity resets, so every component rule below wins without !important. */
:where(.blog) :where(h1, h2, h3, p, ol, ul) {
  margin: 0;
}
:where(.blog) a {
  color: inherit;
}
:where(.blog) strong {
  font-weight: 850;
}
.blog :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 6px;
}

.blog-skip {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 5;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.blog-skip:focus {
  top: 12px;
}

/* ---------- Header ---------- */
.blog-header,
.blog-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.blog-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 88px;
  border-bottom: 1px solid var(--rule);
}
.blog-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  text-decoration: none;
}
.blog-brand__mark {
  width: 29px;
  height: 34px;
  flex: 0 0 auto;
}
.blog-brand__name {
  font-size: 31px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
}
.blog-brand__dot {
  color: var(--coral-dot);
}
.blog-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 750;
}
.blog-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.blog-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.blog-nav a[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--coral-dot);
  text-decoration-thickness: 3px;
  text-underline-offset: 7px;
}

.blog-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf1;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--ink-shadow);
  transition: transform 140ms, box-shadow 140ms, background 140ms;
}
.blog-button:hover {
  background: var(--ink-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--ink-shadow);
}
.blog-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink-shadow);
}

/* ---------- Footer ---------- */
.blog-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}
.blog-footer__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.blog-footer .blog-brand {
  color: var(--ink);
}
.blog-footer .blog-brand__name {
  font-size: 24px;
  letter-spacing: -1px;
}
.blog-footer .blog-brand__mark {
  width: 23px;
  height: 27px;
}
.blog-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  padding: 0;
  list-style: none;
  font-weight: 700;
}
.blog-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.blog-footer__nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* ---------- Shared ---------- */
.blog-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--gutter) 72px;
}
/* The eyebrow: "DATE · N MIN READ", with coral dots between the parts. */
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
.blog-eyebrow {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--coral-text);
}
.blog-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral-dot);
}
.blog-lede {
  max-width: 34em;
  font-size: 19px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Index ---------- */
.blog-intro {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 64px 0 40px;
}
.blog-intro__badge {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: var(--peach-subtle);
  transform: rotate(-5deg);
}
.blog-intro__mark {
  width: 40px;
  height: 44px;
  transform: rotate(5deg);
}
.blog-intro h1 {
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.blog-intro .blog-lede {
  margin-top: 12px;
}

.blog-list {
  display: grid;
  gap: 20px;
  padding: 0;
  list-style: none;
}
.blog-empty {
  color: var(--muted);
}

/* A post card: the title link covers the whole card, so the card is one tap target without JavaScript. */
.blog-card {
  position: relative;
  height: 100%;
  padding: 32px 36px 34px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  transition: border-color 140ms, transform 140ms;
}
.blog-card:hover {
  border-color: var(--rule-strong);
  transform: translateY(-2px);
}
.blog-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--coral-text);
}
.blog-pin svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.blog-card--latest {
  padding-top: 40px;
  padding-bottom: 42px;
  background: var(--peach-subtle);
  border-color: var(--peach-rule);
}
.blog-card__title {
  margin: 14px 0 10px;
  font-size: clamp(25px, 3.4vw, 33px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.blog-card--latest .blog-card__title {
  font-size: clamp(30px, 4.4vw, 44px);
}
.blog-card__title a {
  text-decoration: none;
}
.blog-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
}
.blog-card__title a:focus-visible {
  outline: none;
}
.blog-card__title a:focus-visible::after {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
.blog-card__description {
  max-width: 38em;
  font-weight: 600;
  color: var(--muted);
}
.blog-card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 850;
}
.blog-card__more span {
  font-size: 19px;
  line-height: 1;
  transition: transform 140ms;
}
.blog-card:hover .blog-card__more span {
  transform: translateX(3px);
}

/* ---------- Post ---------- */
.blog-back {
  margin-top: 28px;
}
.blog-back a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}
.blog-back a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.blog-post__header {
  margin-bottom: 40px;
  padding: 28px 0 40px;
  border-bottom: 1px solid var(--rule);
}
.blog-post__header h1 {
  margin: 16px 0;
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.05em;
}
.blog-post__header .blog-lede {
  max-width: 30em;
  font-size: clamp(19px, 2.4vw, 22px);
  line-height: 1.5;
}
/* Byline, tags and the Markdown link: one quiet line under the post. */
.blog-post__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  max-width: 68ch;
  margin-top: 44px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.blog-post__byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.blog-post__footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration-color: var(--coral-dot);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.blog-tag {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--mint-subtle);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

/* ---------- Post body ---------- */
.blog-prose {
  max-width: 68ch;
  font-size: 18px;
  line-height: 1.72;
  font-weight: 550;
}
.blog-prose > * + * {
  margin-top: 1.1em;
}
.blog-prose h2 {
  margin-top: 2.3em;
  font-size: clamp(23px, 3vw, 27px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.blog-prose h3 {
  margin-top: 1.8em;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.blog-prose h2 + *,
.blog-prose h3 + * {
  margin-top: 0.6em;
}
.blog-prose h2,
.blog-prose h3 {
  scroll-margin-top: 24px;
}
.blog-prose a {
  font-weight: 750;
  text-decoration-color: var(--coral-dot);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.blog-prose a:hover {
  text-decoration-color: var(--ink);
}
/* Headings link to themselves; they read as headings, not links. */
.blog-prose .blog-anchor {
  font-weight: inherit;
  text-decoration: none;
}
.blog-prose .blog-anchor:hover {
  text-decoration: underline;
  text-decoration-color: var(--coral-dot);
}
.blog-prose ul {
  padding: 0;
  list-style: none;
}
.blog-prose ul > li {
  position: relative;
  padding-left: 26px;
}
.blog-prose ul > li + li {
  margin-top: 12px;
}
.blog-prose ul > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.66em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral-dot);
}
/* Numbered steps sit on small tilted tiles: peach, butter, mint. */
.blog-prose ol {
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.blog-prose ol > li {
  position: relative;
  padding-left: 46px;
  counter-increment: step;
}
.blog-prose ol > li + li {
  margin-top: 14px;
}
.blog-prose ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px 10px 12px 7px;
  background: var(--peach-subtle);
  font-size: 15px;
  font-weight: 900;
  transform: rotate(-5deg);
}
.blog-prose ol > li:nth-child(3n + 2)::before {
  background: var(--butter);
  transform: rotate(5deg);
}
.blog-prose ol > li:nth-child(3n)::before {
  background: var(--mint);
  transform: rotate(-3deg);
}
.blog-prose li > ul,
.blog-prose li > ol {
  margin-top: 10px;
}
.blog-prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 16px 20px;
  border-left: 4px solid var(--peach);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--peach-subtle);
}
.blog-prose blockquote > * + * {
  margin-top: 0.8em;
}
.blog-prose code {
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--mint-subtle);
  font: 600 0.88em var(--mono);
}
.blog-prose pre {
  margin-left: 0;
  margin-right: 0;
  padding: 16px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--mint-subtle);
  overflow-x: auto;
  line-height: 1.5;
}
.blog-prose pre code {
  padding: 0;
  background: none;
}
.blog-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
}
.blog-prose hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--rule);
}
.blog-prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
}
.blog-prose th,
.blog-prose td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

/* Heart divider: a quiet rule with the brand heart in the middle. */
.blog-heart {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 56px 0;
  color: var(--heart);
}
.blog-heart::before,
.blog-heart::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}
.blog-heart svg {
  width: 22px;
  height: 20px;
}

/* ---------- Keep reading ---------- */
.blog-more h2 {
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
/* Two cards side by side; a single neighbour takes the full width. */
.blog-more__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin-top: 16px;
  padding: 0;
  list-style: none;
}
.blog-card--compact {
  padding: 24px 26px 26px;
}
.blog-card--compact .blog-card__title {
  margin: 10px 0 0;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ---------- 404 ---------- */
.blog-missing {
  padding: 64px 0 24px;
}
.blog-missing h1 {
  margin: 12px 0;
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.blog-missing p:last-child {
  margin-top: 28px;
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .blog-header__inner {
    flex-wrap: wrap;
    gap: 0 12px;
    min-height: 0;
    padding-top: 14px;
  }
  .blog-header .blog-button {
    margin-left: auto;
  }
  .blog-nav {
    order: 3;
    width: 100%;
    margin: 4px 0 6px;
    gap: 22px;
  }
  .blog-intro {
    align-items: flex-start;
    gap: 16px;
    padding: 40px 0 28px;
  }
  .blog-intro__badge {
    width: 56px;
    height: 56px;
    margin-top: 6px;
    border-radius: 18px;
  }
  .blog-intro__mark {
    width: 30px;
    height: 33px;
  }
  .blog-card,
  .blog-card--latest {
    padding: 24px 22px 26px;
  }
  .blog-card--compact {
    padding: 22px 22px 24px;
  }
  .blog-heart {
    margin: 44px 0;
  }
  .blog-prose {
    font-size: 17px;
  }
  .blog-missing {
    padding-top: 40px;
  }
  .blog-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
@media (max-width: 400px) {
  .blog-brand {
    gap: 5px;
  }
  .blog-brand__name {
    font-size: 26px;
  }
  .blog-brand__mark {
    width: 24px;
    height: 28px;
  }
  .blog-header .blog-button {
    padding: 0 14px;
    font-size: 13.5px;
  }
  .blog-intro__badge {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .blog *,
  .blog *::before,
  .blog *::after {
    transition: none !important;
  }
  .blog-card:hover {
    transform: none;
  }
}
