:root {
  --bg: #fff7f1;
  --bg-alt: #fffdf9;
  --panel: rgba(255, 252, 248, 0.86);
  --panel-strong: #fff9f4;
  --line: rgba(114, 88, 71, 0.12);
  --text: #534438;
  --muted: #7b685a;
  --title: #3f3128;
  --peach: #f7cfc5;
  --rose: #efb9c7;
  --cream: #f8e8b9;
  --mint: #c8e8d2;
  --sky: #d5e7f3;
  --shadow: 0 24px 70px rgba(101, 75, 55, 0.12);
  --shadow-soft: 0 14px 36px rgba(131, 93, 70, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(247, 207, 197, 0.7), transparent 34%),
    radial-gradient(circle at top right, rgba(213, 231, 243, 0.75), transparent 26%),
    linear-gradient(180deg, #fff8f3 0%, #fffdfb 45%, #fff8f1 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(83, 68, 56, 0.045) 1px, transparent 1px),
    radial-gradient(rgba(83, 68, 56, 0.025) 1px, transparent 1px);
  background-position: 0 0, 18px 18px;
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent);
}

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

.page-glow {
  position: fixed;
  width: 26rem;
  height: 26rem;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.page-glow-left {
  top: -10rem;
  left: -12rem;
  background: rgba(248, 232, 185, 0.75);
}

.page-glow-right {
  right: -8rem;
  bottom: 4rem;
  background: rgba(200, 232, 210, 0.7);
}

.hero,
.layout,
.footer {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 1.2rem 1.4rem 0;
}

.topbar,
.hero-card,
.layout,
.footer {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  position: relative;
  width: 2.8rem;
  height: 2.6rem;
  border-radius: 46% 46% 42% 42%;
  background: linear-gradient(180deg, #f3c7be, #efb9c7);
  box-shadow: inset 0 -0.25rem 0 rgba(255, 255, 255, 0.45);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  top: -0.55rem;
  width: 0.95rem;
  height: 1rem;
  background: linear-gradient(180deg, #f0c4bb, #efb9c7);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.brand-mark::before {
  left: 0.25rem;
  transform: rotate(-8deg);
}

.brand-mark::after {
  right: 0.25rem;
  transform: rotate(8deg);
}

.brand-copy {
  display: grid;
  gap: 0.12rem;
}

.brand-copy strong {
  font-size: 1rem;
  color: var(--title);
}

.brand-copy span {
  font-size: 0.82rem;
  color: var(--muted);
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.topbar-links a {
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.topbar-links a:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--title);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 2rem;
  padding: 2.4rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 251, 248, 0.82)),
    linear-gradient(135deg, rgba(247, 207, 197, 0.3), rgba(213, 231, 243, 0.35));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b47c78;
}

.hero-copy h1,
.section-heading h2,
.seo-note h2 {
  margin: 0;
  color: var(--title);
  font-family: "Marck Script", "Brush Script MT", cursive;
  font-weight: 400;
  line-height: 1.04;
}

.hero-copy h1 {
  max-width: 13ch;
  font-size: clamp(2.7rem, 5vw, 4.9rem);
}

.hero-text,
.section-intro,
.feature-strip p,
.character-card p,
.sidebar-note p,
.story-card p,
.footer p {
  line-height: 1.7;
  color: var(--muted);
}

.hero-text {
  max-width: 58ch;
  margin: 1.1rem 0 1.4rem;
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.95rem;
}

.cat-button,
.cat-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3.35rem;
  padding: 0.95rem 1.25rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease;
}

.cat-button::before,
.cat-button::after,
.cat-tab::before,
.cat-tab::after {
  content: "";
  position: absolute;
  top: -0.78rem;
  width: 1.42rem;
  height: 1.52rem;
  clip-path: polygon(50% 0%, 78% 28%, 100% 100%, 0 100%, 22% 28%);
  border-radius: 0 0 46% 46%;
  --ear-outer: rgba(255, 255, 255, 0.86);
  --ear-inner: rgba(239, 185, 199, 0.24);
  background-color: var(--ear-outer);
  background-image: var(--ear-inner-shape);
  background-position: 50% 58%;
  background-repeat: no-repeat;
  background-size: 0.78rem 0.98rem;
  transform-origin: 50% 100%;
}

.cat-button::before,
.cat-tab::before {
  left: 0.82rem;
  transform: rotate(-3deg);
}

