/* Vasto 소개 페이지(스크롤 이야기 다섯 장: 첫 장면, 하루와 음악, 엽서, 돌려 보기, 곁에 두기). 시스템 글꼴만 쓰고, 움직임은 transform·opacity 로만 한다(흐림·그림자 애니메이션 없음) */
:root {
  color-scheme: dark;
  --bg: #07090f;
  --fg: #f3efe6;
  --muted: rgba(243, 239, 230, .76);
  --faint: rgba(243, 239, 230, .5);
  --accent: #e9b86a;
  --gutter: 28px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 1rem; line-height: 1.5; }
h1, h2, h3, p, li, a, button { word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -10000px; top: 0; }
.skip:focus { position: fixed; left: 12px; top: 12px; z-index: 30; padding: 10px 14px; background: var(--fg); color: var(--bg); border-radius: 8px; }
main { display: block; }
main:focus { outline: none; }

/* 머리띠 */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--gutter) 28px; background: linear-gradient(180deg, rgba(7, 9, 15, .62), rgba(7, 9, 15, 0)); pointer-events: none; }
.top a { pointer-events: auto; text-decoration: none; }
.brand { font-weight: 700; font-size: .875rem; letter-spacing: .16em; text-transform: uppercase; }
.top nav { display: flex; gap: 22px; font-size: .875rem; }
.top nav a { opacity: .85; padding: 6px 0; }
.top nav a:hover { opacity: 1; text-decoration: underline; }

/* 단추 */
.cta { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--fg); color: #0b0d14; padding: 15px 24px;
  border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 1rem; line-height: 1.2; }
