:root {
  color-scheme: light;
  --navy-950: #061936;
  --navy-900: #09224a;
  --navy-800: #0c2f63;
  --blue-700: #0d4a9a;
  --gold-500: #f5b73c;
  --gold-300: #ffe4a3;
  --ink: #10234a;
  --muted: #60708e;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --line: #dfe6f1;
  --success: #2eae69;
  --danger: #db3f45;
  --shadow: 0 18px 45px rgba(8, 28, 61, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef3f9 0%, #ffffff 48%, #f5f7fb 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
summary,
button,
a {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.container {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(6, 25, 54, 0.97);
  border-bottom: 1px solid rgba(245, 183, 60, 0.65);
  box-shadow: 0 8px 28px rgba(3, 16, 35, 0.26);
  color: #ffffff;
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 86px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand__logo,
.brand__mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
}

.brand__logo {
  object-fit: contain;
}

.brand__mark {
  display: grid;
  place-items: center;
  border: 2px solid rgba(245, 183, 60, 0.8);
  color: var(--gold-500);
  font-weight: 800;
}

.brand__copy {
  display: grid;
  min-width: 0;
}

.brand__title {
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.1;
}

.brand__tagline {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
}

.category-tabs,
.main-nav,
.social-links {
  display: flex;
  align-items: center;
}

.category-tabs {
  justify-content: center;
  gap: 26px;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.category-tab__icon {
  color: #ff7676;
  font-size: 1.35rem;
  line-height: 1;
}

.main-nav {
  justify-content: flex-end;
  gap: 30px;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 8%, rgba(245, 183, 60, 0.12), transparent 25%),
    linear-gradient(110deg, var(--navy-950) 0%, var(--navy-900) 48%, #0a2c59 100%);
  color: #ffffff;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(6, 25, 54, 0.25), rgba(6, 25, 54, 0)),
    repeating-linear-gradient(90deg, transparent 0 76px, rgba(255, 255, 255, 0.025) 77px 78px);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(520px, 1.2fr);
  gap: 56px;
  align-items: center;
  min-height: 470px;
  padding: 46px 0 34px;
}

.hero__intro {
  max-width: 620px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--gold-300);
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero__description {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.9);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

.hero__description p:last-child,
.rich-text p:last-child {
  margin-bottom: 0;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 560px;
  padding: 28px 0 0;
  margin: 0;
  list-style: none;
}

.hero-features li {
  display: grid;
  gap: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 650;
}

.hero-features__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--gold-500);
  border-radius: 999px;
  color: var(--gold-500);
  font-weight: 800;
}

.book-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(210px, 1fr));
  gap: 36px;
  align-items: end;
  perspective: 1200px;
}

.book-card {
  display: grid;
  gap: 0;
  transform-style: preserve-3d;
}

.book-card--1 {
  transform: rotateY(-7deg) translateY(-6px);
}

.book-card--2 {
  transform: rotateY(6deg) translateY(8px);
}

.book-card__visual {
  display: grid;
  justify-items: center;
  min-height: 270px;
}

.book-card__image,
.book-card__placeholder {
  width: min(100%, 330px);
  aspect-ratio: 0.72;
  border-radius: 4px;
  box-shadow:
    18px 18px 34px rgba(0, 0, 0, 0.38),
    inset -10px 0 22px rgba(255, 255, 255, 0.16);
}

.book-card__image {
  object-fit: cover;
}