.cat-button::after,
.cat-tab::after {
  right: 0.82rem;
  transform: rotate(3deg);
}

.cat-button:hover,
.cat-tab:hover {
  transform: translateY(-2px);
}

.cat-button-primary {
  color: #5f4035;
  background: linear-gradient(180deg, #f9d7cb, #f1c0b2);
  box-shadow: 0 12px 22px rgba(239, 185, 199, 0.35);
}

.cat-button-primary::before,
.cat-button-primary::after {
  --ear-outer: #f4c8bc;
  --ear-inner: #efb2bd;
  --ear-inner-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 80'%3E%3Cpath fill='%23efb2bd' d='M32 4 C45 20 54 46 52 72 C44 78 20 78 12 72 C10 46 19 20 32 4 Z'/%3E%3C/svg%3E");
}

.cat-button-secondary {
  color: #5b534f;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 20px rgba(120, 92, 72, 0.08);
}

.cat-button-secondary::before,
.cat-button-secondary::after {
  --ear-outer: rgba(255, 255, 255, 0.8);
  --ear-inner: rgba(239, 185, 199, 0.28);
  --ear-inner-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 80'%3E%3Cpath fill='%23f3d4dc' d='M32 4 C45 20 54 46 52 72 C44 78 20 78 12 72 C10 46 19 20 32 4 Z'/%3E%3C/svg%3E");
}

.hero-points {
  display: grid;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.hero-points li {
  position: relative;
  padding-left: 1.45rem;
  color: var(--text);
}

.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #efb9c7, #f7cfc5);
}

.library-note {
  max-width: 43rem;
  margin: 0.95rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 1.2rem;
  background:
    linear-gradient(135deg, rgba(255, 247, 232, 0.88), rgba(235, 247, 226, 0.68)),
    rgba(255, 255, 255, 0.58);
  color: #76594a;
  box-shadow: 0 12px 26px rgba(131, 93, 70, 0.08);
  line-height: 1.6;
  font-weight: 700;
}

.hero-scene {
  position: relative;
  min-height: 30rem;
  border-radius: 1.7rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(215, 231, 243, 0.85), rgba(255, 255, 255, 0.8)),
    radial-gradient(circle at 30% 15%, rgba(248, 232, 185, 0.65), transparent 26%);
}

.hero-scene::before {
  content: none;
}

.moon {
  position: absolute;
  top: 2.3rem;
  right: 2.5rem;
  width: 5.8rem;
  height: 5.8rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fffdf6, #f8e8b9);
  box-shadow: 0 0 0 1rem rgba(255, 253, 246, 0.16);
  z-index: 1;
}

