/* Looking Back — the sample journal. The app's own colours, light and dark,
   around the Library design: Insights, Library and Goals. */

:root {
  --bg: #F3EEE3; --surface: #FAF6EE; --surface-2: #EAE2D3; --surface-3: #E0D5C2;
  --ink: #382129; --ink-2: #49363C; --muted: #6C5960; --faint: #7A676B;
  --accent: #5C2633; --accent-2: #71773E; --gold: #9A7F3A;
  --border: #D6CAB5; --line: #E2D9C8;
  --primary: #E6B451; --primary-ink: #27150E; --primary-hover: #F1C66D;
  --focus: #5C2633;
  --drift: #9A5B2E; --good: #5F6A2F;
  --ledge: linear-gradient(#ded2bc, #eee4d3 27%, #ddd0b9 38%, #d7c9af 80%, #b9a990);
  --serif: "Newsreader", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1B0C0E; --surface: #26131A; --surface-2: #2E181D; --surface-3: #3B2228;
  --ink: #F3EEE3; --ink-2: #E0D4CC; --muted: #C4B5AD; --faint: #B4A19B;
  --accent: #CFC18F; --accent-2: #BFC38F; --gold: #CFC18F;
  --border: #594047; --line: #40272D;
  --focus: #E6B451;
  --drift: #E3A36F; --good: #BFC38F;
  --ledge: linear-gradient(#72604a, #5c4d3c 40%, #483e31);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 50; padding: 10px 14px; background: var(--primary); color: var(--primary-ink); font-weight: 600; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
svg { stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.03em; margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(38px, 5vw, 60px); line-height: 1.02; }
h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; }
h3 { font-size: 24px; line-height: 1.15; }
h1 em, h2 em, h3 em { font-style: italic; color: var(--accent); }
.eyebrow { margin: 0 0 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.fine { margin: 0; font-size: 12px; color: var(--faint); }
.lede { font-size: 17px; line-height: 1.7; color: var(--ink-2); }

.button {
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--border); border-radius: 4px;
  background: transparent; color: var(--ink);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.button:hover { border-color: var(--ink); }
.button svg { width: 15px; height: 15px; }
.button-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.button-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.text-link, .row-link, .back-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.text-link svg, .row-link svg, .back-link svg { width: 15px; height: 15px; transition: transform .2s; }
.text-link:hover svg, .row-link:hover svg, a:hover .row-link svg { transform: translateX(3px); }
.back-link { margin: 0 0 28px; min-height: 44px; color: var(--muted); }
.back-link:hover { color: var(--ink); }
.back-link:hover svg { transform: translateX(-3px); }

/* ---------- frame ---------- */
.sample-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px 22px; flex-wrap: wrap;
  padding: 9px 16px;
  background: var(--accent); color: #F3EEE3;
  font-size: 12.5px; text-align: center;
}
:root[data-theme="dark"] .sample-bar { background: #382129; }
.sample-bar p { margin: 0; }
.sample-bar a { color: #F3EEE3; font-weight: 600; text-underline-offset: 3px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 56px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-brand { justify-self: start; display: block; }
.brand-wordmark { display: block; width: 150px; height: 39px; background: url("/icons/looking-back-wordmark-red-gold.svg") left center / contain no-repeat; }
:root[data-theme="dark"] .brand-wordmark { background-image: url("/icons/looking-back-wordmark-white.svg"); }
.topbar-nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.topbar-nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  font-size: 14px; color: var(--muted); text-decoration: none;
}
.topbar-nav a:hover { color: var(--ink); }
.topbar-nav a[aria-current="page"] { color: var(--ink); }
.topbar-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -13px; height: 2px; background: var(--accent); }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--border); border-radius: 50%; background: transparent; cursor: pointer;
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle:hover { border-color: var(--ink); }

main { display: block; max-width: 1180px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px) 96px; outline: none; }
.view { animation: view-in .35s ease-out both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sample-foot {
  display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 48px) 40px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--faint);
}
.sample-foot nav { display: flex; gap: 20px; }
.sample-foot a { color: var(--muted); text-decoration: none; }
.sample-foot a:hover { color: var(--ink); text-decoration: underline; }
.noscript { text-align: center; padding: 40px 16px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(32px, 5vw, 52px); }
.page-note { margin: 0; text-align: right; font-size: 13px; color: var(--muted); line-height: 1.6; }
.page-note strong { color: var(--ink); font-weight: 500; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: clamp(22px, 3vw, 34px); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.tag { padding: 3px 10px; border: 1px solid var(--border); border-radius: 99px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 99px; background: transparent;
  font-size: 12px; text-decoration: none; cursor: pointer; text-align: left;
}
.chip:hover { border-color: var(--ink); }
.chip.is-static, .chip.is-static:hover { cursor: default; border-color: var(--line); }
.track { height: 2px; background: var(--line); margin: 16px 0; }
.track i { display: block; height: 100%; background: var(--accent-2); }
.status {
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  color: var(--muted);
}
.status-on-track, .status-strong, .status-achieved { color: var(--good); }
.status-drifting { color: var(--drift); }

/* ---------- Insights ---------- */
.write-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px;
  margin-bottom: 24px; padding: clamp(26px, 4vw, 40px) clamp(22px, 4vw, 40px);
  background: #3A2229; color: #F3EEE3; border-radius: 8px;
}
.write-card .eyebrow { color: rgba(243,238,227,.62); }
.write-card h2 { color: #F3EEE3; font-size: clamp(32px, 4.4vw, 50px); }
.write-card h2 em { color: #CFC18F; }
.write-card p:not(.eyebrow) { margin: 14px 0 0; color: rgba(243,238,227,.74); max-width: 46ch; }
.write-card-btn { min-height: 56px; padding: 14px 26px; font-size: 15px; gap: 12px; cursor: default; box-shadow: 0 10px 30px -12px rgba(230,180,81,.55); }
.write-card-btn span { font-size: 22px; line-height: 1; }
@media (max-width: 720px) {
  .write-card { grid-template-columns: 1fr; }
  .write-card-btn { justify-content: center; }
}
.captures { margin-bottom: 24px; }
.captures h3 { font-size: 22px; }
.capture-row { display: flex; gap: 12px; margin: 6px 0 14px; }
.capture-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 0;
  border: 0; border-bottom: 1px solid var(--border); background: transparent;
  font: inherit; color: var(--ink);
}
.capture-row input::placeholder { color: var(--faint); }
.capture-list { list-style: none; margin: 0; padding: 0; }
.capture-list li { display: flex; gap: 16px; padding: 8px 0; font-size: 14px; border-top: 1px solid var(--line); }
.capture-list li:first-child { border-top: 0; }
.capture-list small { flex: 0 0 72px; color: var(--faint); font-size: 11px; padding-top: 2px; }

.insights-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.insights-side { display: grid; gap: 24px; align-content: start; }
.insight-card { display: flex; flex-direction: column; }
.insight-title { font-size: clamp(30px, 3.3vw, 42px); line-height: 1.08; margin: 14px 0 18px; max-width: 18ch; }
.insight-body { margin: 0 0 22px; font-size: 16px; line-height: 1.75; color: var(--ink-2); max-width: 58ch; }
.sources { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--faint); }
.sources span { margin-right: 4px; }
.insight-card > .talk-row { margin-top: auto; }
.insight-card .sources { margin-bottom: 22px; }
.chat { display: grid; gap: 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.msg { max-width: 92%; padding: 14px 18px; border-radius: 8px; background: var(--surface-2); }
.msg p { margin: 0; font-size: 14.5px; line-height: 1.65; }
.msg .msg-who { margin-bottom: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.msg-who span { font-weight: 400; letter-spacing: .02em; text-transform: none; }
.msg-you { justify-self: end; background: transparent; border: 1px solid var(--border); }
.asks { margin-top: 20px; }
.asks-label { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.asks-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-ask { min-height: 40px; font-size: 13px; }
.asks-done { margin: 20px 0 0; font-size: 13px; color: var(--muted); }

.big-number { display: flex; align-items: flex-end; gap: 14px; }
.big-number strong { font: 400 56px/1 var(--serif); letter-spacing: -.04em; }
.big-number strong em { font-style: normal; font-size: 26px; color: var(--muted); }
.big-number span { padding-bottom: 6px; font-size: 13px; line-height: 1.35; }
.big-number small { display: block; color: var(--faint); font-size: 11.5px; }
.week-dots { display: flex; gap: 5px; margin: 20px 0 12px; }
.week-dots i { flex: 1; height: 18px; max-width: 14px; border-radius: 2px; background: var(--accent-2); }
.week-dots i.skip { background: transparent; border: 1px dashed var(--accent-2); }
.goal-mini { list-style: none; margin: 0; padding: 0; }
.goal-mini li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.goal-mini small { grid-column: 1; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.goal-mini span { grid-column: 1; font-size: 14px; line-height: 1.4; }
.goal-mini .status { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

.anniversary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: clamp(24px, 4vw, 56px); margin-top: 24px; }
.anniversary-label h2 { margin-bottom: 18px; }
.anniversary-text { padding-left: clamp(0px, 4vw, 48px); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.anniversary blockquote { margin: 0; font: 400 clamp(21px, 2vw, 26px)/1.45 var(--serif); color: var(--ink); }

.next-book {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(18px, 3vw, 36px);
  margin-top: 24px; padding: 24px clamp(22px, 3vw, 34px);
  background: var(--surface-2); border-radius: 8px;
}
.next-book-cover { --book-h: 104px; --book-w: 70px; }
.next-book h3 { margin-bottom: 4px; }
.next-book p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------- Library ---------- */
.shelf-stage {
  padding: clamp(32px, 5vw, 48px) clamp(12px, 4vw, 48px) 26px;
  border-radius: 8px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface-3) 55%, transparent));
}
.shelf-stage .lb-shelf { --book-w: clamp(78px, 17vw, 176px); --book-h: calc(var(--book-w) * 1.5); max-width: 900px; margin: 0 auto; }
.shelf-stage .lb-book { flex: 0 0 var(--book-w); }
.lb-shelf-captions p { margin: 0; font-size: 12.5px; line-height: 1.4; }
.lb-shelf-captions span { display: block; }
.lb-shelf-captions small { color: var(--faint); font-size: 11px; }
.library-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.library-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: border-color .2s; }
.library-card:hover { border-color: var(--border); }
.library-card h2 { font-size: 30px; }
.library-card p { margin: 0; color: var(--ink-2); }
.library-card .row-link { margin-top: auto; padding-top: 10px; }
.thread-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.thread-pills span { padding: 4px 14px; border: 1px solid var(--border); border-radius: 99px; font: italic 16px var(--serif); }
.moments-card { flex-direction: row; align-items: center; gap: clamp(18px, 3vw, 32px); background: var(--surface-2); }
.moments-card > div { display: flex; flex-direction: column; gap: 12px; }
.moments-card-seal { flex: 0 0 96px; height: 96px; color: var(--gold); --seal-fill: var(--surface-2); }

.book-page { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: start; margin-bottom: 64px; }
.book-page-cover { --book-w: clamp(150px, 20vw, 220px); --book-h: calc(var(--book-w) * 1.5); position: sticky; top: 110px; }
.book-page h1 { margin-bottom: 26px; }
.passage { margin: 0 0 32px; padding: 0 0 28px; border-bottom: 1px solid var(--line); }
.passage blockquote { margin: 0 0 10px; font: italic 400 clamp(23px, 2.4vw, 30px)/1.35 var(--serif); }
.passage figcaption { font-size: 12px; color: var(--muted); }
.closing p:not(.eyebrow) { margin: 0 0 14px; font-size: 16px; line-height: 1.8; color: var(--ink-2); max-width: 62ch; }
.entry-list { border-top: 1px solid var(--line); padding-top: 36px; }
.entry-row {
  display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 24px; align-items: baseline;
  padding: 18px 4px; border-bottom: 1px solid var(--line); text-decoration: none;
}
.entry-row:hover { background: var(--surface); }
.entry-row-date { font-size: 13px; color: var(--muted); }
.entry-row-text { font: 400 18px/1.45 var(--serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry-row-score { font: 400 24px var(--serif); }
.entry-row-score small { font: 12px var(--sans); color: var(--faint); }

/* An entry, as a page from its book. */
.spread {
  position: relative;
  display: grid; grid-template-columns: 170px minmax(0, 880px); column-gap: clamp(28px, 5vw, 64px); row-gap: 0;
  align-items: start;
  padding-bottom: 40px;
}
.spread-margin { position: sticky; top: 110px; display: grid; gap: 18px; justify-items: start; }
.margin-cover { --book-w: 116px; --book-h: 174px; display: block; text-decoration: none; }
.margin-cover .lb-book-object { transform: rotateY(-14deg) rotateZ(-2deg); transition: transform .4s; }
.margin-cover:hover .lb-book-object { transform: rotateY(-6deg) rotateZ(0deg) translateY(-4px); }
.margin-book, .margin-week { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.margin-book strong { font: 400 19px/1.2 var(--serif); color: var(--ink); letter-spacing: -.02em; }
.margin-week { padding-top: 14px; border-top: 1px solid var(--line); width: 100%; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

.paper {
  --paper: #FBF7EF;
  position: relative;
  padding: clamp(28px, 5vw, 64px) clamp(22px, 5.5vw, 72px) clamp(24px, 4vw, 44px);
  background:
    linear-gradient(90deg, rgba(92,38,51,.06) 0, rgba(92,38,51,0) 26px),
    radial-gradient(120% 80% at 100% 0%, rgba(154,127,58,.07), transparent 60%),
    var(--paper);
  border-radius: 2px 6px 6px 2px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 2px 0 -1px #efe7d8, 0 4px 0 -2px #e8dfcd, 0 26px 50px -30px rgba(56,33,41,.45);
}
:root[data-theme="dark"] .paper {
  --paper: #2A171D;
  box-shadow: 0 2px 0 -1px #331c23, 0 4px 0 -2px #3a2128, 0 30px 60px -30px rgba(0,0,0,.8);
}
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 26px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.paper-folio { margin: 0 0 10px; font: italic 400 15px var(--serif); color: var(--muted); }
.paper-head h1 { font-size: clamp(32px, 4vw, 48px); }
.score-seal {
  --score: 5;
  position: relative; flex: 0 0 auto;
  display: grid; place-items: center; align-content: center;
  width: 96px; height: 96px; border-radius: 50%;
  background:
    radial-gradient(circle, var(--paper) 0 60%, transparent 61%),
    conic-gradient(var(--accent-2) calc(var(--score) * 36deg), var(--line) 0);
}
.score-seal::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--accent-2) 45%, transparent); }
.score-seal strong { font: 400 38px/1 var(--serif); letter-spacing: -.04em; }
.score-seal small { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.page-lists { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 4vw, 44px); }
.page-list h2, .page-text h2 {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  font: 600 10.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.page-list h2::after, .page-text h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.page-list ol { list-style: none; margin: 0; padding: 0; }
.page-list li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 8px 0; font-size: 15px; line-height: 1.55; }
.page-list-n {
  display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px;
  border-radius: 50%; font: italic 400 14px/1 var(--serif);
}
.is-happy .page-list-n { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }
.is-sad .page-list-n { background: color-mix(in srgb, var(--drift) 14%, transparent); color: var(--drift); }
.page-text { margin-top: 38px; }
.page-text p { margin: 0 0 17px; font: 400 clamp(19px, 1.7vw, 21px)/1.75 var(--serif); }
.has-initial .initial {
  float: left;
  margin: 8px 12px 0 0;
  font: 400 76px/.72 var(--serif);
  color: var(--accent);
}
.paper-foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
}
.paper-foot a { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; font-size: 14px; }
.paper-foot a.next { justify-self: end; text-align: right; }
.paper-foot small { display: block; font-size: 11px; color: var(--faint); }
.paper-foot svg { width: 16px; height: 16px; flex: 0 0 16px; }
.paper-mark { color: var(--gold); font-size: 18px; }

/* Bookmarks are stickers, in the colour you gave them. */
.sticker-red { --sticker: #C8553D; }
.sticker-yellow { --sticker: #E3B04B; }
.sticker-green { --sticker: #7E9A55; }
.sticker-blue { --sticker: #5B86B0; }
.sticker-pink { --sticker: #D98BA6; }
.sticker {
  position: absolute; top: -14px; left: clamp(22px, 5.5vw, 72px); z-index: 2;
  width: 34px; height: 46px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.35) 0 22%, rgba(255,255,255,0) 40%),
    var(--sticker);
  border-radius: 4px 4px 6px 6px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  transform: rotate(-4deg);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.18));
}
.sticker::after {
  content: ""; position: absolute; left: 50%; top: 11px; width: 10px; height: 10px;
  transform: translateX(-50%); border-radius: 50%;
  background: rgba(255,255,255,.55);
}
.dot-sticker {
  display: inline-block; width: 9px; height: 12px; margin-right: 9px; vertical-align: -1px;
  background: var(--sticker);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

.tucked-note {
  position: relative;
  grid-column: 2;
  justify-self: end;
  width: min(420px, 92%);
  margin: -26px 28px 0 0;
  padding: 30px 28px 22px;
  background: #FFFDF6;
  border: 1px solid #eadfc9;
  box-shadow: 0 18px 34px -18px rgba(56,33,41,.4);
  transform: rotate(1.4deg);
}
:root[data-theme="dark"] .tucked-note { background: #3A2229; border-color: #4a2e35; box-shadow: 0 20px 40px -18px rgba(0,0,0,.8); }
.tape {
  position: absolute; top: -12px; left: 50%; width: 96px; height: 24px;
  transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--gold) 28%, transparent);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.tucked-note .eyebrow { color: var(--gold); }
.tucked-text { margin: 0 0 12px; font: italic 400 21px/1.55 var(--serif); color: var(--ink); }

/* ---------- People & topics ---------- */
.thread-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.thread-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.thread-card:hover { border-color: var(--border); }
.thread-card p:not(.eyebrow) { margin: 0; color: var(--ink-2); font-size: 14px; }
.thread-card .eyebrow { margin: 0; }
.thread-card .row-link { margin-top: auto; padding-top: 8px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 1px solid var(--border); max-width: 780px; }
.timeline li { position: relative; }
.timeline-book { margin: 28px 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.timeline-book:first-child { margin-top: 0; }
.timeline li a { display: block; padding: 12px 0 14px; text-decoration: none; }
.timeline li a::before { content: ""; position: absolute; left: -31px; top: 19px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent-2); }
.timeline li a:hover span { text-decoration: underline; text-underline-offset: 4px; }
.timeline small { display: block; font-size: 12px; color: var(--faint); }
.timeline span { font: 400 20px/1.5 var(--serif); }

/* ---------- Book of Moments ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { min-height: 40px; padding: 6px 16px; border: 1px solid var(--border); border-radius: 99px; background: transparent; font-size: 13px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.moment-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.moment { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 26px 20px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.moment-seal { width: 92px; height: 92px; color: var(--faint); opacity: .55; --seal-fill: var(--surface); }
.moment.is-done .moment-seal { color: var(--gold); opacity: 1; }
.moment h2 { font-size: 20px; line-height: 1.2; }
.moment p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.moment-state { margin-top: auto; padding-top: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.moment-state.is-done { color: var(--good); }
.moment .track { width: 70%; margin: 4px 0 0; }

/* ---------- Goals ---------- */
.status-on-track, .status-strong, .status-achieved { --status: var(--good); }
.status-drifting { --status: var(--drift); }
.goal-overview {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 28px;
  margin: -12px 0 48px; padding: 24px clamp(20px, 3vw, 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.status-bar { grid-column: 1 / -1; display: flex; gap: 4px; height: 10px; }
.status-bar i { flex: 1; border-radius: 2px; background: var(--status); }
.status-bar .status-achieved { background: var(--accent-2); }
.status-bar .status-strong, .status-bar .status-on-track { background: color-mix(in srgb, var(--accent-2) 45%, transparent); }
.status-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.status-legend li { display: flex; align-items: center; gap: 7px; }
.status-legend i { width: 9px; height: 9px; border-radius: 2px; background: color-mix(in srgb, var(--accent-2) 45%, transparent); }
.status-legend .status-achieved i { background: var(--accent-2); }
.status-legend .status-drifting i { background: var(--drift); }
.status-legend strong { color: var(--ink); font-weight: 600; }
.overview-left { margin: 0; font-size: 13px; color: var(--muted); }
.overview-left strong { font: 400 24px var(--serif); color: var(--ink); margin-right: 4px; }

.goal-group { margin-bottom: 40px; }
.group-head {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer; list-style: none;
}
.group-head::-webkit-details-marker { display: none; }
.goal-group[open] > .group-head { margin-bottom: 16px; }
.group-dots { display: flex; gap: 4px; margin-left: auto; }
.group-dots i { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--accent-2) 45%, transparent); }
.group-dots .status-achieved { background: var(--accent-2); }
.group-dots .status-drifting { background: var(--drift); }
.group-toggle { position: relative; flex: 0 0 32px; height: 32px; border: 1px solid var(--border); border-radius: 50%; }
.group-toggle::before, .group-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1px; background: var(--ink); transform: translate(-50%, -50%); transition: transform .2s; }
.group-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.goal-group[open] .group-toggle::after { transform: translate(-50%, -50%) rotate(0deg); }
.group-head:hover .group-toggle { border-color: var(--ink); }
.group-head h2 { font-size: 28px; }
.group-head span { font-size: 12px; color: var(--faint); }
.goal-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.goal-card {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px 24px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden;
}
.goal-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--status); opacity: .8; }
.goal-card h3 { font-size: 21px; line-height: 1.3; }
.goal-card.is-done { background: color-mix(in srgb, var(--accent-2) 9%, var(--surface)); }
.goal-card.is-done h3 { color: var(--ink-2); }
.status-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 4px; border-radius: 99px;
  background: color-mix(in srgb, var(--status) 12%, transparent);
  color: var(--status);
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}
.status-chip i {
  display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--status); color: var(--surface); font-style: normal; font-size: 10px;
}
.status-chip i:empty::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--surface); }
.goal-progress { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.goal-marks { display: flex; gap: 3px; }
.goal-marks i { width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--border); }
.goal-marks i.on { background: var(--status); border-color: var(--status); }
.goal-note { margin: 0; font: italic 400 16px/1.5 var(--serif); color: var(--ink-2); }
.goal-last {
  display: flex; align-items: center; gap: 8px; margin: auto 0 0; padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--muted); text-decoration: none; min-height: 36px;
}

