:root {
  color-scheme: light;
  --site-bg: #f6f2e8;
  --site-panel: rgba(255, 253, 248, 0.96);
  --site-ink: #2a241d;
  --site-muted: #7a6d5e;
  --site-border: rgba(70, 52, 35, 0.14);
  --site-shadow: 0 10px 22px rgba(56, 36, 21, 0.08);
  --site-accent: #c8503c;
  --site-blue: #2e5eaa;
  --site-font: "Coming Soon", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --site-text-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--site-ink);
  background: radial-gradient(circle at top, #fffefb 0%, var(--site-bg) 72%);
  font-family: var(--site-text-font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.site {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) clamp(16px, 4vw, 40px) 80px;
}

h1,
h2,
.site-name,
.chapter-number,
.chapter-title,
.exercise-label,
.part {
  font-family: var(--site-font);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.site-header {
  margin-bottom: clamp(28px, 5vw, 48px);
}

.site-name {
  margin: 0 0 10px;
  color: var(--site-accent);
  font-size: 1.1rem;
  font-weight: 700;
}

.site-intro {
  max-width: 60ch;
  margin: 14px 0 0;
  color: var(--site-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.book + .book,
.loose {
  margin-top: clamp(32px, 6vw, 56px);
}

.book-title {
  margin-bottom: 16px;
}

.book-edition {
  color: var(--site-muted);
  font-weight: 400;
}

.chapter-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.chapter-card,
.loose-card {
  display: grid;
  gap: 6px;
  padding: 20px 22px;
  border: 1px solid var(--site-border);
  border-radius: 18px;
  background: var(--site-panel);
  box-shadow: var(--site-shadow);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.chapter-card:hover,
.loose-card:hover {
  transform: translateY(-2px);
  border-color: rgba(42, 36, 29, 0.3);
  box-shadow: 0 14px 28px rgba(56, 36, 21, 0.12);
}

.chapter-card .chapter-number {
  color: var(--site-accent);
  font-size: 0.95rem;
}

.chapter-title {
  font-size: 1.35rem;
  line-height: 1.2;
}

.chapter-paragraphs {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  color: var(--site-muted);
  font-size: 0.92rem;
}

.chapter-count {
  margin-top: 8px;
  color: var(--site-blue);
  font-size: 0.85rem;
  font-weight: 700;
}

.loose h2 {
  margin-bottom: 16px;
}

.loose-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.loose-card {
  padding: 16px 18px;
  font-family: var(--site-font);
  font-size: 1.1rem;
}

.crumbs {
  margin-bottom: 18px;
  color: var(--site-muted);
  font-size: 0.92rem;
}

.crumbs a {
  color: var(--site-blue);
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.chapter-header {
  margin-bottom: clamp(24px, 5vw, 40px);
}

.chapter-header .chapter-number {
  margin: 0 0 6px;
  color: var(--site-accent);
  font-size: 1.1rem;
}

.paragraph-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.paragraph-jumps a {
  padding: 7px 14px;
  border: 1px solid var(--site-border);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.76);
  color: var(--site-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.paragraph-jumps a:hover {
  color: var(--site-ink);
  border-color: rgba(42, 36, 29, 0.3);
}

.paragraph {
  scroll-margin-top: 16px;
}

.paragraph + .paragraph {
  margin-top: clamp(32px, 6vw, 56px);
}

.paragraph h2 {
  margin-bottom: 14px;
}

.paragraph-number {
  color: var(--site-accent);
}

.exercises {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--site-border);
  border-radius: 18px;
  background: var(--site-panel);
  box-shadow: var(--site-shadow);
  overflow: hidden;
}

.exercise {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
}

.exercise + .exercise {
  border-top: 1px solid rgba(70, 52, 35, 0.08);
}

.exercise--check {
  background: rgba(46, 94, 170, 0.04);
}

.exercise-label {
  justify-self: start;
  min-width: 2.8rem;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(122, 109, 94, 0.12);
  color: var(--site-muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.exercise--check .exercise-label {
  background: rgba(46, 94, 170, 0.12);
  color: var(--site-blue);
}

.exercise-title {
  min-width: 0;
  line-height: 1.35;
}

.exercise-parts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.part {
  display: inline-grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 10px;
  border: 1px solid rgba(200, 80, 60, 0.35);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--site-accent);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.part:hover,
.part:focus-visible {
  background: var(--site-accent);
  color: #fffdf8;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .exercise {
    grid-template-columns: 3rem minmax(0, 1fr);
    row-gap: 8px;
  }

  .exercise-parts {
    grid-column: 2;
    justify-content: flex-start;
  }
}
