:root {
  --sage: #dfe9c5;
  --moss: #66784a;
  --fern: #34452d;
  --cream: #fff9e8;
  --paper: rgba(255, 249, 232, 0.94);
  --pink: #f3a6b7;
  --rose: #8b5360;
  --ink: #2f3c2b;
  --border: #77895d;
  --shadow: rgba(50, 63, 39, 0.25);
  --focus: #6a3bd1;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--sage);
  background-image:
    linear-gradient(rgba(235, 242, 211, 0.34), rgba(235, 242, 211, 0.34)),
    url("assets/witchy-kawaii-background-300ppi.png");
  background-repeat: repeat;
  background-size: auto, min(900px, 160vw) auto;
  font-family: "Gaegu", "Trebuchet MS", sans-serif;
  font-size: 20px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background: radial-gradient(circle at top, rgba(255, 249, 232, 0.26), rgba(223, 233, 197, 0.08) 46%, rgba(140, 154, 104, 0.16));
  pointer-events: none;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 5;
  padding: 8px 12px;
  color: var(--cream);
  background: var(--fern);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 34px auto 18px;
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(210px, 250px);
  gap: 18px;
  align-items: start;
}

.main-card,
.sidebar {
  background: var(--paper);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: 7px 7px 0 var(--shadow);
}

.main-card {
  padding: clamp(18px, 3vw, 30px);
}

.sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.hero {
  min-height: clamp(340px, 48vh, 470px);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: clamp(24px, 6vw, 58px) 18px;
  border: 2px dashed var(--pink);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 249, 232, 0.24), rgba(223, 233, 197, 0.75)),
    url("assets/witchy-kawaii-background-300ppi.png") center / min(720px, 150vw) auto;
}

.moon,
.sticker {
  margin: 0;
  line-height: 1;
  text-align: center;
  color: var(--moss);
  filter: drop-shadow(2px 2px 0 rgba(255, 255, 255, 0.8));
}

.moon {
  font-size: clamp(48px, 8vw, 72px);
}

.sticker {
  font-size: 50px;
}

.eyebrow,
.post-date {
  width: fit-content;
  margin: 0 auto;
  padding: 4px 12px;
  color: var(--rose);
  background: #ffe5eb;
  border: 1px solid #bd8291;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: "IM Fell English", Georgia, serif;
  color: var(--fern);
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 12px 0 10px;
  font-size: clamp(48px, 9vw, 86px);
  line-height: 0.9;
  text-shadow: 2px 2px 0 #f7c0cd;
}

h2 {
  margin: 0 0 10px;
  font-size: 32px;
  line-height: 1;
}

h3 {
  margin: 8px 0;
  font-size: 30px;
  line-height: 1;
}

p {
  line-height: 1.38;
}

.tagline {
  max-width: 520px;
  margin: 0;
  color: #586840;
  font-size: clamp(22px, 3vw, 28px);
}

.intro,
.post-preview,
.panel,
.pixel-note,
.blinkie,
.scrapbook-grid article {
  background: rgba(255, 253, 244, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.intro {
  margin-top: 22px;
  padding: 20px 22px;
  border-left: 8px solid var(--pink);
}

.intro p {
  margin: 10px 0 0;
}

.about-photo-frame {
  width: min(100%, 720px);
  margin: 0 auto 20px;
  padding: 12px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(50, 63, 39, 0.16);
}

.about-photo-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
}

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

.scrapbook-grid article {
  min-height: 190px;
  padding: 16px;
}

.scrapbook-grid span {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--rose);
  background: #ffe5eb;
  border: 1px solid #d79aaa;
  border-radius: 50%;
}

.post-preview {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.post-preview h2 {
  margin-top: 10px;
}

.post-preview p {
  max-width: 640px;
  margin: 0;
}

.button-link,
.text-link,
button,
.mini-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 15px;
  color: var(--fern);
  background: #f9d9e1;
  border: 1px solid #bc8792;
  border-radius: 999px;
  box-shadow: 2px 2px 0 rgba(110, 91, 75, 0.18);
  text-decoration: none;
  cursor: pointer;
}

