:root {
  color-scheme: light;
  --ink: #18263d;
  --muted: #58677d;
  --accent: #f5b829;
  --accent-dark: #d89206;
  --paper: #fffdf8;
  --line: #e6e0d4;
  --navy: #14223a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  background: var(--navy);
  color: white;
}

.header-inner,
.section-wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: white;
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.brand span {
  color: var(--accent);
}

nav {
  display: flex;
  gap: 26px;
}

nav a {
  color: #e3e9f2;
  font-size: 0.92rem;
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  color: var(--accent);
}

.hero {
  padding: 82px 20px 88px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(245, 184, 41, 0.2), transparent 50%),
    linear-gradient(180deg, #f8f2e5 0%, var(--paper) 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: #9a6700;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 5.3rem);
  line-height: 1.04;
  letter-spacing: -0.065em;
}

.hero h1 span {
  color: #b87900;
}

.hero-copy {
  max-width: 580px;
  margin: 22px auto 28px;
  color: var(--muted);
  font-size: 1.08rem;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 19px;
  border-radius: 999px;
  background: var(--navy);
  color: white;
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease;
}

.primary-link:hover {
  transform: translateY(-2px);
  background: #263b5e;
}

.chapters {
  padding-top: 60px;
  padding-bottom: 76px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.section-heading h2,
.journey h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.section-heading > p {
  max-width: 360px;
  margin: 0 0 4px;
  color: var(--muted);
}

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

.chapter-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 5px 16px rgba(24, 38, 61, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(24, 38, 61, 0.12);
}

.chapter-card-featured {
  border: 2px solid var(--accent);
}

.comic-link {
  display: block;
  background: #f1ede5;
}

.comic-link:focus-visible {
  outline: 4px solid #2369bd;
  outline-offset: -4px;
}

.chapter-card img {
  display: block;
  width: 100%;
  height: auto;
}

.comic-viewer {
  width: min(1000px, calc(100% - 32px));
  max-width: none;
  max-height: min(94dvh, 1000px);
  padding: 22px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.comic-viewer::backdrop {
  background: rgba(12, 22, 39, 0.82);
  backdrop-filter: blur(4px);
}

.comic-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.comic-viewer-chapter {
  margin: 0;
  color: #9a6700;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.comic-viewer-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #ece7dd;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.comic-viewer h2 {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.2;
}

.comic-viewer-stage {
  display: flex;
  justify-content: center;
  padding: 12px;
  border-radius: 12px;
  background: #e9e5dc;
}

.comic-viewer-image {
  display: block;
  max-width: 100%;
  max-height: 66dvh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.comic-viewer-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.comic-viewer-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.comic-viewer-button:last-child {
  justify-self: end;
}

.comic-viewer-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #263b5e;
}

.comic-viewer-button:focus-visible,
.comic-viewer-close:focus-visible {
  outline: 3px solid #2369bd;
  outline-offset: 3px;
}

.comic-viewer-button:disabled {
  background: #d8d5ce;
  color: #666;
  cursor: not-allowed;
}

.comic-viewer-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.card-caption {
  padding: 13px 18px 17px;
}

.card-caption span {
  color: #9a6700;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-caption h3 {
  margin: 2px 0 0;
  font-size: 1.18rem;
  line-height: 1.35;
}

.journey {
  padding: 61px 0 68px;
  background: #f5f0e5;
}

.journey-inner > p:not(.eyebrow) {
  margin: 12px 0 24px;
  color: var(--muted);
}

.path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: path;
}

.path li {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e7dcc2;
  border-radius: 12px;
  background: white;
  font-weight: 700;
  line-height: 1.35;
  counter-increment: path;
}

.path li::before {
  content: "0" counter(path);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.site-footer {
  padding: 22px 20px;
  background: var(--navy);
  color: #e3e9f2;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
}

.site-footer span {
  padding: 0 5px;
  color: var(--accent);
}

@media (max-width: 680px) {
  .header-inner {
    min-height: 62px;
  }

  .brand {
    font-size: 1rem;
  }

  nav {
    gap: 14px;
  }

  nav a {
    font-size: 0.83rem;
  }

  .hero {
    padding: 66px 20px 70px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 11px;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .comic-viewer {
    padding: 16px;
  }

  .comic-viewer-controls {
    grid-template-columns: 1fr 1fr;
  }

  .comic-viewer-count {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .comic-viewer-button {
    padding: 9px 12px;
    font-size: 0.88rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
