:root {
  --bg: #f6efe4;
  --bg-soft: #fff9f0;
  --text: #2a241f;
  --muted: #6c6259;
  --card: rgba(255, 255, 255, 0.75);
  --card-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(70, 47, 35, 0.12);
  --accent: #c96f4f;
  --accent-dark: #9d4f35;
  --ink: #25201d;
  --yellow: #ffe16f;
  --mint: #bfe6d2;
  --shadow: 0 18px 50px rgba(63, 37, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 220, 178, 0.95), transparent 30%),
    radial-gradient(circle at bottom right, rgba(201, 111, 79, 0.18), transparent 35%),
    linear-gradient(180deg, #f8f1e6 0%, #f4eadb 100%);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.topbar {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 14px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.56);
  border: 0;
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.topbar a.active,
.topbar a:hover {
  color: var(--text);
  background: var(--yellow);
}

.hero,
.story {
  background: var(--card);
  border: 0;
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: center;
}

.comic-hero {
  display: block;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.88), transparent 19%),
    radial-gradient(circle at 12% 92%, rgba(191, 230, 210, 0.55), transparent 24%),
    linear-gradient(135deg, rgba(255, 248, 232, 0.92), rgba(255, 226, 190, 0.78));
}

.comic-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(42, 36, 31, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 36, 31, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
  pointer-events: none;
}

.comic-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(290px, 0.88fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
}

.speech-bubble {
  position: relative;
  align-self: center;
  padding: clamp(22px, 4vw, 42px);
  background: #fffdf7;
  border: 4px solid var(--ink);
  border-radius: 34px;
  box-shadow: 10px 10px 0 rgba(42, 36, 31, 0.12);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: 82px;
  width: 42px;
  height: 42px;
  background: #fffdf7;
  border-right: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  transform: rotate(-45deg);
  border-bottom-right-radius: 8px;
}

.comic-character {
  position: relative;
  min-height: 430px;
  display: flex;
  align-items: end;
  justify-content: center;
  isolation: isolate;
}

.comic-character::before {
  content: "";
  position: absolute;
  inset: 12px 0 34px;
  z-index: -2;
  background:
    repeating-radial-gradient(circle at center, rgba(201, 111, 79, 0.24) 0 5px, transparent 6px 18px),
    radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent 62%);
  border-radius: 50%;
}

.narrator {
  position: relative;
  z-index: 2;
  width: min(100%, 390px);
  max-height: 500px;
  object-fit: contain;
  filter: drop-shadow(0 20px 0 rgba(42, 36, 31, 0.08)) drop-shadow(0 24px 20px rgba(63, 37, 20, 0.2));
  transform: rotate(0.5deg);
}

.ground-shadow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 8px;
  width: min(78%, 320px);
  height: 34px;
  transform: translateX(-50%);
  background: rgba(42, 36, 31, 0.17);
  border-radius: 999px;
  filter: blur(2px);
}

.burst {
  position: absolute;
  z-index: 3;
  padding: 9px 14px;
  color: var(--text);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 rgba(42, 36, 31, 0.14);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.burst-one {
  top: 56px;
  right: 18px;
  transform: rotate(8deg);
}

.burst-two {
  left: 6px;
  bottom: 118px;
  background: var(--mint);
  transform: rotate(-9deg);
}

.comic-actions {
  position: relative;
  z-index: 2;
  justify-content: center;
  margin-top: 6px;
}

.comic-page {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 6%, rgba(255, 225, 111, 0.34), transparent 20%),
    radial-gradient(circle at 4% 72%, rgba(191, 230, 210, 0.45), transparent 26%),
    rgba(255, 249, 240, 0.78);
}

.comic-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(42, 36, 31, 0.09) 1px, transparent 1px);
  background-size: 14px 14px;
  mask-image: linear-gradient(180deg, black, transparent 82%);
  pointer-events: none;
}

.comic-page > * {
  position: relative;
  z-index: 1;
}

.comic-intro {
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 30px);
  align-items: center;
  margin-bottom: 24px;
}

.comic-intro.reverse {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.38fr);
}

.mini-character {
  position: relative;
  min-height: 260px;
  display: flex;
  align-items: end;
  justify-content: center;
}

.mini-character::before {
  content: "";
  position: absolute;
  inset: 22px 2px 18px;
  z-index: -1;
  background: radial-gradient(circle, rgba(255, 225, 111, 0.7), transparent 68%);
  border-radius: 999px;
}

.mini-character img {
  width: min(100%, 230px);
  max-height: 310px;
  object-fit: contain;
  filter: drop-shadow(0 18px 14px rgba(63, 37, 20, 0.2));
}

.mini-character-right img {
  transform: scaleX(-1);
}

.mini-burst {
  top: 22px;
  left: 0;
  font-size: 0.85rem;
  transform: rotate(-8deg);
}

.speech-bubble-small h1 {
  max-width: 16ch;
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.speech-bubble-small::after {
  left: -22px;
  right: auto;
  bottom: 54px;
  transform: rotate(135deg);
}

.comic-intro.reverse .speech-bubble-small::after {
  left: auto;
  right: -22px;
  transform: rotate(-45deg);
}

.comic-panel {
  border: 0;
  box-shadow: var(--shadow);
}

.panel-wide {
  margin-top: 18px;
}

.eyebrow,
.card-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent-dark);
  margin: 0 0 12px;
  font-weight: 800;
}

h1,
h2,
h3 {
  font-family: "Yeseva One", serif;
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 5rem);
  max-width: 10ch;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  margin-bottom: 10px;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.lead,
