/* ============================================================
   jackxu.com — Notes (blog) styles
   Index list (3 switchable layouts) + article reading page.
   Extends site.css — same tokens, same editorial system.
============================================================ */

/* ---------- Index hero (mirrors work.html philosophy header) ---------- */
.notes-hero {
  min-height: auto;
  padding-top: calc(var(--head-h) + clamp(56px, 11vh, 140px));
  padding-bottom: 0;
}

/* ---------- Book-fan motif (book.js) — /notes header emblem ---------- */
.book-fan {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto clamp(8px, 3vh, 28px);
  aspect-ratio: 2.7 / 1;
}
.book-fan canvas { display: block; width: 100%; height: auto; background: transparent; }

/* ---------- Post grid — featured lead + square cards ---------- */
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 1.6vw, 22px); }
.post-dot { color: var(--line-2); }

.note-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: clamp(26px, 2.4vw, 38px);
  transition: background .22s ease, border-color .22s ease, transform .22s ease;
}
.note-card:hover { background: var(--paper-2); border-color: var(--line-2); transform: translateY(-2px); }

.nc-top { font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em; color: var(--ink-3); display: inline-flex; gap: 8px; align-items: baseline; }
.nc-title { font-weight: 400; letter-spacing: -0.012em; line-height: 1.12; margin: 18px 0 0; text-wrap: pretty; }
.nc-ex { color: var(--ink-2); line-height: 1.5; margin: 14px 0 0; text-wrap: pretty; }
.nc-read { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-top: auto; padding-top: 26px; display: inline-flex; gap: 8px; transition: color .2s ease; }
.note-card:hover .nc-read { color: var(--chestnut); }
.nc-rarr { transition: transform .2s ease; }
.note-card:hover .nc-rarr { transform: translate(2px, -2px); }

/* square entries */
.note-card.is-square { aspect-ratio: 1 / 1; }
.note-card.is-square .nc-title { font-size: clamp(1.5rem, 2vw, 1.95rem); }
.note-card.is-square .nc-ex { font-size: 1.04rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* featured lead — spans full width */
.note-card.is-feature { grid-column: 1 / -1; padding: clamp(32px, 3.2vw, 56px); }
.note-card.is-feature .nc-title { font-size: clamp(2.1rem, 3.6vw, 3.2rem); max-width: 18ch; }
.note-card.is-feature .nc-ex { font-size: clamp(1.18rem, 1.5vw, 1.42rem); max-width: 50ch; }

.notes-empty { color: var(--ink-3); padding: 40px 0; }

/* Empty state — playful "thinking" placeholder while notes are in the works */
.notes-brewing {
  font-family: var(--mono);
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  letter-spacing: 0.04em;
  color: var(--ink-3);
  display: inline-flex;
  align-items: baseline;
  margin: 0;
}
.notes-brewing .brew-dots { display: inline-flex; }
.notes-brewing .brew-dots span { animation: brew-pulse 1.4s infinite both; }
.notes-brewing .brew-dots span:nth-child(2) { animation-delay: 0.2s; }
.notes-brewing .brew-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes brew-pulse {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; color: var(--chestnut); }
}
@media (prefers-reduced-motion: reduce) {
  .notes-brewing .brew-dots span { animation: none; opacity: 0.5; }
}

/* ============================================================
   Article reading page
============================================================ */
.article {
  padding-top: calc(var(--head-h) + clamp(40px, 7vh, 86px));
  padding-bottom: clamp(60px, 10vh, 120px);
}
.article-wrap { max-width: 740px; margin-inline: auto; }

.article-back {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(30px, 5vh, 56px);
  transition: color .2s ease;
}
.article-back:hover { color: var(--chestnut); }
.article-back .ar-back { transition: transform .25s ease; }
.article-back:hover .ar-back { transform: translateX(-3px); }

.article-meta {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 20px;
}
.article-title {
  font-size: clamp(2.3rem, 5.2vw, 3.9rem);
  line-height: 1.05;
  letter-spacing: -0.018em;
  font-weight: 400;
  margin: 0 0 clamp(32px, 5.5vh, 58px);
  max-width: 20ch;
  text-wrap: pretty;
}

.article-body { font-size: clamp(1.18rem, 1.55vw, 1.34rem); line-height: 1.66; color: var(--ink); }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.15em; max-width: none; text-wrap: pretty; }
.article-body h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  line-height: 1.16;
  letter-spacing: -0.012em;
  font-weight: 400;
  margin: 1.8em 0 0.5em;
}
.article-body h3 { font-size: 1.4rem; font-weight: 400; margin: 1.5em 0 0.4em; }
/* Instrument Serif ships a single weight — render emphasis as chestnut, not faux-bold */
.article-body strong { font-weight: 400; color: var(--chestnut); }
.article-body em { font-style: italic; }
.article-body a {
  color: var(--chestnut);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-2);
  transition: text-decoration-color .2s ease;
}
.article-body a:hover { text-decoration-color: var(--chestnut); }
.article-body blockquote {
  margin: 1.5em 0;
  padding-left: 26px;
  border-left: 2px solid var(--chestnut);
  font-style: italic;
  color: var(--ink-2);
}
.article-body ul, .article-body ol { padding-left: 1.2em; margin: 0 0 1.15em; }
.article-body li { margin: 0.35em 0; padding-left: 0.2em; }
.article-body li::marker { color: var(--ink-3); }
.article-body hr.rule { margin: 2em 0; }
.article-body code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 3px;
}
.article-body pre {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 18px 20px;
  overflow: auto;
  margin: 1.4em 0;
}
.article-body pre code { background: none; padding: 0; font-size: 0.86rem; line-height: 1.55; }

/* prev / next */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(54px, 8vh, 92px);
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.article-nav a { display: block; max-width: 46%; }
.article-nav a.an-next { text-align: right; margin-left: auto; }
.an-dir {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.an-title { font-size: 1.2rem; line-height: 1.2; color: var(--ink); transition: color .2s ease; }
.article-nav a:hover .an-title { color: var(--chestnut); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .notes-grid { grid-template-columns: 1fr; }
  .note-card.is-square { aspect-ratio: auto; }
}