.hero-ground {
  position: absolute;
  left: calc(var(--grass-x, 48) * 1%);
  bottom: -0.1rem;
  width: auto;
  height: 100%;
  max-width: none;
  transform: translateX(-50%) translateY(calc(var(--grass-bottom, 25) * 1%)) scale(calc(var(--grass-scale, 106) / 100));
  transform-origin: center bottom;
  opacity: calc(var(--grass-opacity, 82) / 100);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.hero-figure {
  position: absolute;
  z-index: 2;
  transform-origin: center bottom;
  filter: drop-shadow(0 18px 24px rgba(110, 84, 63, 0.18));
}

.hero-kitten {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.hero-figure-pear {
  left: 56.06%;
  bottom: 0;
  width: 43.94%;
  z-index: 3;
  animation: floatFigure 6.7s ease-in-out infinite;
}

.hero-figure-strawberry {
  left: 32.25%;
  bottom: 0;
  width: 38.97%;
  z-index: 4;
  animation: floatFigure 5.8s ease-in-out infinite 0.8s;
}

.hero-figure-orange {
  left: 0;
  right: auto;
  bottom: 0;
  width: 43.31%;
  aspect-ratio: 4 / 5;
  z-index: 2;
  animation: floatFigure 7.1s ease-in-out infinite 1.4s;
}

.hero-figure-orange .hero-kitten {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-kitten-base {
  animation: orangeBase 6.2s ease-in-out infinite;
}

.hero-kitten-float {
  animation: orangeFloat 4.9s ease-in-out infinite;
}

.story-cloud {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  color: #6f6258;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  animation: drift 8s ease-in-out infinite;
  z-index: 6;
}

.cloud-one {
  top: 3rem;
  left: 1.4rem;
}

.cloud-two {
  top: 8.1rem;
  right: 2.2rem;
  animation-delay: 1.5s;
}

.cloud-three {
  bottom: 13rem;
  right: 1.4rem;
  animation-delay: 3s;
}

.layout {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 1.4rem 3rem;
}

.sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  display: grid;
  gap: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
  scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar,
.story-side-with-audio::-webkit-scrollbar {
  width: 0.45rem;
}

.sidebar::-webkit-scrollbar-thumb,
.story-side-with-audio::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(180, 124, 120, 0.22);
}

.sidebar::-webkit-scrollbar-track,
.story-side-with-audio::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-card,
.story-card,
.feature-strip article,
.character-card,
.seo-note {
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.6rem;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.sidebar-card {
  padding: 1.1rem;
}

.sidebar-title {
  margin: 0 0 0.85rem;
  font-weight: 800;
  color: var(--title);
}

.age-tabs {
  display: grid;
  gap: 0.8rem;
}

.catalog-kind-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.2rem;
}

.cat-tab {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  color: #70574a;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(120, 92, 72, 0.07);
}

.cat-tab::before,
.cat-tab::after {
  --ear-outer: rgba(255, 255, 255, 0.92);
  --ear-inner: rgba(239, 185, 199, 0.24);
  --ear-inner-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 80'%3E%3Cpath fill='%23f5d9df' d='M32 4 C45 20 54 46 52 72 C44 78 20 78 12 72 C10 46 19 20 32 4 Z'/%3E%3C/svg%3E");
}

.cat-tab.is-active {
  background: linear-gradient(180deg, #f7cfc5, #f2c0c8);
  color: #5a3d31;
}

.cat-tab.is-active::before,
.cat-tab.is-active::after {
  --ear-outer: #f3c8be;
  --ear-inner: #efb2bd;
  --ear-inner-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 80'%3E%3Cpath fill='%23efb2bd' d='M32 4 C45 20 54 46 52 72 C44 78 20 78 12 72 C10 46 19 20 32 4 Z'/%3E%3C/svg%3E");
}

.mood-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.filter-status {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.mood-pills span,
.mood-filter-button,
.story-tags span,
.age-badge,
.time-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}

.mood-pills span,
.mood-filter-button {
  border: 0;
  background: rgba(248, 232, 185, 0.45);
  color: #7b684b;
  font: inherit;
}

.mood-filter-button {
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease;
}

.mood-filter-button:hover,
.mood-filter-button.is-active {
  transform: translateY(-1px);
  background: rgba(247, 207, 197, 0.76);
  color: #5f4035;
  box-shadow: 0 10px 20px rgba(239, 185, 199, 0.22);
}

.mood-filter-button:focus-visible {
  outline: 3px solid rgba(138, 86, 97, 0.34);
  outline-offset: 3px;
}

.content {
  display: grid;
  gap: 1.45rem;
}

.section {
  display: grid;
  gap: 1.2rem;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.section-heading h2,
.seo-note h2 {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
}

.section-intro {
  max-width: 42ch;
  margin: 0.45rem 0 0;
}

.section-link {
  margin-top: -0.3rem;
}

.catalog-subheading {
  margin-top: 1.4rem;
}

.story-grid,
.character-grid,
.feature-strip {
  display: grid;
  gap: 1rem;
}

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

.story-card {
  display: grid;
  gap: 1rem;
  padding: 1.3rem;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    opacity 0.22s ease;
}

.story-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.story-card-head .story-meta {
  flex: 1;
}

.story-card-cover {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, #f7d9c8, #dbe9cf);
  box-shadow: inset 0 0 0 1px rgba(112, 87, 74, 0.08);
  isolation: isolate;
}

.story-card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(92, 65, 52, 0.2)),
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.35), transparent 32%);
  pointer-events: none;
  z-index: 1;
}

.story-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.01);
  transition: transform 0.28s ease;
}

.story-card:hover .story-card-cover img {
  transform: scale(1.055);
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 42px rgba(131, 93, 70, 0.13);
}

.story-card.is-favorite {
  border-color: rgba(239, 185, 199, 0.72);
  box-shadow: 0 20px 42px rgba(239, 185, 199, 0.18);
}

.story-card.is-hidden {
  display: none;
}

