:root {
  --ink: #101012;
  --blue: #063f91;
  --blue-deep: #00266f;
  --blue-dark: #061a58;
  --rule: #aeb5c1;
  --paper: #fbfaf6;
  --paper-warm: #f5f2eb;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.95), transparent 32rem),
    linear-gradient(135deg, #e3e0d7 0%, #f8f6ef 45%, #d8d5cc 100%);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

.book {
  display: grid;
  grid-template-columns: minmax(20rem, 48rem);
  justify-content: center;
  max-width: 54rem;
  margin: 0 auto;
  border: 1px solid #121212;
  box-shadow: 0 2rem 5rem rgba(12, 18, 32, 0.22);
}

.page {
  min-height: 50rem;
  background:
    radial-gradient(circle at 70% 12%, rgba(255, 255, 255, 0.92), transparent 28rem),
    linear-gradient(90deg, rgba(0, 0, 0, 0.045), transparent 1.2rem),
    var(--paper);
  border-left: 1px solid #141414;
  border-bottom: 1px solid #141414;
  position: relative;
}

.page:nth-child(odd) {
  border-left: 1px solid #141414;
}

.cover {
  display: grid;
  grid-template-columns: 10rem 1fr;
}

.spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 4rem 1.5rem;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 35%),
    linear-gradient(180deg, #0658ad 0%, #022a73 100%);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.mark {
  display: grid;
  place-items: center;
  width: 5.75rem;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.9);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.35rem;
  letter-spacing: 0;
}

.spine-rule {
  width: 3.6rem;
  height: 0.32rem;
  margin-top: 7.8rem;
  background: #fff;
}

.spine p {
  margin: auto 0 0;
  line-height: 1.55;
}

.cover-content {
  padding: 13.5rem 5.2rem 4.5rem;
}

