:root {
  --paper: #fbf5ec;
  --paper-deep: #efe3d5;
  --paper-card: #fffaf2;
  --paper-soft: #f7ebdf;
  --ink: #181516;
  --muted: #6f625d;
  --rose: #df7d9b;
  --rose-soft: #f5c6cf;
  --rose-paper: #f3aeba;
  --lilac: #e7d9f3;
  --lilac-deep: #d8c2ea;
  --photo-frame: #fff8ee;
  --sage: #8a9c88;
  --gold: #cf9e55;
  --line: rgba(24, 21, 22, 0.14);
  --line-dark: rgba(24, 21, 22, 0.32);
  --shadow: 0 18px 48px rgba(49, 31, 24, 0.12);
  --mono: "Courier New", Courier, monospace;
  --hand: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  --serif: "Bodoni 72", "Bodoni MT", Didot, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    url("assets/fundo-coracoes-estrelas.png") 48px 62px / 620px 620px repeat,
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.85), transparent 22rem),
    linear-gradient(90deg, rgba(24, 21, 22, 0.026) 1px, transparent 1px),
    linear-gradient(0deg, rgba(24, 21, 22, 0.02) 1px, transparent 1px),
    var(--paper);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
}

body.welcome-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
}

img[data-fit="contain"] {
  object-fit: contain !important;
  background: rgba(255, 250, 242, 0.78);
}

.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(251, 245, 236, 0.78), rgba(251, 245, 236, 0.94)),
    url("assets/fundo-coracoes-estrelas.png") 48px 62px / 620px 620px repeat,
    var(--paper);
  transition: opacity 360ms ease, visibility 360ms ease;
}

.welcome-screen.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.welcome-paper {
  position: relative;
  width: min(640px, 100%);
  padding: 42px 34px 32px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 250, 242, 0.96);
  box-shadow: var(--shadow);
  transform: rotate(-1deg);
}

.feather-mark {
  position: absolute;
  top: -54px;
  left: calc(100% - 18px);
  z-index: 2;
  height: 72px;
  width: auto;
  max-width: none;
  opacity: 0.86;
  filter: drop-shadow(0 8px 10px rgba(49, 31, 24, 0.08));
  transform: translate(0, 0) rotate(39deg);
  transform-origin: 50% 96%;
  animation: featherMove 4.6s cubic-bezier(0.42, 0, 0.16, 1) forwards;
  pointer-events: none;
}

.welcome-paper::before,
.hero-photo::before,
.paper-section::before,
.newsletter-card::before {
  content: "";
  position: absolute;
  width: 112px;
  height: 28px;
  background: rgba(223, 125, 155, 0.32);
  border: 1px solid rgba(223, 125, 155, 0.18);
}

.welcome-paper::before {
  top: -14px;
  left: 34px;
  transform: rotate(-4deg);
}

.pin {
  position: absolute;
  width: 52px;
  height: 2px;
  background: var(--ink);
  opacity: 0.5;
}

.pin-one {
  top: 22px;
  right: 70px;
  transform: rotate(12deg);
}

.pin-two {
  bottom: 44px;
  left: 30px;
  transform: rotate(-16deg);
}

.stamp,
.eyebrow,
.extra-label {
  margin: 0;
  color: var(--rose);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.welcome-paper h1 {
  margin: 4px 0 18px;
  font-size: clamp(2rem, 5vw, 3.15rem);
  line-height: 0.98;
}

.welcome-paper h1 .welcome-script-line {
  position: relative;
  display: block;
  width: fit-content;
  color: var(--muted);
  font-family: var(--hand);
  font-size: 1.35rem;
  font-weight: 400;
}

.welcome-script-text {
  display: inline-block;
}

.welcome-paper h1 strong {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.15rem, 4.15vw, 3.35rem);
  font-style: italic;
  font-weight: 500;
  line-height: 0.98;
  white-space: nowrap;
}

.welcome-paper p:not(.stamp) {
  color: var(--muted);
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
}

.remember-choice {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.64rem;
  opacity: 0.72;
  white-space: nowrap;
}

.remember-choice span {
  white-space: nowrap;
}

.scrapbook-shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  min-height: 100vh;
}

.left-rail {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 30px 24px 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.08)),
    rgba(249, 240, 230, 0.9);
}

.script-logo {
  display: inline-block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 2.85rem;
  font-style: italic;
  font-weight: 500;
  line-height: 0.98;
  text-decoration: none;
  transform: rotate(-4deg);
}

