/* The Springle Library (docs/85): the site's ink and ivory, Funnel Display for the big words with an Instrument Serif
   italic turn, and every lesson's own picture on its paper. Pages are written on the server (api/library.js). */
@font-face { font-family: 'Funnel Display'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/fonts/funnel-display-var-latin.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/fonts/geist-mono-var-latin.woff2) format('woff2'); }

.pg-library { --display: 'Funnel Display', 'Inter', system-ui, sans-serif; --mono: 'Geist Mono', ui-monospace, monospace; --paper: #FCF8F3; --round: 26px; }
.lib { position: relative; z-index: 1; padding: 104px clamp(16px, 4vw, 40px) 0; }
.lib a { text-decoration: none; }
.lib h1, .lib h2, .lib h3 { margin: 0; }
.lib h1 em, .lib h1 span { display: inline; }
.lib em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.wrap { max-width: 1200px; margin: 0 auto; }
.wrap.narrow { max-width: 860px; }
.lib .eyebrow { font-family: var(--mono); font-weight: 500; letter-spacing: .14em; font-size: 12px; }
.label { margin: 0 0 12px; font: 500 10.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.fine { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Hero and search */
.hero { text-align: center; padding: 40px 0 8px; }
.hero h1 { font: 500 clamp(48px, 8vw, 96px)/.98 var(--display); letter-spacing: -.045em; text-wrap: balance; }
.hero h1 em { font-size: 1.1em; }
.sub { margin: 22px auto 0; max-width: 560px; font-size: clamp(16px, 2vw, 19px); line-height: 1.5; color: var(--ink-2); }
.search { position: relative; display: flex; width: 100%; align-items: center; gap: 12px; height: 56px; margin: 22px 0 0; padding: 0 8px 0 10px; max-width: 620px;
  border-radius: 999px; background: rgba(22, 22, 26, .9); box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .16); }
.search-big { height: 68px; max-width: 760px; margin: 36px auto 0; padding-left: 12px; box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .16), 0 0 0 6px rgba(255, 246, 232, .03), 0 24px 60px rgba(0, 0, 0, .5); }
.search .face { width: 36px; height: 36px; flex: none; }
.search-big .face { width: 44px; height: 44px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--ink); font: 400 17px/1 var(--font); outline: none; }
.search-big input { font-size: 19px; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.search:focus-within { box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .4); }
.search-go { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(243, 240, 234, .08); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.search-go svg { width: 18px; height: 18px; }
.search-go:hover { background: rgba(243, 240, 234, .16); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 22px; }
.chips-left { justify-content: flex-start; margin-top: 16px; }
.chips-label { font-size: 13.5px; color: var(--ink-3); margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; color: var(--ink); white-space: nowrap;
  background: rgba(243, 240, 234, .04); box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .14); }
.chip i { font-style: normal; font-size: 12px; color: var(--ink-3); }
a.chip:hover { background: rgba(243, 240, 234, .1); }
.chip-soon { color: var(--ink-3); }

/* Section heads */
.sh { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 64px 0 18px; }
.sh h2 { flex: 1 1 auto; min-width: 0; font: 500 clamp(24px, 3vw, 30px)/1.1 var(--display); letter-spacing: -.03em; }
.sh h2 em { font-size: 1.08em; }
.sh span { font-size: 13.5px; color: var(--ink-3); text-align: right; }

