/* ════════════════════════════════════
   🩸 GLOBAL VARS & FONTS
   ════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;700&family=Noto+Sans+KR:wght@300;400;700;900&display=swap');

:root {
  --main-red: #cc0033;
  --bright-red: #ff1a4a;
  --dark-bg: #050002;
  --border-red: rgba(255, 26, 74, 0.4);
  --glass-bg: rgba(15, 5, 10, 0.65);
  --glass-border: rgba(255, 26, 74, 0.2);
}

* {
  margin: 0; padding: 0; box-sizing: border-box;
}

body {
  background-color: var(--dark-bg);
  color: #fff;
  font-family: 'Noto Sans KR', sans-serif;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ════════════════════════════════════
   🌙 BACKGROUND EFFECTS (INFINITE CASTLE)
   ════════════════════════════════════ */
.bg-base {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, #1a0005 0%, #050002 100%);
  z-index: -5;
}

.bg-moon {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60vh; height: 60vh;
  border-radius: 50%;
  background: radial-gradient(circle, var(--main-red) 0%, transparent 60%);
  filter: blur(100px);
  opacity: 0.3;
  z-index: -4;
  animation: pulse-moon 8s ease-in-out infinite alternate;
}

@keyframes pulse-moon {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.2; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.4; }
}

.bg-ash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(var(--bright-red) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.05;
  z-index: -3;
  animation: ash-fall 60s linear infinite;
}

@keyframes ash-fall {
  0% { transform: translateY(0); }
  100% { transform: translateY(100vh); }
}

/* ════════════════════════════════════
   🧭 NAVIGATION (GLOBAL SYNC)
   ════════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; width: 100%;
  height: 80px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 50px;
  z-index: 1000;
  background: rgba(5, 0, 2, 0.5);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-red);
}

.logo {
  font-family: 'Oswald', sans-serif;
  font-weight: 700; font-size: 2rem;
  color: #fff; text-decoration: none; letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 40px;
}
.nav-links a {
  color: #a0a0a0;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  transition: 0.4s;
  position: relative;
  white-space: nowrap;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--bright-red);
  box-shadow: 0 0 10px var(--bright-red);
  transition: width 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.5); }

/* ════════════════════════════════════
   🎴 TALISMAN SKY (떠다니는 부적 방명록 존)
   ════════════════════════════════════ */
.talisman-sky {
  position: absolute;
  top: 80px; left: 0; right: 400px; /* 우측 폼 영역 제외 */
  bottom: 0;
  overflow: hidden;
  z-index: 1;
}

.talisman-card {
  position: absolute;
  width: 250px;
  min-height: 120px;
  background: rgba(10, 2, 5, 0.5);
  border: 1px solid rgba(255, 26, 74, 0.3);
  border-top: 4px solid var(--bright-red);
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  cursor: crosshair;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  transform-style: preserve-3d;
  /* 애니메이션은 JS에서 퍼펙트하게 부여 */
  animation: float-talisman 8s infinite alternate ease-in-out;
}

@keyframes float-talisman {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-20px) rotate(2deg); }
}

.talisman-card:hover {
  border-color: var(--bright-red);
  box-shadow: 0 0 30px rgba(255, 26, 74, 0.6), inset 0 0 10px rgba(255, 26, 74, 0.2);
  z-index: 50 !important;
}

/* 핏빛 네온 타겟명 */
.tali-target {
  font-size: 0.9rem;
  color: var(--bright-red);
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.tali-msg {
  font-size: 1rem;
  line-height: 1.5;
  color: #ddd;
  margin-bottom: 15px;
  word-break: keep-all;
}

.tali-author {
  font-size: 0.8rem;
  color: #777;
  text-align: right;
}

/* ════════════════════════════════════
   📝 GUESTBOOK WRITING INTERFACE
   ════════════════════════════════════ */
.guestbook-interface {
  position: fixed;
  right: 0; top: 80px; bottom: 0;
  width: 400px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  padding: 40px 30px;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.interface-header {
  margin-bottom: 40px;
}

.interface-header h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--bright-red);
  text-shadow: 0 0 10px rgba(255, 26, 74, 0.5);
}

.interface-header p {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.4;
}

.cheer-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--bright-red);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 1px;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: 'Noto Sans KR', sans-serif;
  padding: 12px 15px;
  border-radius: 4px;
  font-size: 1rem;
  transition: 0.3s;
}

.input-group textarea { resize: none; }

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--bright-red);
  box-shadow: 0 0 10px rgba(255, 26, 74, 0.2);
}

/* 다크 Select UI */
.input-group select option { background: #111; color: #fff; }

.submit-btn {
  position: relative;
  background: var(--bright-red);
  color: #fff;
  border: none;
  padding: 15px 0;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  transition: 0.3s;
  margin-top: 10px;
}

.submit-btn:hover {
  background: #ff3366;
  box-shadow: 0 0 20px rgba(255, 26, 74, 0.6);
  transform: translateY(-2px);
}

.submit-btn .glow {
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  transition: 0s;
}

.submit-btn:hover .glow {
  left: 200%;
  transition: 0.5s ease-in-out;
}

/* ════════════════════════════════════
   ✨ PARTICLE SYSTEM (메시지 발사 이펙트)
   ════════════════════════════════════ */
.particle-system {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999;
}

.spark {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--bright-red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--bright-red);
  animation: explode 0.8s ease-out forwards;
}

