:root {
  color-scheme: light;
  --paper: #f4fbf5;
  --paper-2: #e3f6e7;
  --ink: #0f7a32;
  --muted: #3d8a56;
  --line: #c6e8ce;
  --accent: #128a38;
  --card: rgba(255, 255, 255, 0.82);
  --margin: 2.45rem;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "Lucida Console", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { background: #0c1610; }

body {
  margin: 0 auto;
  max-width: 76rem;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent calc(var(--margin) - 1.5px), #3cba62 0 var(--margin), transparent var(--margin)),
    linear-gradient(to right, rgba(52, 168, 84, 0.2) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(52, 168, 84, 0.2) 1px, transparent 1px);
  background-size: auto, 8px 8px, 8px 8px;
  background-attachment: fixed;
  background-position:
    left max(0px, calc(50% - 38rem)) top 0,
    left max(0px, calc(50% - 38rem)) top 0,
    left max(0px, calc(50% - 38rem)) top 0;
  color: var(--ink);
  font-family: var(--mono);
  line-height: 1.5;
  box-shadow: 0 0 0 1px rgba(160, 220, 176, 0.16), 0 18px 48px rgba(0, 0, 0, 0.35);
}

body::before {
  content: "";
  position: fixed;
  z-index: 3;
  top: 1rem;
  bottom: 1rem;
  width: 0.82rem;
  left: max(0.2rem, calc(50% - 38.4rem));
  pointer-events: none;
  background-image: radial-gradient(ellipse 46% 16% at 50% 50%, transparent 44%, #d5dee6 46% 52%, #8f9eac 54% 64%, #5e6c78 66% 72%, transparent 74%);
  background-size: 100% 2.55rem;
  background-repeat: repeat-y;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.top {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  max-width: none;
  margin: 0;
  min-height: 7.4rem;
  padding: 0.75rem 1.4rem 0.75rem calc(var(--margin) + 1.15rem);
  border-bottom: 1px solid var(--line);
  background-color: var(--paper);
  background-image: inherit;
  background-size: auto, 8px 8px, 8px 8px;
  background-attachment: fixed;
  background-position: inherit;
}

.mark {
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.92rem;
}

.search { display: flex; margin-left: auto; justify-content: flex-end; align-items: center; }
.search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.search input, .search button, .views a, .filters a {
  font-family: var(--mono);
}
.search input {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  min-width: 14rem;
}
.search button, .draft-toggle {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.views {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.6rem;
  border: 0;
}
.views a {
  color: var(--muted);
  text-decoration: none;
  padding: 0;
  border-radius: 50%;
}
.views a.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  background: transparent;
  transform-origin: center center;
  transition: transform 0.16s ease;
}
.views a.current { background: transparent; color: inherit; }
.views a.icon.current { box-shadow: 0 0 0 3px var(--ink); }
.views a.icon:hover,
.views a.icon:focus-visible {
  transform: scale(1.25);
  z-index: 6;
}
.nav-icon { width: 1.15rem; height: 1.15rem; display: block; }
.nav-icon.coin {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  object-fit: cover;
}

html.view-diary main.index > h1,
html.view-diary main.index > h2.month,
html.view-diary main.index > article.card,
html.view-diary main.index > p.empty,
html.view-diary .year-menu,
html.view-diary .filters { display: none !important; }
html.view-diary body {
  display: flex;
  flex-direction: column;
}
html.view-diary main.index {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 0;
}
.diary-book { display: none; }
html.view-diary .diary-book {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

main { max-width: none; margin: 0; padding: 1.2rem 1.4rem 3rem calc(var(--margin) + 1.15rem); }
h1 { font-weight: 500; letter-spacing: -0.03em; margin: 0.2rem 0 1rem; }
h1 span { color: var(--muted); font-size: 0.7em; }

.filters { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: center; margin-bottom: 0.6rem; }
.cats { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.year-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  color: var(--muted);
}
.year-menu select {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}
.filters a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.filters a.current { background: var(--paper-2); color: var(--ink); }

.month {
  margin: 1.6rem 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 700;
}

.card {
  display: grid;
  grid-template-columns: 7.2rem 1fr;
  gap: 0.8rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}
.card time { color: var(--ink); font-family: var(--mono); font-size: 0.86rem; font-weight: 700; padding-top: 0.2rem; }
.card > div,
.entry {
  position: relative;
  isolation: isolate;
}
.card > div::before,
.entry::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -0.55rem -1.4rem -0.7rem -0.65rem;
  pointer-events: none;
  background: radial-gradient(
    ellipse 100% 95% at 40% 42%,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.96) 62%,
    rgba(255, 255, 255, 0.45) 82%,
    rgba(255, 255, 255, 0) 100%
  );
}
.entry::before {
  left: calc(var(--margin) + 0.35rem);
}
.card h3 { margin: 0; font-size: 1.25rem; font-weight: 500; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.meta, .excerpt, .album-line, .lede, .empty { margin: 0.2rem 0 0; }
.meta, .excerpt, .lede { color: var(--muted); }
.album-line { color: var(--accent); font-family: var(--mono); font-size: 0.92rem; }
.excerpt { font-size: 1.02rem; }
.card[hidden], h2.month[hidden], p.empty[hidden] { display: none !important; }

html.view-galleries main.index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.9rem;
  align-items: stretch;
}
html.view-galleries main.index > .filters,
html.view-galleries main.index > h1,
html.view-galleries main.index > .empty {
  grid-column: 1 / -1;
}
html.view-galleries main.index > h2.month { display: none !important; }
html.view-galleries .card {
  display: block;
  position: relative;
  min-height: 15rem;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: #12361f;
}
html.view-galleries .card > div { position: absolute; inset: 0; }
html.view-galleries .card > div::before { display: none; }
html.view-galleries .card time,
html.view-galleries .card .meta,
html.view-galleries .card .excerpt,
html.view-galleries .card .album-line { display: none; }
html.view-galleries .card-photo {
  display: block;
  position: absolute;
  inset: 0;
}
html.view-galleries .card .thumb {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}
html.view-galleries .card h3 {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: max-content;
  max-width: 78%;
  margin: 0;
  padding: 0.45rem 0.7rem;
  text-align: center;
  background: rgba(244, 251, 245, 0.78);
  border: 2px solid #0c6b2c;
  box-shadow: 0 0 0 3px rgba(244, 251, 245, 0.78), 0 0 0 5px #0c6b2c;
  transform: translate(-50%, -50%) rotate(-7deg);
}
html.view-galleries article.card:nth-child(3n) h3 { transform: translate(-50%, -50%) rotate(6deg); }
html.view-galleries article.card:nth-child(3n + 1) h3 { transform: translate(-50%, -50%) rotate(-4deg); }
html.view-galleries .card h3 a {
  color: #0c6b2c;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
}

.entry { max-width: 42rem; }
.entry h1 { font-size: 2.1rem; line-height: 1.15; }
.back { font-family: var(--mono); margin: 0 0 0.8rem; }
.back button {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  cursor: pointer;
}
.back button:hover, .back button:focus-visible { border-color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tags span {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}
.entry-body { font-size: 1.12rem; }
.entry-body p { margin: 0.8rem 0; }
.entry-body img, .diary-photo { max-width: 100%; height: auto; display: block; margin: 0.6rem 0; }
.thumb { width: 7.5rem; height: 5.6rem; object-fit: cover; margin-top: 0.45rem; }

.album, .wp-caption {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  background: var(--card);
  border-left: 3px solid var(--accent);
}
.album-kicker, .file-note {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.album strong { font-size: 1.35rem; font-weight: 500; }
.album p, .wp-caption figcaption { margin: 0.25rem 0 0; color: var(--muted); }
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.album-photo, .album-grid img, .album-grid video {
  width: 100%;
  height: 7.2rem;
  object-fit: cover;
  margin: 0;
  display: block;
  background: var(--paper-2);
}
a.album-photo { text-decoration: none; }

body.viewer {
  max-width: none;
  min-height: 100vh;
  margin: 0;
  background: #12361f;
  background-image: none;
  box-shadow: none;
  color: #c8f5d0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.viewer-film {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.55rem 0.75rem;
  background: #0c2416;
  border-bottom: 1px solid rgba(60, 186, 98, 0.45);
}
.viewer-thumb {
  flex: 0 0 auto;
  width: 4.4rem;
  height: 3.2rem;
  border: 2px solid transparent;
  border-radius: 2px;
  overflow: hidden;
}
.viewer-thumb.current { border-color: #3cba62; }
.viewer-thumb img, .viewer-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  pointer-events: none;
}
body.viewer::before { display: none; }
.viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
}
.viewer-stage img, .viewer-stage video {
  max-width: 100vw;
  max-height: calc(100vh - 8.2rem);
  width: auto;
  height: auto;
  margin: 0;
  object-fit: contain;
  background: transparent;
}
.viewer-side {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(8rem, 22vw);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c8f5d0;
  text-decoration: none;
  z-index: 1;
}
.viewer-side.prev { left: 0; }
.viewer-side.next { right: 0; }
.viewer-side span {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  font-size: 2rem;
  line-height: 1;
}
.viewer-side:hover span, .viewer-side:focus-visible span { background: rgba(0, 0, 0, 0.72); }
.viewer-side.is-end { opacity: 0.25; }
.viewer-bar {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 1rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.92rem;
}
.viewer-bar button {
  justify-self: start;
  background: transparent;
  color: inherit;
  border: 1px solid #3cba62;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font: inherit;
}
.viewer-name {
  color: #8fd9a4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.files { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.missing-file {
  margin: 0.35rem 0.35rem 0.35rem 0;
  padding: 0.55rem 0.7rem;
  background: var(--paper-2);
  display: inline-flex;
  flex-direction: column;
  min-width: 10rem;
  max-width: 16rem;
}
.file-name { font-family: Consolas, "Segoe UI", monospace; font-size: 0.82rem; word-break: break-word; }
.library-files h2 { font-size: 1rem; font-family: var(--mono); letter-spacing: 0.04em; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.92rem;
}

@media (max-width: 700px) {
  :root { --margin: 1.2rem; }
  body::before { display: none; }
  .top { flex-direction: column; align-items: stretch; min-height: 0; gap: 0.8rem; }
  .views { position: static; transform: none; }
  .search input { min-width: 0; flex: 1; }
  .card { grid-template-columns: 1fr; gap: 0.15rem; }
}

html.has-book:not(.book-seen) body { overflow: hidden; }
html.book-seen .book-intro { display: none; }

.book-intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 42%, #1a3a24 0%, #102418 52%, #07110c 100%);
  transition: opacity 0.8s ease;
  cursor: pointer;
}
.book-intro.is-done { opacity: 0; pointer-events: none; }
.book-wrap {
  perspective: 1100px;
  perspective-origin: 50% 42%;
  transition: opacity 0.8s ease;
}
.book-intro.is-done .book-wrap { opacity: 0; }
.book {
  position: relative;
  width: min(24rem, 76vw);
  transform: rotateX(54deg) rotateZ(-20deg);
  transform-style: preserve-3d;
  transition: transform 0.95s cubic-bezier(.45, .05, .2, 1);
}
.book-intro.is-lift .book { transform: rotateX(24deg) rotateZ(-8deg); }
.book-intro.is-open .book { transform: rotateX(0deg) rotateZ(0deg) scale(1.04); }
.spiral {
  position: absolute;
  z-index: 6;
  left: -0.85rem;
  top: 0.2rem;
  bottom: 0.35rem;
  width: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateZ(16px);
  transform-style: preserve-3d;
  pointer-events: none;
}
.spiral span {
  display: block;
  height: 0.46rem;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
  border-top-color: #8a8a8a;
  border-left-color: #5c5c5c;
  background:
    radial-gradient(ellipse at 35% 35%, rgba(255, 255, 255, 0.55), transparent 42%),
    linear-gradient(#3a3a3a, #111);
  box-shadow: 1px 1px 0 #050505, inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.board {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.05;
  transform-style: preserve-3d;
}
.page-stack {
  position: absolute;
  inset: 0 0 -0.15rem 0;
  border-radius: 2px 7px 7px 2px;
  background:
    repeating-linear-gradient(
      to bottom,
      #f7f3ea 0 2px,
      #e4ddd0 2px 3px
    );
  transform: translateZ(-18px);
  transform-style: preserve-3d;
  box-shadow: 0 12px 0 #111, 0 14px 0 #2a2a2a;
}
.page-stack::before,
.page-stack::after {
  content: "";
  position: absolute;
  background: repeating-linear-gradient(to bottom, #f6f2e9 0 3px, #c9c2b4 3px 4px);
}
.page-stack::after {
  top: 0;
  bottom: 0;
  right: 0;
  width: 12px;
  transform: rotateY(90deg);
  transform-origin: right center;
}
.page-stack::before {
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  transform: rotateX(-90deg);
  transform-origin: bottom center;
  background: linear-gradient(#f4f0e6, #d9d2c4);
}
.book-intro.is-open .page-stack { opacity: 0; }
.sheet {
  background-color: #f4fbf5;
  background-image:
    linear-gradient(90deg, transparent calc(2.05rem - 1.5px), #3cba62 0 2.05rem, transparent 2.05rem),
    linear-gradient(to right, rgba(52, 168, 84, 0.34) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(52, 168, 84, 0.34) 1px, transparent 1px);
  background-size: auto, 8px 8px, 8px 8px;
}
.leaves {
  position: absolute;
  inset: 0;
  border-radius: 0 7px 7px 0;
  transform: translateZ(-1px);
  box-shadow: 4px 6px 0 #d5dece;
}
.leaf-entry {
  position: absolute;
  top: 1.05rem;
  left: 2.4rem;
  right: 0.55rem;
  margin: 0;
  color: #0f7a32;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: pre-wrap;
}
.leaf-caret {
  display: inline-block;
  width: 0.48em;
  height: 0.95em;
  margin-left: 1px;
  background: #0f7a32;
  vertical-align: -0.12em;
  opacity: 0;
}
.book-intro.is-open .leaf-caret {
  animation: leaf-blink 0.85s steps(1) infinite;
}
@keyframes leaf-blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}
.front-cover {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.25s cubic-bezier(.55, .05, .25, 1) 0.12s;
}
.book-intro.is-open .front-cover { transform: rotateY(-158deg); }
.cover-front, .cover-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 0 7px 7px 0;
  overflow: hidden;
}
.cover-front {
  overflow: visible;
  transform-style: preserve-3d;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.16), transparent 34%),
    #161616;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 16px 28px rgba(0, 0, 0, 0.28);
}
.montage { transform-style: preserve-3d; }
.cover-back {
  transform: rotateY(180deg);
  background-image:
    linear-gradient(to left, transparent calc(1.15rem - 1.5px), #3cba62 0 1.15rem, transparent 1.15rem),
    linear-gradient(to right, rgba(52, 168, 84, 0.34) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(52, 168, 84, 0.34) 1px, transparent 1px);
}
.montage {
  position: absolute;
  inset: 0.95rem 0.75rem 0.85rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 0.62rem;
}
.montage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #d5e2ef;
  border: 3px solid #f4f1ea;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.75s cubic-bezier(.2, .75, .25, 1);
}
.montage img:nth-child(4n + 1) { transform: rotate(-7deg); }
.montage img:nth-child(4n + 2) { transform: rotate(6deg); }
.montage img:nth-child(4n + 3) { transform: rotate(8deg); }
.montage img:nth-child(4n) { transform: rotate(-5deg); }
.book-intro.is-lift .montage img:nth-child(4n + 1) { transform: translate3d(-14px, -26px, 52px) rotate(-16deg) scale(1.2); }
.book-intro.is-lift .montage img:nth-child(4n + 2) { transform: translate3d(12px, -30px, 70px) rotate(14deg) scale(1.24); }
.book-intro.is-lift .montage img:nth-child(4n + 3) { transform: translate3d(-8px, 10px, 46px) rotate(11deg) scale(1.14); }
.book-intro.is-lift .montage img:nth-child(4n) { transform: translate3d(16px, 8px, 60px) rotate(-12deg) scale(1.18); }
.book-shadow {
  width: 78%;
  height: 28px;
  margin: 0.2rem 0 0 12%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 68%);
  transform: rotateX(68deg);
}
.book-skip {
  position: absolute;
  bottom: 1.3rem;
  margin: 0;
  color: rgba(186, 240, 198, 0.8);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.flyer {
  position: fixed;
  z-index: 60;
  object-fit: cover;
  border: 2px solid #e7f0f8;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .book-intro { display: none; }
}

.diary-spread {
  position: relative;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  margin: 0 0.2rem 0.15rem;
  perspective: 2500px;
  perspective-origin: left center;
}
.diary-spread::before {
  content: "";
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  bottom: 0.35rem;
  width: 0.9rem;
  pointer-events: none;
  background: linear-gradient(to right, rgba(8, 40, 20, 0.16), transparent 82%);
}
.diary-spread::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0.4rem;
  right: 0;
  bottom: 0;
  width: 0.55rem;
  border-radius: 0 4px 4px 0;
  background: repeating-linear-gradient(#f7fbf8 0 2px, #c5decb 2px 3px);
  box-shadow: 3px 6px 12px rgba(0, 0, 0, 0.14);
}
.diary-base,
.diary-flip {
  position: absolute;
  inset: 0 0.45rem 0.35rem 0;
}
.diary-base {
  z-index: 1;
  border-radius: 2px 8px 8px 2px;
  background: #e4f3e8;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}
.diary-flip {
  z-index: 2;
  transform-style: preserve-3d;
  transform-origin: left center;
}
.diary-paper {
  position: absolute;
  inset: 0;
  border-radius: 2px 8px 8px 2px;
  backface-visibility: hidden;
}
.diary-front {
  background-color: #f4fbf5;
  background-image:
    linear-gradient(90deg, transparent calc(1.7rem - 1.5px), #3cba62 0 1.7rem, transparent 1.7rem),
    linear-gradient(to right, rgba(52, 168, 84, 0.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(52, 168, 84, 0.28) 1px, transparent 1px);
  background-size: auto, 8px 8px, 8px 8px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16), inset 14px 0 16px rgba(12, 50, 24, 0.05);
}
.diary-back {
  transform: rotateY(180deg);
  background-color: #e7f4eb;
  background-image:
    linear-gradient(to left, transparent calc(1.7rem - 1.5px), #3cba62 0 1.7rem, transparent 1.7rem),
    linear-gradient(to right, rgba(52, 168, 84, 0.2) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(52, 168, 84, 0.2) 1px, transparent 1px);
  background-size: auto, 8px 8px, 8px 8px;
  box-shadow: inset -14px 0 16px rgba(12, 50, 24, 0.06);
}
.diary-face {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
}
.diary-leaf { min-height: 100%; padding: 1.15rem 1.4rem 2rem 2.4rem; }
.diary-date { margin: 0; font-weight: 700; letter-spacing: 0.03em; }
.diary-leaf h2 {
  margin: 0.15rem 0 0.85rem;
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.diary-draft {
  margin: -0.45rem 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.diary-empty { margin: 2rem; font-weight: 700; }
.diary-face img,
.diary-face video { max-width: 100%; height: auto; }
.diary-turn {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0.35rem;
  width: 16%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.diary-turn:disabled { cursor: default; }
.diary-turn-back { left: 0; }
.diary-turn-forward { right: 0.45rem; }
.diary-turn-back:not(:disabled):hover,
.diary-turn-forward:not(:disabled):hover { background: linear-gradient(to right, rgba(15, 122, 50, 0.07), transparent 80%); }
.diary-turn-forward:not(:disabled):hover { background: linear-gradient(to left, rgba(15, 122, 50, 0.07), transparent 80%); }
.diary-turn:not(:disabled)::before,
.diary-turn:not(:disabled)::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 4.8rem;
  height: 4.8rem;
  pointer-events: none;
}
.diary-turn:not(:disabled)::before {
  background: radial-gradient(circle at var(--glow, 76% 76%), rgba(140, 255, 168, 0.95), rgba(60, 186, 98, 0.5) 26%, rgba(60, 186, 98, 0.14) 48%, transparent 70%);
  animation: corner-glow 3.2s ease-in-out infinite;
}
.diary-turn-forward:not(:disabled)::before { right: -0.7rem; }
.diary-turn-back:not(:disabled)::before {
  left: -0.45rem;
  --glow: 24% 76%;
  animation-delay: -1.6s;
}
.diary-turn:not(:disabled)::after {
  width: 2.65rem;
  height: 2.65rem;
  background:
    linear-gradient(var(--sheen, 148deg), rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 44%),
    linear-gradient(var(--paper, 135deg), #f5fff7, #b5e6c6 70%, #79c89c);
  clip-path: var(--peel, polygon(100% 0, 0 100%, 100% 100%));
  transform-origin: var(--hinge, 100% 100%);
  animation: corner-flap 3.2s ease-in-out infinite;
}
.diary-turn-forward:not(:disabled)::after { right: 0; }
.diary-turn-back:not(:disabled)::after {
  left: 0;
  --sheen: 212deg;
  --paper: 225deg;
  --peel: polygon(0 0, 0 100%, 100% 100%);
  --hinge: 0 100%;
  animation-name: corner-flap-back;
  animation-delay: -1.6s;
}
.diary-turn-forward:not(:disabled):hover::before,
.diary-turn-back:not(:disabled):hover::before {
  animation: none;
  opacity: 1;
  transform: scale(1.06);
}
.diary-turn-forward:not(:disabled):hover::after {
  animation: none;
  transform: translate3d(-8px, -14px, 0) rotate(-16deg);
  filter: drop-shadow(0 0 8px rgba(90, 255, 140, 0.95)) drop-shadow(-4px -3px 0 rgba(15, 122, 50, 0.35));
}
.diary-turn-back:not(:disabled):hover::after {
  animation: none;
  transform: translate3d(8px, -14px, 0) rotate(16deg);
  filter: drop-shadow(0 0 8px rgba(90, 255, 140, 0.95)) drop-shadow(4px -3px 0 rgba(15, 122, 50, 0.35));
}
.diary-spread.is-turning .diary-turn { pointer-events: none; }
.diary-spread.is-turning .diary-turn::before,
.diary-spread.is-turning .diary-turn::after {
  animation: none;
  opacity: 0;
}
@keyframes corner-glow {
  0%, 54%, 100% { opacity: 0.34; transform: scale(0.84); }
  68%, 84% { opacity: 1; transform: scale(1.04); }
  76% { opacity: 0.5; transform: scale(0.9); }
}
@keyframes corner-flap {
  0%, 54%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    filter: drop-shadow(-1px -1px 0 rgba(15, 122, 50, 0.35));
  }
  68% {
    transform: translate3d(-10px, -16px, 0) rotate(-18deg);
    filter: drop-shadow(0 0 9px rgba(90, 255, 140, 0.95)) drop-shadow(-6px -4px 0 rgba(15, 122, 50, 0.28));
  }
  76% {
    transform: translate3d(-2px, -3px, 0) rotate(3deg);
    filter: drop-shadow(0 0 3px rgba(90, 255, 140, 0.4)) drop-shadow(-2px -1px 0 rgba(15, 122, 50, 0.35));
  }
  84% {
    transform: translate3d(-6px, -10px, 0) rotate(-10deg);
    filter: drop-shadow(0 0 8px rgba(90, 255, 140, 0.8)) drop-shadow(-4px -3px 0 rgba(15, 122, 50, 0.3));
  }
}
@keyframes corner-flap-back {
  0%, 54%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    filter: drop-shadow(1px -1px 0 rgba(15, 122, 50, 0.35));
  }
  68% {
    transform: translate3d(10px, -16px, 0) rotate(18deg);
    filter: drop-shadow(0 0 9px rgba(90, 255, 140, 0.95)) drop-shadow(6px -4px 0 rgba(15, 122, 50, 0.28));
  }
  76% {
    transform: translate3d(2px, -3px, 0) rotate(-3deg);
    filter: drop-shadow(0 0 3px rgba(90, 255, 140, 0.4)) drop-shadow(2px -1px 0 rgba(15, 122, 50, 0.35));
  }
  84% {
    transform: translate3d(6px, -10px, 0) rotate(10deg);
    filter: drop-shadow(0 0 8px rgba(90, 255, 140, 0.8)) drop-shadow(4px -3px 0 rgba(15, 122, 50, 0.3));
  }
}

.diary-timeline {
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin-top: 0.45rem;
  background: rgba(244, 251, 245, 0.96);
  border-top: 1px solid var(--line);
}
.diary-readout {
  display: none;
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(100% - 0.15rem);
  transform: translateX(-50%);
  margin: 0;
  padding: 0.2rem 0.85rem 0.28rem;
  background: #0f7a32;
  color: #f4fbf5;
  border-radius: 999px;
  text-align: center;
  pointer-events: none;
  line-height: 1.05;
}
.diary-timeline.is-dragging .diary-readout { display: block; }
.diary-readout strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.diary-readout span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.diary-playhead {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 1.65rem;
  bottom: 0.7rem;
  width: 2px;
  margin-left: -1px;
  background: #0f7a32;
  pointer-events: none;
}
.diary-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0 0.15rem;
  cursor: grab;
  user-select: none;
  touch-action: pan-x;
  scrollbar-color: #0f7a32 rgba(15, 122, 50, 0.12);
  scrollbar-width: thin;
}
.diary-timeline.is-dragging .diary-scroll { cursor: grabbing; }
.diary-scroll::-webkit-scrollbar { height: 0.55rem; }
.diary-scroll::-webkit-scrollbar-track { background: rgba(15, 122, 50, 0.12); }
.diary-scroll::-webkit-scrollbar-thumb { background: #0f7a32; border-radius: 999px; }
.diary-ribbon { display: flex; width: max-content; align-items: flex-end; }
.diary-year {
  position: relative;
  border-left: 1px solid rgba(15, 122, 50, 0.28);
  padding-top: 0.15rem;
}
.diary-year-label {
  display: block;
  padding: 0 0.4rem 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.diary-year.is-hot { background: rgba(60, 186, 98, 0.14); }
.diary-timeline.is-dragging .diary-year.is-hot {
  background: rgba(15, 122, 50, 0.28);
  box-shadow: inset 0 -3px 0 #0f7a32;
}
.diary-timeline.is-dragging .diary-year.is-hot .diary-year-label { color: #063d18; }
.diary-months { display: flex; align-items: flex-end; }
.diary-month { min-width: 2.5rem; padding: 0 0.12rem; }
.diary-month.is-empty { min-width: 0.45rem; padding: 0; }
.diary-month.is-hot .diary-month-label { color: var(--ink); }
.diary-month-label {
  display: block;
  min-height: 0.9rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}
.diary-ticks { display: flex; align-items: flex-end; justify-content: center; height: 1.35rem; gap: 2px; }
.diary-tick {
  width: 0.72rem;
  height: 0.72rem;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: #9dceb0;
  cursor: pointer;
}
.diary-tick.is-current { height: 1.2rem; background: #0f7a32; }
.diary-gap { display: block; width: 0.45rem; height: 0.28rem; background: rgba(15, 122, 50, 0.18); }

@media (max-width: 700px) {
  .diary-spread { min-height: 16rem; }
  .diary-leaf { padding-left: 1.5rem; }
  .diary-leaf h2 { font-size: 1.4rem; }
  .diary-turn { width: 20%; }
  .diary-turn:not(:disabled)::before { width: 3.6rem; height: 3.6rem; }
  .diary-turn:not(:disabled)::after { width: 2.2rem; height: 2.2rem; }
  .diary-invite { font-size: 1rem; }
  .casio-spin { width: 6.2rem; }
}

.diary-prompt {
  position: relative;
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.6rem 1.6rem 1.8rem 2.6rem;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 38%, #12301c 0%, #06140c 68%);
  color: #b6ffc2;
}
.dec-cursor {
  display: inline-block;
  width: 0.72em;
  height: 1.12em;
  background: #5dff6a;
  box-shadow: 0 0 10px rgba(93, 255, 106, 0.9);
  animation: dec-blink 1.05s steps(1, end) infinite;
}
@keyframes dec-blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}
.diary-invite {
  position: absolute;
  top: 1.6rem;
  left: 2.6rem;
  margin: 0;
  max-width: 28rem;
  color: #8dff9e;
  font-size: 1.18rem;
  line-height: 1.45;
  text-align: left;
  text-shadow: 0 0 8px rgba(80, 255, 120, 0.35);
}
.casio {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  gap: 0.35rem;
  transform: translateY(0.55rem);
}
.casio:focus-visible { outline: 2px solid #5dff6a; outline-offset: 6px; }
.casio:disabled { cursor: default; }
.casio-hint {
  color: #8dff9e;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  text-shadow: 0 0 8px rgba(80, 255, 120, 0.45);
}
.casio-spin {
  position: relative;
  display: block;
  width: 7.4rem;
}
.casio-face { display: block; width: 100%; height: auto; }
.casio-face text { font-family: var(--mono); }
.casio-lcd {
  position: absolute;
  left: 30%;
  top: 41.7%;
  width: 40%;
  height: 12.5%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  pointer-events: none;
}
.reel { flex: 1 1 0; overflow: hidden; }
.reel-strip { display: flex; flex-direction: column; will-change: transform; }
.reel-strip span,
.casio-colon {
  display: grid;
  place-items: center;
  height: var(--cell, 16px);
  color: #1a2416;
  font-family: var(--mono);
  font-size: calc(var(--cell, 16px) * 0.86);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.casio-colon {
  flex: 0 0 auto;
  width: 0.42em;
  height: auto;
  align-self: stretch;
}
.casio.is-rolling .reel-strip span { animation: digit-blur 0.62s linear forwards; }
@keyframes digit-blur {
  0%, 62% { filter: blur(0.7px); }
  100% { filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dec-cursor { animation: none; }
  .casio.is-rolling .reel-strip span { animation: none; }
  .diary-turn::before,
  .diary-turn::after { animation: none; }
  .diary-turn::before { opacity: 0.75; }
}
