/* 경남문화예술교육연구회 — 홈 + 첫 접속 인트로 */

:root {
  --bg: #081320;
  --band: #060e17;
  --line: #5e656e;
  --text: #ffffff;
  --muted: #b2bfd6;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-reveal: cubic-bezier(0.77, 0, 0.18, 1);
  --ease-menu: cubic-bezier(0.45, 0, 0.18, 1);
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic",
          "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

ul { list-style: none; margin: 0; padding: 0; }

figure { margin: 0; }

/* ---------- 공통 요소 ---------- */

/* 공식 로고: 원본 알파 그대로, 색만 흰색으로 */
.brand-logo {
  width: 100%;
  height: auto;
  filter: brightness(0) invert(1);
}

.brand { transition: opacity 0.6s ease; }
html.hero-logo-frame .brand { opacity: 0; pointer-events: none; }

.gnb a {
  position: relative;
  display: inline-block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  transform-origin: left center;
  transition: transform 0.95s var(--ease-menu), color 0.65s ease;
}

.gnb a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  background: #b9d5ff;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.95s var(--ease-menu), opacity 0.65s ease;
}

.gnb a:hover,
.gnb a:focus-visible {
  color: #fff;
  transform: translateX(6px) scale(1.06);
}

.gnb a:hover::after,
.gnb a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

/* 상단 헤더 띠: 화면 전체 폭 */
.site-header::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  background:
    radial-gradient(ellipse 36% 100% at 88% 0%, rgba(53, 79, 140, 0.3), transparent 78%),
    linear-gradient(105deg, #060e17 9%, #0a1728 56%, #10172e 100%);
  border-bottom: 1px solid rgba(173, 198, 243, 0.17);
  box-shadow: 0 10px 28px rgba(2, 8, 20, 0.1);
  pointer-events: none;
}

.hero-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
}

.hero-frame:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

.hero-mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

.hero-video { transition: opacity 0.45s var(--ease-out); }
html.hero-playing .hero-video { opacity: 1; }
html.intro-canvas-active .hero-video { opacity: 0; }

.hero-feedback {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 19, 32, 0.42);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.88);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.hero-feedback.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.hero-feedback-icon {
  display: block;
  width: 19px;
  height: 26px;
  border-left: 6px solid rgba(255, 255, 255, 0.9);
  border-right: 6px solid rgba(255, 255, 255, 0.9);
}

.hero-feedback.is-playing .hero-feedback-icon {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 21px solid rgba(255, 255, 255, 0.9);
  border-right: 0;
}

/* 원화 속 큰 별 자리에 먼저 비치는 빛 (원화 뒤에 깔림) */
.hero-glow {
  position: absolute;
  left: 79%;
  top: 53%;
  width: 46%;
  aspect-ratio: 1;
  margin-left: -23%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side,
              rgba(196, 214, 255, 0.55) 0%,
              rgba(110, 140, 255, 0.22) 38%,
              rgba(60, 80, 200, 0) 100%);
  opacity: 0;
  pointer-events: none;
}

/* 가로 리빌 경계를 부드럽게 만드는 페더 */
.hero-feather {
  position: absolute;
  top: 0;
  right: 0;
  width: 22%;
  height: 100%;
  background: linear-gradient(to right, rgba(8, 19, 32, 0) 0%, var(--bg) 100%);
  opacity: 0;
  pointer-events: none;
}

.menu-item {
  position: relative;
  isolation: isolate;
}

.menu-item:last-child { border-bottom: 1px solid rgba(178, 191, 214, 0.3); }

.menu-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(178, 191, 214, 0.34);
  transform-origin: 0 50%;
}

.menu-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #b9d5ff;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.95s var(--ease-menu);
}

.menu-item a {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
}

.menu-item a::before {
  content: "";
  position: absolute;
  inset: 1px 0 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(80, 131, 209, 0.18), rgba(80, 131, 209, 0.04) 68%, transparent);
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.85s var(--ease-menu), transform 0.95s var(--ease-menu);
}

.menu-num {
  position: absolute;
  color: #99b9ed;
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.08em;
  transition: color 0.65s ease, transform 0.9s var(--ease-menu);
}

.menu-label {
  position: absolute;
  font-family: "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif;
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.045em;
  transform-origin: left center;
  will-change: transform;
  transition: transform 0.95s var(--ease-menu), color 0.65s ease;
}

.menu-item:hover .menu-line::after,
.menu-item:focus-within .menu-line::after { transform: scaleX(1); }

.menu-item a:hover::before,
.menu-item a:focus-visible::before { opacity: 1; transform: translateX(0); }

