:root {
  --paper: #fffaf0;
  --paper-soft: #fff6df;
  --sky: #cfeaf1;
  --sky-deep: #9dccd8;
  --sand: #efd6a6;
  --grass: #9fca84;
  --grass-dark: #6f9a67;
  --orange: #db7b3f;
  --fox: #d76632;
  --brown: #684a36;
  --ink: #3f342d;
  --muted: #78695f;
  --white: #fffdf7;
  --shadow: 0 18px 44px rgba(95, 67, 42, 0.13);
  --soft-shadow: 0 10px 26px rgba(95, 67, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: "Nunito", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

button {
  font: inherit;
}

.hidden {
  display: none !important;
}

.progress-shell {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  height: 8px;
  background: rgba(255, 250, 240, 0.72);
  opacity: 0;
  transition: opacity 220ms ease;
}

body.reading .progress-shell {
  opacity: 1;
}

.reading-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--grass), var(--orange), var(--sky-deep));
  border-radius: 0 999px 999px 0;
  transition: width 120ms linear;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 5vw, 5rem);
  background: rgba(255, 253, 247, 0.82);
  box-shadow: 0 8px 24px rgba(95, 67, 42, 0.08);
  backdrop-filter: blur(14px);
}

body.reading .site-nav {
  display: none;
}

.nav-brand,
.nav-link {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: var(--brown);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.nav-brand {
  flex: 0 0 auto;
  padding: 0.5rem 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
}

.nav-links {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
}

.nav-link {
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding: 0.45rem 0.85rem;
  transition: background 160ms ease, transform 160ms ease;
}

.nav-link:hover {
  background: rgba(239, 214, 166, 0.5);
  transform: translateY(-1px);
}

.nav-link.active {
  background: rgba(111, 154, 103, 0.18);
  color: var(--grass-dark);
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(360px, 1.16fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2rem, 5vw, 5rem);
  overflow: hidden;
}

.watercolor-sky {
  position: absolute;
  inset: clamp(1rem, 3vw, 2rem);
  z-index: -1;
  overflow: hidden;
  border-radius: 44px;
  background: #ffffff;
  box-shadow: none;
}

.watercolor-sky::after,
.watercolor-sky::before {
  content: "";
  position: absolute;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  filter: blur(9px);
  opacity: 0.38;
}

.watercolor-sky::before {
  left: -5rem;
  bottom: 5rem;
  background: rgba(255, 255, 255, 0);
}

.watercolor-sky::after {
  right: -3rem;
  bottom: -2rem;
  background: rgba(255, 255, 255, 0);
}

.cloud,
.cloud::before,
.cloud::after {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0);
}

.cloud {
  width: 8.7rem;
  height: 3.4rem;
  filter: blur(0.4px);
}

.cloud::before,
.cloud::after {
  content: "";
}

.cloud::before {
  width: 4.8rem;
  height: 4.8rem;
  left: 1rem;
  bottom: 0.7rem;
}

.cloud::after {
  width: 5.7rem;
  height: 5.7rem;
  right: 0.8rem;
  bottom: 0.4rem;
}

.cloud-one {
  top: 12%;
  left: 12%;
}

.cloud-two {
  top: 20%;
  right: 16%;
  transform: scale(0.78);
  opacity: 0.82;
}

.sun-wash {
  position: absolute;
  top: 11%;
  right: 31%;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0);
  filter: blur(5px);
}

.sea-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10%;
  height: 9.5rem;
  background: transparent;
  border-radius: 48% 52% 0 0;
}

.hill {
  position: absolute;
  bottom: -5rem;
  width: 62%;
  height: 15rem;
  border-radius: 50% 50% 0 0;
  opacity: 0.86;
}

.hill-one {
  left: -8%;
  background: transparent;
}

.hill-two {
  right: -8%;
  background: transparent;
}

.grass {
  position: absolute;
  bottom: 3rem;
  width: 0.35rem;
  height: 4rem;
  border-radius: 999px;
  background: transparent;
  transform-origin: bottom;
}

.grass-one {
  left: 18%;
  transform: rotate(-16deg);
}

.grass-two {
  right: 21%;
  transform: rotate(18deg);
}

.hero-content {
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--grass-dark);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.05;
  color: var(--brown);
}

