/* Designing with Interest — shared styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Georgia', serif;
  background: #fafaf8;
  color: #1a1a1a;
  line-height: 1.8;
  font-size: 17px;
}

/* Logo */
.logo { position: fixed; top: 20px; left: 20px; z-index: 100; }
.logo a { border-bottom: none; }
.logo a:hover { border-bottom: none; }
.logo img { height: 36px; opacity: 0.7; }

/* Chapter nav */
.chapter-nav {
  position: fixed; top: 0; right: 0;
  width: 48px; height: 100vh;
  background: #f0efe8;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 6px; z-index: 100;
  border-left: 1px solid #e0ddd4;
}
.chapter-nav a {
  width: 28px; height: 28px; border-radius: 50%;
  background: #ddd; display: flex;
  align-items: center; justify-content: center;
  font-size: 10px; font-family: -apple-system, sans-serif;
  color: #888; text-decoration: none; transition: all 0.2s;
}
.chapter-nav a:hover { background: #c9b896; color: #fff; }
.chapter-nav a.active { background: #2a5a3a; color: #fff; }
.chapter-nav a.placeholder { opacity: 0.4; }

/* Main layout */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 20px 120px;
  margin-right: calc(50% - 360px + 24px);
}

/* Chapter header */
.chapter-number {
  font-size: 13px; text-transform: uppercase;
  letter-spacing: 3px; color: #999;
  margin-bottom: 8px; font-family: -apple-system, sans-serif;
}
.chapter-title {
  font-size: 42px; font-weight: 400;
  line-height: 1.2; margin-bottom: 8px;
}
.chapter-subtitle {
  font-size: 20px; color: #666;
  font-style: italic; margin-bottom: 48px;
}

/* Headings */
h2 {
  font-size: 24px; font-weight: 400;
  margin-top: 56px; margin-bottom: 20px;
  border-bottom: 1px solid #eee; padding-bottom: 8px;
}

/* Prose */
p { margin-bottom: 20px; }
.lead { font-size: 19px; color: #333; }
strong { font-weight: 600; }
em { font-style: italic; }
a { color: #2a5a3a; text-decoration: none; border-bottom: 1px solid #c9d4c9; }
a:hover { border-bottom-color: #2a5a3a; }

/* Pull quote */
.pullquote {
  font-size: 22px; line-height: 1.5;
  color: #2a5a3a; border-left: 3px solid #c9b896;
  padding: 16px 0 16px 24px; margin: 36px 0;
  font-style: italic;
}

/* Glossary term */
.term { border-bottom: 1px dotted #c9b896; cursor: help; position: relative; }
.term:hover::after {
  content: attr(data-def);
  position: absolute; bottom: 100%; left: 0;
  width: 300px; background: #333; color: #fff;
  padding: 10px 14px; border-radius: 6px;
  font-size: 13px; line-height: 1.5; z-index: 50;
  font-style: normal; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Claude aside */
.claude-aside {
  background: #f5f3ee; border-left: 3px solid #c9b896;
  padding: 24px 28px; margin: 36px 0; border-radius: 0 8px 8px 0;
}
.claude-aside .aside-label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 2px; color: #999;
  margin-bottom: 12px; font-family: -apple-system, sans-serif;
  display: flex; align-items: center; gap: 8px;
}
.claude-aside .aside-label::before {
  content: '';
  display: inline-block;
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='2' fill='%23D4A574'/%3E%3Cellipse cx='12' cy='5' rx='2' ry='4' fill='%23D4A574' opacity='0.9'/%3E%3Cellipse cx='12' cy='19' rx='2' ry='4' fill='%23D4A574' opacity='0.9'/%3E%3Cellipse cx='5' cy='12' rx='4' ry='2' fill='%23D4A574' opacity='0.9'/%3E%3Cellipse cx='19' cy='12' rx='4' ry='2' fill='%23D4A574' opacity='0.9'/%3E%3Cellipse cx='7.1' cy='7.1' rx='1.5' ry='3.5' transform='rotate(-45 7.1 7.1)' fill='%23D4A574' opacity='0.6'/%3E%3Cellipse cx='16.9' cy='16.9' rx='1.5' ry='3.5' transform='rotate(-45 16.9 16.9)' fill='%23D4A574' opacity='0.6'/%3E%3Cellipse cx='16.9' cy='7.1' rx='1.5' ry='3.5' transform='rotate(45 16.9 7.1)' fill='%23D4A574' opacity='0.6'/%3E%3Cellipse cx='7.1' cy='16.9' rx='1.5' ry='3.5' transform='rotate(45 7.1 16.9)' fill='%23D4A574' opacity='0.6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}
.claude-aside p {
  font-size: 15px; line-height: 1.8;
  color: #555; margin-bottom: 14px;
}
.claude-aside p:last-child { margin-bottom: 0; }

/* Paired callout */
.callout {
  background: #fff; border: 1px solid #e0ddd4;
  border-radius: 8px; margin: 36px 0; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.callout-header {
  padding: 14px 20px; background: #f8f7f2;
  border-bottom: 1px solid #e0ddd4;
  display: flex; justify-content: space-between; align-items: center;
}
.callout-title {
  font-size: 15px; font-weight: 600;
  font-family: -apple-system, sans-serif;
}
.callout-toggle {
  display: flex; gap: 0; border-radius: 6px;
  overflow: hidden; border: 1px solid #ddd;
}
.callout-toggle button {
  padding: 5px 14px; font-size: 11px;
  font-family: -apple-system, sans-serif;
  border: none; background: #fff; color: #888;
  cursor: pointer; transition: all 0.15s;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.callout-toggle button:not(:last-child) { border-right: 1px solid #ddd; }
.callout-toggle button.active { background: #2a5a3a; color: #fff; }
.callout-toggle button:hover:not(.active) { background: #f0efe8; }
.callout-body { padding: 20px 24px; }
.callout-section { display: none; }
.callout-section.visible { display: block; }
.callout-section h4 {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 1.5px; color: #999;
  margin-bottom: 10px; font-family: -apple-system, sans-serif;
  font-weight: 600;
}
.callout-section.ml h4 { color: #4a6fa5; }
.callout-section.ux h4 { color: #8a5a3a; }
.callout-section.bridge h4 { color: #2a5a3a; }
.callout-section p {
  font-size: 15px; line-height: 1.8;
  color: #444; margin-bottom: 12px;
}
.callout-section p:last-child { margin-bottom: 0; }

/* Diagrams */
.diagram {
  margin: 40px 0; padding: 32px;
  background: #fff; border: 1px solid #e0ddd4;
  border-radius: 8px;
}
.diagram-title {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 2px; color: #999;
  margin-bottom: 24px; text-align: center;
  font-family: -apple-system, sans-serif;
}
.diagram-caption {
  font-size: 13px; color: #888;
  text-align: center; margin-top: 20px;
  font-style: italic;
}

/* Closing */
.closing-question {
  margin-top: 56px; padding: 32px;
  background: #f5f3ee; border-radius: 8px;
}
.closing-question p.question {
  font-size: 20px; font-style: italic;
  color: #2a5a3a; margin-bottom: 16px; line-height: 1.5;
}
.closing-question p { font-size: 15px; color: #555; line-height: 1.8; }
.closing-mirror {
  font-size: 17px; color: #888;
  font-style: italic; text-align: center; margin-top: 32px;
}

/* Chapter footer nav */
.chapter-footer-nav {
  margin-top: 80px; padding-top: 32px;
  border-top: 1px solid #eee;
  display: flex; justify-content: space-between;
}
.chapter-footer-nav a {
  font-size: 14px; font-family: -apple-system, sans-serif;
  color: #888; text-decoration: none; border: none;
}
.chapter-footer-nav a:hover { color: #2a5a3a; }
.chapter-footer-nav .next { text-align: right; }
.chapter-footer-nav .label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: #bbb; display: block; margin-bottom: 4px;
}

/* Sidebar */
.sidebar-note {
  position: absolute; right: -280px; width: 240px;
  font-size: 13px; line-height: 1.6; color: #888;
  border-left: 2px solid #e0ddd4; padding-left: 16px;
}
.sidebar-note a { color: #2a5a3a; border-bottom: 1px dotted #2a5a3a; }
.sidebar-note .sidebar-label {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 1.5px; color: #bbb;
  margin-bottom: 4px; font-family: -apple-system, sans-serif;
}
.section { position: relative; }

/* Visual panels */
.split-panel {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; margin: 40px 0;
}
.panel {
  padding: 24px; border-radius: 8px;
  border: 1px solid #e0ddd4;
}
.panel-label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.5px; color: #999;
  margin-bottom: 12px; font-family: -apple-system, sans-serif;
}
.panel-highlight { background: #f5f3ee; }

/* Bar chart */
.bar-chart {
  display: flex; gap: 32px; align-items: flex-end;
  justify-content: center; padding: 32px;
  margin: 40px 0; background: #fff;
  border: 1px solid #e0ddd4; border-radius: 8px;
}
.bar-item { text-align: center; }
.bar {
  width: 80px; border-radius: 4px 4px 0 0;
  margin: 0 auto 8px; transition: height 0.5s;
}
.bar-label {
  font-size: 12px; color: #888;
  font-family: -apple-system, sans-serif;
}
.bar-value {
  font-size: 18px; font-weight: 600;
  margin-bottom: 4px;
}

/* Research figures */
.research-figures {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid #e0ddd4;
}
.research-figures h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999;
  margin-bottom: 24px;
  font-family: -apple-system, sans-serif;
}
.research-fig {
  margin: 32px 0;
  background: #fff;
  border: 1px solid #e0ddd4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.research-fig img {
  width: 100%;
  display: block;
  border-bottom: 1px solid #e0ddd4;
}
.research-fig-body {
  padding: 16px 20px;
}
.research-fig-body .fig-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
}
.research-fig-body .fig-title a {
  color: #2a5a3a;
}
.research-fig-body .fig-caption {
  font-size: 13px;
  color: #888;
  font-style: italic;
  line-height: 1.6;
}

/* Print styles */
@media print {
  /* Font size control — adjust this value to scale all print text */
  body { font-size: 12px; }
  .lead { font-size: 14px; }
  .chapter-title { font-size: 32px; }
  .chapter-subtitle { font-size: 16px; }
  h2 { font-size: 19px; }
  .pullquote { font-size: 17px; }

  /* Prevent page breaks inside these elements */
  .callout { break-inside: avoid; page-break-inside: avoid; }
  .diagram { break-inside: avoid; page-break-inside: avoid; }
  .research-fig { break-inside: avoid; page-break-inside: avoid; }
  .claude-aside { break-inside: avoid; page-break-inside: avoid; }
  .closing-question { break-inside: avoid; page-break-inside: avoid; }
  .split-panel { break-inside: avoid; page-break-inside: avoid; }
  .pullquote { break-inside: avoid; page-break-inside: avoid; }
  blockquote { break-inside: avoid; page-break-inside: avoid; }

  /* Keep images with their captions */
  .research-fig img { break-after: avoid; page-break-after: avoid; }
  .diagram img { break-after: avoid; page-break-after: avoid; }
  figure { break-inside: avoid; page-break-inside: avoid; }

  /* Avoid orphan headings at bottom of page */
  h2 { break-after: avoid; page-break-after: avoid; }

  /* Hide screen-only elements */
  .chapter-nav { display: none; }
  .logo { position: static; margin-bottom: 24px; }

  /* Page margins */
  @page { margin: 2cm 1.5cm 1.5cm 1.5cm; }

  /* Remove fixed positioning and shadows for print */
  .page { margin: 0 auto; padding: 0 20px; }
  .callout { box-shadow: none; }
  .research-fig { box-shadow: none; }
}

@media (max-width: 1100px) {
  .sidebar-note { display: none; }
  .page { margin-right: auto; }
}
@media (max-width: 768px) {
  .split-panel { grid-template-columns: 1fr; }
  .chapter-title { font-size: 32px; }
  .chapter-nav { display: none; }
  .logo { position: static; padding: 16px 0 0 16px; }
  .page { padding: 20px 16px 80px; margin-right: auto; }
}
