/* ========================================
   Shared styles — new_year_mina
   ======================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600&family=Noto+Serif:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600&display=swap');

* {
  box-sizing: border-box;
}

:root {
  --bg: #f7f1e8;
  --text: #3d2c2c;
  --nav-bg: #4a3535;
  --nav-text: #f0e6d8;
  --nav-hover: #e8c4b0;
  --card-bg: #fffaf4;
  --card-border: #d4a88c;
  --card-shadow: rgba(61, 44, 44, 0.06);
  --summary-color: #8c6a5a;
  --detail-border: #e8d8c8;
  --toggle-bg: rgba(255,255,255,0.15);
  --img-shadow: rgba(61, 44, 44, 0.1);
  --footer-color: #b8a090;
  --particle-color: rgba(212, 168, 140, 0.3);
  --lightbox-bg: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --text: #d4cfc8;
  --nav-bg: #16213e;
  --nav-text: #c8b8a8;
  --nav-hover: #e8c4b0;
  --card-bg: #22223a;
  --card-border: #8c6a5a;
  --card-shadow: rgba(0, 0, 0, 0.2);
  --summary-color: #c4a68c;
  --detail-border: #3a3a52;
  --toggle-bg: rgba(255,255,255,0.1);
  --img-shadow: rgba(0, 0, 0, 0.3);
  --footer-color: #7a6a5a;
  --particle-color: rgba(200, 184, 168, 0.15);
  --lightbox-bg: rgba(0, 0, 0, 0.95);
}

body {
  background: var(--bg);
  font-family: "Noto Serif", "Georgia", "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* --- Page transition --- */
body {
  opacity: 0;
  animation: pageIn 0.6s ease forwards;
}
body.page-leaving {
  animation: pageOut 0.35s ease forwards;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pageOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

/* --- Navigation --- */
.head {
  background-color: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(61, 44, 44, 0.15);
  transition: background-color 0.3s;
}

.head a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 1rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.3s, border-bottom 0.3s;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border-bottom: 2px solid transparent;
}

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

/* Active navigation */
.head a.active {
  color: var(--nav-hover);
  border-bottom: 2px solid var(--nav-hover);
}

.theme-toggle {
  background: var(--toggle-bg);
  border: none;
  color: var(--nav-text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  border-radius: 50%;
  transition: background 0.3s;
  line-height: 1;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.25);
}