.rail-bio {
  max-width: 155px;
  margin: 18px 0 28px;
  font-size: 0.78rem;
}

.rail-nav {
  display: grid;
  gap: 10px;
  margin-bottom: 34px;
}

.rail-nav a {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  width: 176px;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--lilac);
  font-weight: 700;
  text-decoration: none;
}

.nav-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 2px 1px rgba(49, 31, 24, 0.08));
}

.rail-nav a.active,
.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: var(--lilac-deep);
  outline: none;
}

.rail-photo {
  position: relative;
  width: 154px;
  margin: 0 0 26px;
  padding: 8px 8px 22px;
  background: var(--photo-frame);
  box-shadow: 0 12px 28px rgba(49, 31, 24, 0.14);
  transform: rotate(-1deg);
}

.rail-photo::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 52px;
  width: 64px;
  height: 22px;
  background: rgba(211, 188, 155, 0.55);
  transform: rotate(-8deg);
}

.rail-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  object-fit: cover;
}

.spotify-card {
  position: relative;
  width: 154px;
  margin: 0 0 26px;
  padding: 12px;
  border-radius: 8px;
  background: #e8d6c7;
  box-shadow: 0 12px 28px rgba(49, 31, 24, 0.14);
  transform: rotate(-1deg);
}

.spotify-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 48px;
  width: 72px;
  height: 22px;
  background: rgba(211, 188, 155, 0.6);
  transform: rotate(-8deg);
}

.spotify-card p {
  margin: 0 0 10px;
  font-weight: 700;
}

.spotify-card iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 250, 242, 0.75);
}

.spotify-card span {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.72rem;
}

.rail-note {
  width: 150px;
  padding: 14px 14px 16px;
  background: #f2d9c9;
  box-shadow: 0 10px 24px rgba(49, 31, 24, 0.12);
  transform: rotate(-1.5deg);
}

.rail-note span {
  display: block;
  margin-bottom: 10px;
  font-size: 0.72rem;
}

.rail-note p {
  margin: 0;
  font-family: var(--hand);
  font-size: 0.92rem;
  line-height: 1.35;
}

.main-board {
  min-width: 0;
  padding: 30px clamp(20px, 3.5vw, 44px) 22px;
}

.hero-board {
  display: grid;
  grid-template-columns:
    minmax(185px, 0.72fr)
    minmax(370px, 1.12fr)
    minmax(300px, 1.1fr)
    minmax(250px, 0.9fr);
  gap: 24px;
  align-items: center;
}

.welcome-copy {
  position: relative;
  min-height: 350px;
  padding-top: 40px;
}

.welcome-copy h1 {
  margin: 0;
  font-size: clamp(2.15rem, 3vw, 3rem);
  font-weight: 500;
  line-height: 1.12;
}

.welcome-copy h1 > span {
  display: block;
  color: var(--ink);
  font-weight: 500;
}