.story-meta,
.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.age-badge {
  background: rgba(239, 185, 199, 0.34);
  color: #8a5661;
}

.time-badge {
  background: rgba(213, 231, 243, 0.5);
  color: #5e7082;
}

.story-card h3,
.feature-strip h3,
.character-card h3 {
  margin: 0;
  color: var(--title);
}

.story-tags span {
  background: rgba(200, 232, 210, 0.48);
  color: #4f7a60;
  font-size: 0.92rem;
}

.riddle-answer {
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(180, 124, 120, 0.18);
  border-radius: 1rem;
  background: rgba(255, 247, 232, 0.68);
  color: var(--title);
}

.riddle-answer summary {
  font-weight: 800;
  cursor: pointer;
}

.riddle-answer p {
  margin: 0.65rem 0 0;
  color: #76594a;
  font-weight: 800;
}

.text-link {
  display: inline-flex;
  font-weight: 800;
  color: #b4726f;
}

.favorite-toggle,
.favorite-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(180, 124, 120, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #74594d;
  box-shadow: 0 10px 22px rgba(120, 92, 72, 0.08);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.favorite-toggle:hover,
.favorite-filter-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(120, 92, 72, 0.12);
}

.favorite-toggle.is-active,
.favorite-filter-button[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(247, 207, 197, 0.92), rgba(239, 185, 199, 0.9));
  border-color: rgba(180, 124, 120, 0.3);
  color: #5f4035;
}

.favorite-toggle:disabled,
.favorite-filter-button:disabled {
  opacity: 0.58;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.favorite-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.favorites-card {
  display: grid;
  gap: 0.9rem;
}

.favorites-status,
.favorites-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.favorites-note {
  font-size: 0.9rem;
}

.favorite-filter-button {
  width: 100%;
}

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

.feature-strip article {
  padding: 1.25rem;
}

.feature-kicker {
  margin: 0 0 0.6rem;
  color: #b37b76;
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.character-card {
  padding: 1.15rem;
}

.character-portrait {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 12rem;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border-radius: 1.4rem;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.45)),
    linear-gradient(180deg, rgba(247, 207, 197, 0.18), rgba(213, 231, 243, 0.16));
  overflow: hidden;
}

.character-portrait img,
.character-layer {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 12.5rem;
  height: auto;
}

.character-portrait-orange {
  min-height: 12.8rem;
}

.character-portrait-orange .character-layer {
  position: relative;
}

.character-portrait-orange .character-layer-float {
  position: absolute;
  inset: 0.8rem;
  margin: auto;
  animation: orangeFloat 4.9s ease-in-out infinite;
}

.seo-note {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 1.2rem;
  padding: 1.5rem;
}

.seo-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.seo-list li {
  position: relative;
  padding-left: 1.4rem;
  line-height: 1.6;
}

.seo-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #c8e8d2, #d5e7f3);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.4rem 2.5rem;
}

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

.inner-header {
  position: relative;
  z-index: 1;
  padding: 1.2rem 1.4rem 0;
}

.inner-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 250, 246, 0.88)),
    linear-gradient(135deg, rgba(247, 207, 197, 0.28), rgba(200, 232, 210, 0.3));
  box-shadow: var(--shadow);
}

.breadcrumbs {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.inner-hero h1 {
  margin: 0;
  color: var(--title);
  font-family: "Marck Script", "Brush Script MT", cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 4vw, 4.2rem);
  line-height: 1.06;
}

.inner-intro {
  max-width: 62ch;
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.inner-layout,
.story-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.4rem 3rem;
}

.inner-aside,
.story-side {
  display: grid;
  align-self: start;
  gap: 1rem;
}

.story-side-with-audio {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.25rem;
}

.story-hero {
  display: grid;
  gap: 0.9rem;
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.story-audio {
  display: grid;
  gap: 0.75rem;
  max-width: 34rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.3rem;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 10px 24px rgba(120, 92, 72, 0.08);
}

.story-audio-title {
  margin: 0;
  color: var(--title);
  font-weight: 800;
}

.story-audio-player {
  width: 100%;
}

.story-audio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--title);
  font-weight: 700;
  cursor: pointer;
}

.story-audio-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #b4726f;
}

.story-audio-choices {
  display: grid;
  gap: 0.7rem;
}

.story-audio-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--title);
  font-weight: 700;
  cursor: pointer;
}