/* --- Content area --- */
.body {
  display: flex;
  justify-content: center;
  flex-direction: column;
  max-width: 680px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

/* --- Cards --- */
.tab {
  display: flex;
  padding: 1.4rem 1.6rem;
  background-color: var(--card-bg);
  border-radius: 10px;
  margin: 10px 0;
  flex-direction: column;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
  border-left: 3px solid var(--card-border);
  box-shadow: 0 1px 6px var(--card-shadow);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.tab:hover {
  box-shadow: 0 3px 15px var(--card-shadow);
  transform: translateY(-1px);
}

.tab p {
  margin: 0.5em 0;
}

.tab summary {
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0;
  font-size: 0.95rem;
  color: var(--summary-color);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.5px;
}

.tab details {
  margin: 0;
}

.tab details[open] summary {
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--detail-border);
  padding-bottom: 0.5rem;
}

/* smooth details open */
.tab details[open] > *:not(summary) {
  animation: detailSlide 0.3s ease;
}

@keyframes detailSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Fade-in on scroll --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Photo section (notebook) --- */
.ph {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 680px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.ph img {
  width: 100%;
  max-width: 560px;
  height: auto;
  border-radius: 8px;
  margin: 0.5rem 0;
  box-shadow: 0 2px 10px var(--img-shadow);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ph img:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 20px var(--img-shadow);
}

.ph p {
  color: var(--summary-color);
  text-align: center;
  margin: 0.4rem 0 1.2rem;
  padding: 0 0.5rem;
  font-size: 0.9rem;
  font-family: "Caveat", cursive;
  letter-spacing: 0.3px;
  font-size: 1.1rem;
}

/* --- Polaroid style --- */
.polaroid {
  background: #fff;
  padding: 10px 10px 30px 10px;
  box-shadow: 0 3px 15px var(--img-shadow);
  margin: 1rem 0;
  display: inline-block;
  transition: transform 0.3s ease;
}

[data-theme="dark"] .polaroid {
  background: #2a2a3e;
}

.polaroid:nth-child(odd) {
  transform: rotate(-1.5deg);
}
.polaroid:nth-child(even) {
  transform: rotate(1deg);
}
.polaroid:hover {
  transform: rotate(0deg) scale(1.03);
}

.polaroid img {
  width: 100%;
  max-width: 520px;
  display: block;
  margin: 0;
  box-shadow: none;
  border-radius: 0;
}
.polaroid img:hover {
  transform: none;
  box-shadow: none;
}

.polaroid .caption {
  font-family: "Caveat", cursive;
  font-size: 1.15rem;
  color: var(--summary-color);
  text-align: center;
  padding-top: 8px;
  letter-spacing: 0.5px;
}

/* --- Lightbox --- */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--lightbox-bg);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  animation: lbFadeIn 0.3s ease;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 5px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background 0.2s;
}
.lightbox-nav:hover {
  background: rgba(255,255,255,0.3);
}
.lightbox-prev { left: 15px; }
.lightbox-next { right: 15px; }
.lightbox-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Typewriter --- */
.typewriter {
  overflow: hidden;
  white-space: normal;
}
.typewriter .cursor {
  display: inline-block;
  width: 2px;
  background: var(--card-border);
  animation: blink 0.8s infinite;
  margin-left: 2px;
  vertical-align: text-bottom;
  height: 1.2em;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- "New" badge --- */
.new-badge {
  display: inline-block;
  font-size: 0.7rem;
  background: linear-gradient(135deg, #e8c4b0, #d4a88c);
  color: #3d2c2c;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 8px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  animation: sparkle 2s ease-in-out infinite;
  vertical-align: middle;
}

[data-theme="dark"] .new-badge {
  background: linear-gradient(135deg, #8c6a5a, #6a4a3a);
  color: #e8d8c8;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* --- Easter egg --- */
.easter-egg-trigger {
  cursor: default;
  user-select: none;
}
.easter-egg-msg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--card-bg);
  color: var(--text);
  padding: 2rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  z-index: 10000;
  text-align: center;
  font-family: "Caveat", cursive;
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
  max-width: 320px;
  line-height: 1.6;
}
.easter-egg-msg.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.easter-egg-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.easter-egg-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* --- Scroll to top --- */
.scroll-top-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--nav-bg);
  color: var(--nav-text);
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
  z-index: 900;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background: var(--card-border);
}

/* --- Particle canvas --- */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.head, .body, .ph, .tail, footer {
  position: relative;
  z-index: 1;
}

/* --- Footer --- */
footer.site-footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  font-family: "Caveat", cursive;
  font-size: 1.15rem;
  color: var(--footer-color);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}
footer.site-footer::before {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: var(--detail-border);
  margin: 0 auto 1rem;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    font-size: 16px;
    line-height: 2;
    word-spacing: 0.02em;
  }

  .head {
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .head a {
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .body {
    margin: 0.6rem auto;
    padding: 0 1.15rem;
    max-width: 100%;
  }

  .tab {
    padding: 1rem 1.1rem;
    margin: 8px 0;
    border-radius: 8px;
    border-left-width: 2px;
  }

  .tab p {
    font-size: 0.95rem;
    line-height: 2;
    margin: 0.6em 0;
  }

  .tab summary {
    font-size: 0.9rem;
    padding: 0.45rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .theme-toggle {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ph {
    margin: 0.6rem auto;
    padding: 0 1.15rem;
    max-width: 100%;
  }

  .ph img {
    border-radius: 6px;
    margin: 0.5rem 0;
    max-width: 100%;
  }

  .ph p {
    font-size: 1rem;
    line-height: 1.7;
    margin: 0.3rem 0 1rem;
    padding: 0 0.3rem;
  }

  .polaroid {
    padding: 6px 6px 22px 6px;
    margin: 0.6rem 0;
  }

  .lightbox-nav {
    font-size: 1.5rem;
    padding: 0.4rem 0.7rem;
  }

  .scroll-top-btn {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }

  .easter-egg-msg {
    max-width: 85vw;
    font-size: 1.2rem;
    padding: 1.5rem 1.8rem;
  }
}