h1 {
  max-width: 760px;
  font-size: clamp(3.1rem, 8vw, 6.8rem);
}

h2 {
  font-size: clamp(2.1rem, 4.7vw, 4rem);
}

.subtitle {
  max-width: 620px;
  margin: 1.2rem 0 2rem;
  color: var(--muted);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.hero-actions,
.card-actions,
.end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.button,
.filter-button,
.back-link,
.like-button {
  min-height: 3.25rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.35rem;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--soft-shadow);
}

.button:hover,
.filter-button:hover,
.back-link:hover,
.like-button:hover {
  transform: translateY(-2px);
}

.primary {
  color: #fffdf7;
  background: var(--orange);
}

.secondary {
  color: var(--brown);
  background: rgba(255, 253, 247, 0.78);
}

.quiet {
  color: var(--brown);
  background: rgba(239, 214, 166, 0.45);
}

.hero-friends {
  position: relative;
  z-index: 1;
  align-self: center;
  width: min(100%, 820px);
  margin-inline: auto;
}

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

.hero-illustration {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  filter: none;
  mix-blend-mode: multiply;
}

.stories-section,
.generator-section,
.library-section,
.about-section {
  padding: clamp(3rem, 6vw, 6rem) clamp(1rem, 5vw, 5rem);
}

.section-heading {
  max-width: 980px;
  margin: 0 auto 1.7rem;
}

.filters {
  position: sticky;
  top: 0.5rem;
  z-index: 5;
  display: flex;
  gap: 0.65rem;
  max-width: 980px;
  margin: 0 auto 2rem;
  padding: 0.55rem;
  overflow-x: auto;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.8);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(95, 67, 42, 0.08);
}

.filter-button {
  flex: 0 0 auto;
  padding: 0.65rem 1rem;
  color: var(--brown);
  background: transparent;
}

.filter-button.active {
  color: #fffdf7;
  background: var(--grass-dark);
}

.story-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 980px;
  margin: 0 auto;
}

.story-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 0.36fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  overflow: hidden;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid rgba(104, 74, 54, 0.08);
  border-radius: 28px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: var(--shadow);
}

.story-card::before {
  content: "";
  position: absolute;
  right: -2.5rem;
  top: -2.8rem;
  width: 12rem;
  height: 12rem;
  border-radius: 42% 58% 49% 51%;
  background: var(--wash-color, rgba(207, 234, 241, 0.5));
  filter: blur(2px);
  opacity: 0.52;
}

.story-art {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 24% 25%, rgba(255, 255, 255, 0.9), transparent 4rem),
    linear-gradient(180deg, var(--art-top), var(--art-mid) 56%, var(--art-bottom));
}

.story-art.has-image {
  background: #ffffff;
}

.story-art.has-image::before,
.story-art.has-image::after {
  content: none;
}

.story-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: multiply;
}

.story-scene-preview {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.82), transparent 4.4rem),
    linear-gradient(180deg, var(--scene-sky, #cfeaf1), var(--scene-ground, #9fca84));
}

.story-scene-preview::before,
.story-scene-preview::after {
  content: "";
  position: absolute;
}

.story-scene-preview::before {
  left: -8%;
  right: -8%;
  bottom: -2rem;
  height: 42%;
  border-radius: 55% 45% 0 0;
  background: var(--scene-hill, rgba(111, 154, 103, 0.5));
}

.story-scene-preview::after {
  right: 12%;
  top: 18%;
  width: 4.8rem;
  height: 2.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    -3.5rem 2.4rem 0 rgba(255, 255, 255, 0.45),
    0.4rem 0.2rem 0 1rem rgba(255, 255, 255, 0.32);
}

.story-art::before,
.story-art::after {
  content: "";
  position: absolute;
}

.story-art::before {
  left: -12%;
  right: -12%;
  bottom: -2rem;
  height: 7rem;
  border-radius: 50% 50% 0 0;
  background: rgba(111, 154, 103, 0.43);
}

.story-art::after {
  right: 1.3rem;
  top: 1.2rem;
  width: 4rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: -2.7rem 2rem 0 rgba(255, 255, 255, 0.52), -0.9rem 0.1rem 0 1.2rem rgba(255, 255, 255, 0.42);
}

.story-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.story-content h3 {
  margin: 0 0 0.7rem;
  color: var(--brown);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.14;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: var(--brown);
  background: rgba(239, 214, 166, 0.52);
  font-size: 0.95rem;
  font-weight: 800;
}

.user-pill {
  background: rgba(207, 234, 241, 0.65);
}

.story-content p {
  max-width: 620px;
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.generator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  gap: clamp(1rem, 3vw, 2rem);
  max-width: 980px;
  margin: 0 auto;
  align-items: start;
}

.generator-form,
.subscription-panel,
.auth-panel,
.library-status {
  border: 1px solid rgba(104, 74, 54, 0.08);
  border-radius: 28px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow);
}