.menu-item a:hover .menu-num,
.menu-item a:focus-visible .menu-num { color: #fff; transform: translateX(10px); }

.menu-item a:hover .menu-label,
.menu-item a:focus-visible .menu-label { color: #fff; transform: translateX(30px) scale(1.06); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 22px;
  border-top: 1px solid rgba(178, 191, 214, 0.22);
  padding-top: 14px;
  color: rgba(178, 191, 214, 0.76);
  font-size: 11px;
  line-height: 1.4;
}

.site-footer a { transition: color 0.25s ease; }
.site-footer a:hover { color: #fff; }
.footer-draft { color: rgba(178, 191, 214, 0.56); }

/* ---------- 모바일 / 세로 화면 (기본) ---------- */

.stage {
  position: relative;
  z-index: 0;
  padding: 20px 20px 40px;
  max-width: 640px;
  margin: 0 auto;
}

.site-header::before { height: 132px; }

.site-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: block;
  width: min(250px, 100%);
}

.gnb {
  display: flex;
  gap: 20px;
}

.hero { margin-top: 26px; }

/* 모바일은 원화를 자르지 않고 원본 비율 그대로 */
.hero-frame { aspect-ratio: 1672 / 941; }

.menu { margin-top: 26px; }

.menu-item { height: 112px; }

.menu-num { left: 0; top: 18px; font-size: 12px; }

.menu-label { left: 0; top: 46px; font-size: 42px; }

.site-footer { margin-top: 28px; }

/* ---------- 데스크톱: 1440×810 기준 화면을 비율대로 축소·확대 ---------- */

@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  :root { --s: min(calc(100vw / 1440), calc(100vh / 810)); }

  body {
    display: grid;
    justify-items: center;
    align-items: start;
  }

  .stage {
    width: calc(1440 * var(--s));
    height: calc(810 * var(--s));
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .site-header { display: block; }

  .site-header::before { height: calc(112 * var(--s)); }

  .brand {
    position: absolute;
    left: calc(54 * var(--s));
    top: calc(24 * var(--s));
    width: calc(310 * var(--s));
  }

  .gnb {
    position: absolute;
    right: calc(74 * var(--s));
    top: calc(50 * var(--s));
    gap: calc(30 * var(--s));
  }

  .gnb a { font-size: calc(13 * var(--s)); }

  .hero {
    position: absolute;
    left: calc(54 * var(--s));
    top: calc(140 * var(--s));
    width: calc(920 * var(--s));
    height: calc(543 * var(--s));
    margin: 0;
  }

  .hero-frame { width: 100%; height: 100%; aspect-ratio: auto; }

  .menu {
    position: absolute;
    left: calc(1008 * var(--s));
    top: calc(140 * var(--s));
    width: calc(378 * var(--s));
    margin: 0;
  }

  .menu-item { height: calc(181 * var(--s)); }

  .menu-num { top: calc(23 * var(--s)); font-size: calc(13 * var(--s)); }

  .menu-label { top: calc(68 * var(--s)); font-size: calc(58 * var(--s)); }

  .site-footer {
    position: absolute;
    left: calc(54 * var(--s));
    right: calc(54 * var(--s));
    bottom: calc(25 * var(--s));
    margin: 0;
    padding-top: calc(15 * var(--s));
    font-size: calc(11 * var(--s));
  }
}

/* ---------- 첫 접속 캔버스 인트로 ---------- */

.intro-layer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #081320;
  transition: opacity 0.32s ease;
}

.intro-layer.is-leaving { opacity: 0; }

.intro-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

html.intro-canvas-active .intro-layer { display: block; }
html.intro-canvas-active .stage { visibility: hidden; }

/* 마지막 원화를 메인 영상 자리로 접으면서 홈을 드러냄 */
.handoff-art {
  position: fixed;
  z-index: 40;
  overflow: hidden;
  transform-origin: 0 0;
  pointer-events: none;
}

.handoff-art img {
  width: 100%;
  height: 100%;
  max-width: none;
}

html.handoff-hero .hero-img,
html.handoff-hero .hero-video { opacity: 0 !important; }
html.handoff-hero .stage { z-index: auto; }
html.handoff-hero .brand { z-index: 45; }

html.handoff .site-header::before { animation: fade-in 0.4s var(--ease-out) 0.25s both; }
html.handoff .gnb { animation: rise-in 0.4s var(--ease-out) 0.35s both; }
html.handoff .menu-line { animation: line-in 0.4s var(--ease-out) calc(0.35s + var(--i) * 0.07s) both; }
html.handoff .menu-num,
html.handoff .menu-label { animation: rise-in 0.4s var(--ease-out) calc(0.42s + var(--i) * 0.07s) both; }
html.handoff .site-footer { animation: fade-in 0.4s var(--ease-out) 0.65s both; }

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

@keyframes line-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
