/* Knowist editorial system: the app and reader as a well-made magazine, set for easy reading.
   The look: warm paper with grain, a double-ruled masthead, Boska headlines with one italic accent word,
   books as objects with a spine and page edges, a drop cap and pull quotes in the reader.
   The reading rules (after Headway and Speechify):
   - Boska only at headline sizes (28px and up). Everything people read or tap is Satoshi.
   - No italics under headline size, no letterspaced caps under 12px, one orange label per block at most.
   - Text people read is ink; secondary text is a darker grey that passes WCAG AA (4.5:1) on paper.
   - Reading text is a sans at 19px/1.75, left-aligned, no hyphenation, paragraphs spaced, not indented.
   Scoped to the app shell, the book dialog and the reader; the onboarding funnel keeps its own look.
   Loaded before mobile.css. */
:root{
 --grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
 --paper:#fbf9f3;--rule:var(--ink);--edge-a:#f3eee2;--edge-b:#ddd6c5;--table:#3b2a1a;
}
[data-theme=dark]{--paper:#262b27;--edge-a:#3a3f39;--edge-b:#2c312c;--table:#000}
/* Secondary text a step darker than the funnel's grey: 6:1 on paper instead of 4.3:1. */
.sidebar,.shell,#book-dialog,.learn-page,.mobile-nav{--muted:#5c6057}
[data-theme=dark] :is(.sidebar,.shell,#book-dialog,.learn-page,.mobile-nav){--muted:#bcc1b5}
body:not(.funnel-active){background-image:var(--grain)}

/* Type */
.shell h1,.learn-page h1,#book-dialog h1,.shell h2,#book-dialog h2{font-family:var(--font-display);font-weight:500;letter-spacing:-.01em;color:var(--ink)}
.shell h1 em,.shell h2 em,.learn-page h1 em{font-style:italic;color:var(--accent)}
.shell p,#book-dialog p,.learn-page p{line-height:1.6}
.kicker{display:inline-flex;align-items:center;gap:10px;font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--accent)}
.kicker::before{content:"";width:20px;height:1.5px;background:currentColor}
.dek{font-size:var(--text-base);line-height:1.5;color:var(--muted);margin-top:var(--space-2)}

/* Sidebar: icon and label, an accent rule for the current section */
.sidebar{background:var(--paper);background-image:var(--grain)}
.side-nav{gap:4px}
.sidebar .side-nav .nav-item{gap:var(--space-3);border-radius:10px;padding:var(--space-3) var(--space-3);color:var(--muted);font-size:16px;font-weight:500;min-height:48px}
.sidebar .side-nav .nav-item:hover{color:var(--ink);background:var(--soft)}
.sidebar .side-nav .nav-item.active{color:var(--ink);background:var(--soft);font-weight:700;box-shadow:inset 3px 0 0 var(--accent)}
.nav-icon{width:22px;height:22px;flex:none}
.nav-item.active .nav-icon{color:var(--accent)}
.side-note p{font-family:var(--font-display);font-size:24px;line-height:1.1;color:var(--ink)}
.mobile-nav svg{width:22px;height:22px}
.mobile-nav button.active svg{color:var(--accent)}

/* Masthead: the date and a double rule, nothing else competing */
.topbar{border-bottom:3px double var(--rule)}
.dateline{font-size:13px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}

/* Page headings */
.edition-head,.catalog-heading{align-items:flex-end;padding-bottom:var(--space-6);margin-bottom:var(--space-8);border-bottom:1px solid var(--rule)}
.edition-head h1,.catalog-heading h1{font-size:clamp(2.4rem,1.9rem + 1.8vw,3.4rem);line-height:1.05;margin-top:var(--space-3)}
.catalog-heading h1{margin-top:0}
.edition-head .quiet-link{margin-bottom:6px}

/* Buttons: ink-outlined pills and accent pills, both 48px tall */
.shell .secondary,#book-dialog .secondary{border:1.5px solid var(--ink);background:transparent;border-radius:999px;font-weight:700;min-height:48px}
.shell .secondary:hover,#book-dialog .secondary:hover{background:var(--ink);color:var(--bg)}
.shell .primary,#book-dialog .primary{border-radius:999px;min-height:52px;padding-inline:var(--space-8);font-size:16px;box-shadow:0 8px 18px -10px color-mix(in srgb,var(--accent) 80%,transparent)}

/* Book as an object */
.book-obj{position:relative;display:inline-block;line-height:0;aspect-ratio:2/3;border-radius:2px 4px 4px 2px;transform:perspective(700px) rotateY(-8deg);transform-origin:left center;transition:transform .35s cubic-bezier(.2,.7,.2,1);box-shadow:0 1px 1px #0000001a,6px 12px 18px -8px color-mix(in srgb,var(--table) 45%,transparent),14px 26px 30px -20px color-mix(in srgb,var(--table) 40%,transparent)}
.book-obj img{display:block;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;border-radius:inherit;object-fit:cover;transform:none!important;box-shadow:none!important}
.book-obj::after{content:"";position:absolute;top:2px;bottom:2px;right:-5px;width:5px;border-radius:0 3px 3px 0;background:repeating-linear-gradient(to bottom,var(--edge-a) 0 1px,var(--edge-b) 1px 2px);box-shadow:inset 1px 0 1px #00000014}
.book-spine{position:absolute;inset:0 auto 0 0;width:9%;border-radius:2px 0 0 2px;background:linear-gradient(90deg,#00000038,#ffffff30 45%,#0000000d 70%,transparent);pointer-events:none}
.book-obj.is-small{height:84px}
.book-obj.is-large{height:220px}
button:hover>.book-obj,a:hover>.book-obj,.book-card:hover .book-obj{transform:perspective(700px) rotateY(-2deg) translateY(-4px)}

/* Explore / library cards: a tinted plate with the book on it, then a plain, bold title (as Headway does) */
.book-art{height:250px;border-radius:12px;background-image:var(--grain)!important}
[data-theme=dark] .book-art{box-shadow:inset 0 0 0 999px #1c201dab,inset 0 0 0 1px #ffffff0d}
.book-art>button:first-child{padding:var(--space-6) var(--space-5) var(--space-8)}
.book-art .book-obj{height:184px}
.book-art img,.book-card:nth-child(even) .book-art img,.book-card:nth-child(even) .book-art:hover img{transform:none;box-shadow:none;max-width:none;height:100%}
.book-info{padding-top:var(--space-3)}
.book-kicker{display:block;font-size:13px;font-weight:500;color:var(--muted);margin-bottom:2px}
.book-info .book-title{font-family:var(--font-body);font-size:17px;font-weight:700;line-height:1.3;text-align:left;padding:0;letter-spacing:-.01em;color:var(--ink)}
.book-info h3{margin:0}
/* The cover above is the big tap target; the title button hugs its text so the author sits right under it. */
.book-info .book-title{min-height:0;display:block;width:100%;padding:4px 0}
.book-info .author{font-size:15px;margin-top:2px!important;color:var(--muted)}
.book-info .book-meta{font-size:13px;margin-top:6px;color:var(--muted)}
.save-btn{backdrop-filter:blur(6px);width:44px;height:44px}

/* Explore: underline tabs and a ruled search line */
.search-field{border:0;border-bottom:1.5px solid var(--rule);border-radius:0;background:transparent;padding-inline:0;min-height:52px}
.search-field input{font-size:17px}
.filter-row{gap:var(--space-6);border-bottom:1px solid var(--line);margin-top:var(--space-5)}
.filter{border:0;border-radius:0;background:none;padding:var(--space-3) 0;min-height:44px;margin-bottom:-1px;border-bottom:2px solid transparent;color:var(--muted);font-weight:500;font-size:15px}
.filter:hover{background:none;color:var(--ink)}
.filter.active{background:none;color:var(--ink);font-weight:700;border-bottom-color:var(--accent)}
.catalog-count{font-size:14px;color:var(--muted);border:0}

/* Where you left off + today's idea */
.resume{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(0,1.1fr);gap:var(--space-10);align-items:center;padding:var(--space-6) 0 var(--space-10);margin-bottom:var(--space-4)}
.resume-book{padding-left:var(--space-2)}
.resume-copy h2{font-size:clamp(1.9rem,1.5rem + 1vw,2.4rem);line-height:1.1;margin-top:var(--space-3)}
.resume-chapter{margin-top:var(--space-3);font-size:16px;color:var(--ink)}
.resume-chapter span{color:var(--muted);margin-right:6px}
.resume-progress{margin:var(--space-5) 0 var(--space-6);max-width:320px}
.resume-progress small{display:block;margin-top:6px;color:var(--muted);font-size:14px}
.idea-quote{position:relative;margin:0;padding:var(--space-8);background:var(--paper);border-top:3px double var(--rule);border-bottom:1px solid var(--rule)}
.idea-quote blockquote{margin:var(--space-4) 0 0;font-family:var(--font-display);font-weight:500;font-size:clamp(1.4rem,1.2rem + .6vw,1.7rem);line-height:1.3;color:var(--ink);max-width:32ch}
.idea-quote blockquote::before{content:"“";color:var(--accent)}
.idea-quote blockquote::after{content:"”";color:var(--accent)}
.idea-quote figcaption{margin-top:var(--space-4);font-size:14px;color:var(--muted)}
.idea-quote cite{font-style:normal;font-weight:700;color:var(--ink)}

/* Your way to knowing: three plain steps */
.journey-strip{border-bottom:0;border-top:1px solid var(--line);gap:var(--space-8)}
.journey-title{font-size:13px;font-weight:700;color:var(--muted)}
.journey-item{font-size:15px;font-weight:500;color:var(--ink)}

/* The reading list */
.section-head{align-items:flex-end;border-bottom:1px solid var(--rule);padding-bottom:var(--space-4)}
.section-head h2{font-size:clamp(1.7rem,1.4rem + .8vw,2.1rem)}
.section-head p{font-size:15px}
.path-list{border-top:0}
.path-row{display:grid;grid-template-columns:36px 60px minmax(0,1fr) auto;gap:var(--space-5);align-items:center;padding:var(--space-5) 0;border-bottom:1px solid var(--line)}
.path-row .path-number{font-family:var(--font-body);width:auto;white-space:nowrap;font-size:15px;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
.path-row h3{font-size:18px;font-weight:700;line-height:1.3;color:var(--ink)}
.path-row .eyebrow{font-size:12px;letter-spacing:.1em;color:var(--green);margin-bottom:4px}
.path-author{font-size:15px!important;color:var(--muted);margin-top:2px!important}
.path-row p:not(.path-author){font-size:15px;color:var(--ink);margin-top:6px;max-width:60ch}
.path-state{display:inline-block;margin-top:8px;font-size:13px;font-weight:700;color:var(--accent)}
.path-state.is-done{color:var(--green)}

/* Notes at the foot of the page */
.plan-strip{border-radius:0;border:0;border-top:3px double var(--rule);border-bottom:1px solid var(--rule);background:transparent;padding-inline:0}
.plan-strip h3,.thought h3{font-size:17px;font-weight:700}
.thought{border-top:1px solid var(--line)}
.thought .fleuron{font-family:var(--font-display);font-size:28px;line-height:1;color:var(--accent)}

/* Book details: a contents page */
#book-dialog{border-radius:12px;background:var(--paper)}
#book-dialog .dialog-header{border-bottom:3px double var(--rule)}
#book-dialog .detail-top h1{font-size:clamp(2rem,1.6rem + 1vw,2.6rem);line-height:1.08}
#book-dialog .detail-top p{font-size:16px}
#book-dialog .detail-top .book-meta{font-size:14px}
#book-dialog .intro-text{font-size:17px;line-height:1.6;color:var(--ink)}
#book-dialog .detail-summary{font-size:15px;color:var(--muted)}
.toc-title .kicker{font-family:var(--font-body)}
.toc-title{display:grid;gap:8px;font-size:1.75rem;margin-top:var(--space-8);padding-bottom:var(--space-3);border-bottom:1px solid var(--rule)}
.lesson-row{padding:var(--space-3) 0;gap:var(--space-4);border-bottom:1px solid var(--line);min-height:48px}
.lesson-row>span{font-size:14px;font-weight:700;color:var(--muted);min-width:28px;font-variant-numeric:tabular-nums}
.lesson-row>b{flex:1;font-weight:500;font-size:16px;color:var(--ink)}
.lesson-part{text-transform:none;letter-spacing:0;font-size:15px;font-weight:700;color:var(--ink);margin-top:var(--space-6);padding-bottom:6px;border-bottom:1px solid var(--rule)}

/* Reader: a set page with a drop cap and a pull quote, and a comfortable sans for the text itself */
.learn-page{background-image:var(--grain)}
.learn-header{background:var(--paper);border-bottom:3px double var(--rule)}
.reading-paper{background:var(--paper);border:0;border-radius:6px;box-shadow:0 1px 0 var(--line),0 30px 60px -40px #3b2a1a44,0 0 0 1px #0000000a}
.section-kicker{padding-bottom:var(--space-3);border-bottom:1px solid var(--rule);font-size:12px;letter-spacing:.12em}
.chapter-label{text-transform:none;letter-spacing:0;font-size:15px;font-weight:700;color:var(--accent);margin-top:var(--space-6)}
.reading-paper .reader-head h1{font-size:clamp(2.2rem,1.7rem + 1.5vw,3rem);line-height:1.08}
.reader-head{border-bottom:0;margin-bottom:var(--space-6)}
.reader-head p{font-size:15px;color:var(--muted)}
.section-body{font-family:var(--font-body);font-size:19px;line-height:1.75;letter-spacing:0;color:var(--ink);max-width:66ch;hyphens:manual}
.section-body p+p{margin-top:1em}
.section-body .sync-text>p:first-child::first-letter,.section-body>.sync-text:not(:has(p))::first-letter{float:left;font-family:var(--font-display);font-weight:500;font-size:3.5em;line-height:.85;padding:6px 10px 0 0;color:var(--accent)}
.key-idea{border-left:0;border-radius:0;background:transparent;border-top:3px double var(--rule);border-bottom:1px solid var(--rule);padding:var(--space-6) 0;max-width:none}
.key-idea span{font-size:12px;letter-spacing:.12em}
.key-idea p{font-family:var(--font-display);font-weight:500;font-size:1.6rem;line-height:1.3;color:var(--ink)}
.section-footnote{font-size:14px;color:var(--muted)}
.rail-book strong{font-size:16px;font-weight:700}
/* Chapters not reached yet stay readable; the empty circle already says they're ahead. */
.learn-page .rail-sections .chapter-step:disabled{opacity:.85}
.rail-part-name{text-transform:none;letter-spacing:0;font-size:14px;font-weight:700}
.np-bar{background:color-mix(in srgb,var(--paper) 94%,transparent);backdrop-filter:blur(12px);border-top:1px solid var(--rule)}
.np-meta strong{font-size:16px;font-weight:700}

@media(max-width:1050px){.resume{grid-template-columns:auto minmax(0,1fr)}.idea-quote{grid-column:1/-1}}
@media(max-width:780px){
 .edition-head h1,.catalog-heading h1{font-size:2.2rem}
 .edition-head{flex-wrap:wrap;gap:var(--space-3)}
 .resume{grid-template-columns:1fr;gap:var(--space-6);padding-top:var(--space-2)}
 .resume-book{display:flex;justify-content:center}
 .resume .primary{width:100%;justify-content:center}
 .book-obj.is-large{height:190px}
 .idea-quote{padding:var(--space-6) var(--space-5)}
 .journey-strip{gap:var(--space-4);flex-wrap:wrap}
 .path-row{grid-template-columns:28px 56px minmax(0,1fr);gap:var(--space-3);align-items:start}
 .path-row .secondary{grid-column:1/-1;justify-self:stretch;margin-left:0}
 .book-obj.is-small{height:78px}
 .book-art{height:210px}
 .book-art .book-obj{height:150px}
 .book-info .book-title{font-size:16px}
 .section-body{font-size:18px;line-height:1.7}
 .key-idea p{font-size:1.35rem}
 /* Filters keep wrapping on phones (the approved Explore layout never clips them); each tab keeps its own rule. */
 .catalog-page .filter-row{column-gap:var(--space-5);row-gap:0;border-bottom:0}
 .catalog-page .filter{border-bottom:1px solid var(--line)}
 .catalog-page .filter.active{border-bottom:2px solid var(--accent)}
 .filter{white-space:nowrap}
}
@media(prefers-reduced-motion:reduce){.book-obj{transition:none}}
/* The funnel keeps its look: before Boska loaded, this line fell back to Georgia, so pin it there. */
.f-mini-welcome{font-family:Georgia,serif}
