/* ==========================================================================
   TYCHE SD — Common Design System
   타이키공간디자인 공통 스타일시트
   기존 Wix 사이트의 브랜드 컬러 팔레트 적용
   ========================================================================== */

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

/* 전체 이탤릭 제거 */
em, i { font-style: normal; }

:root {
  /* ==========================================================================
     COLORS — 기존 타이키 브랜드 팔레트
     ========================================================================== */

  /* Core brand colors — TYCHE 브랜드 팔레트 */
  --color-charcoal:    #2B2B2B;  /* 메인 다크 */
  --color-burgundy:    #7C0005;  /* 버건디 — 메인 브랜드 컬러 */

  /* Functional assignments (기능별 할당) */
  --bg:          #F8F6F3;        /* 배경: 오프화이트 (PDF에 가까운 밝은 톤) */
  --bg-alt:      #F2EEEB;        /* 서브 배경: 아주 약한 따뜻한 오프화이트 */
  --bg-dark:     #2B2B2B;        /* 다크 배경: 차콜 */

  --ink:         #2B2B2B;        /* 기본 텍스트 */
  --ink-soft:    #444040;        /* 본문 텍스트 */
  --ink-muted:   #7A6A6A;        /* 보조 텍스트: 뉴트럴 그레이-브라운 */

  --line:        #DEDAD8;        /* 구분선: 뉴트럴 라이트 */
  --line-soft:   #EAE7E5;        /* 부드러운 구분선 */
  --line-burgundy: rgba(124, 0, 5, 0.18);  /* 버건디 얇은 선 */

  --accent:      #7C0005;        /* 메인 액센트: 버건디 */
  --accent-dark: #5C0004;        /* 진한 버건디 (호버) */
  --accent-deep: #7C0005;        /* 버건디 (동일) */

  /* ==========================================================================
     TYPOGRAPHY
     ========================================================================== */

  --serif: 'Cormorant Garamond', 'Noto Serif KR', serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --kr-serif: 'Noto Serif KR', serif;

  /* ==========================================================================
     LAYOUT
     ========================================================================== */

  --max-w: 1440px;
  --pad: clamp(20px, 4vw, 60px);
  --header-h: 80px;
}

html {
  scroll-behavior: smooth;
}

/* 이탤릭 전체 비활성화 */
em, i, cite, dfn {
  font-style: normal;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

/* ==========================================================================
   HEADER (공통)
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px var(--pad);
  background: rgba(248, 246, 243, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: padding 0.4s ease, background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.header.scrolled {
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line-burgundy);  /* 버건디 얇은 선 - 조용한 메인 디테일 */
}

/* 다크 모드 헤더 (HOME 히어로 위에 올릴 때) */
.header.on-dark {
  background: transparent;
  color: var(--bg);
}
.header.on-dark .logo img {
  filter: none;
}
.header.on-dark .nav a,
.header.on-dark .header-lang,
.header.on-dark .header-lang .active {
  color: var(--bg);
}
.header.on-dark .nav a.active {
  color: var(--color-burgundy);
  font-weight: 700;
  opacity: 1;
}
.header.on-dark .menu-btn span {
  background: var(--bg);
}
.header.on-dark.scrolled {
  background: rgba(248, 246, 243, 0.95);
  color: var(--ink);
}
.header.on-dark.scrolled .logo img {
  filter: none;
}
.header.on-dark.scrolled .nav a,
.header.on-dark.scrolled .header-lang,
.header.on-dark.scrolled .header-lang .active {
  color: var(--ink);
}
.header.on-dark.scrolled .menu-btn span {
  background: var(--ink);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.logo {
  display: inline-block;
  line-height: 0;
}

.logo img {
  height: 44px;
  width: auto;
  opacity: 0.9;
  transition: filter 0.4s ease;
}

.nav {
  display: flex;
  gap: 36px;
  justify-content: center;
}

.nav a {
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
  transition: color 0.25s, font-weight 0.25s, opacity 0.25s;
  position: relative;
  padding: 4px 0;
}

.nav a:hover {
  color: var(--color-burgundy);
  font-weight: 700;
  opacity: 1;
}

.nav a.active {
  color: var(--color-burgundy);
  font-weight: 700;
  opacity: 1;
}

.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
}

.header-lang {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
}

.header-lang .active {
  color: var(--ink);
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: all 0.3s;
}

