:root { --paper: #f6efe0; --ink: #22201c; --soft: #6b6558; --line: rgba(34, 32, 28, .16); --sans: "Instrument Sans", system-ui, sans-serif; --serif: "Instrument Serif", Georgia, serif; }
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
body { min-height: 100vh; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; background: var(--paper); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
header { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 48px); font-weight: 500; }
.brand { font: 400 32px var(--serif); letter-spacing: .02em; }
.brand-c { position: relative; display: inline-block; }
.brand-c::before { content: ""; position: absolute; left: 8%; right: 8%; top: .02em; height: .06em; background: currentColor; }
.brand-c::after { content: "a"; position: absolute; left: 96%; top: -.35em; font-size: .34em; line-height: 1; letter-spacing: 0; }
main { width: min(100% - 32px, 720px); margin: clamp(24px, 6vh, 64px) auto 96px; }
h1 { font: 400 clamp(46px, 8vw, 80px)/1.04 var(--serif); letter-spacing: -.02em; }
.lede { font-size: 19px; color: var(--soft); margin-top: 10px; }
.chips { display: flex; gap: 24px; margin: 32px 0 0; border-bottom: 1px solid var(--line); }
.chips button { min-height: 44px; padding: 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--soft); font: 500 16px var(--sans); cursor: pointer; }
.chips button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.feature { display: block; padding: 28px 0 32px; border-bottom: 1px solid var(--line); }
.feature img { display: block; width: 100%; aspect-ratio: 16 / 8; object-fit: cover; object-position: 50% 70%; border-radius: 6px; margin-bottom: 18px; }
.feature small { display: block; font-size: 14px; color: var(--soft); }
.feature b { display: block; margin-top: 6px; font: 400 clamp(36px, 6vw, 52px)/1.08 var(--serif); }
.feature span { display: block; margin-top: 10px; font-size: 18px; line-height: 1.5; color: var(--soft); }
.row:not(.feature) { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line); }
.row small { font-size: 14px; color: var(--soft); }
.row:not(.feature) b { font: 400 clamp(24px, 3.4vw, 30px)/1.15 var(--serif); }
.row:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (max-width: 560px) {
  .row:not(.feature) { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .row:not(.feature) b { grid-column: 1 / -1; grid-row: 2; }
}

/* Shared by every entry */
.bar { position: fixed; top: 0; left: 0; z-index: 5; width: 100%; height: 3px; background: var(--accent, var(--ink)); transform: scaleX(var(--read, 0)); transform-origin: left; }
.entry-page main { width: 100%; margin: 0; }
.entry-page header { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.cover { padding: clamp(112px, 16vh, 168px) max(16px, calc(50% - 310px)) clamp(40px, 7vh, 72px); }
.cover h1 { font-size: clamp(46px, 8vw, 84px); }
.kicker { font-size: 15px; margin-bottom: 12px; opacity: .78; }
article { width: min(100% - 32px, 620px); margin: 0 auto; padding: clamp(36px, 7vh, 64px) 0 clamp(48px, 9vh, 88px); }
article p { font-size: 20px; line-height: 1.6; margin-top: 24px; }
article > p:first-child { margin-top: 0; }
blockquote { margin: 44px 0; font: 400 clamp(34px, 5.4vw, 50px)/1.1 var(--serif); letter-spacing: -.01em; color: var(--accent, var(--ink)); }
.next { display: block; padding: clamp(36px, 7vh, 64px) max(16px, calc(50% - 310px)); border-top: 1px solid var(--line); }
.next:only-child, h1 + .lede + .next { padding-left: 0; border-top: 0; }
.next small { display: block; font-size: 15px; opacity: .72; }
.next b { display: block; margin-top: 6px; font: 400 clamp(32px, 5vw, 48px)/1.08 var(--serif); }
.next:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

/* Why Darb goes first: Darb green, a path that draws itself */
.t-path { --accent: #044a27; }
.t-path header, .t-path .cover { background: #044a27; color: #fff; }
.t-path .cover-icon { display: block; width: 64px; height: 64px; margin-bottom: 24px; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); }
.trail { display: block; width: 100%; margin-top: 36px; overflow: visible; }
.trail path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100; animation: draw 2.4s .3s cubic-bezier(.4, 0, .2, 1) both; }
.trail circle { fill: #044a27; stroke: #fff; stroke-width: 3; }
@keyframes draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

/* Build for the moment: first light, a sun that crosses as you read */
.t-dawn { --accent: #b9562f; }
.t-dawn header { color: #fff; }
.t-dawn .cover { position: relative; display: flex; align-items: flex-end; min-height: 72vh; padding-bottom: 40px; color: #fff; overflow: hidden; }
.t-dawn .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 80%; }
.t-dawn .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(8, 10, 24, .16), rgba(8, 10, 24, .1) 40%, rgba(8, 10, 24, .68)); }
.t-dawn .cover div { position: relative; z-index: 1; }
.dial { position: fixed; right: 20px; bottom: 20px; z-index: 4; width: 96px; height: 52px; }
.dial svg { position: absolute; inset: 0; overflow: visible; }
.dial path { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 5; opacity: .5; }
.dial i { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--accent); offset-path: path("M5 48A43 43 0 0 1 91 48"); offset-distance: calc(var(--read, 0) * 100%); offset-rotate: 0deg; }

/* What we keep: night, the parts laid out */
.t-night { --paper: #0d1530; --ink: #fff8ee; --soft: rgba(255, 248, 238, .72); --line: rgba(255, 248, 238, .18); --accent: #ffd9a0; }
.t-night .cover { background: radial-gradient(1.5px 1.5px at 18% 30%, #fff, transparent), radial-gradient(1px 1px at 62% 22%, #fff, transparent), radial-gradient(1.5px 1.5px at 84% 58%, #fff, transparent), radial-gradient(1px 1px at 36% 66%, #fff, transparent), radial-gradient(1px 1px at 74% 82%, #fff, transparent); }
.t-night blockquote { margin-top: 0; }
.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 40px 0; background: var(--line); border: 1px solid var(--line); }
.part { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--paper); }
.part small { font-size: 13px; font-weight: 600; color: #cfe8c3; }
.part.off small { color: var(--soft); }
.part b { font: italic 400 30px/1.1 var(--serif); }
.part span { font-size: 16px; line-height: 1.4; color: var(--soft); }
.part.off b, .part.off span { opacity: .6; }

/* Five questions: a numbered checklist */
.t-five { --accent: #b9562f; }
.t-five .cover { border-bottom: 2px solid var(--ink); }
.asks { list-style: none; padding: 0; margin: 36px 0 0; counter-reset: ask; }
.asks li { counter-increment: ask; display: grid; grid-template-columns: 76px minmax(0, 1fr); padding: 26px 0; border-top: 1px solid var(--line); }
.asks li::before { content: counter(ask); grid-row: span 2; font: italic 400 64px/.9 var(--serif); color: var(--accent); }
.asks h2 { font: 400 clamp(28px, 4vw, 36px)/1.12 var(--serif); }
.asks p { margin-top: 8px; font-size: 18px; color: var(--soft); }

/* A good streak: two weeks of days, one missed, and it carries on */
.t-streak { --accent: #044a27; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 44px)); gap: 10px; margin-bottom: 36px; }
.week i { aspect-ratio: 1; border-radius: 50%; background: var(--accent); animation: dot .4s calc(var(--n) * 90ms + .2s) both; }
.week i.miss { background: none; box-shadow: inset 0 0 0 2px var(--line); }
@keyframes dot { from { opacity: 0; transform: scale(.4); } }

@media (prefers-reduced-motion: reduce) {
  .trail path, .week i { animation: none; }
}
@media (max-width: 560px) {
  article p { font-size: 18px; }
  .parts { grid-template-columns: minmax(0, 1fr); }
  .asks li { grid-template-columns: 56px minmax(0, 1fr); }
  .asks li::before { font-size: 48px; }
  .dial { display: none; }
}

/* One header and clear ways onward */
.nav { display: flex; gap: clamp(12px, 3vw, 28px); font-size: 15px; font-weight: 500; }
.nav a { min-height: 44px; display: inline-flex; align-items: center; }
.related { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 36px !important; padding-top: 18px; border-top: 1px solid var(--line); font-size: 16px !important; font-weight: 500; }
.related a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

/* The Notebook page is a library: a lamp-lit bookcase, one shelf per category */
.library-page { --ink: #f3e6cc; --soft: rgba(243, 230, 204, .7); --line: rgba(243, 230, 204, .16); background: radial-gradient(ellipse 70% 50% at 50% -8%, rgba(255, 190, 110, .3), rgba(255, 190, 110, 0)), linear-gradient(#2c1d15, #160e0a 70%); background-attachment: fixed; }
.library { width: min(100% - 32px, 980px); }
.library-page .vol { animation: shelve .7s calc(var(--i) * 90ms + .2s) cubic-bezier(.2, .8, .2, 1) both; }
.every { margin: 64px auto 0; max-width: 680px; padding: clamp(28px, 5vw, 48px); border-radius: 3px; background: #f6efe0; color: #22201c; box-shadow: 0 30px 60px rgba(0, 0, 0, .45); }
.every h2 { font: 400 40px var(--serif); text-align: center; letter-spacing: .02em; }
.every h2::after { content: ""; display: block; width: 40px; height: 1px; margin: 14px auto 0; background: currentColor; opacity: .5; }
.every ol { list-style: none; padding: 0; margin-top: 24px; }
.every a { display: flex; align-items: baseline; gap: 10px; padding: 10px 0; }
.every .t { font: 400 21px/1.25 var(--serif); }
.every .dots { flex: 1; min-width: 24px; border-bottom: 1.5px dotted rgba(34, 32, 28, .35); transform: translateY(-5px); }
.every .c { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #6b6558; }
.every .n { width: 2ch; font: italic 400 18px var(--serif); text-align: right; }
.every a:hover .t { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) { .every .c { display: none; } .every .t { font-size: 19px; } }
@media (max-width: 820px) {
}

/* Moving between pages crossfades instead of cutting */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out .26s ease both; }
::view-transition-new(root) { animation: page-in .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* Notes ease in as they load */
.entry-page .cover > *, .entry-page article > * { animation: rise-in .7s cubic-bezier(.2, .8, .2, 1) both; }
.entry-page .cover > :nth-child(2), .entry-page article > :nth-child(2) { animation-delay: .08s; }
.entry-page .cover > :nth-child(3), .entry-page article > :nth-child(3) { animation-delay: .16s; }
.entry-page .cover > :nth-child(n+4), .entry-page article > :nth-child(n+4) { animation-delay: .24s; }
.library .case { animation: rise-in .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } }
.row, .every a, .next b, .nav a, .related a { transition: color .25s, opacity .25s; }
@media (prefers-reduced-motion: reduce) { .entry-page .cover > *, .entry-page article > *, .library .case { animation: none; } }

/* Featured note lies open on a lectern above the shelves */
.lectern { display: grid; grid-template-columns: 1fr 1fr; margin-top: 36px; perspective: 1600px; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .5)); transition: transform .4s cubic-bezier(.2, .8, .2, 1); animation: rise-in .8s .1s cubic-bezier(.2, .8, .2, 1) both; }
.lectern:hover { transform: translateY(-4px); }
.l-left, .l-right { display: flex; flex-direction: column; min-height: 260px; padding: clamp(22px, 4vw, 40px); }
.l-left { border-radius: 8px 2px 2px 8px; background: linear-gradient(270deg, rgba(0, 0, 0, .35), rgba(255, 255, 255, .06) 6%, rgba(0, 0, 0, 0) 10%), #0f4a30; color: #e7c98a; transform: rotateY(6deg); transform-origin: right center; }
.l-right { border-radius: 2px 8px 8px 2px; background: linear-gradient(90deg, rgba(70, 48, 28, .22), rgba(70, 48, 28, 0) 10%), #f6efe0; color: #22201c; transform: rotateY(-6deg); transform-origin: left center; }
.lectern small { font-size: 13px; font-weight: 500; opacity: .8; }
.l-left b { margin-top: 12px; font: 400 clamp(32px, 4vw, 46px)/1.05 var(--serif); }
.l-left i { margin-top: auto; font: italic 400 16px var(--serif); opacity: .8; }
.l-ex { margin: auto 0; font: 400 clamp(21px, 2.4vw, 27px)/1.3 var(--serif); }
.lectern em { align-self: flex-start; font-style: normal; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 640px) {
  .lectern { grid-template-columns: minmax(0, 1fr); }
  .l-left, .l-right { min-height: 0; transform: none; }
  .l-left { border-radius: 8px 8px 2px 2px; }
  .l-right { border-radius: 2px 2px 8px 8px; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { .lectern { animation: none; } }

/* One long library shelf with category tabs above it */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.tabs button { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border: 1px solid rgba(243, 230, 204, .25); border-radius: 99px; background: none; color: var(--ink); font: 500 15px var(--sans); cursor: pointer; transition: background .25s, color .25s, border-color .25s; }
.tabs button span { font-size: 12px; opacity: .6; }
.tabs button:hover { border-color: rgba(243, 230, 204, .6); }
.tabs button[aria-pressed="true"] { background: #f3e6cc; color: #22201c; border-color: #f3e6cc; }
.library .lib { margin-top: 28px; }
.library .wall { --tall: 400px; --w: 84px; }
.library .wall .books { gap: 8px; justify-content: center; }
.library .wall .spine b { font-size: 26px; }
.library .wall .spine { padding-top: 30px; }
.library .wall .divider { width: 30px; margin: 0 12px; }
.library .wall .divider b { font-size: 11px; }
@media (max-width: 820px) {
  .library .wall { --tall: 260px; --w: 46px; }
  .library .wall .books { gap: 4px; }
  .library .wall .spine b { font-size: 18px; }
  .library .wall .spine { padding-top: 18px; }
  .library .wall .divider { width: 14px; margin: 0 3px; }
}