.cta small { opacity: .6; font-weight: 500; font-size: .85em; }
.cta:hover { background: #fff; }
.fine { font-size: .875rem; color: var(--faint); line-height: 1.6; }

/* 1장: 첫 장면 */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 540px; overflow: hidden; }
.hero-media { position: absolute; inset: -3%; transform: perspective(1400px) rotateY(var(--rx, 0deg)) rotateX(var(--ry, 0deg)); transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.hero-media picture, .hero-img { width: 100%; height: 100%; }
.hero-img { object-fit: cover; object-position: 50% 42%; animation: drift 32s ease-in-out infinite alternate; transform-origin: 50% 40%; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.07); } }
.hero-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 9, 15, .35) 0%, rgba(7, 9, 15, 0) 26%, rgba(7, 9, 15, 0) 52%, rgba(7, 9, 15, .82) 82%, var(--bg) 100%); }
.hero-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--gutter) 76px; max-width: 920px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .875rem; color: var(--muted); margin: 0 0 14px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.eyebrow .tag { padding: 3px 9px; border: 1px solid rgba(243, 239, 230, .32); border-radius: 999px; font-size: .75rem; }
.hero h1 { font-size: clamp(2.2rem, 6.2vw, 5.25rem); line-height: 1.04; letter-spacing: -.025em; margin: 0 0 18px; font-weight: 700; }
html[lang="ko"] .hero h1 { line-height: 1.12; letter-spacing: -.035em; }
.sub { font-size: clamp(1rem, 1.8vw, 1.25rem); line-height: 1.55; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.scroll-cue { position: absolute; left: 50%; bottom: 20px; margin: 0; transform: translateX(-50%); font-size: .75rem; letter-spacing: .16em; color: var(--faint); animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* 2·4장 공통: 긴 구역 안에 화면 높이의 무대가 고정된다 */
.chapter { position: relative; height: 320vh; }
#day { height: 400vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage::after { content: ""; position: absolute; inset: auto 0 0 0; height: 46%; background: linear-gradient(180deg, rgba(7, 9, 15, 0), rgba(7, 9, 15, .86) 70%, var(--bg)); pointer-events: none; z-index: 1; }
.steps { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 9vh; z-index: 2; max-width: 600px; }
.step h2 { font-size: clamp(1.9rem, 4.4vw, 3.75rem); line-height: 1.08; letter-spacing: -.025em; margin: 0 0 14px; font-weight: 700; }
html[lang="ko"] .step h2 { line-height: 1.16; letter-spacing: -.035em; }
.step p { font-size: clamp(1rem, 1.7vw, 1.2rem); line-height: 1.55; color: var(--muted); margin: 0; max-width: 32em; }
.step p.fine { font-size: .875rem; color: var(--faint); margin-top: 12px; }
/* 지금 단계만 보인다. 숨은 단계도 스크린 리더는 읽어야 하므로 visibility 는 쓰지 않고, 키보드로 들어오면 보이게 한다 */
.js .step { position: absolute; left: 0; right: 0; bottom: 0; opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
.js .step.on, .js .step:focus-within { opacity: 1; transform: none; pointer-events: auto; }
html:not(.js) .step + .step { margin-top: 28px; }

/* 4장: 돌려 보기 */
.orbit { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; }
/* 정사각 그림의 좌우와 위쪽 하늘을 바탕으로 녹인다(두 마스크의 교집합) */
.orbit canvas, .orbit-still { height: min(100svh, 100vw); width: auto; aspect-ratio: 1; max-width: 100vw;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent), linear-gradient(180deg, transparent 4%, #000 27%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent), linear-gradient(180deg, transparent 4%, #000 27%); mask-composite: intersect; }
.orbit canvas { display: none; }
.js .orbit canvas { display: block; }
.js .orbit-still { display: none; }
.hint { position: absolute; right: var(--gutter); top: 50%; margin: 0; transform: translateY(-50%); writing-mode: vertical-rl; font-size: .75rem; letter-spacing: .2em; color: var(--faint); z-index: 2; }

/* 2장: 하루와 음악 */
.day-layers, .day-layers .layer { position: absolute; inset: 0; }
.day-layers .layer { opacity: var(--o, 0); transition: opacity .25s linear; }
.day-layers .layer:first-child { --o: 1; }
.day-layers picture, .day-layers img { width: 100%; height: 100%; }
.day-layers img { object-fit: cover; object-position: 50% 42%; }
/* 시간대 글자가 밝은 그림 위에서도 읽히게 위쪽을 어둡게 한다 */
#day .stage::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 30%; background: linear-gradient(180deg, rgba(7, 9, 15, .62), rgba(7, 9, 15, 0)); z-index: 1; pointer-events: none; }
.clock { position: absolute; left: var(--gutter); right: var(--gutter); top: max(76px, 11vh); z-index: 2; display: flex; justify-content: space-between; max-width: 720px; margin: 0 auto; padding-bottom: 14px; }
.clock button { appearance: none; background: none; border: 0; color: var(--fg); font: inherit; font-size: .8125rem; letter-spacing: .1em; padding: 12px 6px; min-width: 44px; min-height: 44px; opacity: .62; cursor: pointer; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.clock button[aria-current="true"] { opacity: 1; color: var(--accent); }
.clock .track { position: absolute; left: 0; right: 0; bottom: 6px; height: 1px; background: rgba(255, 255, 255, .3); }
.clock .dot { position: absolute; top: -3px; left: calc(var(--p, 0) * 100% - 3.5px); width: 7px; height: 7px; border-radius: 50%; background: #fff; }

/* 음악 단추: 하루 장 무대 오른쪽 아래. 누를 때만 재생하고, 장을 벗어나면 멈춘다(story.js) */
.tune { position: absolute; z-index: 3; right: var(--gutter); bottom: 9vh; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.listen { display: inline-flex; align-items: center; gap: 12px; appearance: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem;
  padding: 13px 22px 13px 18px; border-radius: 999px; min-height: 48px; color: var(--fg); background: rgba(7, 9, 15, .5); border: 1px solid rgba(243, 239, 230, .38); }
.listen:hover { background: rgba(7, 9, 15, .7); }
.listen.playing { background: var(--fg); color: #0b0d14; }
.listen .icon { width: 0; height: 0; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent currentColor; }
.listen.playing .icon { width: 12px; height: 12px; border: 0; background: currentColor; border-radius: 2px; }
.tune .fine { margin: 0; color: var(--muted); text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }

/* 3장: 엽서 */
.places { max-width: 1240px; margin: 0 auto; padding: 18vh var(--gutter) 14vh; }
.places h2 { font-size: clamp(1.9rem, 4.4vw, 3.5rem); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 16px; }
html[lang="ko"] .places h2 { line-height: 1.18; letter-spacing: -.035em; }
.lead { font-size: clamp(1rem, 1.7vw, 1.2rem); line-height: 1.55; color: var(--muted); margin: 0 0 48px; max-width: 32em; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; }
.cards img { width: 100%; height: auto; aspect-ratio: 1206 / 861; object-fit: cover; border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.cards li:nth-child(odd) img { transform: rotate(-1.2deg); }
.cards li:nth-child(even) img { transform: rotate(1deg) translateY(10px); }
.cards p { margin: 14px 2px 0; font-size: .875rem; letter-spacing: .06em; color: var(--muted); }
.places .fine { margin: 40px 0 0; }

/* 5장: 곁에 두기·받기 */
/* 마지막 화면이 4장 끝과 섞이지 않게 화면 높이만큼은 차지한다 */
.own { max-width: 1120px; min-height: 100vh; min-height: 100svh; margin: 0 auto; padding: 120px var(--gutter) 56px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.own h2 { font-size: clamp(1.9rem, 4.4vw, 3.5rem); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 16px; }
.own .lead { margin-bottom: 44px; }
html[lang="ko"] .own h2 { line-height: 1.18; letter-spacing: -.035em; }
.cols { list-style: none; padding: 0; margin: 0 0 44px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 32px; }
.cols h3 { font-size: 1.2rem; line-height: 1.35; margin: 0 0 8px; }
.cols em { font-style: normal; color: var(--accent); }
.cols p { margin: 0; color: var(--muted); line-height: 1.6; }
.own .fine { margin: 28px 0 0; max-width: 46em; }
.foot { max-width: 1120px; margin: 0 auto; padding: 28px var(--gutter) 56px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; font-size: .8125rem; color: var(--faint); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { text-decoration: none; color: var(--muted); }
.foot a:hover { text-decoration: underline; }
.foot p { margin: 0; }

/* 휴대폰 */
@media (max-width: 760px) {
  :root { --gutter: 18px; }
  .top { padding: 14px var(--gutter) 24px; }
  .top nav { display: none; }
  .hero-copy { padding-bottom: 64px; }
  .sub br { display: none; }
  #spin { height: 260vh; }
  #day { height: 340vh; }
  .orbit { align-items: flex-start; padding-top: 11svh; }
  .orbit canvas, .orbit-still { height: auto; width: 100vw; -webkit-mask-image: linear-gradient(180deg, transparent 4%, #000 27%, #000 72%, transparent); -webkit-mask-composite: source-over; mask-image: linear-gradient(180deg, transparent 4%, #000 27%, #000 72%, transparent); mask-composite: add; }
  .hint { display: none; }
  .steps { bottom: 6vh; }
  /* 음악 단추는 시간대 막대 아래 왼쪽에 둔다(아래쪽은 단계 글이 차지함) */
  .tune { left: var(--gutter); right: auto; top: calc(max(76px, 11vh) + 64px); bottom: auto; align-items: flex-start; }
  .places { padding: 14vh 0 10vh; }
  .places h2, .places .lead, .places .fine { padding: 0 var(--gutter); }
  /* 엽서는 옆으로 넘겨 본다 */
  .cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; padding: 0 var(--gutter) 24px; }
  .cards li { flex: 0 0 78%; scroll-snap-align: center; }
  .own { padding-top: 88px; }
}
@media (orientation: portrait) and (min-width: 761px) {
  .orbit canvas, .orbit-still { height: auto; width: min(100vw, 82svh); }
}

/* 큰 글자·낮은 화면: 미디어 질의의 em 은 기기·브라우저 기본 글자 크기를 따르므로, 글자를 키우면(200% 면 1280px) 이 규칙이 켜진다.
   고정 무대를 풀고 그림 → 글 순서의 일반 문서 흐름으로 바꿔, 글이 무대 밖으로 잘리지 않게 한다 */
@media (max-height: 40em) {
  .hero { height: auto; min-height: 0; }
  .hero-media { position: relative; inset: auto; height: max(300px, 62svh); transform: none; }
  .hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 9, 15, .3), rgba(7, 9, 15, 0) 30%, rgba(7, 9, 15, 0) 60%, var(--bg)); }
  .hero-veil, .scroll-cue, .hint, .stage::after, #day .stage::before { display: none; }
  .hero-copy { position: static; padding: 8px var(--gutter) 56px; }
  .chapter, #spin, #day { height: auto; }
  .stage { position: relative; height: auto; overflow: visible; padding: 72px 0 56px; }
  .steps { position: static; padding: 24px var(--gutter) 0; max-width: 46em; }
  .js .step { position: static; opacity: 1; transform: none; pointer-events: auto; }
  .js .step + .step { margin-top: 28px; }
  .orbit { position: relative; inset: auto; padding: 0; }
  .orbit canvas, .orbit-still { width: min(100vw, 72svh, 640px); height: auto; }
  .day-layers { position: relative; inset: auto; height: max(260px, 56svh); }
  .clock { position: relative; left: auto; right: auto; top: auto; margin: 0 var(--gutter) 16px; }
  .tune { position: static; align-items: flex-start; margin: 0 var(--gutter); }
  .places { padding-top: 72px; padding-bottom: 56px; }
  .cards { display: grid; grid-template-columns: 1fr; overflow: visible; padding: 0 var(--gutter); }
  .cards li:nth-child(n) img { transform: none; }
  .own { min-height: 0; padding-top: 72px; }
}

/* 움직임 줄이기: 자동 움직임을 끄고, 스크롤 연동 교차 페이드는 즉시 전환(스크립트가 0/1 만 넘김) */
@media (prefers-reduced-motion: reduce) {
  .hero-img, .scroll-cue { animation: none; }
  .hero-media, .day-layers .layer, .js .step { transition: none; }
  .js .step { transform: none; }
}