@keyframes explode {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ════════════════════════════════════
   📱 MOBILE RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 768px) {
  nav { 
    height: auto; 
    min-height: 80px;
    padding: 15px 6%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  .logo {
    font-size: 1.4rem;
    letter-spacing: 2px;
  }
  
  .nav-links {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  
  .nav-links a {
    margin: 0 12px;
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
  }

  .guestbook-interface {
    width: 100%; height: auto;
    position: relative; top: 0; border-left: none;
    padding: 30px 20px;
    border-top: 1px solid var(--border-red);
  }
  .talisman-sky {
    position: relative; right: 0;
    height: 60vh; top: 0;
  }
  
  .archive-header { margin-bottom: 40px; }
  .header-seal { width: 80px; height: 80px; font-size: 3rem; }
  .archive-title { font-size: 2rem; letter-spacing: 5px; }
  .archive-subtitle { font-size: 0.85rem; letter-spacing: 1px; }
  .times-archive-section { padding-top: 120px; padding-left: 20px; padding-right: 20px; }
}

/* ════════════════════════════════════
   🏯 TIMES ARCHIVE: THE CRIMSON CHRONICLE
   ════════════════════════════════════ */
:root {
  --antique-gold: #c5a059;
}

.times-archive-section {
  padding: 140px 50px 100px;
  position: relative;
  z-index: 10;
  max-width: 1400px;
  margin: 0 auto;
}

/* 📜 헤더: 비밀 인장 연출 */
.archive-header {
  text-align: center;
  margin-bottom: 80px;
  position: relative;
}

.header-seal {
  font-size: 5rem;
  color: var(--bright-red);
  font-family: 'Oswald', sans-serif;
  border: 4px solid var(--bright-red);
  width: 120px; height: 120px;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  opacity: 0.8;
  box-shadow: 0 0 30px rgba(255, 26, 74, 0.4);
  background: rgba(15, 0, 5, 0.6);
  animation: seal-pulse 4s infinite ease-in-out;
}

@keyframes seal-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 26, 74, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(255, 26, 74, 0.6); }
}

.archive-title {
  font-family: 'Oswald', sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 12px;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.4);
  margin-bottom: 10px;
}

.archive-subtitle {
  color: #aaa;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

/* 🩸 타임라인 본체: 수직 혈선 (Bloodline) */
.timeline-container {
  position: relative;
  width: 100%;
  padding: 40px 0;
}

.blood-line {
  position: absolute;
  top: 0; left: 50%;
  width: 2px; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--bright-red), var(--main-red), transparent);
  box-shadow: 0 0 15px var(--bright-red);
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 120px;
  width: 100%;
}

/* 📜 비밀 두루마리 (Scroll) 아이템 */
.scroll-item {
  position: relative;
  width: 44%;
  display: flex;
  z-index: 10;
}

.scroll-item:nth-child(even) { align-self: flex-end; justify-content: flex-start; text-align: left; }
.scroll-item:nth-child(odd) { align-self: flex-start; justify-content: flex-end; text-align: right; }

/* 🚪 미닫이문 (Fusuma) 효과 */
.fusuma-gate {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
  border-radius: 8px;
}

.fusuma-left, .fusuma-right {
  position: absolute;
  top: 0; width: 50%; height: 100%;
  background: rgba(15, 0, 5, 0.95);
  border: 1px solid var(--glass-border);
  transition: transform 1.2s cubic-bezier(0.8, 0, 0.2, 1);
  display: flex; align-items: center; justify-content: center;
}

/* 문 표면 창호지 무늬 */
.fusuma-left {
  left: 0; border-right: 2px solid var(--border-red);
  background-image: linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 20px 20px;
}
.fusuma-right {
  right: 0; border-left: 2px solid var(--border-red);
  background-image: linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* 관측 시점에 문이 열리는 효과 */
.scroll-item.is-visible .fusuma-left { transform: translateX(-100%); }
.scroll-item.is-visible .fusuma-right { transform: translateX(100%); }

/* 📜 실제 카드 (Scroll Content) */
.scroll-content {
  background: linear-gradient(135deg, #250005 0%, #0e0002 100%);
  border: 1px solid rgba(197, 160, 89, 0.5);
  border-top: 3px solid var(--antique-gold);
  padding: 35px;
  border-radius: 6px;
  box-shadow: 0 10px 50px rgba(0,0,0,0.9), inset 0 0 30px rgba(197, 160, 89, 0.05);
  width: 100%;
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.4s, border-color 0.4s;
  text-decoration: none;
  display: block;
}

.scroll-content:hover {
  transform: scale(1.03) translateY(-4px);
  border-color: rgba(197, 160, 89, 0.9);
  box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 30px rgba(197, 160, 89, 0.2);
}

.scroll-issue {
  font-family: 'Oswald', sans-serif;
  color: var(--antique-gold);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 15px;
  display: block;
}

.scroll-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #eee;
  line-height: 1.4;
  margin-bottom: 20px;
}

.scroll-date {
  font-size: 0.9rem;
  color: #666;
  font-family: 'Oswald', sans-serif;
}

/* 🩸 타임라인 중앙 노드 (Connect Node) */
.timeline-node {
  position: absolute;
  top: 50%;
  background: var(--bright-red);
  width: 16px; height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 26, 74, 0.25), 0 0 25px var(--bright-red);
  z-index: 5;
  animation: node-pulse 2s ease-in-out infinite alternate;
}

