/* ======================================================== */
/*  varibles */
/* ======================================================== */

:root {
	--bg-1: #f6e6ef;
	--bg-2: #fff9fc;
	--paper: #fffefc;
	--accent: #ec8eb4;
	--accent-soft: rgba(236, 142, 180, 0.15);
	--text: #4b5c78;
	--muted: #8a90a8;

	--font-body: 'Hiragino Kaku Gothic Pro', 'Noto Sans CJK JP', sans-serif;
	--font-heading: Georgia, serif;

	--radius: 14px;
}

/* ======================================================== */
/*  base */
/* ======================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 30px 15px;
	background-color: var(--bg-2);
	background-image: url(flowers.gif);
	
	
	font-family: var(--font-body);
	color: var(--text);
	line-height: 1.8;
	display: block;
	/* important to stop layout shaking */
	overflow-x: hidden;
}

body,
.layout {
	overflow: visible !important;
}

/* ======================================================== */
/* layout */
/* ======================================================== */

.layout {
	width: 100%;
	max-width: 920px;
	display: grid;
	gap: 20px;
	grid-template:
		"header header" auto
		"main sidebar" auto
		"footer footer" auto
		/ 1fr 240px;
	margin: 0 auto;
}

/* ======================================================== */
/* header */
/* ======================================================== */

header {
	grid-area: header;
	text-align: center;
	padding: 30px 20px 10px;
}

.header-title {
	font-family: var(--font-heading);
	font-size: 2.4rem;
	letter-spacing: 1px;
}

.header-subtitle {
	font-style: italic;
	font-size: 0.95rem;
	opacity: 0.6;
	margin-top: 8px;
}

header::after {
	content: "";
	display: block;
	height: 1px;
	width: 60%;
	margin: 20px auto 0;
	background: linear-gradient(to right, transparent, var(--accent), transparent);
}

/* ======================================================== */
/* nav */
/* ======================================================== */

nav ul {
	list-style: none;
	padding: 0;
	margin: 20px 0 0;
	display: flex;
	justify-content: center;
	gap: 25px;
}

nav a {
	text-decoration: none;
	color: var(--text);
	font-size: 0.95rem;
	position: relative;
	transition: color 0.3s ease;
}

nav a::after {
	content: "";
	position: absolute;
	bottom: -4px;
	left: 0;
	width: 100%;
	height: 1px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.3s ease;
}

nav a:hover::after,
nav a.active::after {
	transform: scaleX(1);
	transform-origin: left;
}

nav a.active {
	font-weight: bold;
}

/* Highlight the active page in nav */
nav a.active {
	text-decoration: underline;
	/* adds the underline */
	font-weight: bold;
	/* optional: makes it stand out */
	color: #922a45;
	/* optional: change color if you like */
}

/* Mobile nav toggle */
.nav-toggle {
	display: none;
	background: none;
	border: none;
	font-size: 1.5rem;
	margin-top: 10px;
	cursor: pointer;
}

/* Mobile nav dropdown */
@media (max-width: 800px) {
	nav {
		display: none;
		background: var(--paper);
		border-radius: var(--radius);
		padding: 15px 0;
		box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
	}

	nav.open {
		display: block;
	}

	nav ul {
		flex-direction: column;
		gap: 12px;
		margin-top: 0;
	}
}

/* ======================================================== */
/* main content*/
/* ======================================================== */

main {
	grid-area: main;
	background-color: #f9f0f4;

	padding: 45px;
	border-radius: var(--radius);
	box-shadow:
		0 15px 40px rgba(0, 0, 0, 0.05),
		0 5px 10px rgba(0, 0, 0, 0.04);
}

main h1,
main h2 {
	font-family: var(--font-heading);
	margin-top: 0;
}

main h1 {
	font-size: 2rem;
}

main h2 {
	font-size: 1.5rem;
	margin-top: 2em;
	padding-left: 12px;
	border-left: 4px solid var(--accent);
}

main p {
	margin: 1em 0;
	font-size: 1.05rem;
	letter-spacing: 0.2px;
}

main p:first-of-type::first-letter {
	float: left;
	font-size: 3rem;
	line-height: 1;
	padding-right: 10px;
	font-family: var(--font-heading);
	color: var(--accent);
}

main blockquote {
	background: var(--accent-soft);
	border-left: 3px solid var(--accent);
	padding: 20px;
	margin: 2em 0;
	font-style: italic;
}

mark {
	background-color: lightpink ;
	color: white ;
	font-family: var(--font-heading) ;
}

/* ======================================================== */
/* sidebr*/
/* ======================================================== */