.welcome-copy h1 strong {
  display: block;
  max-width: 12ch;
  margin-top: 12px;
  color: var(--rose);
  font-family: var(--serif);
  font-size: clamp(1.78rem, 2.4vw, 2.45rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1;
}

.welcome-chibi {
  display: block;
  width: min(190px, 82%);
  margin: 28px auto 0;
  filter: drop-shadow(0 16px 18px rgba(49, 31, 24, 0.13));
  transform: rotate(-2deg);
  pointer-events: none;
}

.welcome-copy p {
  max-width: 240px;
  margin: 34px 0 0;
  font-size: 0.92rem;
}

.sparkle {
  position: relative;
  top: -0.14em;
  display: inline-block;
  margin: 0 0.08em 0 0.04em;
  color: var(--gold);
  font-family: var(--hand);
  font-size: 0.92em;
  line-height: 1;
  vertical-align: middle;
}

.hero-gallery {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(94px, 0.42fr);
  gap: 14px;
  align-items: center;
  justify-self: center;
  width: min(100%, 430px);
}

.hero-side-photos {
  display: grid;
  gap: 14px;
}

.hero-photo {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 8px 8px 18px;
  background: var(--photo-frame);
  box-shadow: 0 16px 35px rgba(49, 31, 24, 0.16);
  transform: rotate(0.5deg);
}

.hero-photo::before {
  top: -13px;
  left: 40%;
  z-index: 2;
  transform: rotate(4deg);
}

.hero-photo-small {
  padding: 6px 6px 12px;
  box-shadow: 0 12px 26px rgba(49, 31, 24, 0.13);
  transform: rotate(-2.5deg);
}

.hero-photo-small:nth-child(2) {
  transform: rotate(2.5deg);
}

.hero-photo-small::before {
  top: -9px;
  left: 26%;
  width: 66px;
  height: 17px;
  transform: rotate(-5deg);
}

.hero-photo img {
  display: block;
  width: 100%;
  height: min(43vh, 390px);
  min-height: 320px;
  object-fit: cover;
}

.hero-photo-small img {
  aspect-ratio: 4 / 5;
  height: auto;
  min-height: 0;
}

.progress-sheet,
.diary-preview,
.paper-section,
.newsletter-card,
.auth-card,
.admin-card {
  position: relative;
  border: 1px solid rgba(24, 21, 22, 0.1);
  border-radius: 2px;
  background: rgba(255, 250, 242, 0.86);
  box-shadow: 0 12px 30px rgba(49, 31, 24, 0.08);
}

.progress-sheet {
  min-height: 338px;
  padding: 36px 32px 28px;
}

.progress-sheet .eyebrow {
  display: block;
  width: fit-content;
  margin-inline: auto;
  text-align: center;
}

.progress-sheet::after {
  content: "";
  position: absolute;
  inset: auto 12px -8px 18px;
  height: 18px;
  background: rgba(24, 21, 22, 0.09);
  filter: blur(8px);
  z-index: -1;
}

.progress-sheet h2 {
  font-family: var(--serif);
  font-style: italic;
  margin: 22px auto;
  max-width: 14ch;
  text-align: center;
  font-size: clamp(1.65rem, 2.3vw, 2.3rem);
  font-weight: 500;
  line-height: 1.3;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.progress-rail {
  height: 19px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.progress-rail span {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: 999px;
  background: var(--rose);
  transition: width 600ms ease;
}

.progress-row strong {
  font-family: var(--hand);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
}

.progress-quote {
  margin: 28px 0 22px;
  text-align: center;
  font-weight: 700;
}

.progress-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.progress-facts div {
  text-align: center;
}

.progress-facts div + div {
  border-left: 1px solid var(--line);
}

.progress-facts dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.7rem;
}

.progress-facts dd {
  margin: 0;
  font-weight: 700;
}

.diary-preview {
  align-self: stretch;
  padding: 22px 24px;
}

.diary-preview h2,
.section-title-row h2,
.newsletter-card h2,
.auth-card h1,
.admin-card h2 {
  display: inline-block;
  margin: 0;
  padding: 5px 14px;
  color: #fffaf2;
  background: var(--ink);
  font-size: 1.35rem;
  line-height: 1.1;
  transform: rotate(-1deg);
}

.diary-preview > p,
.section-title-row p,
.newsletter-card p {
  margin: 16px 0 18px;
  font-size: 0.86rem;
}

.diary-preview-list {
  display: grid;
  gap: 14px;
}

.diary-note,
.note-card {
  padding: 16px;
  background: rgba(231, 217, 243, 0.78);
  box-shadow: 0 8px 20px rgba(49, 31, 24, 0.08);
}

.diary-note time,
.note-card time,
.message-date {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.72rem;
}

.diary-note p,
.note-card p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.diary-preview a,
.section-title-row a {
  display: inline-block;
  margin-top: 18px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--line-dark);
}

.pink-ticket {
  width: min(520px, 92%);
  margin: 30px auto 24px;
  padding: 18px 28px;
  background: var(--rose-soft);
  box-shadow: 0 10px 25px rgba(49, 31, 24, 0.1);
  transform: rotate(-1deg);
}

.visit-updates {
  width: min(640px, 92%);
  margin: 8px auto 28px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.9);
  box-shadow: 0 14px 34px rgba(49, 31, 24, 0.08);
}

.visit-updates h2 {
  display: inline-block;
  margin: 0;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.05rem;
  transform: rotate(-1deg);
}

.visit-updates ul {
  margin: 16px 0 0;
  padding-left: 22px;
}

.visit-updates li {
  margin: 8px 0;
  line-height: 1.65;
}

.paper-section {
  margin-top: 28px;
  padding: 28px;
}

