/* 메인 페이지. 시간대 테마는 html[data-band]에 따라 바뀐다 (새벽 / 아침(day) / 저녁 / 밤). 장면의 색은 모두 아래 변수에서 온다. */
html {
  /* 아침(day): 아이보리 지평선 위로 옅은 남색 하늘, 금빛 해, 남색 계열 능선 (브랜드 아이보리·네이비·골드) */
  --sky-top: #b4c4d8;
  --sky-mid: #e1e4e5;
  --sky-low: #f8f1e2;
  --glow-x: 62%;
  --glow-y: 20%;
  --glow-a: rgba(255, 238, 196, 0.95);
  --glow-b: rgba(255, 238, 196, 0.28);
  --disc: #fff3cf;
  --ridge-1: #d4dbe4;
  --ridge-2: #bac6d4;
  --ridge-3: #9bacbf;
  --ridge-4: #71879f;
  --ridge-5: #3f5877;
  --bld-1: #c9d3df;
  --bld-2: #94a6bb;
  --bld-3: #5b7391;
  --win: #fff1b8;
  --lit: 0;
  --star: 0;
  --aura-1: rgba(255, 240, 205, 0.9);
  --aura-2: rgba(160, 185, 215, 0.55);
  --aura-3: rgba(63, 88, 119, 0.6);
  --ring-line: rgba(255, 255, 255, 0.4);
  --ground-scrim: rgba(15, 27, 45, 0.32);
  --on-scene: #23303f;
  --on-scene-sub: #43556a;
  --on-ground: #f8f5ef;
  --on-ground-sub: rgba(248, 245, 239, 0.84);
  --glass: rgba(255, 255, 255, 0.7);
  --ring: rgba(35, 48, 63, 0.4);
  background: var(--sky-mid);
}

html[data-band="dawn"] {
  --sky-top: #a9b5cf;
  --sky-mid: #e9d8cc;
  --sky-low: #f7e6c6;
  --glow-x: 16%;
  --glow-y: 56%;
  --glow-a: rgba(255, 226, 170, 0.95);
  --glow-b: rgba(255, 214, 160, 0.3);
  --disc: #ffe6b0;
  --ridge-1: #e5d0c4;
  --ridge-2: #d3b5af;
  --ridge-3: #b294a1;
  --ridge-4: #7d6d87;
  --ridge-5: #434b69;
  --bld-1: #d6b9b3;
  --bld-2: #a58997;
  --bld-3: #5c5876;
  --win: #ffd9a0;
  --lit: 0.3;
  --aura-1: rgba(255, 222, 170, 0.9);
  --aura-2: rgba(190, 170, 205, 0.55);
  --aura-3: rgba(70, 80, 115, 0.6);
  --ground-scrim: rgba(25, 30, 55, 0.32);
  --on-scene: #2c3246;
  --on-scene-sub: #4d5468;
  --on-ground: #f7efe9;
  --on-ground-sub: rgba(247, 239, 233, 0.84);
  --glass: rgba(255, 255, 255, 0.6);
  --ring: rgba(44, 50, 70, 0.4);
}

html[data-band="dusk"] {
  --sky-top: #8e9bb9;
  --sky-mid: #ebba8c;
  --sky-low: #f6d8a4;
  --glow-x: 84%;
  --glow-y: 56%;
  --glow-a: rgba(255, 205, 130, 0.95);
  --glow-b: rgba(255, 190, 120, 0.3);
  --disc: #ffd9a0;
  --ridge-1: #e2b597;
  --ridge-2: #c99691;
  --ridge-3: #a2748b;
  --ridge-4: #6f5978;
  --ridge-5: #3e4160;
  --bld-1: #cfa09b;
  --bld-2: #8f728a;
  --bld-3: #4c4a6a;
  --win: #ffcf8a;
  --lit: 0.6;
  --aura-1: rgba(255, 200, 130, 0.9);
  --aura-2: rgba(215, 150, 150, 0.55);
  --aura-3: rgba(70, 75, 115, 0.6);
  --ground-scrim: rgba(25, 28, 52, 0.34);
  --on-scene: #2a2f4a;
  --on-scene-sub: #4a4d68;
  --on-ground: #f8ebdf;
  --on-ground-sub: rgba(248, 235, 223, 0.84);
  --glass: rgba(255, 255, 255, 0.58);
  --ring: rgba(42, 47, 74, 0.4);
}

