/* walk.cpuchip.net — reading-experience SPA styles.
   Built only on walk-tokens.css custom properties. Mobile-first. */

html, body { overflow-x: hidden; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

a { color: inherit; }

/* ---------- chrome (breadcrumb) ---------- */
.chrome {
  border-bottom: 1px solid var(--line);
  padding: var(--s-3) var(--s-4);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--ink-faint);
}
.breadcrumb a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: var(--s-1) 0;
}
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { color: var(--ink-faint); }
.breadcrumb [aria-current="page"] { color: var(--ink-soft); }

/* ---------- front door ---------- */
.view-front {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--s-7) var(--s-5);
}
.view-front h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-2xl);
  letter-spacing: 0.03em;
  margin: 0 0 var(--s-5);
  color: var(--ink);
}
.view-front blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-lg);
  line-height: var(--lh-body);
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0 auto var(--s-3);
}
.view-front cite {
  font-style: normal;
  display: block;
}
.view-front cite a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--quick);
}
.view-front cite a:hover { border-bottom-color: var(--accent); }
.view-front .lede {
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  color: var(--ink-faint);
  max-width: 40ch;
  margin: var(--s-6) auto 0;
}
.btn-begin {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--s-6);
  padding: var(--s-3) var(--s-6);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--t-sm);
  text-decoration: none;
  transition: background var(--quick), transform var(--quick);
}
.btn-begin:hover { background: var(--accent-strong); }
.btn-begin:active { transform: translateY(1px); }

@media (min-width: 640px) {
  .view-front h1 { font-size: var(--t-3xl); }
}

/* ---------- books index / book chapter list ---------- */
.view-books, .view-book {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--s-6) var(--s-4) var(--s-9);
}
.view-books h1, .view-book h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-xl);
  margin: 0 0 var(--s-5);
  color: var(--ink);
}
.book-list, .chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.book-list a, .chapter-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 44px;
  padding: var(--s-3) var(--s-2);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: background var(--quick);
}
.book-list a:hover, .chapter-list a:hover { background: var(--surface); }
.book-name, .ch-title {
  font-family: var(--font-display);
  font-size: var(--t-md);
  color: var(--ink);
}
.book-count {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--ink-faint);
  white-space: nowrap;
}
.ch-n {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  color: var(--accent);
  min-width: 2ch;
}
.chapter-list a { gap: var(--s-4); }
.chapter-list .ch-title { flex: 1; }

/* ---------- chapter (reading surface) ---------- */
.view-chapter {
  flex: 1;
  width: 100%;
}
.chapter {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--s-6) var(--s-4) var(--s-9);
}
.loading {
  font-family: var(--font-ui);
  color: var(--ink-faint);
  padding: var(--s-6) var(--s-4);
}
.chapter-hero { margin-bottom: var(--s-6); }
.chapter-hero .ref {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 var(--s-2);
}
.chapter-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-2xl);
  line-height: var(--lh-tight);
  color: var(--ink);
  margin: 0 0 var(--s-4);
}
.read-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--quick);
}
.read-link:hover { border-bottom-color: var(--accent-strong); }

.binding-idea {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-lg);
  line-height: var(--lh-body);
  color: var(--ink-soft);
  margin: 0 0 var(--s-7);
  padding-left: var(--s-4);
  border-left: 2px solid var(--accent);
}

.thoughts { margin-bottom: var(--s-7); }
.thought {
  font-family: var(--font-display);
  font-size: var(--t-md);
  line-height: var(--lh-body);
  color: var(--ink);
  margin: 0 0 var(--s-5);
}
.thought:last-child { margin-bottom: 0; }
.thought em, .binding-idea em { font-style: italic; color: var(--ink); }

.secondary {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.secondary h2 {
  font-family: var(--font-ui);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0 0 var(--s-3);
}
.secondary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.secondary li {
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  line-height: 1.6;
  color: var(--ink-soft);
}
.secondary em { font-style: italic; color: var(--ink-soft); }
.secondary code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ink-soft);
  background: var(--surface);
  padding: 1px 4px;
  border-radius: var(--r-sm);
}
.entity-label {
  font-weight: 600;
  color: var(--ink);
}

.chapter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
}
.chapter-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color var(--quick);
}
.chapter-nav a:hover { color: var(--ink); }
.chapter-nav .nav-book {
  color: var(--ink-faint);
  font-size: var(--t-xs);
}