.generator-form {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.6rem);
}

.field,
.field-group {
  display: grid;
  gap: 0.55rem;
}

.field span,
.field-group legend {
  color: var(--brown);
  font-size: 1rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(104, 74, 54, 0.14);
  border-radius: 18px;
  padding: 0.85rem 1rem;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.72);
  font: inherit;
  outline: none;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(111, 154, 103, 0.7);
  box-shadow: 0 0 0 4px rgba(159, 202, 132, 0.2);
}

.field-group {
  margin: 0;
  border: 0;
  padding: 0;
}

.field-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin-right: 0.8rem;
  color: var(--muted);
  font-weight: 800;
}

.field-group input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--grass-dark);
}

.generator-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.generation-status {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.subscription-panel {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.subscription-panel h3 {
  margin: 0 0 0.75rem;
  color: var(--brown);
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.15;
}

.subscription-panel p:not(.eyebrow) {
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.subscription-usage,
.subscription-period,
.subscription-warning,
.subscription-fallback {
  font-weight: 800;
}

.subscription-usage {
  color: var(--brown) !important;
}

.subscription-period {
  color: var(--muted);
}

.subscription-warning,
.subscription-fallback {
  padding: 0.85rem 1rem;
  border-radius: 18px;
}

.subscription-warning {
  color: #8a4a2e !important;
  background: rgba(239, 214, 166, 0.58);
}

.subscription-fallback {
  color: #72543e !important;
  background: rgba(207, 234, 241, 0.58);
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  align-items: end;
  max-width: 980px;
  margin: 0 auto 1.25rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.auth-copy h3 {
  margin: 0 0 0.55rem;
  color: var(--brown);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.2;
}

.auth-status {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.auth-status.success {
  color: var(--grass-dark);
}

.auth-status.warning {
  color: #a8623a;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.auth-buttons,
.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.library-status {
  max-width: 980px;
  margin: 0 auto 1.25rem;
  padding: 1rem 1.2rem;
  color: var(--muted);
  font-weight: 800;
}

.about-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(248, 233, 190, 0.58), transparent 15rem),
    radial-gradient(circle at 86% 22%, rgba(207, 234, 241, 0.7), transparent 17rem),
    linear-gradient(180deg, #fffdf7, #fff6df);
}

body.about-page {
  background:
    radial-gradient(circle at 8% 14%, rgba(248, 233, 190, 0.45), transparent 18rem),
    radial-gradient(circle at 92% 8%, rgba(207, 234, 241, 0.5), transparent 18rem),
    #fffdf7;
}

.about-page .about-section {
  min-height: calc(100vh - 4.5rem);
}

.about-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.23;
  background-image:
    linear-gradient(rgba(104, 74, 54, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 74, 54, 0.08) 1px, transparent 1px);
  background-size: 100% 3.2rem, 4.4rem 100%;
}

.about-hero,
.workshop-layout,
.process-block,
.drafts-block,
.future-block {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto clamp(2rem, 5vw, 4rem);
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
  min-height: 68vh;
}

.about-hero-copy {
  max-width: 760px;
}

.about-hero-copy h1,
.about-hero-copy h2 {
  font-size: clamp(3rem, 7vw, 6rem);
}

.about-lead {
  margin: 0.9rem 0 1.2rem;
  color: var(--brown);
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  font-weight: 800;
}

.about-hero-copy p:not(.eyebrow):not(.about-lead) {
  max-width: 720px;
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
}

.workshop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.36fr);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: start;
}

.reverse-layout {
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
}

.reverse-layout .notebook-page {
  grid-column: 2;
}

.reverse-layout .soft-quote {
  grid-column: 1;
  grid-row: 1;
}

.notebook-page,
.handwritten-note,
.soft-quote,
.draft-step,
.draft-card,
.sketch-card {
  position: relative;
  border: 1px solid rgba(104, 74, 54, 0.11);
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow);
}

.notebook-page {
  padding: clamp(1.4rem, 4vw, 2.5rem);
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(216, 139, 91, 0.16) 0 1px, transparent 1px 100%),
    repeating-linear-gradient(180deg, transparent 0 2.2rem, rgba(157, 204, 216, 0.18) 2.2rem calc(2.2rem + 1px)),
    rgba(255, 253, 247, 0.94);
  background-position: 3.1rem 0, 0 1.6rem, 0 0;
}