.right-sidebar {
	grid-area: sidebar;
	background: #ffffffcc;
	backdrop-filter: blur(6px);
	padding: 25px;
	border-radius: var(--radius);
	border: 1px solid rgba(0, 0, 0, 0.05);
	height: fit-content;
}

.sidebar-title {
	font-family: var(--font-heading);
	margin-bottom: 10px;
	font-size: 1.1rem;
}

.right-sidebar blockquote {
	font-style: italic;
	font-size: 0.9rem;
	opacity: 0.8;
}

/* ======================================================== */
/* other */
/* ======================================================== */

img {
  overflow: auto ;
}

hr {
  color: var(--accent);
}
li::marker {
 content: "⟢" ; 
}
/* ======================================================== */
/* footer*/
/* ======================================================== */

footer {
	grid-area: footer;
	text-align: center;
	font-size: 0.8rem;
	opacity: 0.6;
	padding: 20px 0;
}

/* ======================================================== */
/* posts */
/* ======================================================== */

.post {
	background: #ffffffdd;
	border: 2px solid #f3b6d9;
	padding: 25px;
	margin-bottom: 40px;
	box-shadow: 0 0 20px #ffd6ec;
	position: relative;
	transition: 0.3s ease;
}

.post-title {
	font-size: 20px;
	font-style: italic;
	color: #b94f93;
	cursor: pointer;
	transition: 0.3s ease;
}

.post-title:hover {
	color: #ff66c4;
	text-shadow: 0 0 6px #ffcce6;
}

.post-content {
	max-height: 0;
	overflow: auto;
	padding: 0 10px;
	transition: max-height 0.5s ease, padding 0.4s ease;
}

.post.open .post-content {
	max-height: 300px;
	overflow-y: auto;
	padding: 15px;
}

.post-content::-webkit-scrollbar {
	width: 8px;
}

.post-content::-webkit-scrollbar-thumb {
	background: #f3b6d9;
	border-radius: 10px;
}

.tags {
	margin-top: 15px;
	font-size: 14px;
}

.tags span {
	color: #c061a8;
	cursor: pointer;
	margin-right: 10px;
}

.tags span:hover {
	color: #ff66c4;
	text-shadow: 0 0 6px #ffcce6;
}

.notes {
	margin-top: 12px;
	font-size: 13px;
	color: #8c4a72;
	border-top: 1px solid #f3b6d9;
	padding-top: 10px;
}

.active-tag {
	text-align: center;
	font-style: italic;
	color: #b94f93;
	margin-bottom: 30px;
}

/* ======================================================== */
/* sprkls */
/* ======================================================== */

.sparkle {
	position: fixed;
	pointer-events: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	z-index: 9999;
	mix-blend-mode: lighten;
	animation: sparkle-fade 0.6s forwards;
}

@keyframes sparkle-fade {
	0% {
		transform: scale(1);
		opacity: 1;
	}

	50% {
		transform: scale(1.5);
		opacity: 1;
	}

	100% {
		transform: scale(0);
		opacity: 0;
	}
}

/* ======================================================== */
/* mobile */
/* ======================================================== */

@media (max-width: 800px) {
	body {
		padding: 20px 12px;
	}

	.layout {
		grid-template:
			"header"
			"main"
			"sidebar"
			"footer"
			/ 1fr;
	}

	main {
		padding: 30px 25px;
	}

	main p {
		font-size: 1rem;
	}

	main p:first-of-type::first-letter {
		font-size: 2.2rem;
	}

	.nav-toggle {
		display: block;
	}

	nav ul {
		flex-direction: column;
		gap: 12px;
		
	}
	nav li::marker  {
	  content: none ;
	}
}
/* ========================================================
   photopile - smaller scrapbook / polaroid style
======================================================== */

.photopile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  gap: 8px; /* smaller gaps */
}

.photopile figure {
  display: inline-block;
  background: #fffaf0; /* pastel paper color */
  box-shadow: 3px 4px 6px rgba(0,0,0,0.35);
  transform: rotate(calc(-5deg + 10deg * var(--rand, 0.5)));
  margin: 0 -15px; /* smaller overlap */
  border: 2px dashed #ffb6c1; /* scrapbook stitching */
  border-radius: 6px;
  position: relative;
  transition: transform 0.2s ease;
  max-width: 180px; /* smaller overall size */
}

.photopile figure:hover {
  transform: scale(1.05) rotate(calc(-3deg + 6deg * var(--rand, 0.5)));
  z-index: 5;
}

.photopile figure img {
  max-width: calc(100% - 1.5rem); /* smaller image padding */
  margin: 0.75rem;
  border: 2px solid rgba(0,0,0,0.35); /* inked border for polaroid */
  border-radius: 4px;
}

