/* SourceBook demo kit: shared stage, cursor, captions and the app's look (from the app's app.css). */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;0,700;1,500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --accent: #b5573b; --accent-ink: #8f3f28; --accent-lt: #f7e9e3; --accent-xlt: #fcf5f2;
  --gold: #c9a84c; --gold-lt: #fbf3dc;
  --ink: #2a1d18; --muted: #6e5e57; --faint: #a3948c;
  --paper: #faf6f1; --card: #ffffff; --line: #e8ddd3;
  --teal: #2a7a6b;
  --t1: #B5573B; --t2: #7A2E3A; --t3: #9C6B8E; --t4: #6E4A6B; --t5: #C08C8C; --t6: #C7A97E; --t7: #8A6D5A; --t8: #C9A84C;
  --sel: rgba(66, 133, 244, .28);
  --frag: #f6dd8f;
}
html, body { width: 100%; height: 100%; overflow: hidden; background: #efe5dd; }
body { font-family: 'DM Sans', system-ui, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
.stage {
  position: absolute; left: 50%; top: 50%; width: 1280px; height: 800px; overflow: hidden;
  transform-origin: center center;
  background: radial-gradient(120% 90% at 15% 0%, #fbf2ec 0%, #f2e6dd 55%, #ead9cd 100%);
}

/* Cursor and clicks */
.cursor { position: absolute; left: 0; top: 0; z-index: 900; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); transition: scale .12s; }
.cursor.down { scale: .86; }
.click-ring { position: absolute; z-index: 899; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 3px solid var(--gold); pointer-events: none; animation: ring .55s ease-out forwards; }
@keyframes ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.pressed { filter: brightness(.92); transform: translateY(1px); }

/* Captions */
.caption { position: absolute; left: 50%; bottom: 26px; z-index: 800; display: flex; align-items: center; gap: 14px;
  background: rgba(42, 29, 24, .92); color: #fff; padding: 13px 26px 13px 14px; border-radius: 40px;
  font-size: 21px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; box-shadow: 0 10px 30px rgba(42,29,24,.28);
  transform: translate(-50%, 16px); opacity: 0; transition: opacity .35s, transform .35s; }
.caption.show { opacity: 1; transform: translate(-50%, 0); }
.cap-n { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 17px; font-weight: 700; flex: none; }
.no-captions .caption { display: none; }
.cover { position: absolute; inset: 0; z-index: 950; background: #f2e6dd; opacity: 0; pointer-events: none; transition: opacity .55s; }
.cover.on { opacity: 1; }
.still .caption { transition: none; }

/* Typing caret */
.typing::after { content: ''; display: inline-block; width: 2px; height: 1.05em; background: var(--accent); vertical-align: -2px; margin-left: 1px; animation: caret .9s steps(1) infinite; }
textarea.typing, input.typing { caret-color: var(--accent); }
@keyframes caret { 50% { opacity: 0; } }

/* App window */
.win { position: absolute; background: var(--paper); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(74, 40, 25, .22), 0 0 0 1px rgba(74, 40, 25, .08); display: flex; flex-direction: column; }
.appbar { height: 58px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 22px; background: #fff; border-bottom: 1px solid var(--line); }
.appbar .mark { width: 30px; height: 30px; border-radius: 7px; }
.appbar .brand { font-family: 'Lora', serif; font-weight: 600; font-size: 19px; }
.appbar .sep { width: 1px; height: 24px; background: var(--line); }
.appbar .proj { font-family: 'Lora', serif; font-size: 17px; font-weight: 600; color: var(--ink); }
.appbar .style-pill { font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; background: var(--paper); }
.appbar .who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; background: var(--t3); }
.tabs { display: flex; gap: 6px; padding: 0 22px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.tab { font-size: 16px; font-weight: 600; color: var(--muted); padding: 12px 14px 11px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.on { color: var(--accent-ink); border-bottom-color: var(--accent); }
.app-body { flex: 1; position: relative; overflow: hidden; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; gap: 7px; font: 600 15px 'DM Sans', sans-serif; border-radius: 9px; padding: 9px 16px; border: 1px solid transparent; white-space: nowrap; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.quiet { background: #fff; color: var(--muted); border-color: var(--line); }
.btn.done { background: var(--teal); color: #fff; }
.field { font: 15px 'DM Sans', sans-serif; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; min-height: 40px; }

/* Themes and cards (the cards view) */
.theme-bar { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .01em;
  padding: 9px 13px; border-radius: 10px; }
.theme-bar .n { margin-left: auto; font-size: 13px; font-weight: 600; opacity: .85; background: rgba(255,255,255,.18); padding: 1px 9px; border-radius: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 2px 8px rgba(42, 29, 24, .05); }
.card .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.card .meta .pg { color: var(--faint); letter-spacing: .02em; text-transform: none; font-weight: 600; font-size: 12.5px; }
.card .quote { font-family: 'Lora', serif; font-size: 16.5px; line-height: 1.45; margin: 6px 0 4px; color: var(--ink); }
.card .quote::before { content: '\201C'; } .card .quote::after { content: '\201D'; }
.card .idea { font-size: 16px; line-height: 1.45; margin: 6px 0 4px; }
.card .note { font-size: 14.5px; line-height: 1.45; color: var(--muted); margin-top: 4px; }
.card .note b { color: var(--ink); font-weight: 600; }
.card .src { font-size: 13.5px; color: var(--faint); margin-top: 6px; }
.card .src em { font-style: italic; }
.card .go { color: var(--accent-ink); font-weight: 600; float: right; }
.card.type-idea .meta { color: var(--t4); }
.card.type-para .meta { color: var(--t2); }

/* Browser window (for source pages) */
.browser { position: absolute; background: #fff; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(74, 40, 25, .22), 0 0 0 1px rgba(74, 40, 25, .08); }
.b-top { height: 44px; background: #ece6e1; display: flex; align-items: flex-end; padding: 0 14px; gap: 12px; flex: none; }
.b-dots { display: flex; gap: 8px; align-self: center; }
.b-dots i { width: 13px; height: 13px; border-radius: 50%; background: #e0574f; display: block; }
.b-dots i:nth-child(2) { background: #e6b24a; } .b-dots i:nth-child(3) { background: #5fbf5a; }
.b-tab { background: #fff; border-radius: 10px 10px 0 0; padding: 9px 16px; font-size: 13.5px; color: #3a3a3a; max-width: 330px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 8px; align-items: center; }
.b-tab .fav { width: 14px; height: 14px; border-radius: 3px; background: #29506e; flex: none; }
.b-bar { height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid #e6e1dc; flex: none; }
.b-nav { color: #8b8580; font-size: 18px; letter-spacing: 8px; }
.b-url { flex: 1; background: #f3efeb; border-radius: 20px; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 14px; color: #444; white-space: nowrap; overflow: hidden; }
.b-url .lock { width: 11px; height: 13px; border: 2px solid #777; border-radius: 3px; position: relative; flex: none; }
.b-url .host { color: #222; }
.b-url .path { color: #8a8580; }
.b-ext { position: relative; width: 30px; height: 30px; border-radius: 7px; overflow: visible; }
.b-ext img { width: 30px; height: 30px; border-radius: 7px; display: block; }
.b-ext .badge { position: absolute; right: -6px; bottom: -4px; background: var(--teal); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 4px; border: 1.5px solid #fff; }
.b-page { flex: 1; overflow: hidden; position: relative; }

/* A journal article page (fictional) */
.article { max-width: 760px; margin: 0 auto; padding: 34px 40px 120px; font-family: Georgia, 'Times New Roman', serif; color: #222; }
.j-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid #29506e; margin-bottom: 24px; font-family: 'DM Sans', sans-serif; }
.j-logo { width: 34px; height: 34px; border-radius: 6px; background: #29506e; color: #fff; font: 700 13px 'DM Sans'; display: grid; place-items: center; }
.j-name { font-size: 15px; font-weight: 700; color: #29506e; letter-spacing: .02em; }
.j-vol { margin-left: auto; font-size: 13px; color: #777; }
.article h1 { font-size: 31px; line-height: 1.2; font-weight: 700; margin-bottom: 12px; color: #1b1b1b; }
.article .by { font-family: 'DM Sans', sans-serif; font-size: 15px; color: #444; margin-bottom: 6px; }
.article .doi { font-family: 'DM Sans', sans-serif; font-size: 13px; color: #29506e; margin-bottom: 22px; }
.article h2 { font-size: 20px; margin: 26px 0 10px; color: #1b1b1b; }
.article p { font-size: 17.5px; line-height: 1.72; margin-bottom: 16px; }
.article .abs { background: #f5f7f9; border-left: 3px solid #29506e; padding: 14px 18px; font-size: 15.5px; line-height: 1.6; }
.w.sel { background: var(--sel); }
.frag { background: var(--frag); box-shadow: 0 0 0 2px var(--frag); border-radius: 2px; }

/* Context menu (generic browser) */
.ctx { position: absolute; z-index: 400; width: 300px; background: #fff; border-radius: 10px; padding: 6px 0; font-size: 14.5px; color: #222;
  box-shadow: 0 12px 34px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.08); opacity: 0; transform: scale(.96); transform-origin: top left; transition: opacity .15s, transform .15s; }
.ctx.show { opacity: 1; transform: none; }
.ctx div { padding: 7px 16px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.ctx hr { border: 0; border-top: 1px solid #e8e8e8; margin: 5px 0; }
.ctx .sb { font-weight: 600; }
.ctx .sb img { width: 18px; height: 18px; border-radius: 4px; }
.ctx .sb.hot { background: #f1ebe7; }
.ctx .k { margin-left: auto; color: #999; font-size: 13px; }
.scroller { position: absolute; inset: 0; overflow: hidden; }