.button-link:hover,
.text-link:hover,
button:hover,
.mini-nav a:hover {
  background: #ffe8ee;
  transform: translateY(-1px);
}

.mini-nav a[aria-current="page"] {
  background: #fff0b8;
  border-color: #9a8a55;
}

.text-link {
  width: fit-content;
  min-height: 34px;
  margin-top: 8px;
  padding: 5px 12px;
  font-size: 19px;
}

.page-main {
  display: grid;
  gap: 22px;
}

.page-hero {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: clamp(24px, 5vw, 48px) 18px;
  border: 2px dashed var(--pink);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 249, 232, 0.38), rgba(223, 233, 197, 0.82)),
    url("assets/witchy-kawaii-background-300ppi.png") center / min(680px, 145vw) auto;
}

.page-hero h1 {
  font-size: clamp(46px, 8vw, 76px);
}

.note-stack,
.post-list,
.reading-shelf,
.book-nook-shelf,
.photo-grid {
  display: grid;
  gap: 14px;
}

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

.post-card,
.note-stack article,
.reading-shelf article,
.photo-grid article {
  padding: 18px;
  background: rgba(255, 253, 244, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.post-card {
  display: grid;
  gap: 8px;
}

.post-card p,
.reading-shelf p,
.photo-grid p,
.note-stack p {
  margin: 0;
}

.post-card h2,
.reading-shelf h2,
.photo-grid h2,
.note-stack h2 {
  margin-top: 8px;
}

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

.book-nook-shelf {
  padding: 18px;
  background: rgba(255, 253, 244, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.section-heading {
  display: grid;
  justify-items: center;
  text-align: center;
}

.section-heading p {
  max-width: 620px;
  margin: 0;
}

.section-heading h2 {
  margin-top: 10px;
}

.book-row {
  min-height: 230px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 9px;
  margin-top: 10px;
  padding: 26px 16px 20px;
  overflow-x: auto;
  background:
    linear-gradient(to bottom, transparent 0 76%, rgba(91, 71, 48, 0.28) 76% 80%, rgba(90, 66, 39, 0.68) 80% 87%, rgba(51, 60, 39, 0.16) 87% 100%),
    rgba(223, 233, 197, 0.44);
  border: 1px dashed var(--border);
  border-radius: 8px;
  perspective: 900px;
}

.book-spine {
  --book-color: #879b65;
  --book-shadow: #53633d;
  position: relative;
  flex: 0 0 54px;
  width: 54px;
  min-height: 172px;
  padding: 12px 7px;
  align-items: center;
  color: #fffdf4;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 18% 72%, rgba(0, 0, 0, 0.16)),
    var(--book-color);
  border: 1px solid rgba(47, 60, 43, 0.5);
  border-radius: 5px 5px 3px 3px;
  box-shadow: inset -5px 0 0 rgba(0, 0, 0, 0.08), 3px 5px 0 rgba(50, 63, 39, 0.18);
  transform-origin: bottom center;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.book-spine::before,
.book-spine::after {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  content: "";
  background: rgba(255, 249, 232, 0.64);
}

.book-spine::before {
  top: 18px;
}

.book-spine::after {
  bottom: 18px;
}

.book-spine span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  line-height: 1;
  text-align: center;
  font-weight: 700;
  text-shadow: 1px 1px 0 rgba(47, 60, 43, 0.35);
}

.book-spine:hover,
.book-spine:focus-visible,
.book-spine.is-selected {
  filter: saturate(1.08);
  transform: translateY(-22px) translateZ(42px) rotate(-2deg);
  box-shadow: inset -5px 0 0 rgba(0, 0, 0, 0.08), 8px 13px 0 rgba(50, 63, 39, 0.16);
}

.sage-book {
  --book-color: #849862;
}

.rose-book {
  --book-color: #bd7887;
}

.fern-book {
  --book-color: #536d45;
}

.gold-book {
  --book-color: #b49b56;
}

.moss-book {
  --book-color: #6f8052;
}

.blush-book {
  --book-color: #d694a8;
}

.book-detail {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  padding: 18px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-left: 8px solid var(--pink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(50, 63, 39, 0.14);
}

.book-detail p {
  margin: 0;
}

.book-detail h2 {
  margin: 4px 0 0;
}

.book-detail-heading {
  display: grid;
  justify-items: center;
  text-align: center;
}

.current-book {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: rgba(223, 233, 197, 0.58);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.current-book h3,
.past-reads h3 {
  margin: 0 0 8px;
}

.current-book p {
  margin: 0;
}

.cover-card {
  display: grid;
  gap: 8px;
}

.cover-art {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px;
  color: var(--cream);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 18%),
    var(--moss);
  border: 1px solid rgba(47, 60, 43, 0.42);
  border-radius: 6px;
  box-shadow: 4px 5px 0 rgba(50, 63, 39, 0.16);
  text-align: center;
  font-weight: 700;
  line-height: 1.05;
}

.cover-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-art span {
  position: relative;
  z-index: 1;
  text-shadow: 1px 1px 0 rgba(47, 60, 43, 0.35);
}

.cover-title {
  margin: 0;
  color: var(--fern);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.book-cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 14px;
}

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

.photo-placeholder {
  display: grid;
  min-height: 150px;
  place-items: center;
  margin-bottom: 14px;
  color: var(--rose);
  background:
    linear-gradient(rgba(255, 229, 235, 0.82), rgba(255, 249, 232, 0.76)),
    url("assets/witchy-kawaii-background-300ppi.png") center / 420px auto;
  border: 1px dashed var(--pink);
  border-radius: 8px;
  font-weight: 700;
}

.scrapbook-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 18px;
  background: rgba(255, 253, 244, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.scrapbook-wall figure {
  margin: 0;
  padding: 8px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 3px 3px 0 rgba(50, 63, 39, 0.14);
}

.scrapbook-photo-button {
  width: 100%;
  min-height: 0;
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
}

.scrapbook-photo-button:hover {
  transform: none;
}

.scrapbook-wall img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

.scrapbook-photo-button:hover img,
.scrapbook-photo-button:focus-visible img {
  filter: saturate(1.08);
}

.scrapbook-lightbox {
  max-width: min(92vw, 980px);
  max-height: 92vh;
  padding: 14px;
  background: var(--cream);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: 8px 8px 0 rgba(50, 63, 39, 0.25);
}

.scrapbook-lightbox::backdrop {
  background: rgba(47, 60, 43, 0.66);
}

.scrapbook-lightbox img {
  display: block;
  max-width: calc(92vw - 28px);
  max-height: calc(92vh - 72px);
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  width: 38px;
  min-height: 38px;
  display: inline-flex;
  margin: 0 0 10px auto;
  padding: 0;
  font-size: 30px;
  line-height: 1;
}

.field-entry {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: rgba(255, 253, 244, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.field-entry-copy {
  padding: 18px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-left: 8px solid var(--pink);
  border-radius: 8px;
}

.field-entry-copy p {
  margin: 10px 0 0;
}

.field-entry-copy .post-date {
  margin: 0;
}

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

.field-gallery figure {
  margin: 0;
  padding: 8px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 3px 3px 0 rgba(50, 63, 39, 0.14);
}

.field-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

.field-gallery .featured-field-photo {
  grid-column: span 2;
  grid-row: span 2;
}

.field-gallery .featured-field-photo img {
  height: 100%;
}

.stationery-entry {
  position: relative;
  display: grid;
  gap: 12px;
  padding: clamp(22px, 5vw, 44px);
  background:
    linear-gradient(90deg, rgba(243, 166, 183, 0.26) 0 2px, transparent 2px 100%) 42px 0 / 100% 100%,
    repeating-linear-gradient(to bottom, rgba(102, 120, 74, 0.14) 0 1px, transparent 1px 34px),
    rgba(255, 249, 232, 0.96);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 6px 6px 0 rgba(50, 63, 39, 0.16);
}

.stationery-entry::before {
  position: absolute;
  top: 14px;
  right: 18px;
  content: "✦";
  color: var(--pink);
  font-size: 30px;
}

.stationery-entry .post-date {
  margin: 0;
}

.stationery-entry h2 {
  margin: 4px 0 8px;
}

.stationery-entry p {
  max-width: 70ch;
  margin: 0;
}

.stationery-entry .letter-greeting,
.stationery-entry .letter-signoff {
  font-family: "IM Fell English", Georgia, serif;
  color: var(--rose);
  font-size: 28px;
}

.stationery-entry .letter-signoff {
  margin-top: 10px;
}

.comments-panel {
  display: grid;
  gap: 12px;
  padding: 20px;
  background: rgba(255, 253, 244, 0.78);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.comments-panel .post-date {
  margin: 0;
}

.comments-panel p {
  margin: 0;
}

.comment-placeholder {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #65734c;
  background: var(--cream);
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.panel,
.pixel-note,
.blinkie {
  padding: 14px;
}

.status-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.status-list div {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
}

.status-list dt {
  color: var(--rose);
  font-weight: 700;
}

.status-list dd {
  margin: 0;
}

.mini-nav {
  display: grid;
  gap: 8px;
}

.mini-nav a {
  width: 100%;
}

.pixel-note,
.blinkie {
  margin: 0;
  text-align: center;
}

.treasure-list {
  margin: 0;
  padding-left: 24px;
}

.treasure-list li + li {
  margin-top: 8px;
}

.guestbook form {
  display: grid;
  gap: 10px;
}

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.guestbook label {
  display: grid;
  gap: 4px;
  color: var(--rose);
  font-weight: 700;
}

.guestbook input,
.guestbook textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fffdf4;
}

.guestbook textarea {
  min-height: 92px;
  resize: vertical;
}

.guestbook-message {
  min-height: 28px;
  margin: 8px 0 0;
  color: #56643e;
}

.blinkie {
  border-style: dotted;
  border-color: var(--pink);
  background: #ffe5eb;
  animation: glow 1.6s infinite alternate;
}

footer {
  width: min(1220px, calc(100% - 32px));
  margin: 10px auto 34px;
  padding: 9px 16px;
  color: #5d6b47;
  background: rgba(255, 249, 232, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-align: center;
}

.contact-strip {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 16px;
  color: var(--fern);
  background: rgba(255, 249, 232, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.contact-strip p {
  margin: 0;
}

.contact-strip a {
  color: var(--rose);
  font-weight: 700;
}

@keyframes glow {
  from {
    opacity: 0.72;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 1050px) {
  .page-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
  }

  .sidebar-left {
    order: 2;
  }

  .main-card {
    order: 1;
  }

  .sidebar-right {
    order: 3;
  }

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

  .note-stack,
  .reading-shelf,
  .photo-grid,
  .field-gallery {
    grid-template-columns: 1fr;
  }

  .book-row {
    justify-content: start;
  }

  .current-book {
    grid-template-columns: 1fr;
  }

  .current-book .cover-card {
    width: min(180px, 100%);
    justify-self: center;
  }

  .field-gallery .featured-field-photo {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 19px;
  }

  .page-shell {
    width: min(100% - 18px, 1220px);
    margin-top: 12px;
    gap: 12px;
  }

  .main-card,
  .sidebar {
    box-shadow: 4px 4px 0 var(--shadow);
  }

  .hero,
  .page-hero {
    min-height: 390px;
  }

  .intro,
  .post-preview,
  .book-nook-shelf,
  .book-detail,
  .field-entry,
  .field-entry-copy,
  .stationery-entry,
  .comments-panel,
  .scrapbook-wall,
  .post-card,
  .note-stack article,
  .reading-shelf article,
  .photo-grid article {
    padding: 16px;
  }

  .status-list div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  footer {
    width: min(100% - 18px, 1220px);
  }

  .contact-strip {
    width: min(100% - 18px, 1220px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