h1,
h2,
h3,
.deck,
.page-header,
th {
  color: var(--blue-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 5vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.accent-line {
  width: 80%;
  height: 0.18rem;
  margin: 2rem 0 1.8rem;
  background: linear-gradient(90deg, var(--blue) 0 25%, var(--blue-dark) 25% 26%, var(--blue) 26% 100%);
}

.deck {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.7;
}

.source,
.note,
blockquote {
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.5;
}

.source {
  margin: 2rem 0 3.8rem;
}

.tool-link {
  margin: -2.2rem 0 3rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

a {
  color: var(--blue);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  color: var(--blue-deep);
}

blockquote {
  margin: 0;
  max-width: 22rem;
}

blockquote span {
  display: block;
  height: 2.5rem;
  color: var(--blue);
  font-size: 6rem;
  font-style: normal;
  line-height: 0.6;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3.3rem 5rem 0;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid #1b1b1b;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}

.prose {
  max-width: 33rem;
  margin: 7.8rem auto 0;
}

h2 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.short-rule {
  width: 6rem;
  height: 0.42rem;
  margin: 1.7rem 0 2.8rem;
  background: var(--blue);
}

.prose p {
  margin: 0 0 2rem;
  font-size: 1.14rem;
  line-height: 1.55;
}

.rule-list {
  list-style: none;
  margin: 1.8rem 5rem 0;
  padding: 0;
}

.rule-list li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding: 1.3rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}

.rule-list li:first-child {
  padding-top: 0;
}

.number {
  color: var(--blue);
  font-size: 3.4rem;
  line-height: 0.95;
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.18rem;
  line-height: 1.2;
}

.rule-list p {
  margin: 0;
  font-size: 1.03rem;
  line-height: 1.42;
}

.compact {
  margin-top: 2rem;
}

.scale h2 {
  margin: 1.4rem 5rem 1rem;
  font-size: 1.26rem;
  letter-spacing: 0.06em;
}

table {
  width: calc(100% - 10rem);
  margin: 0 5rem;
  border-collapse: collapse;
  border: 1px solid var(--rule);
  font-size: 0.96rem;
}

th {
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--blue);
  border-right: 1px solid #fff;
  font-family: Arial, Helvetica, sans-serif;
  text-align: left;
}

td {
  padding: 0.62rem 1rem;
  border-right: 1px solid var(--rule);
}

td:first-child,
th:first-child {
  width: 6rem;
  text-align: center;
  font-weight: 700;
}

tbody tr:nth-child(odd) {
  background: rgba(6, 63, 145, 0.045);
}

.note {
  margin: 1.8rem 5rem 0;
  max-width: 33rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checker-body {
  min-height: 100vh;
  padding: 3rem 1.5rem;
}

.checker-shell {
  max-width: 72rem;
  margin: 0 auto;
  border: 1px solid #141414;
  background: var(--paper);
  box-shadow: 0 2rem 5rem rgba(12, 18, 32, 0.22);
}

.checker-hero {
  padding: 3rem clamp(1.5rem, 5vw, 5rem) 2.5rem;
  border-bottom: 1px solid #141414;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.05), transparent 1.2rem),
    radial-gradient(circle at 80% 8%, rgba(255, 255, 255, 0.95), transparent 24rem),
    var(--paper);
}

.back-link,
.eyebrow,
.checker-deck,
.checker-actions,
label,
.score-label,
.stats,
.finding-type {
  font-family: Arial, Helvetica, sans-serif;
}

.back-link {
  display: inline-block;
  margin-bottom: 4rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.checker-hero h1 {
  max-width: 54rem;
  font-size: clamp(3rem, 8vw, 6.8rem);
}

.checker-deck {
  max-width: 38rem;
  margin: 1.2rem 0 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.65;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-dark);
}

.checker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.95fr);
  gap: 0;
}

.editor-panel,
.report-panel {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.editor-panel {
  border-right: 1px solid #141414;
}

label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

textarea {
  display: block;
  width: 100%;
  min-height: 28rem;
  resize: vertical;
  padding: 1rem;
  border: 1px solid #141414;
  border-radius: 0;
  background: #fffef9;
  color: var(--ink);
  font: 1.05rem/1.55 Georgia, "Times New Roman", serif;
}

textarea:focus {
  outline: 0.2rem solid rgba(6, 63, 145, 0.2);
  outline-offset: 0.12rem;
}

.checker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

button {
  min-height: 2.8rem;
  padding: 0 1rem;
  border: 1px solid #141414;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font: 800 0.78rem/1 Arial, Helvetica, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

button:hover,
button:focus-visible {
  background: var(--blue-deep);
}

button.secondary {
  background: transparent;
  color: var(--blue-dark);
}

button.secondary:hover,
button.secondary:focus-visible {
  background: var(--paper-warm);
}

.score-card {
  display: grid;
  gap: 0.35rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.score-label,
.finding-type {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.score-card strong {
  color: var(--ink);
  font-size: 5rem;
  line-height: 0.95;
}

.score-card span:last-child {
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.45;
}

.stats {
  display: flex;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.findings {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.findings li {
  padding: 1rem 0 1.1rem;
  border-bottom: 1px solid var(--rule);
}

.findings strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.25rem;
}

.findings p {
  margin: 0.55rem 0 0.35rem;
  line-height: 1.45;
}

.findings em {
  display: block;
  color: var(--blue-dark);
  line-height: 1.45;
}

.findings .empty {
  color: var(--blue-dark);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.45;
}

@media (max-width: 880px) {
  .book {
    grid-template-columns: 1fr;
    border-inline: 0;
  }

  .page {
    min-height: auto;
    border-left: 0;
  }

  .cover {
    grid-template-columns: 6.25rem 1fr;
  }

  .spine {
    padding: 2rem 1rem;
  }

  .mark {
    width: 4rem;
    font-size: 1.7rem;
  }

  .spine-rule {
    width: 2.8rem;
    margin-top: 4rem;
  }

  .cover-content {
    padding: 6rem 2rem 4rem;
  }

  .page-header {
    margin: 2rem 2rem 0;
  }

  .prose,
  .rule-list,
  .scale h2,
  table,
  .note {
    margin-left: 2rem;
    margin-right: 2rem;
  }

  .prose {
    margin-top: 4rem;
    margin-bottom: 4rem;
  }

  table {
    width: calc(100% - 4rem);
  }

  .note {
    margin-bottom: 3rem;
  }

  .checker-body {
    padding: 0;
  }

  .checker-shell {
    border-inline: 0;
  }

  .checker-grid {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    border-right: 0;
    border-bottom: 1px solid #141414;
  }

  textarea {
    min-height: 20rem;
  }
}

@media (max-width: 560px) {
  .cover {
    grid-template-columns: 1fr;
  }

  .spine {
    min-height: auto;
    flex-direction: row;
    justify-content: space-between;
    padding: 1rem 1.25rem;
  }

  .spine-rule {
    display: none;
  }

  .spine p {
    margin: 0;
    text-align: right;
  }

  .cover-content {
    padding: 4rem 1.5rem 3rem;
  }

  .accent-line {
    width: 100%;
  }

  .page-header,
  .prose,
  .rule-list,
  .scale h2,
  table,
  .note {
    margin-left: 1.25rem;
    margin-right: 1.25rem;
  }

  .rule-list li {
    grid-template-columns: 3.5rem 1fr;
    gap: 0.8rem;
  }

  .number {
    font-size: 2.85rem;
  }

  table {
    width: calc(100% - 2.5rem);
    font-size: 0.86rem;
  }

  th,
  td {
    padding: 0.55rem 0.65rem;
  }
}
