:root {
  color-scheme: light;
  --paper: #f5f5f1;
  --card: #ffffff;
  --ink: #202b2f;
  --muted: #617079;
  --navy: #11324a;
  --gold: #a66b1f;
  --line: #dde1df;
  --shadow: 0 18px 42px rgba(24, 35, 39, .09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 50% 38%, #ffffff 0, var(--paper) 72%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible { text-decoration: underline; }

header { text-align: center; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2 { font-family: Georgia, "Times New Roman", serif; }

h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1;
}

.category-page h1 { font-size: clamp(2.65rem, 6vw, 4.4rem); }

.rule {
  width: 72px;
  height: 2px;
  margin: 26px auto 22px;
  background: var(--gold);
}

.intro {
  max-width: 740px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.library-section { margin-top: 48px; }

.section-heading {
  margin: 0 0 20px;
  font-size: 1.85rem;
  text-align: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.library-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  align-items: center;
  padding: 32px 26px 26px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.icon {
  display: grid;
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  place-items: center;
  color: #ffffff;
  background: var(--navy);
  border-radius: 50%;
}

.icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.library-card h2 {
  margin: 22px 0 10px;
  font-size: 1.75rem;
  line-height: 1.15;
}

.library-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.card-link {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  padding: 13px 18px;
  color: #ffffff;
  background: var(--navy);
  border-radius: 9px;
  box-shadow: 0 7px 16px rgba(17, 50, 74, .18);
  font-weight: 750;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

.card-link:hover,
.card-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(17, 50, 74, .24);
}

.empty-state {
  padding: 58px 28px;
  text-align: center;
  background: rgba(255, 255, 255, .72);
  border: 1px dashed rgba(31, 42, 46, .22);
  border-radius: 18px;
}

.empty-state .icon { margin: 0 auto; }

.empty-state h2 {
  margin: 22px 0 10px;
  font-size: 1.85rem;
}

.empty-state p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
}

footer {
  margin-top: 38px;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

.manual-page .shell { width: min(920px, calc(100% - 40px)); }

.manual-page h1 {
  max-width: 820px;
  margin-inline: auto;
  font-size: clamp(2.65rem, 5.5vw, 4rem);
  line-height: 1.04;
  text-wrap: balance;
}

.manual-page .intro {
  max-width: 760px;
  color: #4f6069;
  font-size: clamp(1.08rem, 2vw, 1.22rem);
  font-weight: 650;
  line-height: 1.6;
  text-wrap: balance;
}

.quick-reference-page h1 {
  max-width: 760px;
  font-size: clamp(2.35rem, 4.8vw, 3.45rem);
}

.manual-content {
  margin-top: 42px;
  padding: clamp(26px, 5vw, 54px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.manual-content section + section {
  margin-top: 42px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.manual-content h2 {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: 1.75rem;
}

.manual-content h3 {
  margin: 25px 0 10px;
  color: var(--ink);
  font-size: 1.05rem;
}

.manual-content p,
.manual-content li {
  color: #46545b;
  line-height: 1.7;
}

.manual-content ul { padding-left: 1.3rem; }
.manual-content li + li { margin-top: 6px; }

.say {
  margin: 15px 0;
  padding: 15px 18px;
  color: #24343b;
  background: #eaf2f2;
  border-left: 4px solid #74a8aa;
  border-radius: 4px;
  font-weight: 650;
  line-height: 1.6;
}

.remember-callout {
  margin: 0 0 34px;
  padding: 24px 26px;
  background: #eaf2f2;
  border: 1px solid #d5e4e4;
  border-left: 5px solid #74a8aa;
  border-radius: 10px;
}

.remember-callout .label {
  display: block;
  margin-bottom: 8px;
}

.remember-callout p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.08rem, 2vw, 1.2rem);
  font-weight: 750;
  line-height: 1.55;
}

.label {
  color: var(--gold);
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notice {
  margin: 18px 0;
  padding: 16px 18px;
  background: #faf4e9;
  border: 1px solid #ead7b7;
  border-radius: 8px;
  line-height: 1.6;
}

.pocket-list {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.pocket-list li {
  margin: 0;
  padding: 17px 19px;
  background: #f4f6f5;
  border: 1px solid #e5e9e7;
  border-radius: 8px;
  line-height: 1.6;
}

.quick-reference-page .pocket-list strong {
  display: block;
  margin-bottom: 3px;
  color: var(--navy);
  font-size: .79rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.quick-reference-page .manual-content section {
  margin-top: 0;
}

.quick-reference-page .manual-content h2 {
  margin-bottom: 22px;
  text-align: center;
}

.quick-reference-page .notice {
  margin-top: 28px;
}

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1120px); padding-top: 24px; }
  .card-grid { grid-template-columns: 1fr; }
  .library-card { min-height: 290px; }
  .manual-page .shell { width: min(100% - 24px, 920px); }
  .manual-content { padding: 24px 20px; }
  .manual-page h1 { font-size: clamp(2.25rem, 11vw, 3rem); }
  .quick-reference-page h1 { font-size: clamp(2rem, 10vw, 2.65rem); }
  .remember-callout { padding: 20px; }
}