.paper-section::before {
  top: -12px;
  left: 30px;
  background: rgba(211, 188, 155, 0.42);
  transform: rotate(-4deg);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.extras-section .section-title-row,
.buy-section .section-title-row {
  position: relative;
  justify-content: center;
  text-align: center;
}

.extras-section .section-title-row > div,
.buy-section .section-title-row > div {
  margin-inline: auto;
}

.extras-section .section-title-row a {
  position: absolute;
  top: 8px;
  right: 0;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
  background: var(--lilac);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 9px 22px rgba(49, 31, 24, 0.13);
}

.button.primary {
  color: var(--ink);
  background: var(--lilac-deep);
}

.button.ghost {
  background: var(--lilac);
}

.tape-button {
  border: 0;
  background: var(--lilac);
  transform: rotate(-1.5deg);
}

.letter-form {
  display: grid;
  grid-template-columns: auto minmax(145px, 0.5fr) minmax(230px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 22px;
}

.emoji-picker {
  display: flex;
  gap: 6px;
}

.emoji-option {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  background: rgba(255, 250, 242, 0.8);
}

.emoji-option.active,
.emoji-option:focus-visible {
  border-color: var(--rose);
  outline: none;
  background: var(--rose-soft);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: lowercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255, 250, 242, 0.92);
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--rose);
  outline: 2px solid rgba(223, 125, 155, 0.22);
}

.form-status {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--rose);
  font-family: var(--hand);
}

.message-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.message-card,
.extra-card {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: 0 9px 24px rgba(49, 31, 24, 0.07);
  color: inherit;
  text-decoration: none;
}

.message-author {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 2px;
  font-weight: 700;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--paper-deep);
}

.message-card p {
  margin: 12px 0;
  font-size: 0.86rem;
}

.reply-button {
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.replies {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.reply-row {
  font-size: 0.82rem;
}

.reply-form {
  display: none;
  gap: 8px;
  margin-top: 12px;
}

.reply-form.open {
  display: grid;
}

.extras-grid,
.buy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.extras-section .extras-grid {
  max-width: 860px;
  margin-inline: auto;
  grid-template-columns: repeat(3, minmax(0, 260px));
  justify-content: center;
}

.buy-section .buy-grid {
  max-width: 760px;
  margin-inline: auto;
  grid-template-columns: repeat(2, minmax(220px, 340px));
  justify-content: center;
}

.buy-section .buy-card {
  min-height: 0;
}

.buy-section .buy-card img {
  aspect-ratio: 16 / 10;
}

.extra-card,
.buy-card {
  color: inherit;
  text-decoration: none;
  min-height: 205px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: 0 9px 24px rgba(49, 31, 24, 0.07);
}

.extra-card img,
.buy-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

.extra-label {
  display: inline-block;
  margin: -18px 8px 10px;
  padding: 4px 9px;
  color: #fffaf2;
  background: var(--ink);
  position: relative;
  z-index: 1;
}

.extra-card h3,
.buy-card h3 {
  margin: 2px 8px 6px;
  font-size: 1rem;
}

.extra-card p,
.buy-card p,
.locked {
  margin: 0 8px 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.locked {
  display: block;
  color: var(--rose);
}

.locked-extra {
  cursor: not-allowed;
}

.locked-extra img {
  filter: grayscale(0.2) sepia(0.08);
  opacity: 0.72;
}

.locked-extra:hover {
  transform: none;
}

.locked-detail {
  padding: 18px;
  border: 1px dashed var(--rose);
  border-radius: 6px;
  background: rgba(223, 205, 241, 0.36);
}

.locked-detail strong {
  display: inline-block;
  margin-bottom: 6px;
  font-family: var(--typewriter);
  color: var(--rose);
}

.locked-detail p {
  margin: 0;
}

.detail-page {
  min-height: 100vh;
}

.detail-shell {
  width: min(1040px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.detail-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin-top: 34px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 242, 0.88);
  box-shadow: 0 22px 54px rgba(49, 31, 24, 0.12);
}

.detail-card::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 15%;
  width: 116px;
  height: 28px;
  background: rgba(214, 187, 154, 0.42);
  transform: rotate(-5deg);
}

.detail-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 10px solid var(--photo-frame);
  border-radius: 6px;
  box-shadow: 0 17px 34px rgba(49, 31, 24, 0.16);
}

.detail-card h1 {
  max-width: 11ch;
  margin: 10px 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  font-weight: 500;
  line-height: 0.94;
}

.detail-card p {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.75;
}

.detail-description {
  color: var(--ink);
  font-weight: 700;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.detail-items,
.book-list {
  display: grid;
  gap: 18px;
  margin: 28px 0 8px;
}

.detail-item-card,
.book-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 16px;
  align-items: start;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.detail-item-card img,
.book-card img {
  grid-row: 1 / span 4;
  display: block;
  width: 92px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 5px solid var(--photo-frame);
  border-radius: 5px;
  box-shadow: 0 10px 22px rgba(49, 31, 24, 0.12);
}

.detail-item-card h2,
.book-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
}

.detail-item-card p,
.book-card p {
  margin: 0;
  line-height: 1.55;
}

.detail-item-description,
.detail-empty {
  font-weight: 700;
}

.book-card .button {
  width: fit-content;
  margin-top: 8px;
}

.detail-image-button {
  grid-row: 1 / span 4;
  display: block;
  width: 92px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.detail-image-button img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 5px solid var(--photo-frame);
  border-radius: 5px;
  box-shadow: 0 10px 22px rgba(49, 31, 24, 0.12);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(24, 21, 22, 0.72);
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox img {
  display: block;
  max-width: min(92vw, 980px);
  max-height: 84vh;
  object-fit: contain;
  border: 10px solid var(--photo-frame);
  border-radius: 6px;
  background: var(--photo-frame);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.image-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--lilac);
  cursor: pointer;
  font-weight: 700;
}

.lightbox-open {
  overflow: hidden;
}

.purchase-detail-page .detail-card {
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  align-items: start;
}

.purchase-detail-page .detail-card > img {
  position: sticky;
  top: 26px;
  aspect-ratio: 4 / 5;
}

.purchase-detail-page .detail-card h1 {
  max-width: none;
  font-size: clamp(2.8rem, 5vw, 4.6rem);
}

.purchase-detail-page .book-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.purchase-detail-page .book-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.86);
  box-shadow: 0 12px 28px rgba(49, 31, 24, 0.08);
}

