/* ============================================
   NAYE.EXE — Style System
   배경: 아이보리 #F7F4EE  폰트: Noto Sans KR
   강조: 한국 레드 #D11A2A · 블루 #1E3A8A
   ============================================ */

:root {
  --bg-ivory:   #F7F4EE;
  --bg-ivory-d: #EDE9DF;
  --bg-surface: #FFFFFF;
  --ink:        #111111;
  --dim:        #777777;
  --muted:      #BBBBBB;
  --border:     #E0DDD6;
  --kr-red:     #D11A2A;
  --kr-blue:    #1E3A8A;
  --t-micro:    0.25s ease-out;
  --t-reveal:   0.6s ease-out;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; }
body {
  background: var(--bg-ivory);
  color: var(--ink);
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  font-weight: 300;
}

/* ===== GRAIN ===== */
.grain-overlay {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none; opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 180px 180px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg-ivory); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::selection { background: rgba(209,26,42,0.15); color: #111; }

/* ===== SECTION HELPERS ===== */
.section-padded { padding: 7rem 0; }
.section-ivory-d { background: var(--bg-ivory-d); }
.section-header { margin-bottom: 3.5rem; }

.section-label {
  display: block;
  font-size: 0.65rem; letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--kr-red); margin-bottom: 0.6rem; font-weight: 400;
}
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 300; letter-spacing: -0.01em; color: var(--ink); line-height: 1.25;
}

/* ===== HEADER ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background var(--t-reveal), box-shadow var(--t-reveal), backdrop-filter var(--t-reveal);
}
.site-header.scrolled {
  background: rgba(247,244,238,0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 1.4rem 2rem;
}
.header-logo {
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.3em;
  color: var(--ink); text-decoration: none; text-transform: uppercase;
}
.header-nav { display: flex; gap: 2.5rem; }
@media (max-width: 767px) { .header-nav { display: none; } }

.nav-link {
  font-size: 0.8rem; font-weight: 300; letter-spacing: 0.05em;
  color: var(--dim); text-decoration: none; position: relative;
  transition: color var(--t-micro);
}
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: var(--kr-red);
  transition: width var(--t-micro);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 100%; }

.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: transparent; border: none; cursor: pointer; padding: 4px;
}
.nav-hamburger span { display: block; width: 22px; height: 1px; background: var(--dim); transition: background var(--t-micro); }
.nav-hamburger:hover span { background: var(--ink); }
@media (max-width: 767px) { .nav-hamburger { display: flex; } }

.mobile-nav {
  position: fixed; top: 0; right: -100%;
  width: min(280px, 80vw); height: 100vh;
  background: var(--bg-surface); z-index: 99;
  display: flex; flex-direction: column; justify-content: center;
  padding: 3rem 2.5rem; gap: 2rem;
  transition: right 0.4s ease-out;
  border-left: 1px solid var(--border);
}
.mobile-nav.open { right: 0; }
.mobile-nav-link {
  font-size: 1.1rem; font-weight: 300; color: var(--dim);
  text-decoration: none; transition: color var(--t-micro);
}
.mobile-nav-link:hover { color: var(--ink); }

/* ===== HERO ===== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  /* 배경 이미지 */
  background-image: url('../assets/images/배경.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}

/* 전체 어둡게 */
.hero-bg-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 0;
}

.hero-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 1200px;
  margin: 0 auto; padding: 9rem 2rem 6rem;
}

/* 텍스트 박스 — 반투명 검정 */
.hero-text-box {
  display: inline-block;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
  padding: 2.5rem 3rem;
  border-left: 3px solid rgba(209, 26, 42, 0.7);
  max-width: 640px;
}

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(209, 26, 42, 0.9);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 200;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #FFFFFF;
  margin-bottom: 1.75rem;
}

.hero-tagline {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 300;
  color: rgba(255,255,255,0.9);
  margin-bottom: 0.3rem;
}
.hero-tagline-en {
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 2rem;
}

.hero-cta-wrap { margin-top: 0.5rem; }