html[data-band="night"] {
  --sky-top: #0a1428;
  --sky-mid: #172b4d;
  --sky-low: #2f4d7c;
  --glow-x: 70%;
  --glow-y: 22%;
  --glow-a: rgba(240, 222, 168, 0.6);
  --glow-b: rgba(150, 170, 220, 0.16);
  --disc: #f3e6bd;
  --ridge-1: #2b4569;
  --ridge-2: #243b5e;
  --ridge-3: #1c3150;
  --ridge-4: #15263f;
  --ridge-5: #0d1a30;
  --bld-1: #243a5c;
  --bld-2: #182b47;
  --bld-3: #0c1a30;
  --win: #ffd98a;
  --lit: 1;
  --star: 1;
  --aura-1: rgba(120, 150, 220, 0.55);
  --aura-2: rgba(60, 90, 170, 0.5);
  --aura-3: rgba(20, 40, 90, 0.7);
  --ring-line: rgba(220, 230, 255, 0.25);
  --ground-scrim: rgba(0, 0, 0, 0.28);
  --on-scene: #f8f5ef;
  --on-scene-sub: #b8c0cf;
  --on-ground: #dbe3ef;
  --on-ground-sub: #a4b1c5;
  --glass: rgba(255, 255, 255, 0.16);
  --ring: rgba(242, 238, 228, 0.45);
}

.stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 360px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--sky-mid);
}

/* 대표 이미지 장면. 하늘 → 빛 번짐 → 해·달 → 땅(능선·도시) 순으로 겹친다. */
.scene {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-mid) 52%, var(--sky-low));
}

.scene__sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.stars {
  fill: #ffffff;
  opacity: var(--star);
}

.scene__glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle 46vmax at var(--glow-x) var(--glow-y), var(--glow-a), var(--glow-b) 28%, transparent 100%);
}

.scene__disc {
  position: absolute;
  z-index: 2;
  left: var(--glow-x);
  top: var(--glow-y);
  width: clamp(34px, 6.5vmin, 76px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--disc);
  transform: translate(-50%, -50%);
}

.scene__land {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 62%;
}

.fog-stop {
  stop-color: var(--sky-low);
}

.ridge--1 { fill: var(--ridge-1); }
.ridge--2 { fill: var(--ridge-2); }
.ridge--3 { fill: var(--ridge-3); }
.ridge--4 { fill: var(--ridge-4); }
.ridge--5 { fill: var(--ridge-5); }

.bld--1 { fill: var(--bld-1); }
.bld--2 { fill: var(--bld-2); }
.bld--3 { fill: var(--bld-3); }

.win {
  fill: var(--win);
  opacity: var(--lit);
}

/* 빛 장면: 땅 없이 번지는 빛과 동심원 */
.stage[data-scene="glow"] .scene {
  background:
    radial-gradient(60vmax 46vmax at var(--glow-x) var(--glow-y), var(--aura-1), transparent 72%),
    radial-gradient(56vmax 42vmax at 12% 84%, var(--aura-2), transparent 72%),
    radial-gradient(80vmax 52vmax at 50% 112%, var(--aura-3), transparent 74%),
    linear-gradient(to bottom, var(--sky-top), var(--sky-mid) 52%, var(--sky-low));
}

.stage[data-scene="glow"] .scene__glow,
.stage[data-scene="glow"] .scene__disc {
  display: none;
}

.scene__ring {
  position: absolute;
  z-index: 1;
  left: var(--glow-x);
  top: var(--glow-y);
  border: 1px solid var(--ring-line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.scene__ring--1 { width: 20vmax; height: 20vmax; opacity: 0.9; }
.scene__ring--2 { width: 36vmax; height: 36vmax; opacity: 0.65; }
.scene__ring--3 { width: 54vmax; height: 54vmax; opacity: 0.45; }
.scene__ring--4 { width: 76vmax; height: 76vmax; opacity: 0.3; }

/* 머리말 (인사말 + 소개글). 인사말은 시간대에 맞는 것 하나만 보인다. */
.hero {
  position: absolute;
  z-index: 3;
  top: clamp(92px, 21%, 220px);
  right: 24px;
  left: 24px;
  max-width: 680px;
  color: var(--on-scene);
}

.hero__title {
  margin: 0;
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: var(--lh-hero);
  letter-spacing: -0.02em;
}

.hero__title span {
  display: none;
}

html[data-band="dawn"] .hero__title [data-for="dawn"],
html[data-band="day"] .hero__title [data-for="day"],
html[data-band="dusk"] .hero__title [data-for="dusk"],
html[data-band="night"] .hero__title [data-for="night"] {
  display: inline;
}

.hero__text {
  margin: var(--s4) 0 0;
  color: var(--on-scene-sub);
  font-size: var(--fs-heading);
  line-height: var(--lh-heading);
}

.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 24px 0;
}

/* 로고 [심볼] EREERN은 서비스 페이지의 위쪽 바와 같은 공통 부품(components.css .ui-brand)이다: 간격·글자 모양·세로 위치가 같고 장면 위라 이름의 색만 장면 글자색이다 */
.top .ui-brand__name {
  color: var(--on-scene);
}

.top__actions {
  display: flex;
  gap: 10px;
}

/* 대메뉴(스토어·노트·개인)와 계정 팝업이 열려 있는 동안 이 버튼들은 흐려진 뒷 배경 위에 또렷이 남는다: 다른 버튼에 마우스를 올리면 그 팝업으로 바뀐다 (ui.js의 menu 컴포넌트 hover).
   비로그인의 로그인 버튼은 바뀌지 않는다 (SSO 로그인 화면을 불러오는 일이라 올리기만 해서 시작하지 않는다). 일반형은 열린 .menu가 z-index 60의 칸이고 반응형은 .menu가 static이라 칸이 없어, 두 경우 모두 버튼 자체를 올린다. */
.top__actions:has(.menu[data-hover-switch].is-open) .menu[data-hover-switch] > .ui-icon-button {
  z-index: 61;
}

/* 하단: 왼쪽 알림 줄(있을 때만), 오른쪽 화면 버전 전환. 글자는 땅 위에 놓이므로 땅 위 글자색을 쓴다. */
.foot {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px calc(16px + env(safe-area-inset-bottom));
  color: var(--on-ground-sub);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
}

.foot::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -64px 0 0 0;
  background: linear-gradient(to top, var(--ground-scrim), transparent);
  pointer-events: none;
}

