:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --ink: #1a1008;
  --ink-strong: #100800;
  --muted: rgba(60, 40, 20, 0.55);
  --faint: rgba(60, 40, 20, 0.42);
  --line: rgba(60, 40, 20, 0.12);
  --accent: #1aa0e3;
  --accent-deep: #0b86c7;
  --empty: #efe8db;
  --intent: #b9e5f8;
}

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

body.journal-body {
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
  padding: 0 20px 80px;
}

.post-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 241, 232, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  margin: 0 -20px 48px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.post-nav__back,
.post-nav__link {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 150ms;
}

.post-nav__back:hover,
.post-nav__link:hover { color: var(--accent-deep); }

.journal {
  max-width: 860px;
  margin: 0 auto;
}

.journal-kicker {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

.journal-title {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink-strong);
  margin-bottom: 10px;
}

.journal-lede {
  font-size: 1.08rem;
  line-height: 1.7;
  color: #3a2a1a;
  margin-bottom: 42px;
  max-width: 38em;
}

.journal-lede a { color: var(--accent-deep); }

.output { margin-top: 28px; }

.output-year {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink-strong);
  margin-bottom: 16px;
}

.year-heat-wrap {
  overflow-x: auto;
  margin: 4px 0 10px;
  padding-bottom: 4px;
}

.year-heat {
  display: flex;
  gap: 10px;
  min-width: 720px;
  align-items: flex-end;
}

.year-heat__dows {
  display: grid;
  grid-template-rows: 16px repeat(7, 11px);
  gap: 3px;
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.58rem;
  color: var(--faint);
  line-height: 11px;
  padding-top: 0;
}

.year-heat__grid { flex: 1; }

.year-heat__months,
.year-heat__weeks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 11px;
  gap: 3px;
}

.year-heat__months {
  margin-bottom: 4px;
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.58rem;
  color: var(--faint);
  height: 14px;
}

.year-heat__week {
  display: grid;
  grid-template-rows: repeat(7, 11px);
  gap: 3px;
}

.year-heat__cell {
  width: 11px;
  height: 11px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: var(--empty);
  cursor: pointer;
}

.year-heat__cell.is-out { visibility: hidden; cursor: default; }

.year-heat__cell.is-intent { background: var(--intent); }

.year-heat__cell.is-done { background: var(--accent); }

.year-heat__cell.is-selected { outline: 1px solid var(--ink); outline-offset: 1px; }

.cal-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.62rem;
  color: var(--faint);
  margin-bottom: 0;
}

.heat-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--empty);
  display: inline-block;
}

.heat-swatch.is-intent { background: var(--intent); }
.heat-swatch.is-done { background: var(--accent); }

.cal-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: start;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.cal-split > :first-child {
  padding-right: 28px;
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.month-nav__label {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-strong);
}

.month-nav .book-nav__btn {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  background: none;
  border: 1px solid rgba(60, 40, 20, 0.2);
  border-radius: 3px;
  padding: 2px 9px;
  cursor: pointer;
  color: var(--muted);
}

.day-panel {
  margin-top: 0;
  padding: 0 0 0 28px;
  border-left: 1px solid var(--line);
  min-height: 16rem;
}

.day-panel__title {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-weight: 600;
  margin-bottom: 8px;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-weekdays {
  margin-bottom: 6px;
}

.cal-weekdays span {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
}

.cal-day {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: #f7f3ea;
  border-radius: 8px;
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.78rem;
  color: rgba(60, 40, 20, 0.7);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: transform 120ms, border-color 120ms, background 120ms;
}

.cal-day:hover { transform: translateY(-1px); border-color: var(--accent); }

.cal-day.is-pad {
  border: none;
  background: transparent;
  cursor: default;
}

.cal-day.is-future { opacity: 0.42; }

.cal-day.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.cal-day.is-done {
  background: var(--accent);
  border-color: var(--accent);
  color: #f4fbff;
}

.cal-day.is-intent {
  background: var(--intent);
  border-color: rgba(26, 160, 227, 0.35);
}

.cal-day.is-selected { outline: 2px solid var(--accent); outline-offset: 1px; }

.day-panel h3 {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 1rem;
  margin-bottom: 8px;
}

.day-panel ul {
  padding-left: 1.2em;
  margin: 0 0 12px;
  color: #2d1e0e;
}

.day-panel li { margin-bottom: 0.35em; }

.day-panel p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #3a2a1a;
}

.day-panel a {
  color: var(--accent-deep);
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
}

.post-list { list-style: none; }

.post-list__item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.post-list__item:last-child { border-bottom: 1px solid var(--line); }

.post-list__meta {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}

.post-list__title {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink-strong);
  margin-bottom: 6px;
}

.post-list__item:hover .post-list__title { color: var(--accent-deep); }

.post-list__desc {
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(60, 40, 20, 0.72);
}

.post-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 36px;
}

.post-title {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-strong);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.post-date {
  display: block;
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.post-body {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #231508;
}

.post-body p { margin-bottom: 1.5em; }

.post-body h1,
.post-body h2,
.post-body h3 {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-weight: 600;
  color: var(--ink-strong);
  margin: 2em 0 0.6em;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.post-body h1 { font-size: 1.6rem; }
.post-body h2 { font-size: 1.3rem; }
.post-body h3 { font-size: 1.1rem; }

.post-body a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-color: rgba(26, 160, 227, 0.4);
  text-underline-offset: 3px;
}

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

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

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

.post-body blockquote {
  border-left: 3px solid var(--intent);
  padding-left: 1.2em;
  color: rgba(60, 40, 20, 0.7);
  font-style: italic;
  margin: 1.5em 0;
}

.post-body code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.88em;
  background: rgba(60, 40, 20, 0.07);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-body pre {
  background: #1a120a;
  color: #f0e8d8;
  padding: 1.2em 1.4em;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  font-size: 0.88rem;
  line-height: 1.6;
}

.post-body pre code { background: none; padding: 0; font-size: inherit; }

.post-body img {
  width: 100%;
  border-radius: 6px;
  margin: 0.5em 0 1.5em;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5em 0;
}

.post-loading,
.post-error {
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  color: var(--faint);
  font-style: italic;
  font-size: 0.9rem;
  padding: 80px 0;
  text-align: center;
}

@media (max-width: 600px) {
  body.journal-body { padding: 0 16px 60px; }
  .post-nav { padding-left: 16px; padding-right: 16px; margin: 0 -16px 36px; }
  .cal-split { grid-template-columns: 1fr; }
  .cal-split > :first-child { padding-right: 0; }
  .day-panel { padding: 20px 0 0; border-left: none; border-top: 1px solid var(--line); min-height: 0; }
}
