/* 음식물: 빛의 하강 — 다운로드 페이지 */

:root {
  --bg: #0a0818;
  --ink: #efe9dc;
  --ink-dim: rgba(239, 233, 220, 0.55);
  --ink-faint: rgba(239, 233, 220, 0.35);
  --amber: #dda25a;
  --amber-bright: #f0b76e;

  --font-display: "DungGeunMo", monospace;
  --font-body: "Gowun Batang", serif;
}

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

html { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow-x: hidden;
}

/* ---------- 배경 ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #040310 0%, #0c0a1c 45%, #141127 78%, #1c1636 100%);
}

/* 지평선 위 은은한 노을빛 */
.sky::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 45vh;
  background: radial-gradient(120% 100% at 50% 100%, rgba(221, 162, 90, 0.10) 0%, transparent 62%);
  pointer-events: none;
}

.moon {
  position: absolute;
  top: 9%;
  right: 13%;
  width: clamp(56px, 7vw, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #f7f0e2 0%, #e9dfd0 44%, #cfc3b2 100%);
  box-shadow: 0 0 40px 8px rgba(242, 232, 216, 0.12), 0 0 120px 30px rgba(242, 232, 216, 0.05);
}

.stars { position: absolute; inset: 0; }
.star {
  position: absolute;
  border-radius: 50%;
  background: #f7f1e4;
  animation: twinkle var(--tw, 5s) ease-in-out var(--td, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: var(--so, 0.2); }
  50%      { opacity: 0.8; }
}

.skyline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  pointer-events: none;
}
.skyline-back  { height: clamp(140px, 30vh, 340px); opacity: 0.8; }
.skyline-front { height: clamp(100px, 21vh, 240px); }

/* ---------- 본문 ---------- */

.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(48px, 9vh, 96px) 24px;
}

/* 등장 애니메이션 — 아래에서 살짝 떠오르며 */
.stage > * {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.stage > :nth-child(1) { animation-delay: 0.05s; }
.stage > :nth-child(2) { animation-delay: 0.15s; }
.stage > :nth-child(3) { animation-delay: 0.25s; }
.stage > :nth-child(4) { animation-delay: 0.35s; }
.stage > :nth-child(5) { animation-delay: 0.45s; }
.stage > :nth-child(6) { animation-delay: 0.55s; }
.stage > :nth-child(7) { animation-delay: 0.62s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 히어로 아이콘 */

.hero-icon {
  position: relative;
  display: grid;
  place-items: center;
  gap: 13px;
  padding: 0;
  border: 0;
  color: var(--ink-dim);
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.hero-icon img {
  position: relative;
  width: clamp(104px, 16vw, 152px);
  height: auto;
  border-radius: 22.5%;
  box-shadow:
    0 0 0 1px rgba(239, 233, 220, 0.10),
    0 14px 40px rgba(0, 0, 0, 0.55);
  animation: float 6s ease-in-out infinite;
}
.hero-icon:hover img { transform: translateY(-3px); }
.hero-icon:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 8px;
  border-radius: 18px;
}
.icon-action {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.2em;
  transition: color 0.18s ease;
}
.hero-icon:hover .icon-action { color: var(--amber); }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.app-name {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  letter-spacing: 0.3em;
  color: var(--amber);
}
.app-name-sub {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.headline {
  margin-top: clamp(20px, 3.5vh, 32px);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.6vw, 2.7rem);
  font-weight: 400;
  line-height: 1.4;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(4, 3, 16, 0.8);
}

.headline + .hero-icon {
  margin-top: clamp(26px, 4vh, 38px);
}

/* 다운로드 창 */

.download-dialog {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--ink);
  background: rgba(4, 3, 16, 0.78);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.download-dialog:target {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-open { overflow: hidden; }
.download-panel {
  width: min(440px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(239, 233, 220, 0.16);
  border-radius: 12px;
  background: #0d0b1c;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.download-dialog:target .download-panel {
  animation: dialog-in 0.2s ease-out both;
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.download-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 22px 18px;
}
.download-kicker {
  margin-bottom: 7px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}
.download-header h2 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.08em;
}
.download-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-dim);
  background: transparent;
  font: 24px/1 var(--font-body);
  cursor: pointer;
  text-decoration: none;
}
.download-close:hover {
  color: var(--ink);
  background: rgba(239, 233, 220, 0.07);
}
.download-close:focus-visible,
.download-row:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
}
.download-list {
  border-top: 1px solid rgba(239, 233, 220, 0.1);
}
.download-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 17px 22px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s ease;
}
.download-row + .download-row {
  border-top: 1px solid rgba(239, 233, 220, 0.08);
}
.download-row:hover {
  background: rgba(221, 162, 90, 0.08);
}
.platform-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 30px;
  border: 1px solid rgba(239, 233, 220, 0.18);
  border-radius: 5px;
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--amber);
}
.platform-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.platform-copy strong {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
}
.platform-copy span {
  overflow: hidden;
  font-size: 11px;
  color: var(--ink-dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.download-arrow {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink-faint);
}
.download-row:hover .download-arrow { color: var(--amber); }

/* ---------- 푸터 ---------- */

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 20px;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  text-shadow: 0 1px 10px rgba(4, 3, 16, 0.9);
}

/* ---------- 반응형 ---------- */

/* 태블릿 */
@media (max-width: 1024px) {
  .moon { right: 10%; }
}

/* 모바일 */
@media (max-width: 640px) {
  .moon { top: 6%; right: 8%; }
  .stage { padding: 48px 20px; }
  .headline { font-size: clamp(1.2rem, 5.6vw, 1.6rem); line-height: 1.55; }
  .download-row { padding: 16px; }
  .platform-copy span { font-size: 10px; }
}

/* 낮은 가로 화면(폰 가로 모드) — 배경 건물 축소 */
@media (max-height: 560px) {
  .skyline-back  { height: 120px; }
  .skyline-front { height: 84px; }
  .stage { padding: 36px 20px 52px; }
}

/* ---------- 접근성 ---------- */

@media (prefers-reduced-motion: reduce) {
  .star { animation: none; }
  .hero-icon img { animation: none; }
  .stage > * { animation: none; }
  .download-dialog:target .download-panel { animation: none; }
}
