:root {
  --bg: #e3eefb;
  --paper: rgba(247, 251, 255, 0.88);
  --ink: #0f1720;
  --muted: #45576d;
  --line: rgba(11, 24, 40, 0.13);
  --accent: #166bc7;
  --accent-deep: #0f4d93;
  --teal: #2e90df;
  --shadow: 0 18px 55px rgba(15, 35, 61, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Verdana, Arial, sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgba(22, 107, 199, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(46, 144, 223, 0.13), transparent 24%),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 52%, #d4e4f8 100%);
  min-height: 100vh;
}

a { color: inherit; }

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(246, 251, 255, 0.8);
  border-bottom: 1px solid rgba(20, 45, 78, 0.08);
}

.nav-shell,
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav-shell { padding: 1rem 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  font-weight: 700;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong,
h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", Times, serif;
}

.brand-text small { color: var(--muted); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.site-nav a {
  text-decoration: none;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  color: var(--muted);
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  background: rgba(47, 127, 209, 0.1);
  color: var(--ink);
}

.hero,
.page-shell { padding: 4.5rem 0 3rem; }

.hero-grid,
.spotlight-grid,
.split-panel,
.content-grid,
.chapter-grid {
  display: grid;
  gap: 1.2rem;
}

.hero-grid {
  grid-template-columns: 1.45fr 0.95fr;
  align-items: center;
}

.spotlight-grid,
.split-panel,
.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chapter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.2rem;
}

.info-grid .content-card p:last-child,
.info-grid .content-card ul:last-child {
  margin-bottom: 0;
}

.hero-copy h1,
.page-hero h1 {
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 0.95;
  margin: 0 0 1rem;
  letter-spacing: -0.04em;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 60ch;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-deep);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin: 1.6rem 0 1.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #66a9ea);
  color: #fff;
  box-shadow: 0 14px 30px rgba(31, 79, 137, 0.24);
}

.button-secondary {
  background: rgba(22, 107, 199, 0.12);
  border: 1px solid rgba(22, 107, 199, 0.28);
  color: var(--accent-deep);
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible {
  outline: 3px solid rgba(22, 107, 199, 0.22);
  outline-offset: 2px;
}

.button-primary:hover {
  background: linear-gradient(135deg, #125cad, #5a9fe5);
  box-shadow: 0 18px 34px rgba(31, 79, 137, 0.3);
}

.button-secondary:hover {
  background: rgba(22, 107, 199, 0.2);
  border-color: rgba(22, 107, 199, 0.42);
  box-shadow: 0 12px 26px rgba(31, 79, 137, 0.16);
}

.text-link {
  color: var(--accent-deep);
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.hero-points,
.plain-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.hero-card,
.panel,
.content-card,
.chapter-card,
.resource-section {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card,
.content-card,
.panel,
.chapter-card,
.resource-section { padding: 1.6rem; }

.card-label {
  margin: 0 0 0.7rem;
  font-weight: 700;
  color: var(--teal);
}

.author-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

.author-inline img,
.author-portrait img {
  display: block;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.7);
}

.author-inline img {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(15, 35, 61, 0.14);
}

.panel-wide {
  grid-column: 1 / -1;
}

.panel-centered {
  text-align: center;
}

.author-inline strong,
.author-portrait strong {
  display: block;
  font-size: 1.05rem;
}

.author-inline span,
.author-portrait span {
  color: var(--muted);
}

.cover-frame {
  margin-top: 1.2rem;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(11, 24, 40, 0.12);
  box-shadow: 0 18px 40px rgba(15, 35, 61, 0.16);
  background: #166bc7;
}

.cover-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.thumb-grid .cover-frame {
  margin-top: 0;
}

.thumb-link {
  display: block;
}

.thumb-link.cover-frame {
  display: grid;
  place-items: center;
  background: #e5e9ef;
  min-height: 220px;
}

.thumb-link.cover-frame img {
  width: auto;
  max-width: 100%;
  max-height: 280px;
  margin: 0 auto;
}

.book-meta,
.contact-list {
  display: grid;
  gap: 0.85rem;
}

.book-meta div,
.contact-list div {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

dt {
  font-size: 0.85rem;
  color: var(--muted);
}

dd {
  margin: 0.2rem 0 0;
  font-weight: 700;
}

.section { padding: 1.5rem 0 3rem; }

.section-heading,
.page-hero { margin-bottom: 1.4rem; }

.section-heading h2,
.panel h2,
.content-card h2,
.hero-card h2,
.chapter-card h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.55rem, 2vw, 2.4rem);
}

.chapter-card {
  text-decoration: none;
}

.chapter-card h2 {
  margin: 0.35rem 0 0.7rem;
  font-size: 1.4rem;
}

.chapter-card p {
  margin: 0;
  color: var(--muted);
}

.chapter-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.chapter-nav a {
  display: block;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow);
}

.chapter-nav strong {
  display: block;
  margin-bottom: 0.2rem;
}

.chapter-nav span {
  color: var(--muted);
  font-size: 0.95rem;
}

.chapter-nav a.chapter-nav-center {
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(7, 14, 24, 0.86);
  z-index: 1000;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: min(1100px, 100%);
  max-height: 100%;
  overflow: auto;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 4rem);
  transform-origin: center center;
  transition: transform 120ms ease;
}

.lightbox-close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.resource-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resource-section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
}

.resource-links {
  margin: 0;
  padding-left: 1.2rem;
}

.resource-links li + li {
  margin-top: 0.55rem;
}

.resource-links a {
  color: var(--accent-deep);
}

.source-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(22, 107, 199, 0.12);
  border: 1px solid rgba(22, 107, 199, 0.18);
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  vertical-align: middle;
}

.chapter-index {
  color: var(--accent-deep);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.accent-card {
  background: linear-gradient(180deg, rgba(74, 167, 199, 0.2), rgba(255, 255, 255, 0.76));
}

.author-layout {
  align-items: start;
}

.author-portrait {
  text-align: center;
}

.author-portrait img {
  width: min(100%, 320px);
  margin: 0 auto 1rem;
  border-radius: 24px;
  border: 1px solid rgba(11, 24, 40, 0.12);
  box-shadow: 0 18px 40px rgba(15, 35, 61, 0.16);
}

.site-footer { padding: 2rem 0 3rem; }

.footer-row {
  color: var(--muted);
  border-top: 1px solid rgba(20, 45, 78, 0.08);
  padding-top: 1.2rem;
}

@media (max-width: 900px) {
  .hero-grid,
  .spotlight-grid,
  .split-panel,
  .content-grid,
  .info-grid,
  .resource-grid,
  .thumb-grid,
  .chapter-nav,
  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .nav-shell,
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero,
  .page-shell { padding-top: 3rem; }
  .site-nav { width: 100%; }
}