.story-audio-choice input {
  width: 1rem;
  height: 1rem;
  accent-color: #b4726f;
}

.story-audio-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.94rem;
}

.story-audio-sequence {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.2rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(180, 124, 120, 0.18);
}

.story-audio-sequence-toggle {
  align-items: flex-start;
}

.story-audio-next-status {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid rgba(180, 124, 120, 0.18);
  border-radius: 1rem;
  background: rgba(255, 247, 232, 0.8);
  color: var(--title);
}

.story-audio-next-status[hidden],
.story-audio-next-cancel[hidden] {
  display: none;
}

.story-audio-next-status p {
  margin: 0;
  line-height: 1.5;
}

.story-audio-next-cancel {
  justify-self: start;
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(180, 124, 120, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #74594d;
  box-shadow: 0 10px 20px rgba(120, 92, 72, 0.08);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.favorite-toggle-story {
  align-self: flex-start;
}

.story-article {
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.7rem;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  padding: 1.5rem;
}

.story-article p {
  margin: 0 0 1rem;
  font-size: 1.03rem;
  line-height: 1.85;
  color: var(--text);
}

.story-article p:last-child {
  margin-bottom: 0;
}

.fable-poem {
  display: grid;
  gap: 1rem;
}

.fable-poem p {
  margin: 0;
}

.fable-source {
  display: grid;
  gap: 0.75rem;
}

.fable-source p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.story-quote {
  padding: 1rem 1.1rem;
  border-radius: 1.2rem;
  background: rgba(213, 231, 243, 0.34);
}

.story-note {
  padding: 1rem 1.1rem;
  border-radius: 1.2rem;
  background: rgba(248, 232, 185, 0.34);
  color: #6c5b4e;
}

.story-figure {
  display: grid;
  gap: 0.65rem;
  margin: 1.4rem 0;
}

.story-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.4rem;
  box-shadow: 0 18px 36px rgba(131, 93, 70, 0.12);
}

.story-figure-frame {
  display: grid;
  place-items: center;
  gap: 0.65rem;
  min-height: 15rem;
  padding: 1.4rem;
  text-align: center;
  border: 2px dashed rgba(180, 124, 120, 0.35);
  border-radius: 1.4rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 249, 244, 0.92)),
    linear-gradient(135deg, rgba(247, 207, 197, 0.22), rgba(213, 231, 243, 0.26));
}

.story-figure-frame strong {
  color: var(--title);
  font-family: "Marck Script", "Brush Script MT", cursive;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
}

.story-figure-frame span,
.story-figure figcaption {
  max-width: 30ch;
  color: var(--muted);
  line-height: 1.6;
}

.story-figure figcaption {
  text-align: center;
  font-size: 0.92rem;
}

.coloring-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem);
  gap: 1.25rem 1.8rem;
  align-items: stretch;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.6rem;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.coloring-preview-actions {
  display: grid;
  align-content: center;
  justify-self: stretch;
  gap: 0.75rem;
  padding: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.36)),
    rgba(255, 247, 237, 0.48);
}

.coloring-preview-actions .cat-button {
  width: 100%;
  min-height: 3.1rem;
}

.coloring-preview-copy {
  display: grid;
  gap: 1rem;
}

.coloring-preview-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.coloring-layout {
  align-items: start;
}

.coloring-studio {
  gap: 1.2rem;
}

.coloring-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.coloring-panel {
  display: grid;
  gap: 0.9rem;
}

.coloring-sheet-tabs {
  display: grid;
  gap: 0.75rem;
}

