/* ── Bearinana — 10 months story ── */

.page-bearinana {
  --bn-ink: #3a2434;
  --bn-soft: #8a5a6e;
  --bn-blush: #e8b4c4;
  --bn-sky-a: rgba(230, 191, 208, 0.42);
  --bn-sky-b: rgba(198, 214, 240, 0.4);
  --bn-sky-c: rgba(240, 214, 226, 0.45);
  --bn-paper: rgba(255, 252, 249, 0.78);
  --bn-line: rgba(163, 95, 123, 0.22);
}

html[data-theme="dark"] .page-bearinana {
  --bn-ink: #f8ecff;
  --bn-soft: #f1b6ff;
  --bn-blush: #9b6bb0;
  --bn-sky-a: rgba(143, 123, 211, 0.28);
  --bn-sky-b: rgba(241, 182, 255, 0.14);
  --bn-sky-c: rgba(110, 45, 153, 0.28);
  --bn-paper: rgba(35, 27, 51, 0.72);
  --bn-line: rgba(241, 182, 255, 0.2);
}

.bn-header-slim .site-nav {
  /* keep access but quieter — site.js still builds nav */
}

.bn-main {
  position: relative;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
  color: var(--bn-ink);
}

.bn-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 12% 8%, var(--bn-sky-a), transparent 70%),
    radial-gradient(ellipse 60% 40% at 88% 28%, var(--bn-sky-b), transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 100%, var(--bn-sky-c), transparent 70%);
}

/* ── Letter (first viewport) ── */
.bn-letter {
  min-height: calc(100vh - 5.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 3rem 1.25rem 4rem;
  margin: 0.5rem 0 1rem;
  border-radius: 22px;
  background: var(--bn-paper);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(58, 36, 52, 0.08);
  animation: bn-fade-up 1s ease both;
}

.bn-brand {
  margin: 0 0 0.35rem;
  font-family: "Caveat", cursive;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--bn-ink);
  line-height: 1.1;
}

.bn-letter-title {
  margin: 0 0 1.5rem;
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  color: var(--bn-soft);
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.bn-letter-body {
  max-width: 28rem;
  margin: 0 auto;
  font-family: "Nunito", sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--bn-ink);
  opacity: 0.92;
}

.bn-scroll-hint {
  margin: 2.75rem 0 0;
  font-family: "Caveat", cursive;
  font-size: 1.35rem;
  color: var(--bn-soft);
  animation: bn-hint-bob 2.4s ease-in-out infinite;
}

@keyframes bn-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bn-hint-bob {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bn-letter,
  .bn-scroll-hint,
  .bn-stop {
    animation: none !important;
  }
}

/* ── Timeline stops ── */
.bn-timeline {
  display: flex;
  flex-direction: column;
  gap: 4.5rem;
  padding: 1rem 0 3rem;
}

.bn-stop {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.bn-stop.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.bn-stop-label {
  margin: 0 0 0.65rem;
  font-family: "Fredoka", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bn-soft);
  text-align: center;
}

.bn-stop-title {
  margin: 0 0 1rem;
  font-family: "Caveat", cursive;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}

.bn-media {
  position: relative;
  width: 100%;
  border-radius: 4px;
  overflow: visible;
  background: var(--bn-paper);
}

.bn-media img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 4px;
}

.bn-media video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 4px;
  background: #1a1020;
  /* Keep native controls fully clickable / seekable */
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.bn-carousel + .bn-media,
.bn-media + .bn-media,
.bn-media + .bn-carousel {
  margin-top: 0.85rem;
}

.bn-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.bn-carousel-viewport {
  overflow: hidden;
  width: 100%;
}

.bn-carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.35s ease;
  will-change: transform;
}

.bn-carousel-slide {
  flex: 0 0 auto;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.bn-carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
}

.bn-carousel-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  min-height: 1.25rem;
}

.bn-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bn-line);
  cursor: pointer;
  flex: 0 0 auto;
  transform: scale(1);
  transition: background 0.2s ease, transform 0.2s ease;
}

.bn-dot.is-active {
  background: var(--bn-soft);
  transform: scale(1.2);
}

.bn-carousel-arrows {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  padding: 0 0.35rem;
  z-index: 1;
}

.bn-arrow {
  pointer-events: auto;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 252, 249, 0.82);
  color: var(--bn-ink);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(58, 36, 52, 0.12);
}

html[data-theme="dark"] .bn-arrow {
  background: rgba(35, 27, 51, 0.85);
}

.bn-note {
  margin: 1rem auto 0;
  max-width: 32rem;
  font-family: "Nunito", sans-serif;
  font-size: 0.98rem;
  line-height: 1.65;
  text-align: center;
  color: var(--bn-soft);
  white-space: pre-wrap;
}

.bn-stop-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

.bn-delete {
  border: 0;
  background: transparent;
  color: var(--bn-soft);
  font-family: "Nunito", sans-serif;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  opacity: 0.7;
}

.bn-delete:hover {
  opacity: 1;
}

/* ── Ending ── */
.bn-ending {
  text-align: center;
  padding: 3rem 0.5rem 2rem;
  border-top: 1px solid var(--bn-line);
  margin-top: 2rem;
}

.bn-ending-title {
  margin: 0 0 0.75rem;
  font-family: "Caveat", cursive;
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  font-weight: 700;
}

.bn-ending-text {
  margin: 0 auto;
  max-width: 28rem;
  font-family: "Nunito", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--bn-soft);
}

/* ── Add form ── */
.bn-add {
  margin-top: 2.5rem;
  padding: 1.5rem 1.25rem 1.75rem;
  background: var(--bn-paper);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  border: 1px solid var(--bn-line);
}

.bn-add-title {
  margin: 0 0 1rem;
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  color: var(--bn-ink);
}

.bn-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bn-label {
  margin-top: 0.55rem;
  font-family: "Nunito", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--bn-soft);
}

.bn-input,
.bn-textarea,
.bn-file {
  width: 100%;
  box-sizing: border-box;
  font-family: "Nunito", sans-serif;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bn-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--bn-ink);
}

html[data-theme="dark"] .bn-input,
html[data-theme="dark"] .bn-textarea,
html[data-theme="dark"] .bn-file {
  background: rgba(20, 14, 32, 0.55);
}

.bn-textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.bn-submit {
  margin-top: 1rem;
  align-self: center;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  font-family: "Fredoka", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--bn-ink);
  color: #fffaf7;
  cursor: pointer;
}

html[data-theme="dark"] .bn-submit {
  background: var(--bn-soft);
  color: #1a1020;
}

.bn-submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.bn-status {
  margin: 0.65rem 0 0;
  text-align: center;
  font-family: "Nunito", sans-serif;
  font-size: 0.88rem;
  color: var(--bn-soft);
  min-height: 1.2em;
}

.bn-empty {
  text-align: center;
  font-family: "Nunito", sans-serif;
  color: var(--bn-soft);
  padding: 2rem 0;
}

@media (max-width: 520px) {
  .bn-main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .bn-timeline {
    gap: 3.25rem;
  }

  .bn-arrow {
    width: 1.9rem;
    height: 1.9rem;
  }
}
