@import url('https://fonts.googleapis.com/css2?family=Itim&family=Mali:wght@400;500;600;700&display=swap');

:root {
  --red-900: #7b1f26;
  --red-700: #a52f38;
  --red-500: #c7444d;
  --cream: #fff8ea;
  --paper: #ffffff;
  --ink: #4d403d;
  --muted: #786966;
  --line: #efd2c4;
  --gold: #e6a72d;
  --green: #668e50;
  --shadow: 0 16px 42px rgba(86, 37, 31, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 96% 6%, rgba(255, 222, 119, .38), transparent 21rem),
    linear-gradient(180deg, #fff 0%, #fffaf5 72%, #fff7ec 100%);
  font-family: "Mali", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.75;
}
button, select, input { font: inherit; }
a { color: inherit; }
img { max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: #fff8d4;
  background: linear-gradient(105deg, var(--red-900), var(--red-500));
  box-shadow: 0 8px 24px rgba(83, 22, 29, .18);
}
.header-inner {
  max-width: 1420px;
  min-height: 88px;
  margin: auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #fff2bd;
  color: var(--red-900);
  font-size: 34px;
  border: 2px solid rgba(255,255,255,.7);
}
.brand strong {
  display: block;
  font-family: "Itim", Tahoma, sans-serif;
  font-size: 1.65rem;
  line-height: 1.1;
}
.brand small { display: block; color: #fff; font-size: .87rem; }
.nav-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  color: var(--red-900);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}
.main-nav a {
  padding: 9px 11px;
  border-radius: 13px;
  color: #fff;
  font-family: "Itim", Tahoma, sans-serif;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a:focus-visible, .main-nav a[aria-current="page"] {
  color: var(--red-900);
  background: #fff;
  outline: none;
}

main { max-width: 1320px; margin: auto; padding: 52px 28px 72px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 34px;
  align-items: stretch;
}
.hero-media, .hero-copy, .panel {
  border: 2px solid var(--line);
  border-radius: 32px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.hero-media { padding: 26px; display: grid; place-items: center; overflow: hidden; }
.hero-media img { width: 100%; border-radius: 22px; cursor: zoom-in; }
.hero-caption { width: 100%; margin-top: 18px; }
.hero-copy {
  padding: 46px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #fff, #fff8d9);
}
.eyebrow {
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 8px;
}
h1, h2, h3 { font-family: "Itim", Tahoma, sans-serif; color: var(--red-900); line-height: 1.16; }
h1 { margin: 0; font-size: clamp(3rem, 6vw, 5.8rem); }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); margin: 0 0 14px; }
h3 { font-size: 1.55rem; margin: 0 0 8px; }
.lead { font-size: 1.13rem; color: var(--muted); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  padding: 10px 22px;
  border: 2px solid var(--red-700);
  border-radius: 16px;
  background: var(--red-700);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button.secondary { background: #fff; color: var(--red-700); }
.button:focus-visible { outline: 4px solid rgba(230, 167, 45, .45); outline-offset: 2px; }
.section { margin-top: 56px; }
.section-heading { max-width: 760px; margin-bottom: 22px; }
.section-heading p { color: var(--muted); margin: 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  padding: 24px;
  border: 1.5px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(86,37,31,.07);
}
.card .icon { font-size: 2rem; }
.card p { color: var(--muted); margin: 0; }
.card-link { text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.page-head { text-align: center; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(2.6rem, 5vw, 4.8rem); }
.page-head p { max-width: 780px; margin: 10px auto 0; color: var(--muted); }
.viewer {
  padding: 24px;
  border: 2px solid var(--line);
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
}
.viewer-stage {
  min-height: 380px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: #f9fcfd;
}
.viewer-stage img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  cursor: zoom-in;
}
.viewer-caption, .hero-caption {
  padding: 19px 22px;
  border: 1.5px solid #efd2c4;
  border-left: 7px solid var(--gold);
  border-radius: 18px;
  color: var(--ink);
  background: linear-gradient(135deg, #fffaf1, #fff);
}
.viewer-caption { margin-top: 18px; }
.caption-label {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--red-700);
  font-weight: 700;
  font-size: .95rem;
}
.viewer-caption p, .hero-caption p { margin: 0; }
.viewer-controls {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 12px;
  margin-top: 18px;
}
.viewer-controls select {
  min-height: 50px;
  width: 100%;
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: #fff;
}
.viewer-note { text-align: center; margin: 12px 0 0; color: var(--muted); font-size: .92rem; }

.quiz-shell { max-width: 920px; margin: auto; }
.quiz-progress { height: 12px; border-radius: 99px; background: #f4e5df; overflow: hidden; }
.quiz-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red-500)); transition: width .25s; }
.quiz-meta { display: flex; justify-content: space-between; gap: 16px; margin: 10px 0 20px; color: var(--muted); }
.question-card { padding: 30px; border: 2px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
.question-number { color: var(--red-700); font-weight: 700; }
.question-card h2 { font-family: "Mali", Tahoma, sans-serif; font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.5; }
.choices { display: grid; gap: 12px; margin-top: 20px; }
.choice {
  width: 100%;
  padding: 15px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  border: 2px solid #ead8d1;
  border-radius: 17px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.choice:hover, .choice:focus-visible { border-color: var(--gold); background: #fffaf0; outline: none; }
.choice.selected { border-color: var(--red-700); background: #fff3f3; }
.choice strong { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: #f7e6e2; color: var(--red-900); }
.quiz-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.quiz-result { text-align: center; }
.score-circle { width: 154px; height: 154px; margin: 14px auto 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--red-700), var(--gold)); font: 700 2.1rem "Itim", sans-serif; }
.review { margin-top: 24px; display: grid; gap: 14px; text-align: left; }
.review-item { padding: 18px; border-radius: 18px; background: #fff9f4; border: 1px solid var(--line); }
.review-item.correct { border-left: 7px solid #5d8a4a; }
.review-item.incorrect { border-left: 7px solid #c7444d; }

.lightbox[hidden] { display: none !important; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25,16,14,.88);
}
.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 12px; }
.lightbox-close { position: fixed; top: 18px; right: 20px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: #fff; color: var(--red-900); font-size: 1.7rem; cursor: pointer; }

footer { padding: 32px 20px; text-align: center; color: var(--muted); }

@media (max-width: 1120px) {
  .header-inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; width: 100%; margin-left: 0; padding: 8px 0 4px; }
  .main-nav.open { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .main-nav a { text-align: center; }
}
@media (max-width: 850px) {
  main { padding: 30px 16px 54px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 32px 26px; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .header-inner { padding: 10px 14px; min-height: 76px; }
  .brand-icon { width: 54px; height: 54px; border-radius: 16px; font-size: 28px; }
  .brand strong { font-size: 1.3rem; }
  .brand small { display: none; }
  .nav-toggle { padding: 10px 14px; }
  .main-nav.open { grid-template-columns: 1fr; }
  .hero-media { padding: 12px; border-radius: 24px; }
  .hero-copy { border-radius: 24px; }
  .viewer { padding: 10px; border-radius: 22px; }
  .viewer-stage { min-height: 210px; }
  .viewer-controls { grid-template-columns: 1fr 1fr; }
  .viewer-controls select { grid-column: 1 / -1; grid-row: 1; }
  .question-card { padding: 22px 16px; }
  .quiz-actions { flex-wrap: wrap; }
}