.coloring-sheet-tabs .cat-tab {
  width: 100%;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.color-swatch {
  position: relative;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 2px solid rgba(114, 88, 71, 0.12);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 10px 18px rgba(120, 92, 72, 0.08);
  appearance: none;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.color-swatch::after {
  content: "";
  position: absolute;
  inset: 0.8rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.color-swatch:hover {
  transform: translateY(-2px);
}

.color-swatch.is-active {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.88),
    0 0 0 6px rgba(180, 124, 120, 0.3),
    0 14px 22px rgba(120, 92, 72, 0.14);
}

.color-swatch.is-active::after {
  opacity: 1;
}

.brush-control {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.brush-control input[type="range"] {
  width: 100%;
  accent-color: #d78f8b;
}

.brush-size-readout {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.tool-toggle {
  min-height: 3rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(114, 88, 71, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #6a564a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease;
}

.tool-toggle:hover {
  transform: translateY(-2px);
}

.tool-toggle.is-active {
  color: #5b4035;
  background: linear-gradient(180deg, #f7d7cb, #f1c4b7);
  box-shadow: 0 12px 22px rgba(239, 185, 199, 0.25);
}

.coloring-panel-actions .cat-button {
  width: 100%;
}

.coloring-stage-wrap {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.8rem;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.coloring-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--stage-aspect, 900 / 640);
  overflow: hidden;
  border: 1px solid rgba(114, 88, 71, 0.1);
  border-radius: 1.3rem;
  background: linear-gradient(180deg, #ffffff, #fffaf6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  touch-action: none;
  user-select: none;
}

.coloring-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(247, 207, 197, 0.14), transparent 26%),
    radial-gradient(circle at bottom right, rgba(213, 231, 243, 0.16), transparent 24%);
  pointer-events: none;
  z-index: 0;
}

.coloring-canvas,
.coloring-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.coloring-canvas {
  z-index: 1;
  cursor: crosshair;
}

.coloring-outline {
  display: none;
  z-index: 2;
  pointer-events: none;
}

.coloring-outline.is-active {
  display: block;
}

.coloring-outline-raster {
  object-fit: contain;
  mix-blend-mode: multiply;
}

.coloring-status {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  line-height: 1.6;
}

@keyframes floatFigure {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

@keyframes orangeBase {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-4px, -5px, 0) rotate(-1.2deg);
  }
}

@keyframes orangeFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  35% {
    transform: translate3d(8px, -11px, 0) rotate(4deg);
  }
  70% {
    transform: translate3d(-5px, 6px, 0) rotate(-3deg);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -6px, 0);
  }
}

@media (max-width: 1040px) {
  .hero-card,
  .layout,
  .inner-layout,
  .story-layout,
  .seo-note,
  .feature-strip,
  .character-grid {
    grid-template-columns: 1fr;
  }

  .coloring-preview-card {
    grid-template-columns: 1fr;
  }

  .coloring-preview-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: stretch;
  }

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

  .hero-copy h1 {
    max-width: none;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .story-side-with-audio {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .story-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 1rem 0.9rem 0;
  }

  .inner-header {
    padding: 1rem 0.9rem 0;
  }

  .layout {
    padding: 1rem 0.9rem 2.4rem;
  }

  .inner-layout,
  .story-layout {
    padding: 1rem 0.9rem 2.4rem;
  }

  .footer {
    padding: 0 0.9rem 2rem;
  }

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

  .topbar-links {
    justify-content: flex-start;
  }

  .hero-card {
    padding: 1.35rem;
    border-radius: 1.5rem;
  }

  .inner-hero {
    padding: 1.35rem;
    border-radius: 1.5rem;
  }

  .hero-scene {
    min-height: 26rem;
  }

  .hero-figure-pear {
    left: 0.4rem;
    bottom: 0.4rem;
    width: 8.6rem;
  }

  .hero-figure-strawberry {
    left: auto;
    right: 0.45rem;
    bottom: 0.35rem;
    width: 7.8rem;
  }

  .hero-figure-orange {
    left: calc(50% - 4.75rem);
    right: auto;
    bottom: 5.8rem;
    width: 9.5rem;
  }

  .story-cloud {
    padding: 0.65rem 0.85rem;
    font-size: 0.84rem;
  }

  .cloud-one {
    top: 1.2rem;
    left: 0.7rem;
  }

  .cloud-two {
    top: 6.1rem;
    right: 0.9rem;
  }

  .cloud-three {
    right: 0.9rem;
    bottom: 13.6rem;
  }

  .hero-actions,
  .section-heading {
    align-items: flex-start;
  }

  .coloring-toolbar {
    grid-template-columns: 1fr;
  }

  .coloring-preview-actions {
    grid-template-columns: 1fr;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .coloring-stage-wrap {
    padding: 0.75rem;
    border-radius: 1.4rem;
  }

  .coloring-stage {
    border-radius: 1rem;
  }

  .coloring-canvas {
    cursor: default;
  }

  .tool-toggle {
    width: 100%;
  }

  .cat-button,
  .cat-tab {
    width: 100%;
  }

  .story-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .favorite-toggle,
  .favorite-filter-button {
    width: 100%;
  }
}