.purchase-detail-page .book-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-width: 7px;
}

.purchase-detail-page .book-card p {
  color: var(--muted);
  font-size: 0.82rem;
}

.purchase-detail-page .book-card .button {
  margin-top: auto;
}

.scroll-top-button {
  position: fixed;
  right: 16px;
  bottom: 22px;
  z-index: 45;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--lilac);
  box-shadow: 5px 5px 0 rgba(248, 214, 224, 0.95);
  cursor: pointer;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.scroll-top-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.notes-stream {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.note-card {
  min-height: 145px;
}

.newsletter-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 22px;
  align-items: center;
  margin-top: 30px;
  padding: 26px;
  background: var(--rose-soft);
}

.newsletter-card::before {
  top: -12px;
  right: 44px;
  background: rgba(211, 188, 155, 0.45);
  transform: rotate(6deg);
}

.newsletter-card form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.newsletter-status {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--ink);
  font-family: var(--hand);
  font-size: 0.9rem;
}

.hidden-frame {
  position: absolute;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 32px 0 8px;
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

.site-counters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  color: var(--muted);
}

.site-counters strong {
  color: var(--rose);
}

.about-card img {
  background: rgba(255, 250, 242, 0.78);
}

.auth-page,
.admin-page {
  min-height: 100vh;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 34px;
}

.auth-card .script-logo {
  margin-bottom: 28px;
}

.auth-card h1 {
  margin-bottom: 18px;
}

.auth-card form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.auth-actions,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.login-status,
.admin-status {
  min-height: 22px;
  margin: 0;
  color: var(--rose);
  font-family: var(--hand);
}

.admin-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h1 {
  margin: 0;
  font-family: var(--hand);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 0.95;
  transform: rotate(-4deg);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.admin-single-column {
  display: grid;
  gap: 18px;
}

.admin-helper {
  max-width: 780px;
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.admin-link-list {
  display: grid;
  gap: 12px;
}

.admin-link-list a {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--lavender);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 5px 5px 0 rgba(248, 214, 224, 0.95);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.admin-link-list a:hover,
.admin-link-list a:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 rgba(248, 214, 224, 0.95);
}

.admin-link-list strong {
  font-family: var(--type);
  font-size: 1rem;
}

.admin-link-list span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-card {
  padding: 24px;
}

.admin-card + .admin-card {
  margin-top: 18px;
}

.admin-card h2 {
  margin-bottom: 18px;
}

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

.admin-form label.full,
.admin-form .admin-actions {
  grid-column: 1 / -1;
}

.admin-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.admin-list article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 250, 242, 0.68);
}

.admin-list h3 {
  margin: 0 0 7px;
  font-size: 1rem;
}