.notebook-page::before,
.draft-step::before,
.draft-card::before {
  content: "";
  position: absolute;
  top: -0.55rem;
  left: 2rem;
  width: 5.5rem;
  height: 1.15rem;
  border-radius: 4px;
  background: rgba(239, 214, 166, 0.72);
  transform: rotate(-2deg);
}

.wide-page {
  grid-column: 1 / -1;
}

.notebook-page h2,
.notebook-page h3,
.draft-step h3,
.subscription-panel h3 {
  margin: 0 0 0.85rem;
  color: var(--brown);
  font-size: clamp(1.45rem, 2.8vw, 2.1rem);
  line-height: 1.15;
}

.notebook-page p,
.draft-step p,
.draft-card p,
.soft-quote p,
.sketch-card p,
.sketch-card blockquote {
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.notebook-page p {
  margin: 0 0 1rem;
}

.margin-mark {
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  color: rgba(104, 74, 54, 0.28);
  font-size: 1rem;
  font-weight: 800;
}

.handwritten-note {
  padding: 1.15rem 1.25rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.82), transparent 4rem),
    #fff6df;
  color: var(--brown);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  font-style: italic;
  line-height: 1.4;
}

.hero-note {
  min-height: 220px;
  display: grid;
  place-items: center;
  transform: rotate(2deg);
}

.hero-note p {
  max-width: 250px;
  margin: 0;
  color: var(--brown);
  text-align: center;
}

.note-sketch {
  display: block;
  width: min(100%, 320px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin: 0 auto 0.9rem;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(95, 67, 42, 0.12);
  mix-blend-mode: multiply;
}

.notes-stack {
  display: grid;
  gap: 1rem;
}

.small-note {
  min-height: 5.2rem;
  display: grid;
  align-items: center;
}

.rotate-left {
  transform: rotate(-2deg);
}

.rotate-right {
  transform: rotate(2deg);
}

.tape {
  position: absolute;
  width: 5rem;
  height: 1.2rem;
  border-radius: 4px;
  background: rgba(239, 214, 166, 0.75);
  box-shadow: 0 2px 6px rgba(95, 67, 42, 0.08);
}

.tape-left {
  top: -0.45rem;
  left: 1.4rem;
  transform: rotate(-6deg);
}

.tape-center {
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%) rotate(3deg);
}

.paperclip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 1.8rem;
  height: 2.6rem;
  border: 3px solid rgba(104, 74, 54, 0.34);
  border-left-color: transparent;
  border-radius: 999px;
  transform: rotate(12deg);
}

.soft-quote {
  align-self: center;
  padding: clamp(1.4rem, 3vw, 2rem);
  border-radius: 22px;
  background:
    radial-gradient(circle at 80% 18%, rgba(207, 234, 241, 0.68), transparent 7rem),
    rgba(255, 253, 247, 0.92);
}

.soft-quote p {
  margin: 0;
  color: var(--brown);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 800;
  line-height: 1.35;
}

.step-grid,
.draft-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.draft-step,
.draft-card {
  min-height: 100%;
  padding: 1.25rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at 85% 12%, rgba(207, 234, 241, 0.5), transparent 5rem),
    rgba(255, 253, 247, 0.9);
}

.draft-step span,
.draft-label {
  display: inline-flex;
  margin-bottom: 0.65rem;
  color: var(--grass-dark);
  font-weight: 800;
}

.draft-step p,
.draft-card p {
  margin: 0;
}

.draft-card {
  transform: rotate(-0.5deg);
}