.menu-btn span:nth-child(2) {
  width: 22px;
}

/* ==========================================================================
   FOOTER (공통)
   ========================================================================== */

.footer {
  background: #111111;
  padding: 72px var(--pad) 40px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  align-items: start;
}

/* 브랜드 컬럼 */
.footer-logo-text {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
}
.footer-tagline {
  display: block;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 28px;
}

.footer h4 {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  font-weight: 400;
  margin-bottom: 18px;
}

.footer ul { list-style: none; }

.footer li {
  font-size: 14px;
  line-height: 2.2;
  color: rgba(255,255,255,0.5);
}

.footer li a { transition: color 0.3s; }

.footer li a:hover { color: rgba(255,255,255,0.9); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
}

/* 소셜 아이콘 버튼 */
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.social-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.55);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
  flex-shrink: 0;
}
.social-btn:hover {
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}
.social-btn svg { display: block; }

/* ==========================================================================
   OVERLAY MENU (공통) — 기존 Wix 사이드메뉴 테라코타 색 활용
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  transform: translateY(-100%);
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
  overflow-y: auto;
}

.overlay.open {
  transform: translateY(0);
}

.overlay-inner {
  min-height: 100vh;
  padding: 40px var(--pad);
  display: flex;
  flex-direction: column;
}

.overlay-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overlay-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}

.overlay-close::before {
  content: '×';
  font-size: 32px;
  line-height: 1;
  font-weight: 200;
}

.overlay-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding: 80px 0;
  align-items: start;
}

.overlay-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overlay-nav a {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: all 0.3s;
  display: inline-block;
}

.overlay-nav a:hover {
  color: var(--accent);
  font-style: normal;
  padding-left: 24px;
}

/* 브랜드 클로징 — 우측 패널 */
.overlay-info {
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.overlay-info-tagline {
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 300;
  font-style: italic;
  color: var(--color-burgundy, #7C0005);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.overlay-info-desc {
  font-family: var(--kr-serif, 'Noto Serif KR', serif);
  font-size: 14px;
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.9;
  margin-bottom: 28px;
  word-break: keep-all;
}

.overlay-info-email {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  display: inline-block;
  transition: color 0.3s;
}

.overlay-info-email:hover {
  color: var(--color-burgundy, #7C0005);
}

/* 구 overlay-sub — 숨김 */
.overlay-sub { display: none; }

/* ==========================================================================
   SHARED COMPONENTS (공통)
   ========================================================================== */

/* Section Label — 작은 올캡스 라벨 */
.section-label {
  font-size: 16px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-label::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--ink-muted);
}

/* Section Label on dark backgrounds */
.on-dark .section-label,
.section-label.on-dark {
  color: rgba(227, 207, 185, 0.7);
}

.on-dark .section-label::before,
.section-label.on-dark::before {
  background: rgba(227, 207, 185, 0.5);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.fade-in {
  opacity: 0;
  animation: fadeUp 1s ease forwards;
}

.fade-in.delay-1 { animation-delay: 0.2s; }
.fade-in.delay-2 { animation-delay: 0.4s; }
.fade-in.delay-3 { animation-delay: 0.6s; }
.fade-in.delay-4 { animation-delay: 0.8s; }
.fade-in.delay-5 { animation-delay: 1.0s; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
  .nav { display: none; }
  /* 모바일: 로고 좌 / KR·햄버거 우 */
  .header-inner {
    grid-template-columns: 1fr auto;
  }
  /* 단어 단위 줄바꿈 — 한글 본문에만 적용 */
  p, li {
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  .overlay-content {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 56px 0;
  }
  .overlay-nav {
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  .overlay-nav a:hover { padding-left: 0; }
  .overlay-info {
    align-items: center;
    text-align: center;
    padding-top: 36px;
    border-top: 1px solid var(--line-soft);
  }
  /* 태블릿: 2+2 그리드 */
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 600px) {
  /* 모바일: 단일 컬럼 */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-top > div:first-child {
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .footer-social { margin-top: 16px; }
  .footer-bottom {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
}

/* ── 모바일 텍스트 최적화 ── */
@media (max-width: 720px) {
  :root { --pad: clamp(14px, 4.5vw, 22px); }
}

/* 언어 전환 링크 */
.lang-link {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
}
.lang-link:hover { color: var(--ink); }