.btn-hero {
  display: inline-block;
  padding: 0.85rem 2rem;
  border: 1px solid rgba(255,255,255,0.5);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.08);
  transition: background var(--t-micro), border-color var(--t-micro);
}
.btn-hero:hover {
  background: rgba(209,26,42,0.35);
  border-color: rgba(209,26,42,0.8);
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
  position: absolute; bottom: 2.5rem; left: 2rem; z-index: 1;
}
.scroll-line {
  width: 1px; height: 55px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: scroll-pulse 2.5s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7) translateY(-8px); }
  50%       { opacity: 0.9; transform: scaleY(1) translateY(0); }
}

/* ===== JOURNEY (TIMELINE) SECTION ===== */
.journey-section {
  background: var(--bg-ivory);
}

.journey-header {
  max-width: 1200px; margin: 0 auto;
  padding: 7rem 2rem 4rem;
}

/* 각 챕터 */
.chapter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 460px;
  border-top: 1px solid var(--border);
}
.chapter--reverse {
  direction: rtl; /* 좌우 반전 */
}
.chapter--reverse > * {
  direction: ltr; /* 텍스트 방향 복원 */
}
.chapter--center {
  grid-template-columns: 1fr;
  text-align: center;
  padding: 6rem 2rem 5rem;
  background: var(--bg-ivory-d);
  border-bottom: 1px solid var(--border);
}

/* 미디어 영역 */
.chapter-media {
  overflow: hidden;
  position: relative;
}
.chapter-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.6s ease-out;
}
.chapter:hover .chapter-img { transform: scale(1.03); }

.chapter-video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  background: #000;
}

/* 텍스트 영역 */
.chapter-text {
  display: flex; flex-direction: column; justify-content: center;
  padding: 3.5rem 4rem;
  background: var(--bg-surface);
}
.chapter--reverse .chapter-text {
  background: var(--bg-ivory-d);
}
.chapter-text--center {
  max-width: 640px; margin: 0 auto;
  padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}

.chapter-num {
  font-size: 0.78rem; font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--kr-red); margin-bottom: 0.5rem;
}
.chapter-title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 500; color: var(--ink);
  line-height: 1.25; margin-bottom: 1rem;
}
.chapter-list {
  list-style: none; display: flex; flex-direction: column; gap: 0.5rem;
}
.chapter-list li {
  font-size: 0.875rem; color: var(--dim);
  padding-left: 1rem; position: relative;
}
.chapter-list li::before {
  content: '—'; position: absolute; left: 0;
  color: var(--muted); font-size: 0.75rem;
}

/* 음악 재생 버튼 (챕터2) */
.play-album-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 1.5rem;
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  transition: border-color var(--t-micro), background var(--t-micro), color var(--t-micro);
}
.play-album-btn:hover {
  border-color: var(--kr-red);
  background: rgba(209,26,42,0.05);
  color: var(--kr-red);
}
.play-album-btn.playing {
  border-color: var(--kr-red);
  color: var(--kr-red);
}
.play-album-icon { font-size: 0.75rem; }

/* 점 애니메이션 (챕터6) */
.dot-animation {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.5rem; margin: 0.5rem 0;
}
.dot-animation span {
  display: block;
  font-size: 1.8rem; font-weight: 300; color: var(--muted);
  line-height: 1;
  animation: dot-blink 1.4s ease-in-out infinite;
}
.dot-animation span:nth-child(2) { animation-delay: 0.2s; }
.dot-animation span:nth-child(3) { animation-delay: 0.4s; }
.dot-animation span:nth-child(4) { animation-delay: 0.6s; }
@keyframes dot-blink {
  0%, 100% { opacity: 0.2; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(-4px); }
}

.future-question {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 300; color: var(--ink);
  letter-spacing: -0.01em;
}