/* Lesson cards */
.grid-4, .grid-3, .grid-2 { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lc, .cc { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 16px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .08); transition: transform .25s var(--ease), box-shadow .25s; }
.lc:hover, .cc:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .18); }
.lc-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.lc a:not(.lc-link), .cc a:not(.lc-link) { position: relative; z-index: 2; }
.pic { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 15px; overflow: hidden; background: var(--paper); }
.pic img, .lr-pic img, .path-pic img, .area-pic img, .stack-pic img { width: 100%; height: 100%; object-fit: cover; }
.pic-blank { display: block; width: 100%; height: 100%; background: var(--paper) linear-gradient(rgba(35, 35, 43, .05) 1px, transparent 1px) 0 0 / 18px 18px, linear-gradient(90deg, rgba(35, 35, 43, .05) 1px, transparent 1px) 0 0 / 18px 18px; }
.pic-min { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: rgba(10, 10, 11, .86); color: var(--ink); font: 600 11.5px/1.4 var(--font); }
.pic-min svg { width: 8px; height: 8px; }
.lc-title { padding: 0 8px; font: 500 17px/1.25 var(--font); letter-spacing: -.01em; text-wrap: pretty; }
.grid-2 .lc-title { font-size: 18.5px; }
.lc-topic { margin: -4px 8px 0; font-size: 13px; color: var(--ink-3); }
.lc-topic:hover { color: var(--ink); }
.lc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; margin-top: auto; min-width: 0; }
.lc-note { font-size: 12.5px; color: var(--listen); white-space: nowrap; }
.by { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; font-weight: 500; color: var(--ink); }
.by-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { width: var(--s); height: var(--s); flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: var(--t); color: #fff; font: 600 calc(var(--s) * .5)/1 var(--display); }
.av-springle { background: none; }
.av-springle .face { width: 100%; height: 100%; }
.teacher { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 5px; border-radius: 999px; background: rgba(60, 227, 164, .14); color: #7BF0C4; font: 600 11px/1.3 var(--font); white-space: nowrap; }
.teacher svg { width: 11px; height: 11px; }

/* Rows */
.box { padding: 20px; border-radius: var(--round); background: var(--card); box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .08); }
.rows { margin-top: 18px; padding: 8px; }
.lr { display: flex; align-items: center; gap: 14px; padding: 8px; border-radius: 16px; color: var(--ink); }
.lr:hover { background: rgba(243, 240, 234, .05); }
.lr-n { width: 22px; flex: none; text-align: center; font: 500 12px/1 var(--mono); color: var(--ink-3); }
.lr-pic { width: 86px; height: 54px; flex: none; border-radius: 9px; overflow: hidden; background: var(--paper); }
.lr-words { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.lr-title { font-size: 15px; font-weight: 500; line-height: 1.25; }
.lr-meta { font-size: 12.5px; color: var(--ink-3); }
.lr-side { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.box > .lr { margin: 0 -8px; }

/* Page heads */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 18px; font-size: 13.5px; color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }
.page-head h1 { font: 500 clamp(40px, 6vw, 64px)/1.02 var(--display); letter-spacing: -.04em; text-wrap: balance; }
.page-head h1 em { font-size: 1.08em; }
.page-head .eyebrow { margin-bottom: 14px; }
.lede { margin: 16px 0 0; max-width: 700px; font-size: 18px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 22px; }
.head-row .fine { margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 90px; }
.main-col .sh:first-of-type { margin-top: 44px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 14.5px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.facts a:hover { text-decoration: underline; }
.linked { margin-top: 18px; }
.ask { display: flex; flex-direction: column; gap: 12px; background: linear-gradient(160deg, rgba(60, 227, 164, .08), rgba(16, 16, 18, 1) 60%); }
.ask .face { width: 40px; height: 40px; }
.ask p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.ask b { color: var(--ink); }
.ask .btn { align-self: flex-start; }

/* Exams and coverage */
.exam-line { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(243, 240, 234, .07); color: var(--ink); }
.exam-line:first-of-type { border-top: 0; }
.exam-name { font-weight: 500; font-size: 15.5px; margin-right: auto; }
.exam-side { font-size: 13px; color: var(--ink-3); text-align: right; }
.meter { position: relative; display: inline-block; width: 90px; height: 6px; border-radius: 99px; background: rgba(243, 240, 234, .1); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--listen); }
.meter-big { width: 200px; height: 8px; }
.cover { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px; font-size: 14.5px; color: var(--ink-2); }
.outline { padding: 6px 20px; }
.outline-row { padding: 16px 0; border-top: 1px solid rgba(243, 240, 234, .07); }
.outline-row:first-child { border-top: 0; }
.outline-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.outline-head h3 { font: 500 18px/1.2 var(--display); letter-spacing: -.02em; }
.outline .chips { margin-top: 12px; }
.exams { margin-top: 24px; }

/* Subjects, areas, topics, path */
.subjects { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.subject { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 92px; padding: 16px 16px 14px; border-radius: 18px; background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .08); font: 500 16.5px/1.15 var(--display); letter-spacing: -.02em; color: var(--ink); }
.subject span { font: 400 12px/1 var(--font); letter-spacing: 0; color: var(--ink-3); }
a.subject:hover { box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .2); }
.subject-soon { color: var(--ink-3); background: transparent; }
.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.area { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 16px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .08); color: var(--ink); }
a.area:hover { box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .2); }
.area-pics { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; height: 120px; border-radius: 14px; overflow: hidden; background: rgba(243, 240, 234, .04); margin-bottom: 6px; }
.area-pic { display: block; background: var(--paper); overflow: hidden; }
.area-pic:first-child { grid-row: span 2; }
.area-pics:empty { display: none; }
.area-name { padding: 0 6px; font: 500 18px/1.2 var(--display); letter-spacing: -.02em; }
.area-meta { padding: 0 6px; font-size: 13px; color: var(--ink-3); }
.area-soon { background: transparent; color: var(--ink-3); }
.area-soon .area-name { color: var(--ink-2); }
.topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.topic-tile { padding: 18px 18px 10px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .08); }
.topic-name { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 500 20px/1.2 var(--display); letter-spacing: -.02em; color: var(--ink); }
.topic-name span { font: 400 13px/1 var(--font); color: var(--ink-3); white-space: nowrap; }
.topic-name:hover span { color: var(--ink); }
.topic-about { margin: 8px 0 6px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.topic-tile .lr { margin: 0 -8px; }
.path-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; counter-reset: none; }
.path-list a { position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 8px 8px 14px; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .08); color: var(--ink); }
.path-list a:hover { box-shadow: inset 0 0 0 1px rgba(243, 240, 234, .2); }
.path-n { position: absolute; top: 14px; left: 14px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #0a0a0b; font: 600 12px/1 var(--font); }
.path-pic { display: block; aspect-ratio: 16 / 10; border-radius: 13px; overflow: hidden; background: var(--paper); }
.path-words { display: flex; flex-direction: column; gap: 3px; padding: 0 6px; }
.path-name { font-size: 15px; font-weight: 500; line-height: 1.25; }
.path-meta { font-size: 12.5px; color: var(--ink-3); }
.path-list a:not(:has(.path-pic)) .path-n { position: static; }

/* Collections */
.stack { position: relative; height: 190px; margin: 8px 8px 6px; }
.stack > span { position: absolute; top: 0; width: 70%; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); background: var(--paper); }
.stack-pic { display: block; width: 100%; height: 100%; }
.stack-1 { left: 26%; top: 6px !important; transform: rotate(2deg); z-index: 3; }
.stack-2 { left: 13%; top: 20px !important; transform: rotate(-2deg); z-index: 2; filter: brightness(.86); }
.stack-3 { left: 0; top: 34px !important; transform: rotate(-5deg); z-index: 1; filter: brightness(.72); }
.cc { padding: 18px 16px 18px; }
.cc-title { padding: 0 8px; font: 500 22px/1.15 var(--display); letter-spacing: -.025em; }
.cc-meta, .cc-sub { padding: 0 8px; }
.cc-sub { margin: -2px 0 0; font-size: 13px; color: var(--ink-2); }