.story p,
.profile-card p,
.card p {
  font-size: 1.03rem;
  line-height: 1.75;
  color: var(--muted);
}

.lead {
  max-width: 58ch;
  margin: 20px 0 0;
}

.hero-actions,
.story-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 800;
  border: 0;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 46px rgba(63, 37, 20, 0.16);
}

.button.primary {
  background: var(--accent);
  color: white;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.7);
}

.profile-card {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 18px;
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}

.avatar {
  width: min(100%, 320px);
  display: block;
  border-radius: 24px;
}

.grid,
.story-grid,
.monster-panel {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

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

.card,
.story-card {
  background: var(--card-strong);
  border: 0;
  border-radius: 26px;
  padding: 22px;
}

.card.accent {
  background: linear-gradient(180deg, rgba(201, 111, 79, 0.14), rgba(255, 255, 255, 0.88));
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.story {
  padding: 30px;
}

.story > .lead {
  margin-bottom: 6px;
}

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

.story-card.dark {
  background: linear-gradient(180deg, rgba(47, 58, 82, 0.95), rgba(47, 58, 82, 0.86));
  color: #f6efe4;
}

.story-card.dark p {
  color: rgba(246, 239, 228, 0.84);
}

.monster-panel {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  margin-top: 28px;
}

.monster-illustration {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: end;
  justify-content: center;
  overflow: hidden;
  padding: 26px;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.9), transparent 42%),
    repeating-radial-gradient(circle at center, rgba(255, 225, 111, 0.38) 0 5px, transparent 6px 22px),
    linear-gradient(135deg, #ffe9c4, #c96f4f);
  border-radius: 26px;
}

.monster-illustration::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 0;
  border-radius: 22px;
}

.comic-strip {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.comic-scene {
  position: relative;
  padding: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.comic-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 92% 18%, rgba(255, 225, 111, 0.32), transparent 22%),
    radial-gradient(circle at 8% 88%, rgba(191, 230, 210, 0.38), transparent 28%);
  pointer-events: none;
}

.comic-scene > * {
  position: relative;
  z-index: 1;
}

.scene-number {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--yellow);
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.comic-scene p:not(.scene-number):not(.speech-line) {
  color: var(--muted);
  line-height: 1.75;
}

.dialogue-row {
  margin: 18px 0;
}

.speech-line {
  display: inline-block;
  margin: 0;
  padding: 14px 18px;
  background: #fffdf7;
  border: 3px solid var(--ink);
  border-radius: 20px 20px 20px 6px;
  box-shadow: 5px 5px 0 rgba(42, 36, 31, 0.1);
  font-weight: 800;
  line-height: 1.45;
}

.monster-talk .speech-line {
  background: #eef5ef;
  border-radius: 20px 20px 6px 20px;
}

.scene-city {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 233, 196, 0.82));
}

.scene-monster {
  background: linear-gradient(135deg, rgba(47, 58, 82, 0.1), rgba(255, 255, 255, 0.82));
}

.scene-boots {
  background: linear-gradient(135deg, rgba(191, 230, 210, 0.5), rgba(255, 255, 255, 0.84));
}

.monster-photo {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 390px;
  max-height: 470px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 24px 20px rgba(42, 36, 31, 0.28));
}

.monster-shadow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 24px;
  width: min(70%, 320px);
  height: 34px;
  transform: translateX(-50%);
  background: rgba(42, 36, 31, 0.2);
  border-radius: 999px;
  filter: blur(2px);
}

.monster-burst {
  top: 22px;
  left: 22px;
  background: #ffb38f;
  transform: rotate(-8deg);
}

@media (max-width: 900px) {
  .hero,
  .grid,
  .comic-strip,
  .story-grid,
  .monster-panel {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 14ch;
  }

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

  .speech-bubble::after {
    right: 86px;
    bottom: -22px;
    transform: rotate(45deg);
  }

  .comic-character {
    min-height: 360px;
  }

  .comic-intro,
  .comic-intro.reverse {
    grid-template-columns: 1fr;
  }

  .comic-intro.reverse .speech-bubble {
    order: 1;
  }

  .comic-intro.reverse .mini-character {
    order: 2;
  }

  .speech-bubble-small::after,
  .comic-intro.reverse .speech-bubble-small::after {
    left: 72px;
    right: auto;
    bottom: -22px;
    transform: rotate(45deg);
  }

  .mini-character {
    min-height: 250px;
  }

  .monster-illustration {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 18px, 1120px);
    padding: 9px 0 24px;
  }

  .hero,
  .story {
    padding: 18px;
    border-radius: 24px;
  }

  .topbar {
    padding: 10px;
    border-radius: 24px;
    flex-wrap: wrap;
  }

  .topbar a {
    padding: 8px 12px;
  }

  .profile-card,
  .card,
  .story-card {
    border-radius: 20px;
  }

  .comic-character {
    min-height: 315px;
  }

  .narrator {
    width: min(100%, 300px);
  }

  .burst-one {
    top: 28px;
    right: 2px;
  }

  .burst-two {
    left: 0;
    bottom: 82px;
  }

  .speech-bubble {
    border-width: 3px;
    border-radius: 24px;
    box-shadow: 6px 6px 0 rgba(42, 36, 31, 0.1);
  }

  .speech-bubble::after,
  .speech-bubble-small::after,
  .comic-intro.reverse .speech-bubble-small::after {
    width: 32px;
    height: 32px;
    border-width: 3px;
  }

  .mini-character img {
    width: min(100%, 190px);
  }

  .monster-illustration {
    min-height: 300px;
    padding: 18px;
  }

  .monster-photo {
    max-height: 360px;
  }
}