/* 모바일: 챕터 세로 스택 */
@media (max-width: 767px) {
  .chapter {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .chapter--reverse {
    direction: ltr;
  }
  .chapter-media { min-height: 240px; }
  .chapter-text { padding: 2.5rem 1.5rem; }
  .chapter--center { padding: 4rem 1.5rem; }
}

/* ===== GACHA ===== */
.gacha-avatar-wrap { display: flex; justify-content: center; margin-bottom: 1rem; }
.gacha-avatar {
  width: 140px; height: 140px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--t-reveal), box-shadow var(--t-reveal);
}
.gacha-avatar.spinning {
  animation: avatar-spin 0.35s linear infinite;
  border-color: rgba(209,26,42,0.4);
  box-shadow: 0 0 20px rgba(209,26,42,0.1);
}
.gacha-avatar.result {
  animation: none; border-color: var(--muted);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
@keyframes avatar-spin { to { transform: rotateY(360deg); } }

.pixel-avatar { width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; }
.pixel-grid {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 2px; width: 96px; height: 96px;
}
.pixel-cell { width: 100%; aspect-ratio: 1; border-radius: 1px; transition: background var(--t-micro); }

.gacha-label {
  font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 0.5rem; display: block;
}
.gacha-identity-text {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 300; letter-spacing: -0.02em; color: var(--ink); min-height: 2.5rem;
}
.gacha-identity-text.glitching { color: var(--kr-red); }
.gacha-identity-text.revealed  { color: var(--ink); }

/* 가챠 버튼 */
.btn-gacha {
  display: inline-block;
  padding: 1rem 2.5rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg-ivory);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.9rem; font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background var(--t-micro), border-color var(--t-micro), color var(--t-micro), transform var(--t-micro);
}
.btn-gacha:hover { background: var(--kr-red); border-color: var(--kr-red); transform: scale(1.02); }
.btn-gacha:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.gacha-cta { animation: fade-in-up 0.6s ease-out; }
.gacha-cta.hidden { display: none; }

/* ===== EDITORIAL BUTTON ===== */
.btn-editorial {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 0.9rem 2rem;
  border: 1px solid var(--border);
  color: var(--ink); text-decoration: none;
  background: transparent; cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: border-color var(--t-micro), background var(--t-micro), transform var(--t-micro);
}
.btn-editorial:hover { border-color: var(--kr-red); background: rgba(209,26,42,0.03); transform: scale(1.02); }
.btn-editorial-kr { font-size: 0.9rem; font-weight: 400; letter-spacing: 0.03em; }

/* ===== FLOATING MUSIC PLAYER ===== */
.music-player {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 100;
  display: flex; align-items: center; gap: 0.75rem;
  background: rgba(247,244,238,0.92);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  transition: box-shadow var(--t-micro);
}
.music-player:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.12); }

.music-toggle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); border: none; color: var(--bg-ivory);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: background var(--t-micro);
}
.music-toggle:hover { background: var(--kr-red); }

.music-info { display: flex; flex-direction: column; gap: 0.3rem; min-width: 80px; }
.music-track { font-size: 0.65rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.music-progress-bar { width: 100%; height: 1px; background: var(--border); }
.music-progress-fill { height: 100%; width: 0%; background: var(--kr-red); transition: width 0.5s linear; }

/* ===== CONTACT ===== */
.contact-links {
  display: flex; flex-wrap: wrap; gap: 1px;
  justify-content: center; max-width: 560px; margin: 0 auto;
  background: var(--border); border: 1px solid var(--border);
}
.contact-link {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 2rem 1.5rem; background: var(--bg-ivory);
  text-decoration: none; color: var(--ink);
  flex: 1; min-width: 150px;
  transition: background var(--t-micro);
}
.contact-link:hover { background: var(--bg-surface); }
.contact-link:hover .contact-icon { color: var(--kr-red); }
.contact-icon { color: var(--muted); transition: color var(--t-micro); }
.contact-label { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.contact-handle { font-size: 0.8rem; font-weight: 400; color: var(--ink); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(247,244,238,0.88); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; animation: fade-in 0.2s ease-out;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  position: relative; background: var(--bg-surface);
  border: 1px solid var(--border); padding: 2.5rem;
  max-width: 540px; width: 100%;
  animation: slide-up 0.3s ease-out;
  box-shadow: 0 16px 48px rgba(0,0,0,0.1);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: transparent; border: none; color: var(--muted);
  font-size: 1rem; cursor: pointer; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t-micro);
}
.modal-close:hover { color: var(--ink); }
.modal-content { color: var(--dim); line-height: 1.8; }
.modal-content h3 { color: var(--ink); font-size: 1.1rem; font-weight: 500; margin-bottom: 0.75rem; }

/* ===== ANIMATIONS ===== */
@keyframes fade-in    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-up   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

[data-reveal] { opacity: 0; transform: translateY(24px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
:focus-visible { outline: 1px solid var(--kr-red); outline-offset: 3px; }