.photopile figcaption,
.popovers figcaption {
  text-align: center;
  margin: 0.4rem 0.8rem 0.8rem 0.8rem;
  font-size: 0.85rem; /* slightly smaller caption */
  color: #333;
  font-family: 'Comic Sans MS', cursive, sans-serif;
}

.photopile button {
  background: none;
  border: none;
  max-width: 35%; /* slightly smaller */
  position: relative;
}

.photopile button:hover,
.photopile button:focus {
  z-index: 3;
  cursor: pointer;
  transform: scale(1.08); /* smaller hover scale */
}

/* varied rotations for playful randomness */
.photopile button:nth-child(2n) { transform: rotate(-8deg); }
.photopile button:nth-child(3n) { transform: rotate(5deg); }
.photopile button:nth-child(4n) { transform: rotate(3deg); }
.photopile button:nth-child(5n) { transform: rotate(-2deg); }
.photopile button:nth-child(6n) { transform: rotate(-5deg); }

/* optional: doodles / pushpins */
.photopile figure::before {
  content: "📌";
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 1rem;
  transform: rotate(-10deg);
}

.photopile figure::after {
  content: "✎";
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 0.9rem;
  color: #ff69b4;
  transform: rotate(15deg);
}


/* ======================================================== */
/* background toggle */
/* ======================================================== */

body.no-bg {
	background-image: none !important;
	background-color: var(--bg-2);
}

/* cute toggle button */ 
.bg-toggle {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background: var(--paper);
	border: 2px solid var(--accent);
	color: var(--text);
	padding: 8px 14px;
	border-radius: 20px;
	font-size: 0.8rem;
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(0,0,0,0.1);
	transition: 0.3s ease;
	z-index: 9999;
}

.bg-toggle:hover {
	background: var(--accent-soft);
}

/* ======================================================== */
/* ransom note header */
/* ======================================================== */

.ransom {
  display: inline-block;
  position: relative;
}

.ransom span {
  display: inline-block;
  position: relative;
  padding: 8px 12px;
  margin: 4px;
  font-weight: bold;
  text-transform: lowercase;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.15);
  overflow: hidden;

  /* torn bottom */
  clip-path: polygon(
    0% 0%,
    100% 0%,
    100% 85%,
    92% 100%,
    75% 90%,
    60% 100%,
    45% 88%,
    30% 100%,
    15% 90%,
    0% 100%
  );

  /* drop animation */
  opacity: 0;
  transform: translateY(-60px) rotate(0deg);
  animation: dropIn 0.6s ease forwards;
}

/* stagger animation */
.ransom span:nth-child(1) { animation-delay: 0.05s; }
.ransom span:nth-child(2) { animation-delay: 0.1s; }
.ransom span:nth-child(3) { animation-delay: 0.15s; }
.ransom span:nth-child(4) { animation-delay: 0.2s; }
.ransom span:nth-child(5) { animation-delay: 0.25s; }
.ransom span:nth-child(6) { animation-delay: 0.3s; }
.ransom span:nth-child(7) { animation-delay: 0.35s; }
.ransom span:nth-child(8) { animation-delay: 0.4s; }
.ransom span:nth-child(9) { animation-delay: 0.45s; }
.ransom span:nth-child(10) { animation-delay: 0.5s; }