.draft-image {
  aspect-ratio: 4 / 3;
  margin-bottom: 0.85rem;
  box-shadow: 0 8px 18px rgba(95, 67, 42, 0.08);
}

.draft-card:nth-child(2),
.draft-card:nth-child(4) {
  transform: rotate(0.7deg);
}

.sketch-card {
  padding: 1.25rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.78), transparent 6rem),
    rgba(255, 250, 240, 0.9);
}

.sketch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.sketch-thumb {
  margin: 0;
  padding: 0.55rem;
  border: 1px solid rgba(104, 74, 54, 0.12);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.84);
  box-shadow: 0 8px 20px rgba(95, 67, 42, 0.09);
}

.sketch-thumb img,
.draft-image,
.future-sketch img {
  display: block;
  width: 100%;
  object-fit: cover;
  border-radius: 14px;
  mix-blend-mode: multiply;
}

.sketch-thumb img {
  aspect-ratio: 1 / 1;
}

.sketch-thumb figcaption,
.future-sketch figcaption {
  margin-top: 0.45rem;
  color: rgba(104, 74, 54, 0.68);
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.pencil-sketch {
  position: relative;
  min-height: 145px;
  border: 2px dashed rgba(104, 74, 54, 0.35);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 38%, rgba(104, 74, 54, 0.12) 0 1.7rem, transparent 1.75rem),
    linear-gradient(180deg, rgba(255, 253, 247, 0.8), rgba(255, 246, 223, 0.9));
}

.pencil-sketch::before,
.pencil-sketch::after {
  content: "";
  position: absolute;
}

.hedgehog-sketch::before {
  left: 22%;
  top: 28%;
  width: 48%;
  height: 42%;
  border: 2px solid rgba(104, 74, 54, 0.48);
  border-radius: 48% 52% 50% 46%;
}

.hedgehog-sketch::after {
  left: 14%;
  top: 21%;
  width: 48%;
  height: 48%;
  border-top: 8px dotted rgba(104, 74, 54, 0.42);
  transform: rotate(-20deg);
}

.fox-sketch::before {
  left: 25%;
  top: 21%;
  width: 48%;
  height: 48%;
  border: 2px solid rgba(215, 102, 50, 0.56);
  border-radius: 50% 50% 46% 46%;
  clip-path: polygon(50% 0, 76% 26%, 100% 14%, 85% 100%, 15% 100%, 0 14%, 24% 26%);
}

.fox-sketch::after {
  right: 13%;
  bottom: 20%;
  width: 2.7rem;
  height: 1.2rem;
  border: 2px solid rgba(215, 102, 50, 0.42);
  border-radius: 999px;
  transform: rotate(-24deg);
}

.sketch-caption {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-weight: 800;
}

.sketch-card blockquote {
  margin: 0;
  padding-left: 1rem;
  border-left: 3px solid rgba(111, 154, 103, 0.42);
  color: var(--brown);
  font-weight: 800;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.3rem;
}

.future-sketch {
  max-width: 520px;
  margin: 1rem 0 0;
  padding: 0.65rem;
  border: 1px solid rgba(104, 74, 54, 0.1);
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: 0 8px 22px rgba(95, 67, 42, 0.08);
}

.future-sketch img {
  aspect-ratio: 16 / 10;
}

.future-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.future-gallery .future-sketch {
  max-width: none;
  margin: 0;
}

.like-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 8.8rem;
  padding: 0.7rem 1rem;
  color: var(--brown);
  background: rgba(255, 253, 247, 0.82);
  box-shadow: var(--soft-shadow);
}

.like-button.compact {
  min-height: 2.15rem;
  min-width: auto;
  padding: 0.3rem 0.72rem;
  box-shadow: none;
  background: rgba(255, 246, 223, 0.9);
  font-size: 0.96rem;
}

.like-button.liked {
  color: #fffdf7;
  background: #c96d4a;
}

.like-icon {
  font-size: 1.18rem;
  line-height: 1;
}

.like-count {
  min-width: 1.8rem;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  background: rgba(239, 214, 166, 0.52);
  font-size: 0.95rem;
}

.like-button.liked .like-count {
  background: rgba(255, 253, 247, 0.24);
}

.reader {
  min-height: 100vh;
  background: var(--paper);
}