/* Creator */
.creator-head { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 18px; }
.creator-head > div:first-of-type { flex: 1; min-width: 260px; }
.creator-head h1 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font: 500 clamp(40px, 6vw, 60px)/1 var(--display); letter-spacing: -.04em; }
.stats { display: flex; gap: 30px; }
.stats span { font-size: 13px; color: var(--ink-3); }
.stats b { display: block; font: 500 30px/1.1 var(--display); letter-spacing: -.03em; color: var(--ink); }

/* The asked-for board, empty states, band */
.wanted { margin-top: 48px; }
.wanted ul { list-style: none; margin: 0; padding: 0; }
.wanted li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(243, 240, 234, .07); font-size: 15px; }
.wanted li:first-child { border-top: 0; }
.asks { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.empty { padding: 60px 0 20px; }
.empty h1 { font: 500 clamp(36px, 5vw, 56px)/1.04 var(--display); letter-spacing: -.04em; text-wrap: balance; }
.empty .btn, .empty .search { margin-top: 26px; }
.empty p a { color: var(--ink-2); text-decoration: underline; }
.found-topics { margin-top: 28px; }
.band { display: flex; align-items: center; gap: 28px; margin: 72px 0 0; padding: 40px clamp(24px, 4vw, 52px); border-radius: 32px; color: #0A0A0B;
  background: linear-gradient(120deg, #FBE9D2, #F3F0EA 45%, #DDEEE2); }
.band .face { width: 84px; height: 84px; flex: none; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .18)); }
.band > div { flex: 1; }
.band h2 { font: 500 clamp(28px, 3.4vw, 40px)/1.04 var(--display); letter-spacing: -.035em; }
.btn-dark { background: #0A0A0B; color: var(--ink); height: 52px; }
.btn-dark:hover { background: #222; }
.lib .btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .subjects { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .side-col { position: static; }
}
@media (max-width: 760px) {
  .lib { padding-top: 92px; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-2, .areas, .topics { grid-template-columns: 1fr; }
  .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lc-title { font-size: 15px; }
  .lc-foot { flex-wrap: wrap; }
  .sh { margin-top: 48px; }
  .band { flex-direction: column; align-items: flex-start; text-align: left; }
  .lr-side { display: none; }
  .search-big { height: 58px; }
  .search-big .face { width: 38px; height: 38px; }
  .search-big input { font-size: 16px; }
  .search input { font-size: 16px; }
  .chips { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px; scrollbar-width: none; }
  .hero .chips { justify-content: flex-start; }
  .chips-left { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; }
  .stats { gap: 22px; }
}
@media (max-width: 420px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .lc, .cc { transition: none; } .lc:hover, .cc:hover { transform: none; } }
.area-pics:has(> :only-child) { grid-template-columns: 1fr; }
.area-pic:nth-child(2):last-child { grid-row: span 2; }

/* Inside Springle's own apps (?app=1): the pages alone, under the window's own title bar. */
.in-app .glow-top { display: none; }
.in-app .lib { padding-top: calc(env(safe-area-inset-top) + 20px); padding-bottom: 32px; }