/* paper texture overlay */
.ransom span::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.4),
      rgba(255,255,255,0.4) 2px,
      transparent 2px,
      transparent 6px
    );
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* papers */
.ransom span:nth-child(1n) { background: #ffd6ec; }
.ransom span:nth-child(2n) { background: #d6f5ff; }
.ransom span:nth-child(3n) { background: #fff3b8; }
.ransom span:nth-child(4n) { background: #e8d6ff; }
.ransom span:nth-child(5n) { background: #d6ffd9; }

/* mixed fonts */
.ransom span:nth-child(odd) {
  font-family: Georgia, serif;
}
.ransom span:nth-child(even) {
  font-family: "Courier New", monospace;
}
.ransom span:nth-child(3n) {
  font-family: Arial, sans-serif;
}

/* sizing */
.ransom span:nth-child(2n) { font-size: 2rem; }
.ransom span:nth-child(3n) { font-size: 2.4rem; }
.ransom span:nth-child(4n) { font-size: 1.7rem; }

/* rotations */
.ransom span:nth-child(2n) { rotate: -4deg; }
.ransom span:nth-child(3n) { rotate: 5deg; }
.ransom span:nth-child(5n) { rotate: -6deg; }

/* vertical misalignment */
.ransom span:nth-child(2n) { top: -4px; }
.ransom span:nth-child(3n) { top: 5px; }

/* tape pieces */
.ransom span:nth-child(2)::after,
.ransom span:nth-child(6)::after {
  content: "";
  position: absolute;
  width: 70%;
  height: 10px;
  background: rgba(255,255,255,0.6);
  top: -8px;
  left: 15%;
  transform: rotate(-6deg);
  border-radius: 2px;
  box-shadow: 0 2px 3px rgba(0,0,0,0.2);
}

/* hover pop */
.ransom span:hover {
  transform: scale(1.15) rotate(0deg) !important;
  z-index: 10;
}

/* animation keyframes */
@keyframes dropIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ======================================================== */
/* scrapbook visitor counter */
/* ======================================================== */

#visitorCounter  {
  font-family: "Courier New", monospace;
  font-size: 14px;
  letter-spacing: 2px;
  background: #fff7fb;
  padding: 6px 10px;
  border: 2px dashed #ffcfe6;
  box-shadow: 3px 3px 0px #ffdff2;
  color: #ff6fb3;
}

/* container */

.right-sidebar p:has(#visitorCounter) {
  background: #fff0f8;
  border: 2px dotted #ffb6d9;
  padding: 10px;
  margin-bottom: 15px;
  position: relative;
  text-align: center;
}
#lastupdate  {
  font-family: "Courier New", monospace;
  font-size: 14px;
  letter-spacing: 2px;
  background: #fff7fb;
  padding: 6px 10px;
  border: 2px dashed #ffcfe6;
  box-shadow: 3px 3px 0px #ffdff2;
  color: #ff6fb3;
}
.right-sidebar p:has(#lastupdate) {
  background: #fff0f8;
  border: 2px dotted #ffb6d9;
  padding: 10px;
  margin-bottom: 15px;
  position: relative;
  text-align: center;
}
/* ======================================================== */
/* scrapbook polaroid sidebar boxes */
/* ======================================================== */

.sidebar-section {

  background: white;
  padding: 12px;
  margin-bottom: 25px;

  border: 1px solid #eee;

  /* polaroid bottom */
  padding-bottom: 25px;

  box-shadow:
    0 4px 6px rgba(0,0,0,0.15);

  transform: rotate(-1deg);

  position: relative;

}

/* alternate tilt like scrapbook photos */

.sidebar-section:nth-child(even) {
  transform: rotate(1.5deg);
}
.sidebar-section::before {

  content: "";
  position: absolute;

  top: -8px;
  left: 35%;

  width: 60px;
  height: 14px;

  background: rgba(255, 220, 240, 0.7);

  border: 1px solid #ffc3e6;

  transform: rotate(-4deg);

}
.sidebar-title {

  font-family: "Courier New", monospace;
  font-size: 13px;

  text-align: center;

  margin-bottom: 10px;

  color: #ff6fb3;

  border-bottom: 1px dotted #ffc6e7;
  padding-bottom: 4px;

}
.sidebar-section:hover {

  transform: rotate(0deg) scale(1.03);

  transition: 0.25s;

}
.sidebar-section img {

  max-width: 100%;
  margin: 4px;

  border: 3px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);

}
/* ========================================== */
/* scrapbook safety pin */
/* ========================================== */

.sidebar-section::after,
.post::after {

  content: "📌";

  position: absolute;
  top: -10px;
  left: 10px;

  font-size: 18px;

  transform: rotate(-20deg);

  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));

}
/* ========================================== */
/* doodle stars */
/* ========================================== */

.sidebar-section::before,
.post::before {

  content: "✦ ✧ ★";

  position: absolute;

  bottom: -12px;
  right: 10px;

  font-size: 14px;

  color: #ff8fd2;

  transform: rotate(8deg);

}
.post,
.sidebar-section {
  position: relative;
}
/* ======================================================== */
/* torn notebook effect for posts */
/* ======================================================== */

.post {
  position: relative;
  background: #fffefc;
  padding: 25px;
  margin-bottom: 40px;
  border: 2px solid #f3b6d9;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  
  /* torn bottom effect */
  border-bottom: 0;
  overflow: visible;
}

.post::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 20px;
  
  background: repeating-linear-gradient(
    -45deg,
    #fffefc 0 2px,
    #f3b6d9 2px 4px
  );
  border-bottom: 2px solid #f3b6d9;
  z-index: 2;
  transform: skewX(-2deg);
}

/* subtle tilt effect on hover */
.post:hover {
  transform: rotate(-0.5deg) scale(1.02);
  transition: 0.25s ease-in-out;
}