.past-goals { margin-top: 72px; }
.past-card { margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.past-card summary {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: clamp(14px, 2.5vw, 28px);
  padding: 18px clamp(18px, 3vw, 28px);
  cursor: pointer; list-style: none;
}
.past-card summary::-webkit-details-marker { display: none; }
.past-cover { --book-w: 52px; --book-h: 78px; }
.past-title { display: grid; gap: 4px; }
.past-title small { font-size: 11px; color: var(--faint); }
.past-title strong { font: 400 24px/1.15 var(--serif); letter-spacing: -.02em; }
.outcome-bar { display: flex; gap: 4px; margin-top: 6px; max-width: 260px; }
.outcome-bar i { flex: 1; height: 6px; border-radius: 2px; }
.outcome-bar .outcome-achieved { background: var(--accent-2); }
.outcome-bar .outcome-partly { background: var(--gold); }
.outcome-bar .outcome-not-achieved { background: var(--drift); }
.past-tally { font-size: 13px; color: var(--muted); white-space: nowrap; }
.past-tally strong { font: 400 22px var(--serif); color: var(--ink); }
.past-toggle { position: relative; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 50%; }
.past-toggle::before, .past-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1px; background: var(--ink); transform: translate(-50%, -50%); transition: transform .2s; }
.past-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.past-card[open] .past-toggle::after { transform: translate(-50%, -50%) rotate(0deg); }
.past-body { padding: 4px clamp(18px, 3vw, 28px) 22px; border-top: 1px solid var(--line); }
.past-row { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 18px; align-items: start; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.past-row small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.past-row p { margin: 2px 0 0; font-size: 16px; }
.past-note {
  margin-top: 10px !important; padding: 10px 14px;
  font: italic 400 16px/1.55 var(--serif) !important; color: var(--ink-2);
  background: var(--surface-2); border-radius: 0 6px 6px 0;
  border-left: 2px solid var(--gold);
}
.outcome-row-not-achieved .past-note { border-left-color: var(--drift); }
.outcome-chip {
  justify-self: start; margin-top: 2px;
  padding: 4px 10px; border-radius: 99px;
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.outcome-chip.outcome-achieved { color: var(--good); background: color-mix(in srgb, var(--good) 13%, transparent); }
.outcome-chip.outcome-partly { color: var(--gold); background: color-mix(in srgb, var(--gold) 15%, transparent); }
.outcome-chip.outcome-not-achieved { color: var(--drift); background: color-mix(in srgb, var(--drift) 13%, transparent); }
.past-body .text-link { margin-top: 16px; min-height: 44px; }

/* ---------- read more, and the read at the top of a thread ---------- */
.button-small { min-height: 34px; padding: 6px 14px; font-size: 12px; }
.read-more { align-self: flex-start; cursor: default; margin: -6px 0 22px; color: var(--muted); }
.read-more:hover { border-color: var(--border); }
.closing .read-more { margin: 4px 0 0; }
.thread-read {
  margin-bottom: 48px;
  display: flex; flex-direction: column;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
}
.thread-read .eyebrow { color: var(--gold); }
.thread-read-text { margin: 4px 0 22px; font: 400 clamp(21px, 2.1vw, 26px)/1.5 var(--serif); max-width: 62ch; }
.talk-row { min-height: 60px; width: 100%; justify-content: space-between; padding-top: 18px; border-top: 1px solid var(--line); }
.timeline-head { margin-bottom: 24px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .insights-grid, .anniversary, .library-cards { grid-template-columns: 1fr; }
  .anniversary-text { padding-left: 0; border-left: 0; padding-top: 24px; border-top: 1px solid var(--line); }
  .thread-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr auto; row-gap: 0; padding-bottom: 0; }
  .topbar-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; gap: 24px; }
  .topbar-nav a[aria-current="page"]::after { bottom: 0; }
  .brand-wordmark { width: 124px; height: 32px; }
  .topbar-actions .button { padding: 8px 12px; font-size: 12px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-note { text-align: left; }
  .page-note br { display: none; }
  .next-book { grid-template-columns: auto 1fr; }
  .next-book .button { grid-column: 1 / -1; justify-self: start; }
  .shelf-stage .lb-shelf { --book-w: clamp(66px, 21vw, 110px); }
  .shelf-stage .lb-shelf-books, .shelf-stage .lb-shelf-captions { gap: 10px; padding-inline: 0; }
  .lb-shelf-captions p { font-size: 10.5px; }
  .lb-shelf-captions small { font-size: 10px; }
  .moments-card { flex-direction: column; align-items: flex-start; }
  .moments-card-seal { flex-basis: auto; width: 72px; height: 72px; }
  .book-page { grid-template-columns: 1fr; }
  .book-page-cover { position: static; --book-w: 140px; }
  .entry-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; }
  .entry-row-date { grid-column: 1 / -1; }
  .spread { grid-template-columns: 1fr; gap: 20px; }
  .spread-margin { position: static; grid-template-columns: auto 1fr; align-items: center; gap: 4px 16px; }
  .margin-cover { --book-w: 56px; --book-h: 84px; grid-row: span 2; }
  .margin-week { padding-top: 0; border-top: 0; }
  .paper-head { flex-direction: column-reverse; gap: 16px; }
  .score-seal { width: 76px; height: 76px; }
  .score-seal strong { font-size: 30px; }
  .page-lists { grid-template-columns: 1fr; gap: 20px; }
  .has-initial .initial { font-size: 60px; }
  .tucked-note { grid-column: 1; margin: -14px 0 0; width: 94%; }
  .paper-foot { grid-template-columns: 1fr 1fr; }
  .paper-mark { display: none; }
  .goal-cards { grid-template-columns: 1fr; }
  .goal-overview { grid-template-columns: 1fr; }
  .past-card summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .past-tally { grid-column: 2; grid-row: 2; }
  .past-toggle { grid-column: 3; grid-row: 1 / span 2; }
  .past-row { grid-template-columns: 1fr; gap: 8px; }
  .thread-grid { grid-template-columns: 1fr; }
  .sample-bar { font-size: 11.5px; }
}
@media (max-width: 380px) {
  .topbar-actions .button { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  .text-link svg, .row-link svg, .back-link svg { transition: none; }
}