.admin-list h3.admin-section-heading {
  width: fit-content;
  margin-bottom: 16px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--lilac);
  box-shadow: 5px 5px 0 rgba(248, 214, 224, 0.78);
  font-size: 1.06rem;
}

.admin-image-field {
  gap: 10px;
}

.admin-image-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 250, 242, 0.92);
}

.admin-image-preview {
  display: block;
  width: min(220px, 100%);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 6px solid var(--photo-frame);
  border-radius: 6px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: 0 10px 22px rgba(49, 31, 24, 0.1);
}

.admin-list p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-list .empty-admin-note {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: rgba(255, 250, 242, 0.62);
}

.admin-list textarea {
  min-height: 76px;
}

.admin-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.admin-subsection h4 {
  margin: 0 0 12px;
  font-size: 0.92rem;
  text-transform: lowercase;
}

.admin-nested-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-nested-list article {
  background: rgba(231, 217, 243, 0.36);
}

@media (max-width: 1520px) {
  .hero-board {
    grid-template-columns: minmax(185px, 0.8fr) minmax(350px, 1.05fr) minmax(300px, 1.1fr);
  }

  .diary-preview {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .scrapbook-shell {
    grid-template-columns: 1fr;
  }

  .left-rail {
    position: static;
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px 22px;
    align-items: center;
    justify-items: center;
    padding: 22px;
    text-align: center;
  }

  .rail-bio,
  .rail-photo,
  .spotify-card,
  .rail-note {
    display: none;
  }

  .rail-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin: 0;
  }

  .script-logo {
    font-size: 2.35rem;
    text-align: center;
  }

  .hero-board,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .welcome-copy {
    justify-self: center;
    text-align: center;
  }

  .welcome-copy h1 strong {
    max-width: none;
  }

  .hero-gallery {
    justify-self: center;
    width: min(100%, 560px);
  }

  .message-grid,
  .extras-grid,
  .buy-grid,
  .notes-stream,
  .newsletter-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .letter-form {
    grid-template-columns: 1fr 1fr;
  }

  .emoji-picker,
  .letter-message,
  .letter-form .button,
  .form-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .main-board {
    padding: 22px 16px;
  }

  .left-rail {
    grid-template-columns: 1fr;
  }

  .rail-nav a {
    width: 100%;
    padding-inline: 8px;
  }

  .message-grid,
  .extras-grid,
  .buy-grid,
  .notes-stream,
  .newsletter-card,
  .newsletter-card form,
  .letter-form,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .section-title-row,
  .admin-header,
  .site-footer {
    flex-direction: column;
    align-items: center;
  }

  .extras-section .section-title-row a {
    position: static;
    margin-top: 8px;
  }

  .welcome-copy {
    min-height: auto;
    padding-top: 10px;
  }

  .welcome-chibi {
    width: min(170px, 68%);
    margin-top: 20px;
  }

  .welcome-paper h1 strong {
    white-space: normal;
  }

  .hero-gallery {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .hero-photo img {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 5;
  }

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

  .buy-section .buy-grid {
    max-width: 360px;
    grid-template-columns: 1fr;
  }

  .hero-photo-small img {
    aspect-ratio: 1 / 1;
  }

  .progress-sheet,
  .paper-section,
  .newsletter-card,
  .auth-card,
  .admin-card,
  .detail-card {
    padding: 20px;
  }

  .detail-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .detail-card h1 {
    max-width: none;
  }

  .detail-item-card,
  .book-card {
    grid-template-columns: 1fr;
  }

  .detail-item-card img,
  .book-card img {
    grid-row: auto;
    width: min(170px, 100%);
  }

  .detail-image-button {
    grid-row: auto;
    width: min(220px, 100%);
  }

  .detail-image-button img {
    width: 100%;
  }

  .purchase-detail-page .detail-card {
    grid-template-columns: 1fr;
  }

  .purchase-detail-page .detail-card > img {
    position: static;
  }

  .progress-facts {
    grid-template-columns: 1fr;
  }

  .progress-facts div + div {
    padding-top: 12px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@keyframes featherMove {
  0% {
    opacity: 0.72;
    transform: translate(0, 2px) rotate(38deg);
  }
  18% {
    opacity: 0.9;
    transform: translate(18px, -4px) rotate(43deg);
  }
  48% {
    transform: translate(45px, -8px) rotate(39deg);
  }
  76% {
    transform: translate(66px, -3px) rotate(44deg);
  }
  100% {
    opacity: 0.84;
    transform: translate(86px, -6px) rotate(41deg);
  }
}