.book-card__placeholder {
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(135deg, #08244c, #061936 60%, #173d76);
  border: 1px solid rgba(245, 183, 60, 0.7);
  color: var(--gold-300);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  text-align: center;
}

.book-card__caption {
  display: grid;
  justify-items: center;
  min-height: 106px;
  margin-top: -36px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 15px 34px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(12px);
  text-align: center;
}

.book-card__caption h2 {
  margin-bottom: 6px;
  font-size: 1.12rem;
  letter-spacing: 0;
}

.book-card__caption .rich-text {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.book-card__caption .rich-text p:last-child {
  margin-bottom: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--blue-700);
  border-radius: 6px;
  background: linear-gradient(180deg, #0d4a9a, #072f70);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button--secondary {
  background: #ffffff;
  color: var(--navy-800);
  border-color: #aebbd0;
}

.button--ghost {
  width: auto;
  min-height: 38px;
  margin-top: 12px;
  border-color: rgba(245, 183, 60, 0.72);
  background: rgba(245, 183, 60, 0.14);
  color: #ffffff;
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.quiz {
  position: relative;
  z-index: 2;
  margin-top: -1px;
  padding: 18px 0 12px;
  background: #f7f9fc;
}

.quiz-panel {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(320px, 1fr) minmax(190px, 300px);
  gap: 30px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid rgba(185, 196, 215, 0.75);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.quiz-panel__controls {
  padding-right: 28px;
  border-right: 1px solid var(--line);
}

.quiz-panel__controls h2 {
  margin-bottom: 18px;
  color: var(--navy-800);
  font-size: 1.25rem;
  letter-spacing: 0;
}

.field-label {
  display: block;
  margin: 14px 0 6px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
}

.form-select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.quiz-stats {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f9fc;
}

.quiz-stats__title {
  margin-bottom: 8px;
  color: var(--navy-800);
  font-size: 0.88rem;
  font-weight: 800;
}

.quiz-stats__numbers {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.88rem;
}

.quiz-stats__numbers strong {
  color: var(--ink);
}

.quiz-stats__reset {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
}

.quiz-panel__question h3 {
  margin-bottom: 12px;
  color: var(--navy-800);
  font-size: 1rem;
  letter-spacing: 0;
}

.quiz-subject {
  min-height: 20px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.choices {
  display: grid;
  gap: 9px;
}

.choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.choice:hover:not(:disabled) {
  border-color: var(--success);
  background: #eaf8f0;
  box-shadow: 0 0 0 2px rgba(46, 174, 105, 0.16);
}

.choice__marker {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue-700);
  font-weight: 800;
}

.choice.is-correct {
  border-color: var(--success);
  background: #e7f8ef;
  color: #145b36;
  box-shadow: 0 0 0 2px rgba(46, 174, 105, 0.14);
}

.choice.is-wrong {
  border-color: var(--danger);
  background: #fff0f1;
  color: #8a1d25;
  box-shadow: 0 0 0 2px rgba(219, 63, 69, 0.12);
}

.choice.is-correct .choice__marker {
  background: var(--success);
  color: #ffffff;
}

.choice.is-wrong .choice__marker {
  background: var(--danger);
  color: #ffffff;
}

.choice:disabled {
  cursor: default;
}

.quiz-explanation {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #c9ead8;
  border-radius: 7px;
  background: #f2fbf6;
  color: #145b36;
  font-size: 0.94rem;
  line-height: 1.55;
}

.quiz-explanation p:last-child {
  margin-bottom: 0;
}

.quiz-panel__actions {
  display: grid;
  align-self: flex-start;
  gap: 14px;
}

.quiz-recommendation {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: block;
  width: min(380px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid rgba(245, 183, 60, 0.74);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 18px 60px rgba(8, 28, 61, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.quiz-recommendation[hidden] {
  display: none;
}

.quiz-recommendation.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.quiz-recommendation--text-only {
  grid-template-columns: 1fr;
}

.quiz-recommendation__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(12, 47, 99, 0.12);
  border-radius: 999px;
  background: #f7f9fc;
  color: var(--navy-800);
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
}

.quiz-recommendation__media {
  align-self: start;
  display: grid;
  place-items: center;
  width: 88px;
  min-height: 108px;
  border-radius: 7px;
  background: linear-gradient(180deg, #f7f9fc, #fff7e4);
}

.quiz-recommendation__image {
  width: 100%;
  max-height: 118px;
  object-fit: contain;
}

.quiz-recommendation__eyebrow {
  margin-bottom: 5px;
  color: #9b6408;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quiz-recommendation h2 {
  padding-right: 28px;
  margin-bottom: 10px;
  color: var(--navy-800);
  font-size: 1.02rem;
  letter-spacing: 0;
  line-height: 1.25;
}

.quiz-recommendation__item[hidden] {
  display: none;
}

.quiz-recommendation__top {
  padding-right: 28px;
}

.quiz-recommendation__content {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.quiz-recommendation__item--text-only .quiz-recommendation__content {
  grid-template-columns: 1fr;
}

.quiz-recommendation__text {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.quiz-recommendation__text p:last-child {
  margin-bottom: 0;
}

.quiz-recommendation .button {
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  font-size: 0.9rem;
}

.quiz-recommendation__nav {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.quiz-recommendation__nav button {
  display: grid;
  place-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9fc;
  color: var(--navy-800);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.quiz-recommendation__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.quiz-recommendation__dots button {
  width: 9px;
  min-height: 9px;
  padding: 0;
  border-color: rgba(12, 47, 99, 0.24);
  background: #dfe6f1;
}

.quiz-recommendation__dots button.is-active {
  border-color: var(--gold-500);
  background: var(--gold-500);
}

.report-modal {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.report-modal::backdrop {
  background: rgba(4, 18, 39, 0.62);
}

.report-modal__panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.report-modal__header,
.report-modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.report-modal__header h3 {
  margin: 0;
  color: var(--navy-800);
  font-size: 1.1rem;
}

.report-modal__close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1.25rem;
}

.report-modal__textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
}

.report-modal__message {
  margin: 12px 0;
  color: var(--success);
  font-weight: 700;
}

.report-modal__message.is-error {
  color: var(--danger);
}

.report-modal__actions {
  margin-top: 16px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.info {
  padding: 8px 0 20px;
  background: #f7f9fc;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.info-card {
  position: relative;
  display: grid;
  min-height: 160px;
  overflow: hidden;
  border: 1px solid rgba(213, 221, 234, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(18, 42, 76, 0.09);
}

.info-card__body {
  position: relative;
  z-index: 1;
  padding: 20px;
}

.info-card__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.info-card__icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--navy-800);
  color: var(--gold-500);
  font-weight: 800;
}

.info-card h2 {
  margin-bottom: 0;
  color: var(--navy-800);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.info-card .rich-text {
  color: var(--ink);
  font-size: 0.9rem;
}

.faq {
  padding: 0 0 22px;
  background: #f7f9fc;
}

.faq__inner {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  padding: 10px 14px;
  border: 1px solid rgba(213, 221, 234, 0.9);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(18, 42, 76, 0.07);
}

.faq__title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.faq__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--navy-800);
  color: var(--gold-500);
  font-weight: 900;
}

.faq__title h2 {
  margin: 0;
  color: var(--navy-800);
  font-size: 1.08rem;
}

.faq__items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.faq-item {
  min-width: 0;
  border-left: 1px solid var(--line);
}

.faq-item summary {
  min-height: 44px;
  padding: 11px 14px;
  color: var(--navy-800);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  float: right;
  content: "+";
  color: var(--blue-700);
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item .rich-text {
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer {
  background: var(--navy-950);
  color: #ffffff;
  border-top: 1px solid rgba(245, 183, 60, 0.35);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  padding: 16px 0;
}

.brand--footer .brand__title {
  font-size: 1.2rem;
}

.site-footer__copyright {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
}

.social-links {
  gap: 10px;
}

.social-links a {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.rich-text {
  max-width: 860px;
}

.rich-text a {
  color: var(--blue-700);
  font-weight: 700;
}

.fallback,
.admin-tool {
  padding: 44px 0;
}

.fallback {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.message-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.message {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.message--success {
  border-color: #b8e3c8;
  background: #eefaf2;
  color: var(--success);
}

.message--warning {
  border-color: #f3d49b;
  background: #fff8e8;
  color: #7a5200;
}

.message--error {
  border-color: #efb7b7;
  background: #fdecec;
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-tool-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-tool-table th,
.admin-tool-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-tool-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-tool-table tr:last-child td {
  border-bottom: 0;
}

.admin-tool-table__action {
  width: 1%;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .site-header__inner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 0;
  }

  .category-tabs,
  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
  }

  .hero__grid,
  .quiz-panel {
    grid-template-columns: 1fr;
  }

  .quiz-panel__controls {
    padding-right: 0;
    padding-bottom: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quiz-panel__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-grid,
  .faq__items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 24px, 1500px);
  }

  .hero__grid {
    gap: 30px;
    min-height: auto;
    padding: 32px 0 28px;
  }

  .hero-features,
  .book-stage,
  .info-grid,
  .faq__inner,
  .faq__items,
  .quiz-panel__actions {
    grid-template-columns: 1fr;
  }

  .book-card--1,
  .book-card--2 {
    transform: none;
  }

  .book-card__visual {
    min-height: 220px;
  }

  .book-card__image,
  .book-card__placeholder {
    width: min(260px, 78vw);
  }

  .quiz-panel {
    padding: 14px;
  }

  .quiz-recommendation {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: min(360px, calc(100vh - 24px));
    overflow-y: auto;
    padding: 12px;
  }

  .quiz-recommendation__content {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
  }

  .quiz-recommendation__media {
    width: 72px;
    min-height: 92px;
  }

  .quiz-recommendation__image {
    max-height: 96px;
  }

  .info-card {
    min-height: 180px;
  }

  .faq-item {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
