.trail-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.trail-canvas-viewport {
  position: fixed;
  z-index: 10010;
  opacity: .78;
}

.trail-residue { opacity: .44; }
.trail-residue.trail-canvas-viewport { opacity: .29; }

.trail-gallery {
  margin: 0;
  min-height: 100vh;
  background: #14121a;
  color: #fef5fb;
  font-family: "DM Sans", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}

.trail-gallery * { box-sizing: border-box; }
.gallery { max-width: 1232px; margin-inline: auto; padding: clamp(24px, 4.6vw, 58px) clamp(16px, 4.8vw, 62px); }
.gallery-header { margin-bottom: clamp(23px, 3vw, 35px); }
.gallery-intro { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; }
.gallery-intro button { min-height: 36px; padding: 0 12px; border: 1px solid #534153; border-radius: 7px; background: transparent; color: #f1c6e2; font: inherit; font-size: .76rem; cursor: pointer; }
.gallery-intro button:hover { background: #382b3c; }
.gallery-header a { font-size: .8rem; color: #edb9d6; text-decoration: none; }
.gallery-header a:hover { text-decoration: underline; text-underline-offset: 4px; }
.gallery-header h1 { margin: 12px 0 6px; font-size: clamp(2.05rem, 5.3vw, 4.1rem); line-height: 1.02; letter-spacing: -.074em; }
.gallery p { margin: 0; color: #c4bacb; font-size: .84rem; line-height: 1.55; word-break: keep-all; }
.trail-studies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(13px, 2vw, 22px); }
.trail-gallery .study { min-width: 0; overflow: hidden; border-radius: 15px; background: #211e29; }

.trail-stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: clamp(168px, 19vw, 239px);
}
.stage-nebula {
  background: radial-gradient(ellipse at 83% 56%, #332743 0, transparent 66%), #1c1826;
}
.stage-milky {
  background: radial-gradient(ellipse at 39% 100%, #30254f 0, transparent 74%), #161423;
}
.stage-aurora {
  background: radial-gradient(ellipse at 65% 100%, #1b3542 0, transparent 73%), #171927;
}
.stage-comet {
  background: radial-gradient(ellipse at 79% 54%, #3e2138 0, transparent 68%), #231923;
}

.trail-gallery .caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 17px; }
.trail-gallery h2 { margin: 0 0 2px; font-size: 1.15rem; letter-spacing: -.03em; }
.trail-gallery h2 span { margin-left: 5px; color: #c4bacb; font-size: .78rem; font-weight: 500; }
.trail-gallery .caption a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding-inline: 9px; border-radius: 7px; color: #f1c6e2; text-decoration: none; font-size: .75rem; }
.trail-gallery .caption a:hover { color: #fff7fc; background: #382b3c; }
.trail-gallery :is(a, button):focus-visible { outline: 2px solid #efbcde; outline-offset: 2px; }

@media (max-width: 710px) {
  .trail-studies { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 370px) {
  .trail-gallery .caption { align-items: start; flex-direction: column; gap: 2px; }
  .trail-gallery .caption a { margin-left: -9px; }
}

