/* Claude Cowork vs Claude Code — teaching material
   Shared stylesheet. Light + dark, responsive, print-friendly. */

:root {
  --accent: #b8501f;
  --accent-soft: #f2e4dc;
  --bg: #faf9f7;
  --bg-raised: #ffffff;
  --bg-sunken: #f2f0ec;
  --text: #23211d;
  --text-muted: #625d55;
  --border: #e0dcd4;
  --border-strong: #c9c3b8;
  --code-bg: #f2f0ec;
  --ok: #2f6b46;
  --warn: #8a5a12;
  --no: #9b3232;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #e08a5f;
    --accent-soft: #3a2b23;
    --bg: #1a1917;
    --bg-raised: #232120;
    --bg-sunken: #131211;
    --text: #eae7e1;
    --text-muted: #a49e94;
    --border: #35322f;
    --border-strong: #4a4642;
    --code-bg: #2a2725;
    --ok: #7fc79b;
    --warn: #d9ac5e;
    --no: #e08585;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 6px 0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}
main:focus { outline: none; }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 0;
  max-width: 1320px;
  margin: 0 auto;
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 1.75rem 1.25rem 4rem;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
}

main {
  padding: 2.5rem 3rem 6rem;
  min-width: 0;
  max-width: 900px;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  main { padding: 1.75rem 1.25rem 4rem; }
}

/* ---------- Sidebar nav ---------- */

.brand {
  display: block;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.brand strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.brand span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.nav-group-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 1.4rem 0 0.45rem;
}
.nav-group-label:first-of-type { margin-top: 0; }

.sidebar ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar li { margin: 0; }
.sidebar a {
  display: flex;
  gap: 0.55rem;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.855rem;
  line-height: 1.4;
}
.sidebar a:hover { background: var(--bg-sunken); color: var(--text); }
.sidebar a.current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.sidebar a .num {
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
  min-width: 1.1em;
}

/* ---------- Typography ---------- */

h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0 0 0.5rem;
  font-weight: 700;
}
h2 {
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  margin: 2.75rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-weight: 650;
}
h3 {
  font-size: 1.06rem;
  margin: 1.9rem 0 0.5rem;
  font-weight: 650;
}
h4 {
  font-size: 0.94rem;
  margin: 1.4rem 0 0.4rem;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p { margin: 0 0 1rem; }

.lede {
  font-size: 1.075rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 62ch;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

ul, ol { padding-left: 1.3rem; margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }

code {
  font-family: var(--mono);
  font-size: 0.855em;
  background: var(--code-bg);
  padding: 0.12em 0.36em;
  border-radius: 4px;
  border: 1px solid var(--border);
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.83rem;
  line-height: 1.55;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ---------- Tables ---------- */

.tw { overflow-x: auto; margin: 0 0 1.25rem; border: 1px solid var(--border); border-radius: 8px; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.855rem;
  min-width: 520px;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
thead th {
  background: var(--bg-sunken);
  font-weight: 650;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-sunken); }
td:first-child, th:first-child { padding-left: 1rem; }
td strong { font-weight: 650; }

.yes { color: var(--ok); font-weight: 650; }
.no  { color: var(--no); font-weight: 650; }
.part{ color: var(--warn); font-weight: 650; }

/* ---------- Callouts ---------- */

.note, .warn, .key, .teach {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
  font-size: 0.91rem;
  background: var(--bg-raised);
}
.note { border-left-color: var(--accent); }
.warn { border-left-color: var(--warn); }
.key  { border-left-color: var(--ok); }
.teach{ border-left-color: var(--border-strong); background: var(--bg-sunken); }
.note > :last-child, .warn > :last-child, .key > :last-child, .teach > :last-child { margin-bottom: 0; }
.note b, .warn b, .key b, .teach b { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.3rem; }
.note b { color: var(--accent); }
.warn b { color: var(--warn); }
.key b  { color: var(--ok); }
.teach b{ color: var(--text-muted); }

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
  margin: 0 0 1.5rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 1rem 1.1rem;
  background: var(--bg-raised);
  text-decoration: none;
  color: inherit;
  display: block;
}
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 0.3rem; font-size: 0.97rem; }
.card p { margin: 0; font-size: 0.855rem; color: var(--text-muted); }
.card .num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.35rem;
}

/* two-column compare block */
.vs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin: 0 0 1.5rem;
}
@media (max-width: 700px) { .vs { grid-template-columns: 1fr; } }
.vs > div {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 1rem 1.1rem;
  background: var(--bg-raised);
}
.vs h3 { margin-top: 0; }
.vs ul { margin-bottom: 0; }

/* ---------- Meta / badges ---------- */

.meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  vertical-align: middle;
}
.badge.cw { color: var(--accent); border-color: var(--accent); }
.badge.cc { color: var(--ok); border-color: var(--ok); }

/* ---------- Prev / next ---------- */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}
.pager a {
  text-decoration: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  max-width: 47%;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager a span { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- Figures ---------- */

figure {
  margin: 0 0 1.6rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 1.1rem 1.2rem 0.85rem;
  background: var(--bg-raised);
}
figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  line-height: 1.5;
}
figcaption b {
  color: var(--text);
  font-weight: 650;
}
figcaption .synth {
  color: var(--accent);
  font-weight: 650;
}

/* Text-dense figures: below this width, scroll rather than shrink the type
   past legibility. Applied via class="dense" on the <figure>. */
@media (max-width: 640px) {
  figure.dense { overflow-x: auto; }
  figure.dense img { min-width: 560px; }
  figure.dense figcaption::after {
    content: " ← scroll to see the full figure";
    color: var(--accent);
  }
}

/* figure gallery, used on the figure index page */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 0 0 1.75rem;
}
.gallery figure { margin: 0; }
.gallery figure img { background: var(--bg); border-radius: 5px; }
.gallery figcaption { font-size: 0.76rem; }
.gallery .figid {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.2rem;
}

/* ---------- Source citations ---------- */

.src {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1.4rem;
}
.src::before { content: "Source: "; font-weight: 650; }

.srclist { font-size: 0.86rem; }
.srclist code { font-size: 0.8em; }

@media print {
  .sidebar, .pager { display: none; }
  .layout { display: block; }
  main { max-width: none; padding: 0; }
  a { color: inherit; }
}