.foot .ui-text-switch {
  margin-left: auto;
}

.foot .ui-text-switch button[aria-pressed="true"] {
  color: var(--on-ground);
}

/* 알림 줄: 없음(조용히) / 정기 / 알림 / 경고. 종류마다 점 색과 꼬리표가 다르다. */
.foot__notice {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  gap: 7px;
}

/* 알림 종류의 점: 글자 기호(●)가 아니라 8px 원이다 */
.foot__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
}

.foot__tag {
  padding: 2px var(--s2);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.18);
  color: var(--on-ground);
  font-size: var(--fs-micro);
  line-height: var(--lh-micro);
  font-weight: 600;
}

.foot__notice--none {
  opacity: 0.8;
}

.foot__notice--none .foot__dot {
  background: var(--on-ground-sub);
  opacity: 0.55;
}

.foot__notice--regular .foot__dot {
  background: var(--accent-line);
}

.foot__notice--warn .foot__dot {
  background: var(--danger);
}

.foot__notice--warn .foot__tag {
  background: var(--danger);
  color: var(--accent-ink);
}

.stage[data-scene="glow"] .foot__tag {
  background: rgba(0, 0, 0, 0.08);
  color: var(--on-scene);
}

.stage[data-scene="glow"] .foot__notice--none .foot__dot {
  background: var(--on-scene-sub);
}

/* 빛 장면은 땅이 없어 하단도 하늘색 위에 놓인다. */
.stage[data-scene="glow"] .foot {
  color: var(--on-scene-sub);
}

.stage[data-scene="glow"] .foot::before {
  display: none;
}

.stage[data-scene="glow"] .foot .ui-text-switch button[aria-pressed="true"] {
  color: var(--on-scene);
}

/* 반응형 (모바일 버전): 화면 폭이 기준 폭(720px) 이하이면 꽉 채운다. 직접 고른 모바일 버전으로 창이 더 넓으면 기준 폭까지만 쓰고 가운데에 둔다.
   창 폭을 끌 때의 흔들림은 별도 후속이다. */
html[data-mode="responsive"] .stage {
  max-width: var(--responsive-width);
  margin: 0 auto;
  box-shadow: 0 0 48px rgba(10, 30, 50, 0.28);
}

html[data-mode="responsive"] .top {
  padding: calc(12px + env(safe-area-inset-top)) 14px 0;
}

html[data-mode="responsive"] .hero {
  top: clamp(84px, 19%, 180px);
  right: 14px;
  left: 14px;
}

html[data-mode="responsive"] .hero__text {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

html[data-mode="responsive"] .menu {
  position: static;
}

/* 반응형 팝업: 폭은 일반형·서비스 페이지 팝업과 같고(components.css) 화면이 좁을 때만 줄어든다.
   메뉴 버튼이 셋이라 각 버튼 기준이면 왼쪽으로 넘칠 수 있어 헤더(.top)의 오른쪽 끝에 맞춘다. */
html[data-mode="responsive"] .ui-popup {
  top: calc(100% + 6px);
  right: 12px;
  left: auto;
  max-width: calc(100% - 24px);
}

/* 로그인 팝업은 예전 그대로 화면(.stage)의 좌우 12px만 남기고 꽉 차며 화면 폭에 맞춰 줄어든다 (로그인은 기존대로 유지). */
html[data-mode="responsive"] .ui-login-popup {
  width: calc(100% - 24px);
}

html[data-mode="responsive"] .foot {
  padding: 0 14px calc(14px + env(safe-area-inset-bottom));
}

@media (hover: hover) {
  html[data-mode="responsive"] .ui-icon-button[data-tip]:hover::after {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* UI 미리보기 막대 (UI_PREVIEW=1일 때만 나온다. SSO 연동 때 미리보기 모드와 함께 제거한다.) */
.pv {
  position: absolute;
  z-index: 20;
  right: 12px;
  bottom: 52px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(15, 25, 40, 0.72);
  color: #e6ecf3;
  font-size: var(--fs-caption);
}

.pv__group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pv__label {
  margin-right: 4px;
  color: #9fb0c4;
}

.pv a {
  padding: 3px 8px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
}

.pv a[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
