:root {
  --bg: #FBE7DF;
  --text: #000000;
  --nav-muted: #666666;
  --muted: #7a7a7a;
  --divider: #b8a0d6;
  --link: #5a3e8c;
  --toggle-track: #f3d9d0;
  --toggle-thumb: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #241b3d;
  --text: #f2e9f9;
  --nav-muted: #b8a5d1;
  --muted: #9d8bb8;
  --divider: #d9c4f0;
  --link: #e0c8ff;
  --toggle-track: #4a3a70;
  --toggle-thumb: #2d2149;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

main {
  max-width: 600px;
  padding: 3rem 2rem;
  text-align: left;
}

main.wide {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

nav:not(.subnav) a:first-child {
  margin-right: 2rem;
}

.nav-divider {
  text-align: left;
  color: var(--divider);
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
}

nav a {
  color: var(--nav-muted);
  text-decoration: none;
  font-size: 1.15rem;
  white-space: nowrap;
}

nav a:hover {
  color: var(--text);
}

nav a.active {
  color: var(--text);
  font-weight: 600;
}

nav.subnav {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 2rem;
  flex-wrap: nowrap;
  gap: 0.85rem;
}

nav.subnav a {
  font-size: 1rem;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gallery img {
  width: 400px;
  margin: 0;
}

.gallery img,
img[data-lightbox] {
  cursor: pointer;
}

.gallery.grid-3 {
  display: block;
  column-count: 3;
  column-gap: 0.75rem;
}

.gallery.grid-3 img {
  width: 100%;
  margin-bottom: 0.75rem;
  break-inside: avoid;
}

.gallery.grid-2 {
  display: block;
  column-count: 2;
  column-gap: 0.75rem;
}

.gallery.grid-2 img {
  width: 100%;
  margin-bottom: 0.75rem;
  break-inside: avoid;
}

.album-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.album-list a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.album-list a:hover {
  text-decoration: underline;
}

.album-list li::before {
  content: "✧˖° ";
  color: var(--divider);
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.note-list li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.note-list li::before {
  content: "♡";
  color: var(--divider);
}

.note-list a {
  font-size: 1.3rem;
  color: var(--nav-muted);
  text-decoration: none;
}

h2.plain {
  font-weight: normal;
}

.note-list a:hover {
  text-decoration: underline;
}

.note-date {
  color: var(--muted);
  font-size: 0.85rem;
}

.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.book-title-row {
  font-size: 1.3rem;
  color: var(--nav-muted);
}

.book-title-row::before {
  content: "✧˖° ";
  color: var(--divider);
}

.book-list a {
  font-size: inherit;
  color: inherit;
  text-decoration: none;
}

.book-list a:hover {
  text-decoration: underline;
}

.book-author {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.15rem 0 0.15rem 1.2rem;
}

.book-dates {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 1.2rem;
}

.banner-wave {
  display: inline-flex;
}

.cat-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

.tiny-cat {
  position: fixed;
  font-size: 1rem;
  line-height: 1.1;
  color: var(--text);
  white-space: pre;
}

.cursor-sparkle {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  color: var(--divider);
  font-size: 1rem;
  animation: sparkle-fade 0.8s ease-out forwards;
}

@keyframes sparkle-fade {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) translateY(-12px); }
}

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-overlay img {
  max-width: min(90vw, 1000px);
  max-height: 90vh;
  width: auto;
  border-radius: 4px;
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.profile-pic {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1.25rem 0;
}

h2 a {
  text-decoration: none;
  color: var(--link);
}

h2 a:visited {
  color: var(--link);
}

p {
  font-size: 1.1rem;
  line-height: 1.5;
}

img {
  width: 150px;
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
  display: block;
}

.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid var(--divider);
  background: var(--toggle-track);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.theme-toggle-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--toggle-thumb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transform: translateX(0);
  transition: transform 0.3s ease;
}

:root[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(24px);
}

.email-reply {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--link);
  text-decoration: none;
  font-size: 1rem;
}

.email-reply:hover {
  text-decoration: underline;
}

.friend-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.friend-list li {
  font-size: 0.9rem;
}

.friend-list li::before {
  content: "✧ ";
  color: var(--divider);
}

.friend-list a {
  color: var(--nav-muted);
  text-decoration: none;
}

.friend-list a:hover {
  text-decoration: underline;
}