.reader-topbar {
  position: fixed;
  top: 0.8rem;
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(980px, calc(100% - 2rem));
  padding: 0.55rem 0.65rem;
  border-radius: 999px;
  color: var(--brown);
  background: rgba(255, 253, 247, 0.8);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}

.reader-topbar span {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-like {
  flex: 0 0 auto;
}

.reader-like .like-button {
  min-height: 2.75rem;
  min-width: 8rem;
  padding: 0.45rem 0.85rem;
  box-shadow: none;
}

.back-link {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.45rem 0.95rem;
  color: var(--brown);
  background: rgba(239, 214, 166, 0.55);
}

.slides {
  height: 100vh;
  overflow-y: auto;
  /* Каждый экран истории мягко фиксируется при вертикальном листании. */
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.slide {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 6.5rem clamp(1rem, 5vw, 4rem) 4.5rem;
  scroll-snap-align: start;
  overflow: hidden;
}

.slide::before {
  content: "";
  position: absolute;
  inset: clamp(1rem, 3vw, 2rem);
  border-radius: 42px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.86), transparent 8rem),
    radial-gradient(circle at 80% 72%, var(--slide-wash), transparent 14rem),
    linear-gradient(180deg, var(--slide-top), var(--paper-soft));
  box-shadow: var(--shadow);
}

.slide-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.slide-scene::before,
.slide-scene::after {
  content: "";
  position: absolute;
}

.slide-scene::before {
  left: 7%;
  bottom: 9%;
  width: 32%;
  height: 14%;
  border-radius: 50% 50% 0 0;
  background: rgba(111, 154, 103, 0.28);
}

.slide-scene::after {
  right: 8%;
  top: 18%;
  width: 7rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: -4rem 2.8rem 0 rgba(255, 255, 255, 0.42);
}

.slide-card {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  padding: clamp(1.4rem, 4vw, 3rem);
  border-radius: 30px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.72);
  box-shadow: 0 12px 34px rgba(95, 67, 42, 0.09);
}

.slide-card.with-illustration {
  width: min(920px, 100%);
}

.slide-kicker {
  display: inline-flex;
  margin-bottom: 0.7rem;
  color: var(--grass-dark);
  font-weight: 800;
}

.reader-illustration {
  display: block;
  width: min(100%, 680px);
  max-height: 36vh;
  margin: 0 auto 1.2rem;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.scene-illustration {
  position: relative;
  height: min(36vh, 280px);
  min-height: 180px;
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.84), transparent 5rem),
    linear-gradient(180deg, var(--scene-sky, #cfeaf1), var(--scene-ground, #9fca84));
  box-shadow: inset 0 0 0 1px rgba(104, 74, 54, 0.06);
}

.scene-illustration::before,
.scene-illustration::after {
  content: "";
  position: absolute;
}

.scene-illustration::before {
  left: -5%;
  right: -5%;
  bottom: -2rem;
  height: 42%;
  border-radius: 55% 45% 0 0;
  background: var(--scene-hill, rgba(111, 154, 103, 0.48));
}

.scene-illustration::after {
  right: 12%;
  top: 18%;
  width: 5.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    -4rem 2.6rem 0 rgba(255, 255, 255, 0.45),
    0.5rem 0.3rem 0 1.1rem rgba(255, 255, 255, 0.32);
}

.scene-sea_bench {
  --scene-sky: #b9dfe9;
  --scene-ground: #efd6a6;
  --scene-hill: rgba(216, 139, 91, 0.36);
}

.scene-forest_day,
.scene-sunny_meadow,
.scene-mushroom_glade {
  --scene-sky: #cfeaf1;
  --scene-ground: #9fca84;
  --scene-hill: rgba(111, 154, 103, 0.52);
}

.scene-forest_night,
.scene-starry_sky {
  --scene-sky: #9dccd8;
  --scene-ground: #6f9a67;
  --scene-hill: rgba(63, 52, 45, 0.22);
}

.scene-cozy_house,
.scene-warm_kitchen {
  --scene-sky: #f8e9be;
  --scene-ground: #d88b5b;
  --scene-hill: rgba(104, 74, 54, 0.26);
}

.scene-rainy_forest,
.scene-river_bank {
  --scene-sky: #b9dfe9;
  --scene-ground: #7ebccc;
  --scene-hill: rgba(111, 154, 103, 0.44);
}

.scene-autumn_path,
.scene-campfire_evening {
  --scene-sky: #f5c98d;
  --scene-ground: #c96d4a;
  --scene-hill: rgba(111, 154, 103, 0.36);
}

.scene-winter_forest {
  --scene-sky: #cfeaf1;
  --scene-ground: #fffdf7;
  --scene-hill: rgba(157, 204, 216, 0.55);
}

.scene-small_bridge,
.scene-hill_clouds {
  --scene-sky: #cfeaf1;
  --scene-ground: #efd6a6;
  --scene-hill: rgba(159, 202, 132, 0.5);
}

.slide-card.with-illustration .slide-text {
  font-size: clamp(1.12rem, 2.1vw, 1.62rem);
}

.slide-text {
  margin: 0;
  font-size: clamp(1.28rem, 2.6vw, 2rem);
  line-height: 1.58;
}

.slide-hint {
  position: absolute;
  left: 50%;
  bottom: 1.8rem;
  z-index: 2;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 800;
  transform: translateX(-50%);
}

.end-slide .slide-card {
  text-align: center;
}

.end-like {
  display: flex;
  justify-content: center;
  margin-top: 1.2rem;
}

.end-actions {
  justify-content: center;
  margin-top: 1.5rem;
}

@media (max-width: 860px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 96vh;
    padding: 5rem 1rem 2rem;
  }

  .hero-friends {
    width: min(100%, 680px);
  }

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

  .generator-shell {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    grid-template-columns: 1fr;
  }

  .about-hero,
  .workshop-layout,
  .reverse-layout {
    grid-template-columns: 1fr;
  }

  .reverse-layout .notebook-page,
  .reverse-layout .soft-quote {
    grid-column: auto;
    grid-row: auto;
  }

  .hero-note {
    min-height: 170px;
  }

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

  .story-art {
    min-height: 170px;
  }

  .story-art img {
    min-height: 170px;
  }
}