@keyframes node-pulse {
  from { box-shadow: 0 0 0 3px rgba(255, 26, 74, 0.2), 0 0 15px var(--bright-red); }
  to   { box-shadow: 0 0 0 6px rgba(255, 26, 74, 0.4), 0 0 35px var(--bright-red); }
}
.scroll-item:nth-child(odd) .timeline-node { right: -36px; transform: translateY(-50%) translateX(50%); }
.scroll-item:nth-child(even) .timeline-node { left: -36px; transform: translateY(-50%) translateX(-50%); }


/* 🧱 창호지 Fusuma 배경 패턴 (Subtle Background) */
.bg-ash {
  background-image: 
    linear-gradient(rgba(255,26,74,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,26,74,0.02) 1px, transparent 1px);
  background-size: 100px 100px;
  opacity: 0.15;
}

/* 📱 모바일 타임라인 처리 */
@media (max-width: 1024px) {
  .blood-line { left: 40px; transform: none; }
  .scroll-item { width: 85%; align-self: flex-end !important; justify-content: flex-start !important; text-align: left !important; }
  .scroll-item:nth-child(odd) .timeline-node,
  .scroll-item:nth-child(even) .timeline-node { left: -37px; right: auto; transform: translateY(-50%); }
  .archive-title { font-size: 2rem; letter-spacing: 5px; }
  .timeline-list { gap: 60px; }
}
.gallery-section {
  padding: 120px 50px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.gallery-masonry {
  column-count: 3;
  column-gap: 30px;
}

@media (max-width: 1024px) { .gallery-masonry { column-count: 2; } }
@media (max-width: 768px) { .gallery-masonry { column-count: 1; } }

.gallery-item {
  break-inside: avoid;
  margin-bottom: 30px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 25px rgba(0,0,0,0.6);
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.5s;
  border: 1px solid rgba(255, 26, 74, 0.08);
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 20px rgba(255, 26, 74, 0.15);
  border-color: rgba(255, 26, 74, 0.3);
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1), filter 0.4s;
}

.gallery-item:hover img {
  transform: scale(1.08);
  filter: brightness(0.7) saturate(1.1);
}

.gallery-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, rgba(5,0,2,0.9) 0%, transparent 100%);
  padding: 30px 20px 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

.gallery-author {
  color: var(--bright-red);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 5px;
}

.gallery-desc {
  color: #fff;
  font-size: 0.9rem;
}

/* ════════════════════════════════════
   🦶 FOOTER
   ════════════════════════════════════ */
footer {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(to top, rgba(5,0,2,0.95), transparent);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-logo {
  font-family: 'Oswald', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--bright-red);
  text-shadow: 0 0 20px rgba(255, 26, 74, 0.8);
  letter-spacing: 8px;
}

footer p {
  font-size: 0.75rem;
  color: #555;
  letter-spacing: 0.2rem;
}

footer::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 26, 74, 0.3), transparent);
}

.footer-disclaimer {
  font-size: 0.6rem !important;
  color: #444 !important;
  letter-spacing: 0.05rem !important;
  line-height: 1.6;
  max-width: 600px;
  padding: 0 20px;
}


/* ETC Dropdown */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown .dropdown-title {
  color: #fff; cursor: pointer; font-family: 'Oswald', sans-serif;
  letter-spacing: 2px; font-weight: 500; font-size: 0.9rem; padding: 10px 15px; margin: 0;
}
.nav-dropdown .dropdown-content {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: rgba(10, 0, 5, 0.95); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 26, 74, 0.3); border-radius: 8px; min-width: 150px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.8); z-index: 1000; flex-direction: column;
}
.nav-dropdown:hover .dropdown-content { display: flex; }
.nav-dropdown .dropdown-content a {
  padding: 12px 20px; font-size: 0.85rem; letter-spacing: 1px; color: #ccc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); text-decoration: none; margin: 0; display: block;
}
.nav-dropdown .dropdown-content a::after { display: none; }
.nav-dropdown .dropdown-content a:last-child { border-bottom: none; }
.nav-dropdown .dropdown-content a:hover { background: rgba(255, 26, 74, 0.15); color: #fff; }