@media (max-width: 540px) {
  body {
    font-size: 18px;
  }

  .site-nav {
    padding: 0.65rem 1rem;
  }

  .nav-brand {
    font-size: 1.05rem;
  }

  .nav-link {
    min-height: 2.35rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.95rem;
  }

  .watercolor-sky {
    inset: 0.7rem;
    border-radius: 28px;
  }

  .hero-actions,
  .card-actions,
  .end-actions,
  .generator-actions,
  .auth-buttons,
  .auth-actions,
  .about-actions {
    flex-direction: column;
  }

  .button,
  .card-actions .like-button,
  .generator-actions .button,
  .auth-buttons .button,
  .auth-actions .button,
  .about-actions .button {
    width: 100%;
  }

  .about-hero {
    min-height: auto;
  }

  .about-hero-copy h2 {
    font-size: clamp(2.5rem, 18vw, 4rem);
  }

  .about-hero-copy h1 {
    font-size: clamp(2.5rem, 18vw, 4rem);
  }

  .notebook-page,
  .handwritten-note,
  .soft-quote,
  .draft-step,
  .draft-card,
  .sketch-card {
    border-radius: 20px;
  }

  .step-grid,
  .draft-grid,
  .sketch-row,
  .future-gallery {
    grid-template-columns: 1fr;
  }

  .pencil-sketch {
    min-height: 130px;
  }

  .field-group label {
    display: flex;
    width: 100%;
    margin-right: 0;
  }

  .filters {
    border-radius: 24px;
  }

  .story-card {
    border-radius: 22px;
  }

  .reader-topbar {
    top: 0.7rem;
    width: calc(100% - 1rem);
  }

  .reader-topbar span {
    max-width: 34%;
  }

  .reader-like .like-text {
    display: none;
  }

  .reader-like .like-button {
    min-width: 4.4rem;
  }

  .slide {
    padding: 6rem 0.8rem 4.5rem;
  }

  .slide::before {
    inset: 0.65rem;
    border-radius: 26px;
  }

  .slide-card {
    border-radius: 22px;
  }

  .reader-illustration {
    max-height: 26vh;
    margin-bottom: 0.9rem;
  }

  .scene-illustration {
    height: 24vh;
    min-height: 150px;
  }

  .slide-card.with-illustration .slide-text {
    font-size: clamp(1rem, 5vw, 1.2rem);
  }
}
